");
$("div#homebanner3").css("background-image", "url("+DomainURL+"images/home-banner-2.jpg)" );
$("div#homebanner3").append("
");
if(x=="1"){
$("div#homeBannerNav3").append("
Refer Here");
}else{
$("div#homeBannerNav3").append("
Refer Here");
}
$("#homebanner1").hide();
$("#homebanner2").hide();
$("#homebanner3").hide();
}
function buildflag(){
$("div.location_flags").css("width", "18px" );
$("div.location_flags").css("height", "14px" );
$("div.location_flags").css("background-image", "url(http://www.gomezpeerzone.com/wp-content/themes/peerzone/images/flag_dropdown.png)" );
$("div.location_flags").css("background-repeat", "no-repeat" );
$("div.location_flags").css("text-indent", "25px" );
$("div.location_flags").css("padding", "0px 3px" );
$("div.location_flags").css("float", "left" );
$("#location_flag_uk").css("background-position", "0px -743px" );
$("#location_flag_sa").css("background-position", "0px -715px" );
$("#location_flag_se").css("background-position", "0px -687px" );
$("#location_flag_za").css("background-position", "0px -659px" );
$("#location_flag_es").css("background-position", "0px -631px" );
$("#location_flag_sg").css("background-position", "0px -603px" );
$("#location_flag_no").css("background-position", "0px -519px" );
$("#location_flag_nl").css("background-position", "0px -491px" );
$("#location_flag_mx").css("background-position", "0px -463px" );
$("#location_flag_br").css("background-position", "0px -435px" );
$("#location_flag_kr").css("background-position", "0px -407px" );
$("#location_flag_it").css("background-position", "0px -351px" );
$("#location_flag_in").css("background-position", "0px -323px" );
$("#location_flag_hk").css("background-position", "0px -295px" );
$("#location_flag_de").css("background-position", "0px -267px" );
$("#location_flag_fi").css("background-position", "0px -211px" );
$("#location_flag_dk").css("background-position", "0px -183px" );
$("#location_flag_cn").css("background-position", "0px -771px" );
$("#location_flag_ca").css("background-position", "0px -127px" );
$("#location_flag_be").css("background-position", "0px -99px" );
$("#location_flag_at").css("background-position", "0px -71px" );
$("#location_flag_au").css("background-position", "0px -43px" );
$("#location_flag_en").css("background-position", "0px -15px" );
$("#location_flag_fr").css("background-position", "0px -239px" );
$("#location_flag_sp").css("background-position", "0px -631px" );
$("#location_flag_pt").css("background-position", "0px -575px" );
$("#location_flag_jp").css("background-position", "0px -379px" );
}
function LoadSlideShow(){
if($("#homeBannerContainer").size()){
x = "";
insertBanners(x);
$("#homebanner1").show();
setInterval("swapBackgrounds()", 6000);
}
}
function buildMenuAndCurrentFlag(){
ddsmoothmenu.init({
mainmenuid: "smoothmenu1", //menu DIV id
orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu', //class added to menu's outer DIV
//customtheme: ["#1c5a80", "#18374a"],
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
});
$("#mainLanguage").css("width", "18px" );
$("#mainLanguage").css("height", "16px" );
$("#mainLanguage").css("background-image", "url(http://www.gomezpeerzone.com/wp-content/themes/peerzone/images/flag_dropdown.png)" );
$("#mainLanguage").css("background-repeat", "no-repeat" );
$("#mainLanguage").css("text-indent", "25px" );
$("#mainLanguage").css("padding", "0px 3px" );
$("#mainLanguage").css("float", "left" );
$("#mainLanguage").css("margin-top", "7px" );
$("#mainLanguage").css("background-position","0px 0px")}
function newcheckPassword(strPass){
//rules
//1. 7-20 characters
//2. do not include common words or names
//3. combine uppercase letters, lowercase letters, numbers, and symbols.
var str = "";
$("#errPass").remove();
if($.trim(strPass)!=""){
if((strPass.length>6)&&(strPass.length<21)){
str = "";
passError = 0;
conError = 0;
$("#newpasswordtext").slideUp("fast");
}else{
str = "Your password must have 7 - 20 characters.";
passError = 1;
$("#newpasswordtext").append("
"+str+"
");
$("#newpasswordtext").slideDown("fast");
}
}else{
str = "";
passError = 0;
conError = 0;
$("#newpasswordtext").slideUp("fast");
}
}
function confirmnewcheckPassword(newStrPass, confirmStrPass){
var str = "";
$("#errConfirmPass").remove();
if($.trim(newStrPass)!=""){
if(newStrPass!=confirmStrPass){
str = "Your new confirm password must match your new password.";
conError = 1;
passError = 1;
}else{
str = "";
conError = 0;
passError = 0;
}
}else{
str = "";
conError = 0;
passError = 0;
}
//$("#confirmnewpasswordtext").append("
"+str+"
");
return str;
}
function formValidation(xpage){
var str = "";
$("#errPass").remove();
if(xpage!="passwordretrieval"){
if(($("#username").size())&&($("#username").attr("type")!="hidden")){
if($.trim($("#username").val())==""){
str = str + "You must enter a Username
";
}else if($.trim($("#username").val())!=""){
//remove all special characters first cause isAscii will think its English as soon it sees a english like punctuation.
if(!checkASCII($.trim($("#username").val()))){
if(isNaN($.trim($("#username").val()))){
if(xpage!="xlogin"){
//check if its all a number if so the its fine else
str = str + "Please use standard English characters when completing the Username field
";
}
}
}
}
}
if(($("#email").size())&&($("#email").attr("type")!="hidden")){
if($.trim($("#email").val())==""){
str = str + "You must enter a PayPal email address
";
}else if ($.trim($("#email").val())!=""){
if (!validateEmail($.trim($("#email").val()))){
str = str + "You must enter a PayPal email address
";
}
}
}
}else{
if ((($("#username").size())&&($("#username").attr("type")!="hidden"))||(($("#email").size())&&($("#email").attr("type")!="hidden"))){
if(($("#username").size())&&($.trim($("#username").val())!="")){
if($.trim($("#username").val())==""){
str = str + "You must enter a username and PayPal email address
";
}else if($.trim($("#username").val())!=""){
//remove all special characters first cause isAscii will think its English as soon it sees a english like punctuation.
if(!checkASCII($.trim($("#username").val()))){
if(isNaN($.trim($("#username").val()))){
if(xpage!="xlogin"){
str = str + "Please use standard English characters when completing the Username field
";
}
}
}
}
}else if(($("#email").size())&&($.trim($("#email").val())=="")){
if($.trim($("#email").val())==""){
str = str + "You must enter a username and PayPal email address
";
}else if ($.trim($("#email").val())!=""){
if (!validateEmail($.trim($("#email").val()))){
str = str + "You must enter a PayPal email address
";
}
}
}
}
}
if(($("#firstname").size())&&($("#firstname").attr("type")!="hidden")){
if($.trim($("#firstname").val())==""){
str = str + "You must enter a first name
";
}else if($.trim($("#firstname").val())!=""){
if(!checkASCII($.trim($("#firstname").val()))){
str = str + "Please use standard English characters when completing the first name field
";
}
}
}
if(($("#lastname").size())&&($("#lastname").attr("type")!="hidden")){
if($.trim($("#lastname").val())==""){
str = str + "You must enter a last name
";
}else if($.trim($("#lastname").val())!=""){
//remove all special characters first cause isAscii will think its English as soon it sees a english like punctuation.
if(!checkASCII($.trim($("#lastname").val()))){
str = str + "Please use standard English characters when completing the last name field
";
}
}
}
if(($("#address1").size())&&($("#address1").attr("type")!="hidden")){
if($.trim($("#address1").val())==""){
str = str + "You must enter an address
";
}else if($.trim($("#address1").val())!=""){
if(!checkASCII($.trim($("#address1").val()))){
str = str + "Please use standard English characters when completing the address field
";
}
}
}
if(($("#city").size())&&($("#size").attr("type")!="hidden")){
if($.trim($("#city").val())==""){
str = str + "You must enter a city
";
}
}
if(($("#country").size())&&($("#country").attr("type")!="hidden")){
if($.trim($("#country").val())==""){
if(($.trim($("#country").val())=="US")||($.trim($("#country").val())=="CA")||($.trim($("#country").val())=="IN")){
str = str + "You must enter a country
";
}
}
if(($.trim($("#country").val())!="")&&(($.trim($("#country").val())=="US")||($.trim($("#country").val())=="CA")||($.trim($("#country").val())=="IN"))){
if($.trim($("#state_region").val())==""){
str = str + "You must enter a State/Province/Region
";
}
}
}
if(($("#postalcode").size())&&($("#postalcode").attr("type")!="hidden")){
if($.trim($("#postalcode").val())==""){
if(($.trim($("#country").val())=="US")){
str = str + "You must enter a Zip Code / Postal Code
";
}
}else if($.trim($("#postalcode").val())!=""){
if(!$.isNumeric($.trim($("#postalcode").val()))){
//remove all special characters first cause isAscii will think its English as soon it sees a english like punctuation.
if($.trim($("#postalcode").val())==""){
if(($.trim($("#country").val())=="US")){
str = str + "You must enter a Zip Code / Postal Code
";
}
}else{
if(!checkASCII($.trim($("#postalcode").val()))){
if(($.trim($("#country").val())=="US")){
str = str + "Please use standard English characters when completing the zip code/postal code field
";
}
}
}
}
}
}
if(($("#paymentAccount").size())&&($("#paymentAccount").attr("type")!="hidden")){
if($.trim($("#paymentAccount").val())==""){
str = str + "You must enter a PayPal email account
";
}
}
if((($("#paymentAccount").size())&&($("#paymentAccountconfirmation").size()))&&(($("#paymentAccount").attr("type")!="hidden")&&($("#paymentAccountconfirmation").attr("type")!="hidden"))){
if($.trim($("#paymentAccount").val())!=$.trim($("#paymentAccountconfirmation").val())){
str = str + "PayPal Email Address and Confirm PayPal Email Address must match
";
}
}
if(($("#message").size())&&($("#size").attr("type")!="hidden")){
if($.trim($("#message").val())==""){
str = str + "Please enter your message
";
}
}
if((($("#confirmpassword").size())&&($("#newpassword").size()))&&(($("#confirmpassword").attr("type")!="hidden")&&($("#newpassword").attr("type")!="hidden"))){
if($("#confirmpassword").val()!=$("#newpassword").val()){
str = str + "Password and Confirm Password must match
";
}
if(($.trim($("#confirmpassword").val())=="")||($.trim($("#newpassword").val())=="")){
str = str + "You must enter a password
";
}
}
if(xpage=="updatepassword"){
if(($.trim($("#confirmnewpassword").val())=="")||($.trim($("#newpassword").val())=="")){
str = str + "You must enter a password
";
}
}
if((($("#confirmnewpassword").size())&&($("#newpassword").size()))&&(($("#confirmnewpassword").attr("type")!="hidden")&&($("#newpassword").attr("type")!="hidden"))){
if($("#confirmnewpassword").val()!=$("#newpassword").val()){
str = str + "Password and Confirm Password must match
";
}
if(($.trim($("#confirmnewpassword").val())=="")||($.trim($("#newpassword").val())=="")){
str = str + "You must enter a password
";
}
}
if(xpage=="xlogin"){
if(($.trim($("#password").val())=="")){
str = str + "You must enter a password
";
}
}
if((($("#confirmemail").size())&&($("#email").size()))&&(($("#confirmemail").attr("type")!="hidden")&&($("#email").attr("type")!="hidden"))){
if($("#confirmemail").val()!=$("#email").val()){
str = str + "Email and Confirm Email must match
";
}
}
if(str.length>0){
passError = 1;
}else{
passError = 0;
}
//clear system webservice errors
$(".error").html("
");
$("#uierror").append("
"+str+"
");
if(str.length>0){
$("html, body").animate({ scrollTop: 0 }, 0);
}
}
function hideShow(){
if($("#typequestion").val()=="Additional Information"){
$("div#subject").slideDown("fast");
}else{
$("div#subject").slideUp("fast");
}
}
function openclose(id){
var str = "_";
var retstr = "";
retstr = id.substring((id.indexOf(str)),(id.length));
if($("#answer"+retstr).is(":hidden")){
$("#answer"+retstr).slideDown("slow");
}else{
$("#answer"+retstr).slideUp("slow");
}
}
function alertBox(x){
if(x=="messageBox"){
$("#messageBox").fadeIn("fast");
}else if(x=="pmessageBox"){
$("#pmessageBox").fadeIn("fast");
}else if(x=="ContactUsmessageBox"){
$("#ContactUsmessageBox").fadeIn("fast");
}
}
function closeAlertBox(){
$("#messageBox").fadeOut("fast");
$("#pmessageBox").fadeOut("fast");
$("#ContactUsmessageBox").fadeOut("fast");
}
function switchalertBox(){
if($("#mBox_bottom").text()!="EN"){
//means it WAS english and we are switching the box to chinese
$("#mBox_bottom").html("");
$("#mBox_bottom").html("EN");
$("#mBox_title_container").html("");
$("#mBox_title_container").html($("#mBox_chinese_title").html());
$("#mbox_message_context").html("");
$("#mbox_message_context").html($("#mBox_chinese_content").html());
}else if ($("#mBox_bottom").text()=="EN"){
//means it WAS english and we are switching the box to english
$("#mBox_bottom").html("");
$("#mBox_bottom").html("中文");
$("#mBox_title_container").html("");
$("#mBox_title_container").html($("#mBox_english_title").html());
$("#mbox_message_context").html("");
$("#mbox_message_context").html($("#mBox_english_content").html());
}
}
function statezip(){
if($("#country").size()){
if(($("#country").val()!="US")&&($("#country").val()!="CA")&&($("#country").val()!="IN")){
$("#state_region").hide();
$("#hstate").hide();
}else{
$("#state_region").show();
$("#hstate").show();
}
if($("#country").val()!="US"){
$("#postalcode").hide();
$("#ziprow").hide();
}else{
$("#postalcode").show();
$("#ziprow").show();
}
$("#country").change(function(){
if(($("#country").val()!="US")&&($("#country").val()!="CA")&&($("#country").val()!="IN")){
$("#state_region").slideUp();
$("#hstate").slideUp();
}else{
$("#state_region").slideDown();
$("#hstate").slideDown();
}
if($("#country").val()!="US"){
$("#postalcode").slideUp("fast");
$("#ziprow").slideUp("fast");
}else{
$("#postalcode").slideDown("fast");
$("#ziprow").slideDown("fast");
}
});
}
}
function stumbleInit(){
(function() {
var li = document.createElement('script'); li.type = 'text/javascript'; li.async = true;
li.src = 'https://platform.stumbleupon.com/1/widgets.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(li, s);
})();
}