$(document).ready(function(){fcountChar();popHelp()});function popHelp(){var a="yes";$(".helpopen").click(function(){var c=$(document).height();var i=$(window).width();var h=$(window).height();var d=640;var g=300;var e=parseInt(((i-d)/2)-8);var b=$(window).scrollTop()+parseInt((h-g)/2);$("body").append('<div class=moverlay id=moverlay style="height:'+c+'px;"></div>');$("body").append('<div id=hinlay class="ui-corner-all" style="height:'+g+"px;width:"+d+"px;left:"+e+"px;top:"+b+'px;"></div>');if($("#helpcenter").length==0){$("#hinlay").html("<div id=helpcenter></div>");$("#helpcenter").load("/shared/html/helpcenter.html");var f=checkCookies();if(f=="yes"||f=="pending"){$.ajax({type:"GET",url:"getmyinfo.ajax",dataType:"json",success:function(j){$("#hcname").val(j.output);$("#hcemail").val(j.code)}});if(f=="pending"){$("#hcusertype").val("New")}}}});$("#moverlay, #helpclose").live("click",function(b){closeHelp("none","none")});$("#helpsubmit").live("click",function(){$(".errormsg").remove();$("#contactform *").removeClass("requirederror");a="yes";var b=$("#contactform").attr("action");$("#contactform input[type=text], textarea, select").each(function(){var d=$(this).val();if($(this).hasClass("required")){if(d==""){$(this).focus();$("#helpcenter").append("<div class=errormsg style=color:red;>"+$(this).parents("div:first").find("label:first").text()+" Field can not be blank.</div>");$(this).parents("div:first").addClass("requirederror");a="no"}if($(this).hasClass("reqemail")){hvalidEmail=/^[^@]+@[^@]+.[a-z]{2,}$/i;if(d.search(hvalidEmail)==-1){$("#helpcenter").append("<div class=errormsg style=color:red;>Please enter a valid email address.</div>");$(this).parents("div:first").addClass("requirederror");a="no"}}if($(this).hasClass("reqselect")){if(parseInt($(this).val())==0){$("#helpcenter").append("<div class=errormsg style=color:red;>"+$(this).parents("div:first").find("label:first").text()+" Please make selection.</div>");$(this).parents("div:first").addClass("requirederror");a="no"}}}});if(a=="yes"){var c=$("#helpcenter").height();$.ajax({type:"POST",url:b,data:$("#contactform").serialize(),dataType:"json",beforeSend:function(){$("#helpcenter").append("<div id=sendingajax>Sending request...</div>")},success:function(d){$("#sendingajax").remove();$(".errormsg").remove();if(d.code=="ok"){closeHelp(d.code,d.output)}}})}return false})}function closeHelp(b,a){if(b=="ok"){$("#helpcenter").html(a);setTimeout(function(){$("#helpcenter").animate({height:"hide",opacity:"hide"},1500)},5000);setTimeout(function(){$("#hinlay").animate({height:"hide",opacity:"hide"},1500)},5500);setTimeout(function(){$("#moverlay").animate({opacity:"hide"},1500)},6000);setTimeout(function(){$("#helpcenter").remove()},7500);setTimeout(function(){$("#hinlay").remove()},7600);setTimeout(function(){$("#moverlay").remove()},7700)}else{$("#moverlay").remove();$("#hinlay").remove()}}function fcountChar(){$(".hccountbox").live("keypress",function(){var d=$(this).attr("id");var a=d.match(/(limit)-(\d+)/);var b=RegExp.$2;var c=$(this).val();$(this).parents("div:first").find(".hccountreport").html(b-$(this).val().length);$(this).val(c.substr(0,(b-1)))})}function checkCookies(){if(document.cookie.length>0){var a=document.cookie.split(";");var b="rss=";for(var d=0;d<a.length;d++){var e=a[d];while(e.charAt(0)==" "){e=e.substring(1,e.length)}if(e.indexOf(b)==0){if(e.substring(b.length,e.length)=="Pending"){return"pending"}else{if(e.substring(b.length,e.length)=="Active"){return"yes"}}}}}else{return"no"}};
