var ShowPrepageTimer=null;var agt=navigator.userAgent.toLowerCase();var is_ie=(agt.indexOf("msie")!=-1);var NewsArray=new Array();var CurrentNew=0;function InitHP(){Try.these(function(){resizeIframe(984,1200)});positionSubMenu($w("menu_1 menu_2 menu_3 menu_4"));if($("countrySelect")){$("countrySelect").observe("mouseover",function(d){new Ajax.Request("ajax/getcountries.php",{method:"post",onSuccess:function(e){if(!$("countrySelect2")){$("countrySelect").insert({after:e.responseText});InitCS()}}});$("countrySelect").stopObserving("mouseover")})}if($("languageSelect")){$("languageSelect").observe("mouseover",function(d){new Ajax.Request("ajax/getlanguages.php",{method:"post",onSuccess:function(e){if(!$("languageSelect2")){$("languageSelect").insert({after:e.responseText});InitLG()}}});$("languageSelect").stopObserving("mouseover")})}if($("bannermenu")){var c=$("bannermenu");var a=getByTagName(c,"a");for(var b=0;b<a.length;b++){if(a[b].className=="tab04"){a[b].onmouseover=function(){this.className="tab05"};a[b].onmouseout=function(){this.className="tab04"}}if(a[b].className=="tab07"){a[b].onmouseover=function(){this.className="tab08"};a[b].onmouseout=function(){this.className="tab07"}}}}if($("shopmenu")){var c=$("shopmenu");var a=getByTagName(c,"a");for(var b=0;b<a.length;b++){if(a[b].className=="tab07"){a[b].onmouseover=function(){this.className="tab08"};a[b].onmouseout=function(){this.className="tab07"}}}}if($("rss_feed")){NewsChanger(0)}if($("productslist")){InitProductList()}if($("shopwizardaddedmessage")){setTimeout('$("shopwizardaddedmessage").hide();',3000)}if($("startappletbutton")){$("startappletbutton").style.display="block"}buttonState("donebtn",0);if(typeof uploadDocs=="function"){uploadDocs(1)}if($("whitefilterbody_frame")){$("whitefilterbody").hide()}else{if($("whitefilterbody")){$("whitefilterbody").show()}}}function ForgotPsw(b){var a=true;$("error_email_1").hide();if(b.email.value.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/)){$("error_email_1").hide()}else{$("error_email_1").show();a=false}$("error_recaptcha_1").hide();$("error_recaptcha_2").hide();if(b.recaptcha_response_field.value.length>=2){$("error_recaptcha_1").hide()}else{$("error_recaptcha_1").show();a=false}return a}function ChangePsw(b){var a=true;$("error_newpassword_1").hide();$("error_newpassword_2").hide();if(b.newpassword.value.length>=6&&b.newpassword.value.length<=30){$("error_newpassword_1").hide();if(b.newpassword.value.match(/^[0-9a-zA-Z\u0020-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]+$/)){$("error_newpassword_2").hide()}else{$("error_newpassword_2").show();a=false}}else{$("error_newpassword_1").show();a=false}$("error_newpasswordconfirm_1").hide();if(b.newpassword.value==b.newpasswordconfirm.value){$("error_newpasswordconfirm_1").hide()}else{$("error_newpasswordconfirm_1").show();a=false}if(a){b.newpassword.maxLength=32;b.newpasswordconfirm.maxLength=32;b.newpassword.value=md5(b.newpassword.value);b.newpasswordconfirm.value=md5(b.newpasswordconfirm.value)}return a}function toggleFAQ(a){var b,c;if($){b=$(a)}else{if(document.all){b=document.all[a]}else{if(document.layers){b=document.layers[a]}}}c=b.style;if(c.display==""&&b.offsetWidth!=undefined&&b.offsetHeight!=undefined){c.display=(b.offsetWidth!=0&&b.offsetHeight!=0?"block":"none")}c.display=(c.display==""||c.display=="block"?"none":"block")}function SignIn(c){if($("openid_identifier")&&$F("openid_identifier").length>=15){$("existinguser").submit();return true}var a=$("password");var b=a.value;if(!c.password.value.match(/^[0-9a-z]{32}$/)){a.maxLength=32;b=md5(b)}new Ajax.Request("../ajax/getnonce.php",{method:"post",onSuccess:function(d){if(d.responseText.match(/^[0-9a-z]{32}$/)){a.value=md5(b+d.responseText);$("existinguser").submit()}}});return false}function show_hidden_glossary(c,b){if($("shid").innerHTML==b){var a=1;while($("glossary"+(a))){$("glossary"+(a)).hide();a++}$("shid").innerHTML=c}else{var a=1;while($("glossary"+(a))){$("glossary"+(a)).style.display="block";a++}$("shid").innerHTML=b}}function invert_checkbox(b,a){obj=document.forms[b].elements;for(i=0;i<obj.length;i++){if(i>0){obj[i].checked=obj[0].checked}}}function textCounter(){$("remLen").value=$("sms").value.length}function hideDestIntroText(){if($("dest").value=="write phone numbers here"){$("dest").value=""}}function hideSmsIntroText(){if($("sms").value=="write your message here"){$("sms").value=""}}function isEnter(b){var a;if(window.event){a=window.event.keyCode}else{if(b){a=b.which}else{return false}}if(a==13){return true}else{return false}}function callRatesNav(c,a,b){if(a!=null){$("ratesorder").value=a;if($("ratessens").value=="ASC"){$("ratessens").value="DESC"}else{$("ratessens").value="ASC"}}else{if(b!=null){$("ratespage").value=b}else{$("ratespage").value=0}}$(c).submit()}function CheckNewUser(b){var a=true;buttonState("nextbtn",0);$("newpassword_e").hide();$("error_newpassword_2").hide();if(b.newpassword.value.length>=6&&b.newpassword.value.length<=20){$("newpassword_e").hide();if(b.newpassword.value.match(regexpPassword)){$("newpassword_t").className="custominput1";$("error_newpassword_2").hide()}else{$("newpassword_t").className="custominput2";$("error_newpassword_2").show();a=false}}else{$("newpassword_t").className="custominput2";$("newpassword_e").show();a=false}$("newpasswordconfirm_e").hide();if(b.newpassword.value==b.newpasswordconfirm.value){$("newpasswordconfirm_t").className="custominput1";$("newpasswordconfirm_e").hide()}else{$("newpasswordconfirm_t").className="custominput2";$("newpasswordconfirm_e").show();a=false}$("email_e").hide();if(b.email.value.match(regexpEmail)){$("email_t").className="custominput1";$("email_e").hide()}else{$("email_t").className="custominput2";$("email_e").show();a=false}$("birthyear_e").hide();if(b.birthyear.value>=1920){$("birthyear_d").className="customselectbox1";$("birthyear_e").hide()}else{$("birthyeardiv").className="customselectbox2";$("birthyear_e").show();a=false}$("recaptcha_response_field_e").hide();if(b.recaptcha_response_field.value.length>=2){$("recaptcha_response_field_t").className="custominput1";$("recaptcha_response_field_e").hide()}else{$("recaptcha_response_field_t").className="custominput2";$("recaptcha_response_field_e").show();a=false}$("agree_e").hide();if(b.agree.checked){$("agree_d").className="customcheckbox1";$("agree_e").hide()}else{$("agree_d").className="customcheckbox2";$("agree_e").show();a=false}$("newlogin_e").hide();$("error_newlogin_3").hide();$("ok_newlogin").hide();newlogin=b.newlogin;if(newlogin.value.length>=8&&newlogin.value.length<=20){$("newlogin_e").hide();if(newlogin.value.match(regexpCYTALKid)){$("error_newlogin_2").hide();new Ajax.Request("ajax/test_login.php",{method:"post",parameters:"login="+newlogin.value,onSuccess:function(d){var c=d.responseText;if(c=="True"){$("newlogin_t").className="custominput1";$("error_newlogin_3").hide();$("ok_newlogin").show();b.newpassword.maxLength=32;b.newpasswordconfirm.maxLength=32;b.newpassword.value=md5(b.newpassword.value);b.newpasswordconfirm.value=md5(b.newpasswordconfirm.value);$("newuser").submit()}else{$("newlogin_t").className="custominput2";$("error_newlogin_3").show();a=false}}.bind(a).bind(b),onFailure:function(){$("newlogin_t").className="custominput2";$("error_newlogin_3").show();a=false}.bind(a),onCompleate:function(){buttonState("nextbtn",!a)}})}else{$("newlogin_t").className="custominput2";$("error_newlogin_2").show();a=false}}else{$("newlogin_t").className="custominput2";$("newlogin_e").show();a=false}buttonState("nextbtn",!a)}function CheckNewUser2(b){var a=true;if(b.company.value.match(/^[0-9a-zA-Z\u0020\u0026-\u0029\u002C-\u002E\u005F\u007B\u007D]*$/)){$("error_company_1").hide()}else{$("error_company_1").show();a=false}if(b.firstname.value.match(/^[0-9a-zA-Z\u0020\u0027\u002D]+$/)){$("error_firstname_1").hide()}else{$("error_firstname_1").show();a=false}if(b.lastname.value.match(/^[0-9a-zA-Z\u0020\u0027\u002D]+$/)){$("error_lastname_1").hide()}else{$("error_lastname_1").show();a=false}if(b.address.value.match(/^[0-9a-zA-Z\u0020\u0026-\u0029\u002C-\u002E]+$/)){$("error_address_1").hide()}else{$("error_address_1").show();a=false}if(b.address_2.value.match(/^[0-9a-zA-Z\u0020\u0026-\u0029\u002C-\u002E]*$/)){$("error_address2_1").hide()}else{$("error_address2_1").show();a=false}if(b.city.value.match(/^[0-9a-zA-Z\u0020\u0026-\u0029\u002C-\u002E]+$/)){$("error_city_1").hide()}else{$("error_city_1").show();a=false}if(b.zip.value.match(/^[0-9a-zA-Z\u0020\u002D\u002F]+$/)){$("error_zip_1").hide()}else{$("error_zip_1").show();a=false}if(b.state.value.match(/^[0-9a-zA-Z\u0020\u002D\u002F]+$/)){$("error_state_1").hide()}else{$("error_state_1").show();a=false}if(b.phone.value.match(/^[0-9\u0020]+$/)){$("error_phone_1").hide()}else{$("error_phone_1").show();a=false}if(b.mobile.value.match(/^[0-9\u0020]+$/)){$("error_mobile_1").hide()}else{$("error_mobile_1").show();a=false}buttonState("process_checkout",!a);return a}function HideShowNews(a){if($("hide_news_"+a).style.display=="none"){$("hide_news_"+a).show();$("text_news_"+a).show();$("show_news_"+a).hide()}else{$("hide_news_"+a).hide();$("text_news_"+a).hide();$("show_news_"+a).show()}}var topcarttimeout=null;function showTopCart(){$("cart_b").show()}function hideTopCart(){$("cart_b").hide();topChartUnload()}function hideTopCartTimer(){topcarttimeout=setTimeout(function(){hideTopCart()},500)}function showTopCartTimer(){if(topcarttimeout){window.clearTimeout(topcarttimeout);topcarttimeout=null}topcarttimeout=setTimeout(function(){showTopCart()},500)}function videoList(b){if(b=="left"){var a=1;while($("block"+a).style.display=="none"){a++}if($("block"+(a-1))){$("block"+(a-1)).show();$("block"+(a+2)).hide();if(!$("block"+(a-2))){$("left_video_arrow").src="images/phones/HIW_bg/arrow_left.png"}$("right_video_arrow").src="images/phones/HIW_bg/arrow_right_active.png"}}else{if(b=="right"){var a=1;while($("block"+a).style.display=="none"){a++}if($("block"+(a+3))){$("block"+(a+3)).show();$("block"+a).hide();if(!$("block"+(a+4))){$("right_video_arrow").src="images/phones/HIW_bg/arrow_right.png"}$("left_video_arrow").src="images/phones/HIW_bg/arrow_left_active.png"}}}}function topChartLoad(a){$("top_chart_content").update();$("top_chart_spinner").show();new Ajax.Request("../PP_Shop_Cart.php",{method:"post",parameters:a,onLoaded:function(){$("top_chart_spinner").hide()},onSuccess:function(b){$("top_chart_content").update(b.responseText)}})}function topChartTitleRefresh(a){new Ajax.Request("../PP_Top_Chart_Title.php",{method:"post",onSuccess:function(b){$("top_chart_title").update(b.responseText)}});new Ajax.Request("../PP_Chart_Total.php",{method:"post",onSuccess:function(b){$("top_chart_total").update(b.responseText)}});topChartLoad(a)}function topChartUnload(){$("top_chart_content").update()}function topChartRemoteLink(a,b){new Ajax.Request("../"+a,{method:"post",parameters:b,onSuccess:function(c){topChartTitleRefresh("&ajax=true")}})}function NewsChanger(a){if(a==0){$("news_div").style.top="-"+(parseInt($F("rss_feed_count")))*24+"px"}new Effect.Move("news_div",{x:0,y:24,mode:"relative",duration:0.3});a++;if(a>=$F("rss_feed_count")){a=0}setTimeout(function(){NewsChanger(a)},5300)};
