var CurrentTab = 0; var agt = navigator.userAgent.toLowerCase(); var myWidth = 0, myHeight = 0; // Document size var ieType = (typeof window.innerWidth != 'number'); var IE = document.all ? true : false; var is_ie = (agt.indexOf("msie") != -1); var menu = ""; var submenu = ""; var subsubmenu = ""; var MustShowPrepage = false; var ShowPrepageTimer = null; var nowInput = new Array(); var txtInput = new Array(); function preventSelection(element) { var preventSelection = false; function addHandler(element, event, handler) { if (element.attachEvent) element.attachEvent('on' + event, handler); else if (element.addEventListener) element.addEventListener(event, handler, false); } function removeSelection() { if (window.getSelection) { window.getSelection().removeAllRanges(); } else if (document.selection && document.selection.clear) document.selection.clear(); } function killCtrlA(event) { var event = event || window.event; var sender = event.target || event.srcElement; if (sender.tagName.match(/INPUT|TEXTAREA/i)) return; var key = event.keyCode || event.which; if (event.ctrlKey && key == 'A'.charCodeAt(0)) { // 'A'.charCodeAt(0) ????? ???????? ?? 65 removeSelection(); if (event.preventDefault) event.preventDefault(); else event.returnValue = false; } } addHandler(element, 'mousemove', function() { if(preventSelection) removeSelection(); }); addHandler(element, 'mousedown', function(event) { var event = event || window.event; var sender = event.target || event.srcElement; preventSelection = !sender.tagName.match(/INPUT|TEXTAREA/i); }); addHandler(element, 'mouseup', function() { if (preventSelection) removeSelection(); preventSelection = false; }); addHandler(element, 'keydown', killCtrlA); addHandler(element, 'keyup', killCtrlA); } var css_browser_selector = function() { var ua = navigator.userAgent.toLowerCase(), is = function(t) { return ua.indexOf(t) != -1; }, h = document.getElementsByTagName('html')[0], b = (!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua)) ? ('ie ie'+RegExp.$1) : is('firefox/2') ? 'gecko ff2' : is('firefox/3') ? 'gecko ff3' : is('gecko/') ? 'gecko' : is('opera/9') ? 'opera opera9' : /opera\s(\d)/.test(ua) ? 'opera opera' + RegExp.$1 : is('konqueror') ? 'konqueror' : is('chrome') ? 'chrome webkit safari' : is('applewebkit/') ? 'webkit safari' : is('mozilla/') ? 'gecko':'', os = (is('x11') || is('linux')) ? ' linux' : is('mac') ? ' mac' : is('win') ? ' win' : ''; var c = b + os + ' js'; h.className += h.className ? ' ' + c : c; }(); function inithp() { preventSelection(document); SetButtonHover(document.body); if (document.getElementById('main') && document.getElementById('main_bare')) var mainscroll = new TextScroll('mainscroll', 'main', 'main_6', 'main_scroll_up', 'main_scroll_down', 'main_bare'); if (document.getElementById('menu') && document.getElementById('menu_bare')) var menuscroll = new TextScroll('menuscroll', 'menu', 'menu_6', 'menu_scroll_up', 'menu_scroll_down', 'menu_bare'); if (document.getElementById('shop_vn_country') && document.getElementById('countries_bare')) var countries_scroll = new TextScroll('countriesscroll', 'shop_vn_country', 'countries_scroll_table', 'countries_scroll_up', 'countries_scroll_down', 'countries_bare'); if (document.getElementById('sel_country')) countries_scroll.SetPos('sel_country'); if (document.getElementById('shop_vn_area') && document.getElementById('areas_bare')) var areas_scroll = new TextScroll('areasscroll', 'shop_vn_area', 'areas_scroll_table', 'areas_scroll_up', 'areas_scroll_down', 'areas_bare'); if (document.getElementById('sel_area')) areas_scroll.SetPos('sel_area'); if (document.getElementById('shop_vn_category') && document.getElementById('category_bare')) var category_scroll = new TextScroll('categoryscroll', 'shop_vn_category', 'category_scroll_table', 'category_scroll_up', 'category_scroll_down', 'category_bare'); if (document.getElementById('h_div_1_1') && document.getElementById('hw_h_bare')) var products_scroll = new TextScroll('hw_h_scroll', 'h_div_1_1', 'hw_h_scroll', 'hw_h_scroll_left', 'hw_h_scroll_right', 'hw_h_bare', false); HidePrepage(); } function MainScrollReload() { if (document.getElementById('main') && document.getElementById('main_bare')) GetScrollElement('mainscroll').Reload(); if (document.getElementById('menu') && document.getElementById('menu_bare')) GetScrollElement('menuscroll').Reload(); } function switch_tabs(tab) { //switch off all tabs and content var i = 0; while (document.getElementById('tab' + (i+1) + '_content')) { document.getElementById('tab' + (i+1) + '_content').style.display = 'none'; i++; } //switch on the selected tab and content document.getElementById(tab + '_content').style.display = 'block'; CurrentTab = tab; } function togglefaq( faq ) { var elem, vis; if( document.getElementById ) elem = document.getElementById( faq ); else if( document.all ) elem = document.all[faq]; else if( document.layers ) elem = document.layers[faq]; vis = elem.style; if (vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined) vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none'; vis.display = (vis.display==''||vis.display=='block')?'none':'block'; } function hideshowelem( elemid, show ) { var elem, vis; if( document.getElementById ) elem = document.getElementById( elemid ); else if( document.all ) elem = document.all[elemid]; else if( document.layers ) elem = document.layers[elemid]; vis = elem.style; if (show) vis.display = 'block'; else vis.display = 'none'; } function ChangeLanguage(language) { document.cookie = "language=" + language; if (language.length > 1) { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { document.location.reload(); } } xmlHttp.open("GET","lib/change_language.php?language=" + language,true); xmlHttp.send(null); } } function SelectCountry(popupname, country, state, signuptype, map, vn_country, vn_area, update) { if (update == 'yes') { GetPopupElement(popupname).UpdateContentHttp('ajax/user_location.php' , 'popupname=' + popupname + '&country=' + country + '&state=' + state + '&type=' + signuptype + '&map=' + map + '&vn_country=' + vn_country + '&vn_area=' + vn_area + '&update=' + update , 'Preferences'); GetPopupElement(popupname).EnableHelp('User Preferences' , 'HP Help0009' , '#000000' , 65); if (document.getElementById('trselcountry') && GetScrollElement(popupname + '_scroll_1')) { GetScrollElement(popupname + '_scroll_1').SetPos('trselcountry'); } if (country == 233) { if (document.getElementById('trselarea') && GetScrollElement(popupname + '_scroll_3')) { GetScrollElement(popupname + '_scroll_3').SetPos('trselarea'); } } if (document.getElementById('trselcurrency') && GetScrollElement(popupname + '_scroll_2')) { GetScrollElement(popupname + '_scroll_2').SetPos('trselcurrency'); } nd(); } else { var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { var response = xmlHttp.responseText; //alert (response); if (response == 0) { if (signuptype == "signup") { GetPopupElement(popupname).UpdateContentHttp('ajax/shop_user_login.php', 'popupname=' + popupname + '&type=' + signuptype, 'New User Creation'); GetPopupElement(popupname).EnableHelp('New user creation', 'HP Help0019', '#000000', 65); nd(); } else if (signuptype == "call") { document.location.href = 'index.php?menu=shop&submenu=recharges'; } else if (signuptype == "vnselection") { document.location.href = 'index.php?menu=shop&submenu=vns&vn_country=' + vn_country + '&vn_area=' + vn_area; } else if (update == "yes") { document.location.href = 'index.php?menu=shop&deletecart=yes'; } else { document.location.href = 'index.php?menu=shop'; } } } } xmlHttp.open("POST", "ajax/save_user_location.php", true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlHttp.send("country=" + country + "&state=" + state + "&web_language=english"); nd(); } } function SaveUserPreferences(popupname, country, state, language, currency, signuptype, vn_country, vn_area, update) { if (update == "yes") { if (confirm("Changing your preferences will empty your cart. Are you sure you want to proceed?") == false) { return; } } var xmlHttp; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { var response = xmlHttp.responseText; if (response == 0) { if (signuptype == "signup") { GetPopupElement(popupname).UpdateContentHttp('ajax/shop_user_login.php', 'popupname=' + popupname + '&type=' + signuptype, 'New User Creation'); GetPopupElement(popupname).EnableHelp('New user creation', 'HP Help0019', '#000000', 65); } else if (signuptype == "call") { document.location.href = 'index.php?menu=shop&submenu=recharges'; } else if (signuptype == "vnselection") { document.location.href = 'index.php?menu=shop&submenu=vns&vn_country=' + vn_country + '&vn_area=' + vn_area; } else if (update == "yes") { document.location.href = 'index.php?menu=shop&deletecart=yes'; } else { document.location.href = 'index.php?menu=shop'; } } } } xmlHttp.open("POST", "ajax/save_user_location.php", true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlHttp.send("country=" + country + "&state=" + state + "&web_language=" + language + "¤cy=" + currency); } function show_login() { document.getElementById('mainFloatFormBg').className = 'TB_overlay visible'; document.getElementById('login').className = 'login visible'; document.getElementById('pr_login').focus(); if(CurrentTab == 'tab1'){ var tab1 = document.getElementById('tab1_content'); tab1.style.visibility = 'hidden'; } } function hide_login() { document.getElementById('mainFloatFormBg').className = 'TB_overlay hidden'; document.getElementById('login').className = 'login hidden'; if(CurrentTab == 'tab1') { var tab1 = document.getElementById('tab1_content'); tab1.style.visibility = 'block'; } } function submitenter(myfield,e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (keycode == 13) { myfield.form.submit(); return false; } else return true; } function ShowPrepage() { if (MustShowPrepage) { if (document.getElementById) { document.getElementById('prepage').style.visibility = 'visible'; document.getElementById('prepage').style.display = 'block'; if (document.getElementById('prepage_iframe')) { document.getElementById('prepage_iframe').style.visibility = 'visible'; document.getElementById('prepage_iframe').style.display = 'block'; } } else { if (document.layers) { document.prepage.visibility = 'visible'; document.prepage.display = 'block'; if (document.prepage_iframe) { document.prepage_iframe.visibility = 'visible'; document.prepage_iframe.display = 'block'; } } else { document.all.prepage.style.visibility = 'visible'; document.all.prepage.style.display = 'block'; if (document.all.prepage_iframe) { document.all.prepage_iframe.style.visibility = 'visible'; document.all.prepage_iframe.style.display = 'block'; } } } } } function HidePrepage() { if (document.getElementById) { document.getElementById('prepage').style.visibility = 'hidden'; document.getElementById('prepage').style.display = 'none'; if (document.getElementById('prepage_iframe')) { document.getElementById('prepage_iframe').style.visibility = 'hidden'; document.getElementById('prepage_iframe').style.display = 'none'; } } else { if (document.layers) { document.prepage.visibility = 'hidden'; document.prepage.display = 'none'; if (document.prepage_iframe) { document.prepage_iframe.visibility = 'hidden'; document.prepage_iframe.display = 'none'; } } else { document.all.prepage.style.visibility = 'hidden'; document.all.prepage.style.display = 'none'; if (document.all.prepage_iframe) { document.all.prepage_iframe.style.visibility = 'hidden'; document.all.prepage_iframe.style.display = 'none'; } } } } function ResetTableLineBackground (table, color, color2) { var table_obj = document.getElementById(table); var elements = table_obj.getElementsByTagName('tr'); for (var i = 0; i < elements.length; i++) { if (color2) { if (i%2 > 0) elements[i].style.backgroundColor = color; else elements[i].style.backgroundColor = color2; } else { elements[i].style.backgroundColor = color; } } } function ResetTableLineCellClass (line, classname) { var line_obj = document.getElementById(line); var elements = line_obj.getElementsByTagName('td'); for (var i = 0; i < elements.length; i++) { elements[i].className = classname; } } function HideCellTables (cell) { var cell_obj = document.getElementById(cell); var elements = cell_obj.getElementsByTagName('table'); for (var i = 0; i < elements.length; i++) { if (elements[i].parentNode == cell_obj) elements[i].style.display = 'none'; } } function ChangeDivsBackgroundPosition (elem) { var elem_obj = document.getElementById(elem); var elements = elem_obj.getElementsByTagName('div'); for (var i = 0; i < elements.length; i++) { elements[i].style.backgroundPosition = '-16px'; } } function getBounds(element) { bleft = element.offsetLeft; btop = element.offsetTop; //alert(bleft); for (var parent = element.offsetParent; parent; parent = parent.offsetParent) { bleft += parent.offsetLeft; btop += parent.offsetTop; //alert(bleft); } return {bleft: bleft, btop: btop}; } function getByTagName( o, tN ) { if ( o ) { if ( o.getElementsByTagName ) { return o.getElementsByTagName( tN ); } else if( o.all && o.all.tags ) { return o.all.tags( tN ); } } return null; } function HideTopHeaderSubMenus() { var divs = getByTagName(document, 'div'); for (var i = 0; i < divs.length; i++) { if (divs[i].className == 'submenu') { divs[i].style.display = 'none'; } } } function CreateSubMenu(submenu, parentbutton) { HideTopHeaderSubMenus(); bounds = getBounds(parentbutton); submenuobj = document.getElementById(submenu); submenuobj.style.left = bounds.bleft - 30 + 'px'; submenuobj.style.top = bounds.btop - 30 + 'px'; submenuobj.style.display = 'inline'; } function RemoveSubMenu(event, submenu, parentbutton) { bounds = getBounds(document.getElementById(parentbutton)); if( (event.clientX < bounds.bleft-27) || (event.clientX > bounds.bleft+121) || (event.clientY < bounds.btop-20) || (event.clientY > bounds.btop + 107) ) { submenu.style.display = 'none'; } } // Cookies functions var cookies = new Object(); function extractCookies() { var name, value; var beginning, middle, end; for (name in cookies) { cookies = new Object(); break; } beginning = 0; while (beginning < document.cookie.length) { middle = document.cookie.indexOf('=', beginning); end = document.cookie.indexOf(';', beginning); if (end == -1) end = document.cookie.length; if ( (middle > end) || (middle == -1) ) { name = document.cookie.substring(beginning, end); value = ""; } else { name = document.cookie.substring(beginning, middle); value = document.cookie.substring(middle + 1, end); } cookies[name] = unescape(value); beginning = end + 2; } } function ChangeImageSize(elem_name, formsize, tosize) { var elem = document.getElementById(elem_name); var imgs = elem.getElementsByTagName('img'); for ($i = 0; $i < imgs.length; $i++) { imgs[$i].src = imgs[$i].src.replace(formsize, tosize); } } ///////// // Fixed split ///////// var nativeSplit = nativeSplit || String.prototype.split; String.prototype.split = function (s /* separator */, limit) { // If separator is not a regex, use the native split method if (!(s instanceof RegExp)) return nativeSplit.apply(this, arguments); /* Behavior for limit: If it's... - Undefined: No limit - NaN or zero: Return an empty array - A positive number: Use limit after dropping any decimal - A negative number: No limit - Other: Type-convert, then use the above rules */ if (limit === undefined || +limit < 0) { limit = false; } else { limit = Math.floor(+limit); if (!limit) return []; } var flags = (s.global ? "g" : "") + (s.ignoreCase ? "i" : "") + (s.multiline ? "m" : ""), s2 = new RegExp("^" + s.source + "$", flags), output = [], lastLastIndex = 0, i = 0, match; if (!s.global) s = new RegExp(s.source, "g" + flags); while ((!limit || i++ <= limit) && (match = s.exec(this))) { var zeroLengthMatch = !match[0].length; // Fix IE's infinite-loop-resistant but incorrect lastIndex if (zeroLengthMatch && s.lastIndex > match.index) s.lastIndex = match.index; // The same as s.lastIndex-- if (s.lastIndex > lastLastIndex) { // Fix browsers whose exec methods don't consistently return undefined for non-participating capturing groups if (match.length > 1) { match[0].replace(s2, function () { for (var j = 1; j < arguments.length - 2; j++) { if (arguments[j] === undefined) match[j] = undefined; } }); } output = output.concat(this.slice(lastLastIndex, match.index), (match.index === this.length ? [] : match.slice(1))); lastLastIndex = s.lastIndex; } if (zeroLengthMatch) s.lastIndex++; } return (lastLastIndex === this.length) ? (s.test("") ? output : output.concat("")) : (limit ? output : output.concat(this.slice(lastLastIndex))); }; /////////////////////////// // Input - Keyboard Masking /////////////////////////// function isNumberInput(field, event) { var key, keyChar; if (window.event) key = window.event.keyCode; else if (event) key = event.which; else return true; // Check for special characters if (key == null || key == 0 || key == 8 || key == 13 || key == 27) return true; // Check if it is a number keyChar = String.fromCharCode(key); if (/\d/.test(keyChar)) { window.status = ""; return true; } else { window.status = "Field accepts numbers only."; return false; } } // Is "enter" key pressed function isEnter(e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return false; if (keycode == 13) { return true; } else return false; } function ForgotPassword(popupname) { elem = document.getElementById('email'); if (elem.value.length >= 4 && elem.value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) { document.getElementById('h_email').style.display = 'none'; } else { document.getElementById('h_email').style.display = 'block'; GetPopupElement(popupname).Center(); return false; } try { xmlHttp_checkout=new XMLHttpRequest(); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp_checkout.open("POST", "ajax/sendforgotpassword.php", false); xmlHttp_checkout.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlHttp_checkout.send("email=" + elem.value); if (xmlHttp_checkout.status == 200) { var error = xmlHttp_checkout.responseText; } else { return; } GetPopupElement(popupname).UpdateContentHttp('ajax/sentforgotpassword.php', 'popupname=' + popupname + '&email=' + elem.value, 'Forgot Password'); GetPopupElement(popupname).Center(); } function RecoveryPassword(popupname, account, code) { if (document.getElementById('web_password')) { elem = document.getElementById('web_password'); elem_conf = document.getElementById('web_password_conf'); if (elem.value.length >= 6 && elem.value.length <= 30 && elem.value.match(/^[0-9a-zA-Z\u0021-\u007E\u00C0-\u017F\u0400-\u04FF\s\u00B4]+$/)) { document.getElementById('h_web_password').innerHTML = ''; document.getElementById('h_web_password').style.display = 'none'; } else { document.getElementById('h_web_password').innerHTML = '6-30 characters.'; document.getElementById('h_web_password').style.display = 'inline'; return; } if (elem.value != elem_conf.value) { document.getElementById('h_web_password_conf').innerHTML = 'Please make sure both your password entries match.'; document.getElementById('h_web_password_conf').style.display = 'inline'; return; } else { document.getElementById('h_web_password_conf').innerHTML = ''; document.getElementById('h_web_password_conf').style.display = 'none'; } try { xmlHttp_checkout=new XMLHttpRequest(); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } var tmppsw = elem.value.replace('+', 'pplluuss').replace('-', 'mmiinnuuss'); xmlHttp_checkout.open("POST", "ajax/saverecoverypassword.php", false); xmlHttp_checkout.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlHttp_checkout.send('popupname=' + popupname + '&account=' + account + '&code=' + code + '&password=' + tmppsw); if (xmlHttp_checkout.status == 200) { var error = xmlHttp_checkout.responseText; } else { return; } GetPopupElement(popupname).UpdateContentHttp('ajax/savedrecoverypassword.php', 'popupname=' + popupname, 'Forgot Password'); GetPopupElement(popupname).EnableHelp('Password updated', 'HP Help0051', '#000000', 65); GetPopupElement(popupname).Center(); } } function ReSendActivation(popupname) { if (document.getElementById('email')) { elem = document.getElementById('email'); if (elem.value.length >= 4 && elem.value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) { document.getElementById('h_email').innerHTML = ''; document.getElementById('h_email').style.display = 'none'; } else { document.getElementById('h_email').innerHTML = 'Invalid Email format'; document.getElementById('h_email').style.display = 'inline'; return false; } try { xmlHttp_checkout=new XMLHttpRequest(); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp_checkout.open("POST", "ajax/resendactivation.php", false); xmlHttp_checkout.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlHttp_checkout.send("email=" + elem.value); if (xmlHttp_checkout.status == 200) { var error = xmlHttp_checkout.responseText; if (error == 1) return; } else { return; } GetPopupElement(popupname).UpdateContentHttp('activation/sent.php', '', 'Activation Request'); GetPopupElement(popupname).EnableHelp('New activation link sent', 'HP Help0045', '#000000', 65); GetPopupElement(popupname).Center(); } } //----------------------------------------------------------------------------------------------------------- // User Informations Shop functions //----------------------------------------------------------------------------------------------------------- function UserAccountSelection(popupname, button, signup) { if (document.getElementById('new').value == 1) { var email = document.getElementById('email').value; if (email.length >=4 && email.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) { document.getElementById('h_email').style.display = 'none'; } else { document.getElementById('email').focus(); document.getElementById('h_email').style.display = 'block'; GetPopupElement(popupname).Center(); return false; } var emailconf = document.getElementById('email_conf').value; if (email == emailconf) { document.getElementById('h_email_conf').style.display = 'none'; } else { document.getElementById('h_email_conf').style.display = 'block'; GetPopupElement(popupname).Center(); return false; } try { xmlHttp_checkout=new XMLHttpRequest(); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp_checkout.open("POST", "ajax/save_shop_user_login.php", false); xmlHttp_checkout.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlHttp_checkout.send("email=" + email); if (xmlHttp_checkout.status == 200) { var error = xmlHttp_checkout.responseText; if (error == 1) return; } else { return; } if (signup == "signup" || signup == "call" || signup == "conf" || signup == "sms") { GetPopupElement(popupname).UpdateContentHttp('ajax/country_selection.php', 'popupname=' + popupname + '&type=' + signup, 'Select your shipping destination'); GetPopupElement(popupname).EnableHelp('Select your shipping destination', 'HP Help0007', '#000000', 65); } else { GetPopupElement(popupname).UpdateContentHttp('ajax/shop_user_login.php', 'popupname=' + popupname + '&type=' + signup, 'New User Creation'); GetPopupElement(popupname).EnableHelp('New user creation', 'HP Help0019', '#000000', 65); } GetPopupElement(popupname).Center(); ReloadAllScrollbar(); //document.getElementById('web_username').focus(); } else { document.getElementById('form_login').submit(); } } function CheckAndSendNewUserLogin(button, popupname, signup) { var birth = document.getElementById('birthyear').value + "-" + document.getElementById('birthmonth').value + "-" + document.getElementById('birthday').value; var today = new Date(); var todayminus13 = new Date((today.getFullYear() - 13), today.getMonth(), today.getDate()); var birthdate = new Date(parseInt(document.getElementById('birthyear').value), (parseInt(document.getElementById('birthmonth').value) - 1), parseInt(document.getElementById('birthday').value)); if (CheckWebLogin('web_username')) return false; if (CheckUserInfos()) return false; if ((todayminus13 - birthdate) < 0) { document.getElementById('h_birth').style.display = 'inline'; return false; } else { document.getElementById('h_birth').style.display = 'none'; } if (document.getElementById('terms').value != 1) { document.getElementById('h_terms').style.display = 'inline'; return false; } else { document.getElementById('h_terms').style.display = 'none'; } try { xmlHttp_checkout=new XMLHttpRequest(); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp_checkout.open("POST", "ajax/save_shop_user_access.php", false); xmlHttp_checkout.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlHttp_checkout.send("web_username=" + document.getElementById('web_username').value + "&web_password=" + document.getElementById('web_password').value); if (xmlHttp_checkout.status == 200) { var error = xmlHttp_checkout.responseText; if (error == 1) return; } else { return; } xmlHttp_checkout.open("POST", "ajax/save_shop_user_login.php", false); xmlHttp_checkout.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlHttp_checkout.send("birth=" + birth + "¬ification=" + document.getElementById('notifications').value + "&signup=" + signup); if (xmlHttp_checkout.status == 200) { var error = xmlHttp_checkout.responseText; if (error == 1) return; } else { return; } if (signup == "signup" || signup == "call" || signup == "conf" || signup == "sms") { GetPopupElement(popupname).UpdateContentHttp('ajax/signup_confirmation.php', 'popupname=' + popupname, 'Sign up Confirmation'); GetPopupElement(popupname).EnableHelp('Signup Confirmation', 'HP Help0025', '#000000', 65); GetPopupElement(popupname).Center(); ReloadAllScrollbar(); } else { GetPopupElement(popupname).UpdateContentHttp('ajax/shop_contact_information.php', 'popupname=' + popupname, 'Order delivery and billing information'); GetPopupElement(popupname).EnableHelp('Cart Contact Info Help Title', 'HP Help0013', '#000000', 65); GetPopupElement(popupname).Center(); ReloadAllScrollbar(); } } function CheckFeatureRequest() { var error = false; if (document.getElementById('firstname')) { elem = document.getElementById('firstname'); if (elem.value.length >= 1 && elem.value.match(/^[a-zA-Z\u00C0-\u017F\u0400-\u04FF\s\-'´]+$/)) { document.getElementById('h_firstname').innerHTML = ''; document.getElementById('h_firstname').style.display = 'none'; } else { document.getElementById('h_firstname').innerHTML = 'Letters or spaces'; document.getElementById('h_firstname').style.display = 'inline'; error = true; } } if (document.getElementById('lastname')) { elem = document.getElementById('lastname'); if (elem.value.length >= 1 && elem.value.match(/^[a-zA-Z\u00C0-\u017F\u0400-\u04FF\s\-'´]+$/)) { document.getElementById('h_lastname').innerHTML = ''; document.getElementById('h_lastname').style.display = 'none'; } else { document.getElementById('h_lastname').innerHTML = 'Letters or spaces'; document.getElementById('h_lastname').style.display = 'inline'; error = true; } } if (document.getElementById('email')) { elem = document.getElementById('email'); if (elem.value.length >= 4 && elem.value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) { document.getElementById('h_email').innerHTML = ''; document.getElementById('h_email').style.display = 'none'; } else { document.getElementById('h_email').innerHTML = 'Invalid Email format'; document.getElementById('h_email').style.display = 'inline'; error = true; } } if (error == false) { var show_captcha = QuickNewPopupHttp('show_captcha', 1, 'Confirm your are not a robot', 'ajax/feature_request_captcha.php', '', '#000000', 65); show_captcha.EnableHelp('Confirm your are not a robot Help Title', 'HP Help0029', '#000000', 65); if (document.getElementById('recaptcha_div')) { Recaptcha.create('6LdViwAAAAAAAOAak9S-oTla6GKVd2FYtALMFqLc' , 'recaptcha_div' , { theme: 'red' , callback: Recaptcha.focus_response_field , lang: 'en' } ); } } } function SendFeatureRequest() { firstname = encodeURIComponent(document.getElementById('firstname').value); lastname = encodeURIComponent(document.getElementById('lastname').value); country = document.getElementById('country').value; email = document.getElementById('email').value; company = document.getElementById('company').value; house = document.getElementById('home').value; reqtype = document.getElementById('type').value; request = encodeURIComponent(document.getElementById('request').value); try { xmlHttp_checkout=new XMLHttpRequest(); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp_checkout=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } xmlHttp_checkout.open("POST", "ajax/save_feature_request.php", false); xmlHttp_checkout.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlHttp_checkout.send("firstname=" + firstname + "&lastname=" + lastname + "&country=" + country + "&email=" + email + "&company=" + company + "&home=" + house + "&type=" + reqtype + "&request=" + request); if(xmlHttp_checkout.status == 200) { var error = xmlHttp_checkout.responseText; if (error == 1) return; } document.location.href = 'index.php?menu=support&submenu=feature&success=yes'; } function CheckUserInfos() { var elem = null; var error = false; if (document.getElementById('objectname')) { elem = document.getElementById('objectname'); if (elem.value.length >= 2 && elem.value.length <= 22 && elem.value.match(/^[0-9a-zA-Z\u0021-\u007E\u00C0-\u017F\u0400-\u04FF\s\u00B4]+$/)) { document.getElementById('h_objectname').innerHTML = ''; document.getElementById('h_objectname').style.display = 'none'; } else { document.getElementById('h_objectname').innerHTML = '2-22 characters.'; document.getElementById('h_objectname').style.display = 'inline'; error = true; } } if (document.getElementById('web_username')) { elem = document.getElementById('web_username'); if (elem.value.length >= 8 && elem.value.length <= 20 && elem.value.match(/^[0-9a-zA-Z\u0021-\u007E\u00C0-\u017F\u0400-\u04FF\s]+$/)) { document.getElementById('h_web_username').innerHTML = ''; document.getElementById('h_web_username').style.display = 'none'; } else { document.getElementById('h_web_username').innerHTML = '8-20 characters.'; document.getElementById('h_web_username').style.display = 'inline'; error = true; } } if (document.getElementById('web_password')) { elem = document.getElementById('web_password'); elem_conf = document.getElementById('web_password_conf'); if (elem.value.length >= 6 && elem.value.length <= 30 && elem.value.match(/^[0-9a-zA-Z\u0021-\u007E\u00C0-\u017F\u0400-\u04FF\s\u00B4]+$/)) { document.getElementById('h_web_password').innerHTML = ''; document.getElementById('h_web_password').style.display = 'none'; } else { document.getElementById('h_web_password').innerHTML = '6-30 characters.'; document.getElementById('h_web_password').style.display = 'inline'; error = true; } if (elem.value != elem_conf.value) { document.getElementById('h_web_password_conf').innerHTML = 'Please make sure both your password entries match.'; document.getElementById('h_web_password_conf').style.display = 'inline'; error = true; } else { document.getElementById('h_web_password_conf').innerHTML = ''; document.getElementById('h_web_password_conf').style.display = 'none'; } } if (document.getElementById('firstname')) { elem = document.getElementById('firstname'); if (elem.value.length >= 1 && elem.value.match(/^[a-zA-Z\u00C0-\u017F\u0400-\u04FF\s\-\u0027\u00B4]+$/)) { document.getElementById('h_firstname').innerHTML = ''; document.getElementById('h_firstname').style.display = 'none'; } else { document.getElementById('h_firstname').innerHTML = 'Letters or spaces'; document.getElementById('h_firstname').style.display = 'inline'; error = true; } } if (document.getElementById('lastname')) { elem = document.getElementById('lastname'); if (elem.value.length >= 1 && elem.value.match(/^[a-zA-Z\u00C0-\u017F\u0400-\u04FF\s\-\u0027\u00B4]+$/)) { document.getElementById('h_lastname').innerHTML = ''; document.getElementById('h_lastname').style.display = 'none'; } else { document.getElementById('h_lastname').innerHTML = 'Letters or spaces'; document.getElementById('h_lastname').style.display = 'inline'; error = true; } } if (document.getElementById('email')) { elem = document.getElementById('email'); if (elem.value.length >= 4 && elem.value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) { document.getElementById('h_email').innerHTML = ''; document.getElementById('h_email').style.display = 'none'; } else { document.getElementById('h_email').innerHTML = 'Invalid Email format'; document.getElementById('h_email').style.display = 'inline'; error = true; } } if (document.getElementById('address')) { elem = document.getElementById('address'); if (elem.value.length >= 1 && elem.value.match(/^[0-9a-zA-Z\u00C0-\u017F\u0400-\u04FF\s\-\u0026-\u002F\u00B4]+$/)) { document.getElementById('h_address').innerHTML = ''; document.getElementById('h_address').style.display = 'none'; } else { document.getElementById('h_address').innerHTML = 'Please check'; document.getElementById('h_address').style.display = 'inline'; error = true; } } if (document.getElementById('zipcode')) { elem = document.getElementById('zipcode'); if (elem.value.length >= 1 && elem.value.match(/^[0-9a-zA-Z\u00C0-\u017F\u0400-\u04FF\s\-\u0026-\u002F\u00B4]+$/)) { document.getElementById('h_zipcode').innerHTML = ''; document.getElementById('h_zipcode').style.display = 'none'; } else { document.getElementById('h_zipcode').innerHTML = 'Please check'; document.getElementById('h_zipcode').style.display = 'inline'; error = true; } } if (document.getElementById('city')) { elem = document.getElementById('city'); if (elem.value.length >= 1 && elem.value.match(/^[0-9a-zA-Z\u00C0-\u017F\u0400-\u04FF\s\-\u0026-\u002F\u00B4]+$/)) { document.getElementById('h_city').innerHTML = ''; document.getElementById('h_city').style.display = 'none'; } else { document.getElementById('h_city').innerHTML = 'Please check'; document.getElementById('h_city').style.display = 'inline'; error = true; } } if (document.getElementById('state')) { elem = document.getElementById('state'); if (elem.value.length == 0 || elem.value.match(/^[0-9a-zA-Z\u0021-\u007E\u00C0-\u017F\u0400-\u04FF\s\-\\u00B4]+$/)) { document.getElementById('h_state').innerHTML = ''; document.getElementById('h_state').style.display = 'none'; } else { document.getElementById('h_state').innerHTML = 'Please check'; document.getElementById('h_state').style.display = 'inline'; error = true; } } if (document.getElementById('country')) { elem = document.getElementById('country'); if (elem.value >= 1) { document.getElementById('h_country').innerHTML = ''; document.getElementById('h_country').style.display = 'none'; } else { document.getElementById('h_country').innerHTML = 'Please choose a country'; document.getElementById('h_country').style.display = 'inline'; error = true; } } if (document.getElementById('phone')) { elem = document.getElementById('phone'); if (elem.value.match(/^[0-9]+$/)) { document.getElementById('h_phone').innerHTML = ''; document.getElementById('h_phone').style.display = 'none'; } else { document.getElementById('h_phone').innerHTML = 'Invalid Number format'; document.getElementById('h_phone').style.display = 'inline'; error = true; } } if (document.getElementById('fax')) { elem = document.getElementById('fax'); if (elem.value.match(/^[0-9]*$/)) { document.getElementById('h_fax').innerHTML = ''; document.getElementById('h_fax').style.display = 'none'; } else { document.getElementById('h_fax').innerHTML = 'Invalid Number format'; document.getElementById('h_fax').style.display = 'inline'; error = true; } } if (document.getElementById('mobile')) { elem = document.getElementById('mobile'); if (elem.value.match(/^[0-9]*$/)) { document.getElementById('h_mobile').innerHTML = ''; document.getElementById('h_mobile').style.display = 'none'; } else { document.getElementById('h_mobile').innerHTML = 'Invalid Number format'; document.getElementById('h_mobile').style.display = 'inline'; error = true; } } if (document.getElementById('c_name')) { elem = document.getElementById('c_name'); if (elem.value.length == 0 || elem.value.match(/^[0-9a-zA-Z\u0021-\u007E\u00C0-\u017F\u0400-\u04FF\s\-\u0026-\u002F\u00B4]+$/)) { document.getElementById('h_c_name').innerHTML = ''; document.getElementById('h_c_name').style.display = 'none'; } else { document.getElementById('h_c_name').innerHTML = 'Letters or spaces'; document.getElementById('h_c_name').style.display = 'inline'; error = true; } } if (document.getElementById('c_address')) { elem = document.getElementById('c_address'); if (elem.value.length == 0 || elem.value.match(/^[0-9a-zA-Z\u00C0-\u017F\u0400-\u04FF\s\-\u0026-\u002F\u00B4]+$/)) { document.getElementById('h_c_address').innerHTML = ''; document.getElementById('h_c_address').style.display = 'none'; } else { document.getElementById('h_c_address').innerHTML = 'Letters or spaces'; document.getElementById('h_c_address').style.display = 'inline'; error = true; } } if (document.getElementById('c_email')) { elem = document.getElementById('c_email'); if (elem.value.length == 0 || elem.value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)) { document.getElementById('h_c_email').innerHTML = ''; document.getElementById('h_c_email').style.display = 'none'; } else { document.getElementById('h_c_email').innerHTML = 'Invalid Email format'; document.getElementById('h_c_email').style.display = 'inline'; error = true; } } if (document.getElementById('c_zipcode')) { elem = document.getElementById('c_zipcode'); if (elem.value.length == 0 || elem.value.match(/^[0-9a-zA-Z\u00C0-\u017F\u0400-\u04FF\s\-\u0026-\u002F\u00B4]+$/)) { document.getElementById('h_c_zipcode').innerHTML = ''; document.getElementById('h_c_zipcode').style.display = 'none'; } else { document.getElementById('h_c_zipcode').innerHTML = 'Please check'; document.getElementById('h_c_zipcode').style.display = 'inline'; error = true; } } if (document.getElementById('c_phone')) { elem = document.getElementById('c_phone'); if (elem.value.length == 0 || elem.value.match(/^[0-9]+$/)) { document.getElementById('h_c_phone').innerHTML = ''; document.getElementById('h_c_phone').style.display = 'none'; } else { document.getElementById('h_c_phone').innerHTML = 'Invalid Number format'; document.getElementById('h_c_phone').style.display = 'inline'; error = true; } } if (document.getElementById('c_city')) { elem = document.getElementById('c_city'); if (elem.value.length == 0 || elem.value.match(/^[0-9a-zA-Z\u00C0-\u017F\u0400-\u04FF\s\-\u0026-\u002F\u00B4]+$/)) { document.getElementById('h_c_city').innerHTML = ''; document.getElementById('h_c_city').style.display = 'none'; } else { document.getElementById('h_c_city').innerHTML = 'Please check'; document.getElementById('h_c_city').style.display = 'inline'; error = true; } } if (document.getElementById('c_fax')) { elem = document.getElementById('c_fax'); if (elem.value.match(/^[0-9]*$/)) { document.getElementById('h_c_fax').innerHTML = ''; document.getElementById('h_c_fax').style.display = 'none'; } else { document.getElementById('h_c_fax').innerHTML = 'Invalid Number format'; document.getElementById('h_c_fax').style.display = 'inline'; error = true; } } if (document.getElementById('c_state')) { elem = document.getElementById('c_state'); if (elem.value.length == 0 || elem.value.match(/^[0-9a-zA-Z\u0021-\u007E\u00C0-\u017F\u0400-\u04FF\s\-\u00B4]+$/)) { document.getElementById('h_c_state').innerHTML = ''; document.getElementById('h_c_state').style.display = 'none'; } else { document.getElementById('h_c_state').innerHTML = 'Please check'; document.getElementById('h_c_state').style.display = 'inline'; error = true; } } return error; } function CheckWebUsername() { if (document.getElementById('web_username')) { elem = document.getElementById('web_username'); if (elem.value.length >= 8 && elem.value.length <= 20 && elem.value.match(/^[0-9a-zA-Z\u00C0-\u017F\u0400-\u04FF\s\-&@\_\.\#]+$/)) { document.getElementById('h_web_username').innerHTML = ''; document.getElementById('h_web_username').style.display = 'none'; document.getElementById('h_web_username').style.color = '#003399'; } else { document.getElementById('h_web_username').style.display = 'inline'; document.getElementById('h_web_username').innerHTML = '8-20 characters.'; document.getElementById('h_web_username').style.color = '#FF0000'; return; } CheckWebLogin('web_username'); } } function CheckWebLogin(fieldname) { var used = false; if (document.getElementById(fieldname)) { elem = document.getElementById(fieldname); var Ajax_innerHTML = null; try { Ajax_innerHTML = new XMLHttpRequest(); } catch (e) { try { Ajax_innerHTML = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { Ajax_innerHTML = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return true; } } } Ajax_innerHTML.open("POST", "ajax/test_webusername.php", false); Ajax_innerHTML.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); Ajax_innerHTML.send("username=" + elem.value); if(Ajax_innerHTML.status == 200) { var response = Ajax_innerHTML.responseText; if (response == "True") { document.getElementById('h_' + fieldname).innerHTML = 'Ucilia ID is available'; document.getElementById('h_' + fieldname).style.display = 'inline'; document.getElementById('h_' + fieldname).style.color = '#003399'; } else { document.getElementById('h_' + fieldname).innerHTML = 'Sorry, Ucilia ID already in use'; document.getElementById('h_' + fieldname).style.display = 'inline'; document.getElementById('h_' + fieldname).style.color = '#FF0000'; used = true; } } else { document.getElementById('h_' + fieldname).innerHTML = '2-22 characters.'; document.getElementById('h_' + fieldname).style.display = 'inline'; document.getElementById('h_' + fieldname).style.color = '#FF0000'; elem.focus(); used = true; } } return used; } function Set_Cookie( name, value, expires, path, domain, secure ) { var today = new Date(); today.setTime( today.getTime() ); if ( expires ) { expires = expires * 1000 * 60 * 60 * 24; } var expires_date = new Date( today.getTime() + (expires) ); document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); } function Get_Cookie( check_name ) { var a_all_cookies = document.cookie.split( ';' ); var a_temp_cookie = ''; var cookie_name = ''; var cookie_value = ''; var b_cookie_found = false; for ( i = 0; i < a_all_cookies.length; i++ ) { a_temp_cookie = a_all_cookies[i].split( '=' ); cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, ''); if ( cookie_name == check_name ) { b_cookie_found = true; if ( a_temp_cookie.length > 1 ) { cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') ); } return cookie_value; break; } a_temp_cookie = null; cookie_name = ''; } if ( !b_cookie_found ) { return null; } } function Delete_Cookie( name, path, domain ) { if ( Get_Cookie( name ) ) document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT"; } function trim (myString) { return myString.replace(/^\s+/g,'').replace(/\s+$/g,''); } function GetScreenSize() { if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } document.getElementById('prepage').style.width = myWidth + "px"; document.getElementById('prepage').style.height = myHeight + "px"; Set_Cookie('mywidth', myWidth, 7200, '/', '', ''); Set_Cookie('myheight', myHeight, 7200, '/', '', ''); } if(typeof HTMLElement!="undefined" && ! HTMLElement.prototype.insertAdjacentElement) { HTMLElement.prototype.insertAdjacentElement = function (where, parsedNode) { switch (where){ case 'beforeBegin': this.parentNode.insertBefore(parsedNode,this) break; case 'afterBegin': this.insertBefore(parsedNode,this.firstChild); break; case 'beforeEnd': this.appendChild(parsedNode); break; case 'afterEnd': if (this.nextSibling) this.parentNode.insertBefore(parsedNode,this.nextSibling); else this.parentNode.appendChild(parsedNode); break; } } HTMLElement.prototype.insertAdjacentHTML = function (where, htmlStr) { var r = this.ownerDocument.createRange(); r.setStartBefore(this); var parsedHTML = r.createContextualFragment(htmlStr); this.insertAdjacentElement(where,parsedHTML) } HTMLElement.prototype.insertAdjacentText = function (where, txtStr) { var parsedText = document.createTextNode(txtStr) this.insertAdjacentElement(where,parsedText) } } function removeChildSafe(el) { //before deleting el, recursively delete all of its children. while(el.childNodes.length > 0) { removeChildSafe(el.childNodes[el.childNodes.length-1]); } el.parentNode.removeChild(el); } function SetButtonHover(fromelem) { var divs = fromelem.getElementsByTagName('div'); for (var i = 0; i < divs.length; i++) { if (divs[i].className == "button01" || divs[i].className == "button02" || divs[i].className == "button03" || divs[i].className == "button04" || divs[i].className == "button05") { divs[i].onmouseover = function() { var subdivs = this.getElementsByTagName('a'); subdivs[0].style.backgroundPosition = 'bottom left'; subdivs[1].style.backgroundPosition = 'bottom left'; subdivs[2].style.backgroundPosition = 'bottom right'; }; divs[i].onmouseout = function() { var subdivs = this.getElementsByTagName('a'); subdivs[0].style.backgroundPosition = 'top left'; subdivs[1].style.backgroundPosition = 'top left'; subdivs[2].style.backgroundPosition = 'top right'; }; } else if (divs[i].className == "headermenu1_bckg" || divs[i].className == "headermenu1_bckg_sel") { divs[i].onmouseover = function() { this.style.backgroundPosition = 'bottom left'; }; divs[i].onmouseout = function() { this.style.backgroundPosition = 'top left'; }; } } } function BuymeVN(country, area) { var countryselect = QuickNewPopupHttp('countryselect', 1, 'Select your shipping destination', 'ajax/country_selection.php', 'type=vnselection&vn_country=' + country + '&vn_area=' + area, '#000000', 65); countryselect.EnableHelp('Select your shipping destination', 'HP Help0007', '#000000', 65);} function OpenAnimPopup(anim) { var anim = QuickNewPopupHttp('anim', 1, 'How it works?', 'ajax/anim.php', 'anim=' + anim, '#000000', 65); anim.EnableHelp('How it works?', 'HP Help0047', '#000000', 65); } function OpenSignIn(signtype, popupname) { if (popupname != undefined) { GetPopupElement(popupname).UpdateContentHttp('ajax/shop_user.php', 'popupname=' + popupname + '&type=' + signtype, 'Sign Up'); GetPopupElement(popupname).EnableHelp('Sign up', 'HP Help0055', '#000000', 65); } else { var login = QuickNewPopupHttp('login', 1, 'Sign Up', 'ajax/shop_user.php', 'type=' + signtype, '#000000', 65); login.EnableHelp('Sign up', 'HP Help0055', '#000000', 65); } document.getElementById('email').focus(); var textInptArray = new Array(); textInptArray[0] = 'email'; CheckPaste(textInptArray); var textInptArray2 = new Array(); textInptArray2[0] = 'email_conf'; CheckPaste(textInptArray2); } function OpenLogin(error, popupname) { if (popupname != undefined) { GetPopupElement(popupname).UpdateContentHttp('ajax/login.php', 'popupname=' + popupname + '&error=' + error, 'Sign In'); GetPopupElement(popupname).EnableHelp('Sign in', 'HP Help0015', '#000000', 65); } else { var login = QuickNewPopupHttp('login', 1, 'Sign In', 'ajax/login.php', 'error=' + error, '#000000', 65); login.EnableHelp('Sign in', 'HP Help0015', '#000000', 65); } Cookies.init(); loadCookie(); document.getElementById('pr_login').focus(); if (document.getElementById('pr_login').value.length > 0) document.getElementById('pr_remember').value = 1; else document.getElementById('pr_remember').value = 0; } function OpenVNRates() { var vn_rates = QuickNewPopupHttp('vn_rates', 1, 'Available Phone Numbers', 'ajax/vn_rates.php', '', '#000000', 65); vn_rates.EnableHelp('Phone Numbers', 'HP Help0037', '#000000', 65); document.getElementById('country').focus(); } function OpenRates() { var rates = QuickNewPopupHttp('rates', 1, 'Calls rates', 'ajax/rates.php', '', '#000000', 65); rates.EnableHelp('Calls Rates', 'HP Help0027', '#000000', 65); document.getElementById('dst').focus(); } function CheckPaste(txtInputArray) { for(i = 0; i < txtInputArray.length; i++) { txtInput[i] = document.getElementById(txtInputArray[i]); nowInput[i] = txtInput[i].value; } if(document.all) { var browser = navigator.userAgent.toLowerCase(); if(browser.search(/opera[\/\s](\d+(\.?\d)*)/) != -1) { checkView(); } else { for(i = 0; i < txtInput.length; i++) { txtInput[i].onpaste = function () { return false; } } } } else { checkView(); } } function checkView() { checkText(); vTimer = window.setTimeout("checkView();", 1); } function checkText() { for(i = 0; i < txtInput.length; i++) { if(txtInput[i]) { newTextLength = txtInput[i].value.length; nowInputLength = nowInput[i].length; if(newTextLength > (nowInputLength +3)) { txtInput[i].value = nowInput[i]; } else { nowInput[i] = txtInput[i].value; } } } } function CareerInfo(career_vn) { var Careersdtl = QuickNewPopupHttp('careers_dtl', 1, 'Career Details', 'ajax/careers_detail.php', 'careers_nb=' + career_vn, '#000000', 65); } function MyIP() { var Myip = QuickNewPopupHttp('MyIP', 1, 'MyIP', 'ajax/myip.php', '', '#000000', 65); } function saveCookie() { var xl = document.forms['form_login'].pr_login.value; var xp = document.forms['form_login'].pr_password.value; Cookies.create('login',xl,7); Cookies.create('password',xp,7); } function loadCookie() { if((Cookies['login']) && (Cookies['password'])) { document.forms['form_login'].pr_login.value=Cookies['login']; document.forms['form_login'].pr_password.value=Cookies['password']; document.getElementById('pr_remember_div').style.backgroundPosition = '0px'; document.forms['form_login'].pr_remember.value = 1; } } function eraseIt() { Cookies.erase('login'); Cookies.erase('password'); } function checkSaveCookie() { if (document.forms['form_login'].pr_remember.value==1) { saveCookie(); } else { eraseIt(); } } function showAnswerFAQ(jnum, jtext) { if (parent.document.all('faq_answer'+jnum).innerHTML==jtext) { parent.document.all('faq_answer'+jnum).innerHTML=''; } else { parent.document.all('faq_answer'+jnum).innerHTML = jtext; // parent.document.all('faq_button'+jnum).innerHTML = '
Answer
'; } GetScrollElement('mainscroll').Reload(); } function externalLinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); for (var i=0; i