function splchars(e){var d=new Array("(@@)","(##)","\\+\\+","\\$\\$","\\!\\!","\\~","\\>\\>\\>","\\<\\<\\<","\\?\\?","\\;","\\*\\*","\\%\\%","\\=\\=");for(var f=0;f<d.length;f++){if(e.match(d[f])!=null){alert("Please do not enter continous special characters like '@','#','+','$','!','~','>','<','?',';','*' ");return false}}return true}function trim(b){return b.replace(/^\s+|\s+$/g,"")}function echeck(d){if(d==""){alert("Please enter email -id");return false}else{var c=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(c.test(d)==false){alert("Invalid email address");return false}}}function ValidateSendEmail(j){if(j.email_rcv.value==""||j.email_rcv.value==0){alert("Please enter receiver's email");j.email_rcv.focus();return false}var o=j.email_rcv.value;var n=o.split(",");for(p=0;p<n.length;p++){if(echeck(trim(n[p]))==false){j.email_rcv.value="";j.email_rcv.focus();return false}}var k=trim(j.ur_name.value);if(k==""||k==0){alert("Please enter your name");j.ur_name.focus();return false}var m=j.ur_name.value;m=m.replace(/(\s)+/g,"");if(m.length<3){alert("Please enter a name with more than two characters");j.ur_name.focus();return false}if(splchars(trim(j.ur_name.value))==false){j.ur_name.value="";j.ur_name.focus();return false}if(j.ur_mail.value==""||j.ur_mail.value==0){alert("Please enter your email");j.ur_mail.focus();return false}var o=j.ur_mail.value;if(echeck(trim(o))==false){j.ur_mail.value="";j.ur_mail.focus();return false}if(splchars(j.ur_msg.value)==false){j.ur_msg.value="";j.ur_msg.focus();return false}if(j.ur_msg.value==""||j.ur_msg.value==0){alert("Please enter your message");j.ur_msg.focus();return false}var q=false;var l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";for(var p=0;p<j.ur_msg.value.length;p++){if(l.indexOf(j.ur_msg.value.charAt(p))!=-1){q=true;break}}if(q==false){alert("Please do not enter continous special characters like '@','#','+','$','!','~','>','<','?',';','*' ");j.ur_msg.value="";j.ur_msg.focus();return false}if(j.sec_img.value==""){alert("Enter the  picture code shown");j.sec_img.focus();return false}}function validate(s,n){var p=trim(s.cmnts_msg.value);var t=/fuck|asshole|www|^ass$|^.com$/;if(p==""){alert("Enter a comment");n.style.display="block";s.cmnts_msg.focus();return false}var w=false;var h="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";var v=s.cmnts_msg.value;var o=/([A-Z]|[a-z]|[0-9])(\1)(\1)(\1)/;s.cmnts_msg.value=s.cmnts_msg.value.replace(/&/g,"|");var u=trim(s.cmnts_name.value);if(u==""){alert("Enter your name");n.style.display="block";s.cmnts_name.focus();return false}else{if(u.length<3){alert("Name must contain morethan 3 characters");n.style.display="block";s.cmnts_name.focus();return false}}if(splchars(s.cmnts_name.value)==false){s.cmnts_name.focus();return false}var q=echeck(s.cmnts_mail.value);if(q==false){n.style.display="block";s.cmnts_mail.focus();return false}if(trim(s.sec_img_cmnts.value)==""){alert("Please enter the picture code shown");n.style.display="block";s.sec_img_cmnts.value="";s.sec_img_cmnts.focus();return false}var p=p.toLowerCase();var r=p.search(t);if(r!=-1){alert("Your comments will be posted after editorial review");n.style.display="block";s.cmnts_msg.focus();return true}return true}function login_validate(e){var d=echeck(e.email.value);if(d==false){e.email.value="";e.email.focus();return false}var f=trim(e.password.value);if(f==""){alert("Enter a password");e.password.value="";e.password.focus();return false}e.submit()}function sho_hide1(c,d){examples="examples"+c;document.getElementById(examples).style.display="block";for(i=2;i<=d+1;i++){if(i!=c){examples="examples"+i;document.getElementById(examples).style.display="none"}}}function sho_hide2(b){examples="examples"+b;document.getElementById(examples).style.display="none"}function GetXmlHttpObject(){var d=null;try{d=new XMLHttpRequest()}catch(c){try{d=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){d=new ActiveXObject("Microsoft.XMLHTTP")}}return d}function ajax_updatelastlogin(){xmlHttp112=GetXmlHttpObject();xmlHttp112.onreadystatechange=handleupdate;var b="../../update_lastlogin.php";xmlHttp112.open("POST",b,true);xmlHttp112.send(null)}function handleupdate(){if(xmlHttp112.readyState==4){if(xmlHttp112.status==200){}else{alert("Error Code"+xmlHttp112.status)}}}function load_exad(){var b=document.getElementById("career").offsetHeight;if(b>1650){document.getElementById("extra1").style.display="block";document.getElementById("advertisefornew").style.display="block"}if(b>2000){document.getElementById("extra2").style.display="block";document.getElementById("advertisefornew").style.display="block"}if(b>2300){document.getElementById("extra3").style.display="block";document.getElementById("advertisefornew").style.display="block"}if(b>2550){document.getElementById("extra4").style.display="block";document.getElementById("advertisefornew").style.display="block"}if(b>2800){document.getElementById("extra5").style.display="block";document.getElementById("advertisefornew").style.display="block"}if(b>3100){document.getElementById("extra6").style.display="block";document.getElementById("advertisefornew").style.display="block"}}function closeAd(){document.getElementById("banner_div").style.visibility="hidden"}var rtxt;function getXhr(){var d;try{d=new XMLHttpRequest()}catch(c){try{d=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{d=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){alert("Your browser does not support AJAX!");return false}}}return d}function executeajax(j,k,g){if(isEmpty(g)){alert("No function called")}else{var l;var h="";if(isEmpty(k)){k="#"}if(j){h=h+getInputs()}h=h+"cal="+g;var m=getXhr();if(m){b4do(g);m.onreadystatechange=function(){if(m.readyState==4&&m.status==200){afterdo(g,m.responseText)}};m.open("POST",k,true);m.setRequestHeader("Content-type","application/x-www-form-urlencoded");m.setRequestHeader("Content-length",h.length);m.setRequestHeader("Connection","close");m.send(h)}else{alert("error")}}}function isEmpty(b){if(null==b||""==b){return true}return false}function getInputs(){var k="";var f=document.getElementsByTagName("input");for(var j=0;j<f.length;j++){k=k+f[j].name+"="+f[j].value+"&"}var h=document.getElementsByTagName("select");for(var j=0;j<h.length;j++){k=k+h[j].name+"="+h[j].value+"&"}var g=document.getElementsByTagName("textarea");for(var j=0;j<g.length;j++){k=k+g[j].name+"="+g[j].value+"&"}if(k){return k}else{alert("Unable to get formdata")}}var sho=0;var nid=0;var x=1;function clearall(){var e=document.getElementsByTagName("input");for(var d=0;d<e.length;d++){if(e[d].type!="hidden"&&e[d].name!="subject_fwd"&&e[d].type!="submit"){e[d].value=""}}var f=document.getElementsByTagName("textarea");for(var d=0;d<f.length;d++){f[d].value=""}}function sho_hide(){if(sho==0){showregularly(30,0);sho=1}else{hideregularly1(285,500);sho=0}}function hidediv(c,d){if(c!=""){document.getElementById(c).style.display="none"}if(d!=""){document.getElementById(d).style.display="block"}}function hidediv_news(e,f,d){if(e!=""){document.getElementById(e).style.display="block"}if(f!=""){document.getElementById(f).style.display="none"}if(d!=""){document.getElementById(d).style.display="none"}}function wait12(c,d){document.getElementById(c).style.display="none";if(d==0){sho_hide()}}function calwait(c,d){document.getElementById(c).innerHTML=d}function wait14(c,d){switch(d){case 1:document.getElementById(c).innerHTML="Comment posted...";setTimeout("wait14('1122',2)",500);break;case 2:document.getElementById(c).innerHTML="Updating comments...";setTimeout("wait14('1122',3)",500);break;case 3:document.getElementById(c).innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Comments Updated";document.getElementById("1121").innerHTML="";document.getElementById("midhun12").style.display="block";setTimeout("wait14('loadin2',4)",2000);break;case 4:document.getElementById(c).style.display="none";sho_hide();break}}function wait11(){document.getElementById("succes").style.display="none";document.getElementById("fail").style.display="none";document.getElementById("Layer1mt").style.display="none";document.getElementById("Layer4mt").style.display="none"}function jscollection(f,e,d){if(e=="forward_article"){if(ValidateSendEmail(f)!=false){executeajax(true,"/news/functions_news.php",e)}}else{return false}}function b4do(b){if(b=="forward_article"){document.getElementById("loadin").style.display="block"}}function afterdo(f,j){if(f=="forward_article"){if(j.match("ERR\\|")!=null){var e=j.split("ERR|");var h=e[1];document.getElementById("loadin").style.display="none";document.getElementById("err123").innerHTML=h;document.getElementById("fail").style.display="block";setTimeout("document.getElementById('fail').style.display='none'",2000);var g=document.getElementById("newsid").value}else{document.getElementById("email_rcv").value="";document.getElementById("ur_name").value="";document.getElementById("ur_mail").value="";document.getElementById("sec_img").value="";document.getElementById("succes").style.display="block";document.getElementById("loadin").style.display="none";setTimeout("wait11()",2000);window.location.reload()}}}function printThis(){var b=navigator.userAgent.toLowerCase();if(window.print){setTimeout("window.print();",200)}else{if(b.indexOf("mac")!=-1){alert("Press 'Cmd+p' on your keyboard to print article.")}else{alert("Press 'Ctrl+p' on your keyboard to print article.")}}}function hideregularly1(d,c){sho=0;if(d>10){document.getElementById("cmntsouter").style.height=d+"px";document.getElementById("examples1").style.height=d+"px";document.getElementById("incomments").style.clip="rect(0px, "+c+"px,"+d+"px, 0px)";c-=15;d=d-10;setTimeout("hideregularly1("+d+","+c+")",20)}else{document.getElementById("incomments").style.clip="rect(0px 600px 0px 0px)"}}function showregularly(g,e){var f=document.getElementById("cmntsouter").style.height;var h=f.split("p");sho=1;f=Number(h[0]);if(f<300){if(g<310){document.getElementById("cmntsouter").style.height=g+"px";document.getElementById("examples1").style.height=g+"px";document.getElementById("incomments").style.clip="rect(0px, "+e+"px,"+g+"px, 0px)";g=g+10;e=e+21;setTimeout("showregularly("+g+","+e+")",20)}}}function size(e){var d="ad"+e+"i";var f="ad"+e+"o";document.getElementById(f).innerHTML=document.getElementById(d).innerHTML;document.getElementById(f).style.display="block";return true}function sho_hidecmd(){var b=document.getElementById("newsid1").value;document.getElementById("cpt").innerHTML="<img  src='/news/Encrypt/CaptchaSecurityImages1.php?id="+b+"' class='photo' name='capt' height='35' width='100' />";if(sho==0){showregularlycmd(30,0);sho=1}else{hideregularly1cmd(285,500);sho=0}}function hideregularly1cmd(d,c){sho=0;document.getElementById("escapeLink1").innerHTML="<a href='javascript:sho_pre();' class='VerdanablckAsh12 '><span style='color:#0062C4' class='VerdanablckAsh12 '>Submit your news/press release  </a>";document.getElementById("escapeLink").innerHTML="<a href='javascript:sho_hidecmd()' class='VerdanablckAsh12'><span style='color:#0062C4'>Write your comment now  </span></a>";if(d>10){document.getElementById("cmntsouter").style.height=d+"px";document.getElementById("examples1").style.height=d+"px";document.getElementById("incomments").style.clip="rect(0px, "+c+"px,"+d+"px, 0px)";c-=15;d=d-10;setTimeout("hideregularly1cmd("+d+","+c+")",20)}else{document.getElementById("incomments").style.clip="rect(0px 600px 0px 0px)"}}function showregularlycmd(g,e){var f=document.getElementById("cmntsouter").style.height;document.getElementById("escapeLink1").innerHTML="<span style='color:#0062C4' class='VerdanablckAsh12 '>Submit your news/press release  </span>";document.getElementById("escapeLink").innerHTML="<a href='javascript:sho_hidecmd()' class='VerdanablckAsh12'><span style='color:#0062C4'><b>Write your comment now  </b></span></a>";var h=f.split("p");sho=1;f=Number(h[0]);if(f<300){if(g<320){document.getElementById("cmntsouter").style.height=g+"px";document.getElementById("examples1").style.height=g+"px";document.getElementById("incomments").style.clip="rect(0px, "+e+"px,"+g+"px, 0px)";g=g+10;e=e+21;setTimeout("showregularlycmd("+g+","+e+")",20)}}}function sho_pre(){document.getElementById("cpt_new").innerHTML="<img src='/news/captcha/CaptchaSecurityImages.php' width='100' height='35' class='photo' name='captpre'/>";if(sho==0){showregularlypre(30,0);sho=1}else{hideregularlypre(285,500);sho=0}}function hideregularlypre(d,c){sho=0;document.getElementById("escapeLink").innerHTML="<a href='javascript:sho_hidecmd()' class='VerdanablckAsh12'><span style='color:#0062C4'>Write your comment now  </span></a>";document.getElementById("escapeLink1").innerHTML="<a href='javascript:sho_pre();' class='VerdanablckAsh12 '><span style='color:#0062C4' class='VerdanablckAsh12 '>Submit your news/press release  </span></a> ";if(d>10){document.getElementById("test1").style.height=d+"px";document.getElementById("examples1").style.height=d+"px";document.getElementById("inside1").style.clip="rect(0px, "+c+"px,"+d+"px, 0px)";c-=15;d=d-10;setTimeout("hideregularlypre("+d+","+c+")",20)}else{document.getElementById("inside1").style.clip="rect(0px 600px 0px 0px)"}}function showregularlypre(g,e){var f=document.getElementById("test1").style.height;var h=f.split("p");document.getElementById("escapeLink").innerHTML="<span style='color:#0062C4' class='VerdanablckAsh12 '>Write your comment now  </span>";document.getElementById("escapeLink1").innerHTML="<a href='javascript:sho_pre();' class='VerdanablckAsh12 '><span style='color:#0062C4' class='VerdanablckAsh12 '><b>Submit your news/press release  </b></span></a>";sho=1;f=Number(h[0]);if(f<380){if(g<390){document.getElementById("test1").style.height=g+"px";document.getElementById("examples1").style.height=g+"px";document.getElementById("inside1").style.clip="rect(0px, "+e+"px,"+g+"px, 0px)";g=g+10;e=e+21;setTimeout("showregularlypre("+g+","+e+")",20)}}}function GetXmlHttpObject(){var d=null;try{d=new XMLHttpRequest()}catch(c){try{d=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){d=new ActiveXObject("Microsoft.XMLHTTP")}}return d}function press_re(){var g=trim(document.getElementById("prcontent").value);var h=trim(document.getElementById("pname").value);var j=trim(document.getElementById("pemail").value);var l=trim(document.getElementById("pre_img").value);var m=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/;if(g==""){alert("News should not be null");document.getElementById("prcontent").value="";document.getElementById("prcontent").focus();return false}else{if(h==""){alert("Name should not be null");document.getElementById("pname").value="";document.getElementById("pname").focus();return false}else{if(!isNaN(h)){alert("Please enter valid name");document.getElementById("pname").value="";document.getElementById("pname").focus();return false}else{if(j==""){alert("email should not be null");document.getElementById("pemail").focus();return false}else{if(!m.test(document.getElementById("pemail").value)){alert("please enter valid email");document.getElementById("pemail").value="";document.getElementById("pemail").focus();return false}else{if(l==""){alert("Please enter the picture code shown");document.getElementById("pre_img").focus();return false}else{xmlHttp=GetXmlHttpObject();if(xmlHttp==null){alert("Your browser does not support AJAX!");return}var k="/news/upatepressnews.php";k=k+"?c="+g+"&n="+h+"&e="+j+"&img="+l;xmlHttp.onreadystatechange=stateChanged;xmlHttp.open("GET",k,true);xmlHttp.send(null)}}}}}}}function stateChanged(){if(xmlHttp.readyState==4){if(xmlHttp.responseText=="sus"){alert("Your press release posted successfully");document.getElementById("prcontent").value="";document.getElementById("pname").value="";document.getElementById("pemail").value="";document.getElementById("pre_img").value="";window.location.reload()}else{if(xmlHttp.responseText=="not"){alert("Your press release not posted try again !!!!!!!!!");document.getElementById("prcontent").value="";document.getElementById("pname").value="";document.getElementById("pemail").value=""}else{if(xmlHttp.responseText=="not img"){alert("The picture code you have given is wrong.!!!!!!!!!");document.getElementById("pre_img").value="";document.getElementById("pre_img").focus()}}}}}function slide_move(j,k){var r=new Array();for(var s=1;s<=k;s++){r[s-1]=document.getElementById("composition"+s).style.display}if(j=="R"){for(var u=0;u<3;u++){var t=r.pop();var a=r.unshift(t)}for(var q=1;q<=k;q++){document.getElementById("composition"+q).style.display=r[q-1]}}if(j=="L"){for(var l=0;l<3;l++){var n=r.shift();var a=r.push(n)}for(var q=1;q<=k;q++){document.getElementById("composition"+q).style.display=r[q-1]}}if(r[0]=="none"){document.getElementById("composition_left").style.display="block"}else{document.getElementById("composition_left").style.display="none"}if(r[k-1]=="block"){document.getElementById("composition_right").style.display="none"}else{document.getElementById("composition_right").style.display="block"}}function changetext(){var b=document.getElementById("select_search").value;if(b==1){document.getElementById("search_community").value="Search news"}else{if(b==2){document.getElementById("search_community").value="Type keyword (name, city, company, title)"}}}function trim(b){return b.replace(/^\s+|\s+$/g,"")}function valid(){if(trim(document.searchfrm.search.value)==""||document.searchfrm.search.value=="Type keyword (name, city, company, title)"||document.searchfrm.search.value=="Search news"){alert("Enter search string");document.searchfrm.search.value="";document.searchfrm.search.focus();return false}else{var b=document.getElementById("select_search").value;if(b==1){document.searchfrm.action="/news/searchnews.php"}else{if(b==2){document.searchfrm.action="/network/membersearch.php"}}document.searchfrm.submit()}}function check(){if((document.form5.rb[0].checked==false)&&(document.form5.rb[1].checked==false)){alert("Please choose any one");return false}else{alert("You are voted successfully");return false}}function showhide(b){if(b==1){document.getElementById("Layer1mt").style.display="block";document.getElementById("Layer4mt").style.display="block"}else{document.getElementById("Layer1mt").style.display="none";document.getElementById("Layer4mt").style.display="none"}var b=document.getElementById("newsIdForward").value;document.getElementById("catpnew").innerHTML="<img  src='/news/Encrypt/CaptchaSecurityImages2.php?id="+b+"' class='photo' name='capt2' height='40' width='120' />";document.myform_1.subject_fwd.focus()}function textCounter(f,e,d){if(f.value.length>d){f.value=f.value.substring(0,d)}else{e.value=d-f.value.length}}function loadadds(){document.getElementById("adsshow7").innerHTML=document.getElementById("ad7").innerHTML;document.getElementById("adsshow8").innerHTML=document.getElementById("ad8").innerHTML;document.getElementById("adsshow9").innerHTML=document.getElementById("ad9").innerHTML;document.getElementById("adsshow10").innerHTML=document.getElementById("ad10").innerHTML;var l=document.getElementById("addspart").value;if(l==1){document.getElementById("adsshow3").innerHTML=document.getElementById("ad3").innerHTML}var k=document.getElementById("addspartmore6").value;var m=document.getElementById("addspartmore1").value;var n=document.getElementById("addspartmore2").value;var o=document.getElementById("addspartmore3").value;var h=document.getElementById("addspartmore4").value;var j=document.getElementById("addspartmore5").value;if(k==1){document.getElementById("adsshow11").innerHTML=document.getElementById("ad11").innerHTML}if(m==2){document.getElementById("adsshow12").innerHTML=document.getElementById("ad12").innerHTML}if(n==3){document.getElementById("adsshow13").innerHTML=document.getElementById("ad13").innerHTML}if(o==4){document.getElementById("adsshow14").innerHTML=document.getElementById("ad14").innerHTML}if(h==5){document.getElementById("adsshow15").innerHTML=document.getElementById("ad15").innerHTML}if(j==6){document.getElementById("adsshow16").innerHTML=document.getElementById("ad16").innerHTML}}function showspootlight(f,g,k,j){var h=0;for(h=0;h<k;h++){element=document.getElementById("id"+h);if(element){element.style.background="#999999"}document.getElementById("spootlight"+h).style.display="none"}element1=document.getElementById("id"+j);element1.style.background="#f9f9f9";document.getElementById("spootlight").style.display="none";document.getElementById("spootlight"+j).style.display="block"};
