function createRequestObject(){if(window.XMLHttpRequest&&!window.ActiveXObject)return new XMLHttpRequest;else if(window.ActiveXObject)try{return new ActiveXObject("MSXML2.XMLHTTP")}catch(a){return new ActiveXObject("Microsoft.XMLHTTP")}}var http=createRequestObject();
function handleResponse(){if(http.readyState==4){var a=http.responseText;if(a!="undefined"&&a!=""){var b=[],c=[];if(a.indexOf("|||"!=-1)){b=a.split("|||");for(a=1;a<b.length;a++){c=b[a].split("|:|");if(c[0]!="undefined"&&c[0]!=""&&document.getElementById(c[0]))document.getElementById(c[0]).innerHTML=c[1]}}}}}function updateOnlineTime(){http.open("GET","updateonlinetime.php");http.send(null);setTimeout("updateOnlineTime()",6E4)}
function updateOnlineCount(){http.open("get","updateonlinecount.php");http.onreadystatechange=handleResponse;http.send(null);setTimeout("updateOnlineCount()",6E4)}if(use_popups==undefined)var use_popups=true;function isValidEmail(a){if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,7})+$/.test(a))return true;return false}
function isValidURL(a){if(a==null)return false;var b="^ *";b+="(?:([Hh][Tt][Tt][Pp](?:[Ss]?))(?::\\/\\/))?";b+="(?:(\\w+\\:\\w+)(?:\\@))?";b+="([0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}|localhost|([Ww][Ww][Ww].|[a-zA-Z0-9].)[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,6})";b+="(\\:\\d+)?";b+="((?:\\/.*)*\\/?)?";b+="(.*?\\.(\\w{2,4}))?";b+="(\\?(?:[^\\#\\?]+)*)?";b+="(\\#.*)?";b+=" *$";return a.match(b)}
function isValidString(a,b){b||(b="");var c=true;for(i=0;i<a.length;i++){ch=a.charAt(i);for(j=0;j<b.length;j++)if(ch==b.charAt(j))break;if(j==b.length){c=false;break}}return c}var alphabeticChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",numericChars="0123456789";function isNumeric(a){if(/[0-9]/.test(a))return true;return false}function isNumeric(a,b){return isValidString(a,numericChars+b)}function isAlphabetic(a){if(/[A-Za-z]/.test(a))return true;return false}
function isAlphabetic(a,b){return isValidString(a,alphabeticChars+b)}function isAlphaNumeric(a){if(/\w/.test(a))return true;return false}function isAlphaNumeric(a,b){return isValidString(a,alphabeticChars+numericChars+b)}function DispDispHide(a,b,c){if(c)c.style.display="none";if(a)a.style.display="inline";if(b)b.style.display="inline"}function DispHideHide(a,b,c){if(b)b.style.display="none";if(c)c.style.display="none";if(a)a.style.display="inline"}
function showHide(a,b){b.rows.row_usstates.style.display=a.value=="US"?"inline":"none";b.rows.row_castates.style.display=a.value=="CA"?"inline":"none";b.rows.row_austates.style.display=a.value=="AU"?"inline":"none";b.rows.row_gbstates.style.display=a.value=="GB"?"inline":"none"}
function showHide(a){if(a=="US")document.getElementById("row_usstates").style.display="inline";else document.getElementById("row_usstates").style.display="none";if(a=="CA")document.getElementById("row_castates").style.display="inline";else document.getElementById("row_castates").style.display="none";if(a=="AU")document.getElementById("row_austates").style.display="inline";else document.getElementById("row_austates").style.display="none";if(a=="GB")document.getElementById("row_gbstates").style.display=
"inline";else document.getElementById("row_gbstates").style.display="none"}function showHidePref(a,b){b.rows.row_lookusstates.style.display=a.value=="US"?"inline":"none";b.rows.row_lookcastates.style.display=a.value=="CA"?"inline":"none";b.rows.row_lookaustates.style.display=a.value=="AU"?"inline":"none";b.rows.row_lookgbstates.style.display=a.value=="GB"?"inline":"none"}
function showHidePref(a){if(a=="US")document.getElementById("row_lookusstates").style.display="inline";else document.getElementById("row_lookusstates").style.display="none";if(a=="CA")document.getElementById("row_lookcastates").style.display="inline";else document.getElementById("row_lookcastates").style.display="none";if(a=="AU")document.getElementById("row_lookaustates").style.display="inline";else document.getElementById("row_lookaustates").style.display="none";if(a=="GB")document.getElementById("row_lookgbstates").style.display=
"inline";else document.getElementById("row_lookgbstates").style.display="none"}function openWin(a){if(use_popups==false)window.location.href="viewresult.php?pollid="+a;else{openpopup=window.open("viewresult.php?pollid="+a,"","width=550,height=378,left="+(screen.width/2-275)+",top="+(screen.height/2-189)+",resizable=yes,scrollbars=yes,status=no");openpopup.opener.name="abc"}}
function previousPolls(){if(use_popups==false)window.location.href="previouspolls.php";else{openpopup=window.open("previouspolls.php","popupwin","width=600,height=378,left="+(screen.width/2-300)+",top="+(screen.height/2-189)+",resizable=yes,scrollbars=yes,status=no");openpopup.opener.name="abc"}}
function launchTellFriend(){if(use_popups==false)window.location.href="tellafriend.php";else window.open("tellafriend.php","tellfriend","width=300,height=250,left="+(screen.width/2-200)+",top="+(screen.height/2-200)+",copyhistory=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=no")}
function launchTellFriendProfile(a){if(use_popups==false)window.location.href="tellafriend.php?ID="+a;else window.open("tellfriend.php?ID="+a,"tellfriendprofile","width=280,height=300,left="+(screen.width/2-140)+",top="+(screen.height/2-140)+",copyhistory=no,directories=no,menubar=no,location=no,resizable=yes,scrollbars=yes")}var popUpWin=0;
function popUpWindowMessage(a,b,c,d,f){d=c=450;if(use_popups==false)window.location.href=a;else{if(b=="center"){b=screen.width/2-c/2;var e=screen.height/2-d/2}else e=b=0;popUpWin=open(a,"popUpWin"+f,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width="+c+",height="+d+",left="+b+", top="+e+",screenX="+b+",screenY="+e+"")}}function showIM(a){popUpWindow("showinstantmsg.php?id="+a,"center",320,260,a)}
function popUpWindow(a,b,c,d,f){if(use_popups==false)window.location.href=a;else{if(b=="center"){b=screen.width/2-c/2;var e=screen.height/2-d/2}else e=b=0;popUpWin=open(a,"popUpWin"+f,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=yes,copyhistory=yes,width="+c+",height="+d+",left="+b+", top="+e+",screenX="+b+",screenY="+e+"");popUpWin.opener.name="abc1"}}
function popUpScrollWindow(a,b,c,d){if(use_popups==false)window.location.href=a;else{height=screen.height-150;height=Math.min(height,d);if(b=="center"){b=screen.width/2-c/2;d=screen.height/2-height/2}else{b=b=="top"?screen.width/2-c/2:0;d=0}popUpWin=open(a,"popUpWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width="+c+",height="+height+",left="+b+", top="+d+",screenX="+b+",screenY="+d+"")}}
function popUpScrollWindow2(a,b,c,d){if(use_profilepopups==false)window.location.href=a;else{height=screen.height-150;height=Math.min(height,d);if(b=="center"){b=screen.width/2-c/2;d=screen.height/2-height/2}else{b=b=="top"?screen.width/2-c/2:0;d=0}popUpWin=open(a,"popUpWin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width="+c+",height="+height+",left="+b+", top="+d+",screenX="+b+",screenY="+d+"");popUpWin.opener.name="abc1"}}
var prevRow=null;function toggleRow(a,b){if(prevRow!=null)prevRow.style.display="none";prevRow=obj=document.getElementById(a);obj.style.display="inline";for(i=0;i<document.getElementById("tblSelect").length;i++)if(i==b)document.getElementById("tblSelect")[i].className="s_table_blue";else document.getElementById("tblSelect")[i].className="s_table_white"}
function votesubmit(a,b){var c=screen.width/2-300,d=screen.height/2-189;nop=document.frmpoll.rdo.length;var f,e;e="0";for(f=0;f<nop;f++)if(document.frmpoll.rdo[f].checked)e=document.frmpoll.rdo[f].value;if(use_popups==false)window.location.href=e==""?"viewresult.php?t="+b+"&pollid="+a:"votehere.php?t="+b+"&rdo="+e+"&pollid="+a;else{openpopup=e==""?window.open("viewresult.php?t="+b+"&pollid="+a,"","width=600,height=378,left="+c+",top="+d+",resizable=yes,scrollbars=yes,status=no"):window.open("votehere.php?t="+
b+"&rdo="+e+"&pollid="+a,"","width=600,height=378,left="+c+",top="+d+",resizable=yes,scrollbars=yes,status=no");openpopup.opener.name="abc"}}function selectRdo(a,b){for(i=0;i<a.length;i++)if(a.elements[i].type=="radio"&&a.elements[i].name=="searchby"&&a.elements[i].value==b)a.elements[i].checked=true}function checkAll(a,b,c){for(i=0;i<a.length;i++)if(a.elements[i].type=="checkbox"&&a.elements[i].name==b)a.elements[i].checked=c}
function datefromtovalid(a,b,c,d,f,e,h){month=Array("JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC");a=a[a.selectedIndex].value;b=b[b.selectedIndex].value;c=c[c.selectedIndex].value;d=d[d.selectedIndex].value;f=f[f.selectedIndex].value;e=e[e.selectedIndex].value;for(var g=0;g<12;g++){if(b==month[g])b=g;if(f==month[g])f=g}from_date=new Date(a,b,c);to_date=new Date(d,f,e);if(from_date>to_date){alert(h);return false}return true}
function DateCheck(a,b,c,d){hdt=c[c.selectedIndex].value;hmt=b[b.selectedIndex].value;hyr=a[a.selectedIndex].value;hms_maxval=31;if(hmt=="APR"||hmt=="JUN"||hmt=="SEP"||hmt=="NOV")hms_maxval=30;if(hmt=="FEB"&&hyr%4==0)hms_maxval=29;if(hmt=="FEB"&&hyr%4!=0)hms_maxval=28;if(parseInt(hdt)>hms_maxval){alert(d);return false}return true}
function validateLogin(a){ErrorMsg=[];ErrorMsg[0]="------------------------- The Following Errors Occured -------------------------"+String.fromCharCode(13);CheckFieldString("noblank",a.txtusername,"{$lang.signup_js_errors.username_noblank}");CheckFieldString("noblank",a.txtpassword,"{$lang.signup_js_errors.password_noblank}");CheckFieldString("alphanum",a.txtusername,"{$lang.signup_js_errors.username_charset}");CheckFieldString("alphanum",a.txtpassword,"{$lang.signup_js_errors.password_charset}");
result="";if(ErrorCount>0){alert(ErrorMsg[1]);return false}return true}function confirmLink(a,b){var c=confirm(b);if(c)a.href+="&delete=Y";return c}function confirmButton(a){return confirm(a)}function countCheck(a){if(document.frmCmt.comment.value.length>a){alert("Too many characters in the comment box!");document.frmCmt.comment.focus();return false}else return true}
function countText(a){var b=document.frmCmt.counter.value;document.frmCmt.counter.value=document.frmCmt.comment.value.length;if(document.frmCmt.counter.value>a&&b<=a){alert("Too many characters in the comment box!");if(document.styleSheets){document.frmCmt.counter.style.fontWeight="bold";document.frmCmt.counter.style.color="#ff0000"}}else if(document.frmCmt.counter.value<=a&&b>a&&document.styleSheets){document.frmCmt.counter.style.fontWeight="normal";document.frmCmt.counter.style.color="#000000"}}
function openInParentWindow(a){window.opener.document.location.href=a;window.opener.focus()}
function CheckFieldString(a,b,c){var d=b.value,f=true,e=false;if(a=="noblank"){if(d==""){ErrorCount++;ErrorMsg[ErrorCount]=c}}else{if(a=="integer")b="0123456789";else if(a=="decimal")b="0123456789.";else if(a=="text")b=text_chars;else if(a=="alphanumeric")b=alphanumeric_chars;else if(a=="full")b=full_chars;else if(a=="alphanum")b=alphanum_chars;else if(a=="email"){b="0123456789_-@.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";if(!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,7})+$/.test(d)){ErrorCount++;
ErrorMsg[ErrorCount]=c}}else if(a=="phone")b="0123456789-+";else if(a=="URL")b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.:/\\";else if(a=="path")b="0123456789.+-_#,/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz () \\ ";else{ErrorCount++;ErrorMsg[ErrorCount]="Check Validation one of the mentioned validation type is wrong";return 1}for(i=0;i<d.length;i++){ch=d.charAt(i);for(j=0;j<b.length;j++){if(ch==b.charAt(j))break;if(j==b.length-1){f=false;break}}if(a=="decimal")for(t=
0;t<d.length;t++){dot=d.charAt(t);if(dot=="."&&e==false)e=true;else if(dot=="."&&e==true){ErrorCount++;ErrorMsg[ErrorCount]=c;break}}if(!f){ErrorCount++;ErrorMsg[ErrorCount]=c;break}}}}function reloadCaptcha(){now=new Date;var a=document.getElementById("spam_code_img");if(a)a.src=a.src+(a.src.indexOf("?")>-1?"&":"?")+Math.ceil(Math.random()*now.getTime())}function Alpha(a){return a.match(/^[a-zA-Z ]+$/)?true:false}
function emailCheck(a){var b=a.indexOf("@"),c=a.length;a.indexOf(".");if(a.indexOf("@")==-1)return false;if(a.indexOf("@")==-1||a.indexOf("@")==0||a.indexOf("@")==c)return false;if(a.indexOf(".")==-1||a.indexOf(".")==0||a.indexOf(".")==c)return false;if(a.indexOf("@",b+1)!=-1)return false;if(a.substring(b-1,b)=="."||a.substring(b+1,b+2)==".")return false;if(a.indexOf(".",b+2)==-1)return false;if(a.indexOf(" ")!=-1)return false;return true}
function IsNumeric(a){var b,c=true;if(a.length==0)return false;for(i=0;i<a.length&&c==true;i++){b=a.charAt(i);if("0123456789.-".indexOf(b)==-1)c=false}return c}function validate(a){return a.checked==false?false:true}function isAlphaNumeric(a){return a.match(/^[a-zA-Z0-9_]+$/)?true:false};
