function emailValidate(a){var b="";var c=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;if(a.search(c)==-1){b="error"}return b}function emailSubscriber(){errorflag=false;focusOn=false;var a=document.emailSubscrib.newsLetter.value;if(trim(a)==""||trim(a)=="Email Address"){document.getElementById("email_required").style.display="";if(!focusOn){focusOn=document.emailSubscrib.newsLetter}errorflag=true}else{document.getElementById("email_required").style.display="none";if(checkMail(trim(a))){document.getElementById("emailid_invalid").style.display="";if(!focusOn){focusOn=document.emailSubscrib.newsLetter}errorflag=true}else{document.getElementById("emailid_invalid").style.display="none"}}if(focusOn){focusOn.focus()}if(errorflag==true)return false;else return true}function searchContent(){errorflag=false;focusOn=false;var a=document.searchProduct.product.value;if(trim(a)==""||trim(a)=="Search Product"){document.getElementById("search_required").style.display="";if(!focusOn){focusOn=document.searchProduct.product}errorflag=true}else{document.getElementById("search_required").style.display="none"}if(focusOn){focusOn.focus()}if(errorflag==true)return false;else return true}function checkMail(a){var b=a;b=b.replace(/^\s+|\s+$/g,"");var c=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(c.test(b)==false){return true}else{return false}}function stateChanged1(){if(xmlhttp.readyState==4){var a=xmlhttp.responseText;if(a!=""){document.getElementById("state_db").innerHTML=a}}}function Change_Status(a,b,c,d,e){var f="Are you sure ?\n";f+="Do you really want to change the status of this record ??";var g=confirm(f);if(g==false){return false}document.getElementById("state_db").innerHTML="";xmlhttp=GetXmlHttpObject();if(xmlhttp==null){alert("Browser does not support HTTP Request");return}var h=a;h=h+"?Id="+b;h=h+"&table="+c;h=h+"&field="+d;h=h+"&fieldId="+e;xmlhttp.onreadystatechange=stateChanged1;xmlhttp.open("GET",h,true);xmlhttp.send(null)}function GetXmlHttpObject(){if(window.XMLHttpRequest){return new XMLHttpRequest}if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP")}return null}function stateChangedpdf(){if(xmlhttp.readyState==4){var a=parseInt(xmlhttp.responseText);if(a!=""){alert("PDF Deleted Successfully");document.getElementById("delete_image_span").innerHTML="<i><strong style='color:#6B98A8'> No File </strong></i>"}}}function Del_PDF(a,b,c){var d="Are you sure ?\n";d+="Do you really want to delete this File ?";var e=confirm(d);if(e==false){return false}xmlhttp=GetXmlHttpObject();if(xmlhttp==null){alert("Browser does not support HTTP Request");return}var f="index.php";f=f+"?pg="+a;f=f+"&pdfId="+b;f=f+"&action="+c;xmlhttp.onreadystatechange=stateChangedpdf;xmlhttp.open("GET",f,true);xmlhttp.send(null)}function stateChanged(){if(xmlhttp.readyState==4){var a=parseInt(xmlhttp.responseText);if(a!=""){alert("Image Deleted Successfully");document.getElementById("delete_image_span").innerHTML="<i><strong style='color:#6B98A8'> No Image </strong></i>"}}}function Del_Image(a,b,c){var d="Are you sure ?\n";d+="Do you really want to delete this image ?";var e=confirm(d);if(e==false){return false}xmlhttp=GetXmlHttpObject();if(xmlhttp==null){alert("Browser does not support HTTP Request");return}var f="index.php";f=f+"?pg="+a;f=f+"&iCatId="+b;f=f+"&action="+c;xmlhttp.onreadystatechange=stateChanged;xmlhttp.open("GET",f,true);xmlhttp.send(null)}function htmlData(a,b){if(a.length==0){document.getElementById("txtResult").innerHTML="";return}xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Browser does not support HTTP Request");return}a=a+"&"+b;a=a+"&sid="+Math.random();xmlHttp.onreadystatechange=stateChanged;xmlHttp.open("GET",a,true);xmlHttp.send(null)}function stateChanged(){if(xmlHttp.readyState==4||xmlHttp.readyState=="complete"){document.getElementById("txtResult").innerHTML=xmlHttp.responseText}else{};}function GetXmlHttpObject(a){var b=null;if(window.XMLHttpRequest){b=new XMLHttpRequest}else if(window.ActiveXObject){b=new ActiveXObject("Microsoft.XMLHTTP")}return b}function deleteConfirm(a){if(!a){var a="Are you sure ?\n";a+="Do you really want to delete this record ?"}if(confirm(a)){return true}return false}function statusConfirm(a){if(!a){var a="Are you sure ?\n";a+="Do you really want to change the status of this record ?"}if(confirm(a)){return true}return false}function hideShowDiv(a){switch(a){case"succHide":hideDiv("succHide");break;case"errHide":hideDiv("errHide");break;default:hideDiv("succHide");hideDiv("errHide")}}function goToSearch(a){if(a.selsearch.value!="All"){if(a.txt_search.value=="Search here..."){alert("Please enter search text in the search text box.");a.txt_search.focus();return false}var b=a.txt_search.value;TextSearch=b.replace(/^\s+|\s+$/g,"");if(TextSearch==""){alert("Please enter search text in the search text box.");a.txt_search.focus();return false}}if(a.selsearch.value=="select"){alert("Please Select Criteria");a.selsearch.focus();return false}a.gosearch.value="gosearch";a.submit();return true}function IsCreditCard(a){var b="1234567890";var c=true;var d;for(i=0;i<a.length&&c==true;i++){d=a.charAt(i);if(b.indexOf(d)==-1){c=false}}return c}function getCurrentServerTime(){var a=getHTTPObject();if(a){var b=SITE_URL+"current_server_time.php";a.open("GET",b,false);a.send(null);if(a.readyState==4&&a.status==200){return a.responseText}}}function redirect(a){if(a)window.location=a}function verifyTxT(a,b){if(a&&trim(a)!=""){var c=a;extArray=c.split(".");switch(extArray[extArray.length-1].toLowerCase()){case"txt":return true;break;default:return false;break}}else{if(b){return false}return true}}function verifyApplication(a,b){if(a&&trim(a)!=""){var c=a;extArray=c.split(".");switch(extArray[extArray.length-1].toLowerCase()){case"swf":return true;break;default:return false;break}}else{if(b){return false}return true}}function verifyVideo(a,b){if(a&&trim(a)!=""){var c=a;extArray=c.split(".");switch(extArray[extArray.length-1].toLowerCase()){case"flv":return true;break;default:return false;break}}else{if(b){return false}return true}}function verifyRingtone(a,b){if(a&&trim(a)!=""){var c=a;extArray=c.split(".");switch(extArray[extArray.length-1].toLowerCase()){case"mp3":return true;break;default:return false;break}}else{if(b){return false}return true}}function verifyImage(a,b){if(a&&trim(a)!=""){var c=a;extArray=c.split(".");switch(extArray[extArray.length-1].toLowerCase()){case"jpg":case"jpeg":case"gif":case"png":return true;break;default:return false;break}}else{if(b){return false}return true}}var xmlhttp
