function check_email(str){if(str==""){return false}else{if(str!=""){var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;if(!filter.test(str)){return false}}}return true}function login_validate2(theform){if(trim(theform.comment.value)==""){alert("please Enter Comment");theform.comment.value="";theform.comment.focus();return false}var str=theform.comment.value;if(str.length<60){alert("Please Enter at least one line Comment");theform.comment.focus();return false}var return2=check_email(theform.emailid1.value);if(return2==false){alert("Please input a valid email address!");theform.emailid1.value="";theform.emailid1.focus();return false}if(trim(theform.password1.value)==""){alert("Please Enter your Password");theform.password1.value="";theform.password1.focus();return false}if(trim(theform.comment.value)==""){alert("please Enter Comment");theform.comment.value="";theform.comment.focus();return false}}function login_validate1(){if(trim(document.cmtform.comment.value)==""){alert("please Enter Comment");document.cmtform.comment.value="";document.cmtform.comment.focus();return false}var str=document.cmtform.comment.value;if(str.length<60){alert("Please Enter at least one line Comment");document.cmtform.comment.focus();return false}var return2=check_email(document.cmtform.emailid1.value);if(return2==false){alert("Please input a valid email address!");document.cmtform.emailid1.value="";document.cmtform.emailid1.focus();return false}if(trim(document.cmtform.password1.value)==""){alert("Please Enter your Password");document.cmtform.password1.value="";document.cmtform.password1.focus();return false}if(trim(document.cmtform.comment.value)==""){alert("please Enter Comment");document.cmtform.comment.value="";document.cmtform.comment.focus();return false}}function changetext(){var val1=document.getElementById("select_search").value;if(val1==1){document.getElementById("search_community").value="Search blogs"}else{if(val1==9){document.getElementById("search_community").value="Search bloggers"}else{if(val1==2){document.getElementById("search_community").value="Type keyword (name, city, company, title)"}else{if(val1==3){document.getElementById("search_community").value="Search news"}else{if(val1==4){document.getElementById("search_community").value="Search jobs"}else{if(val1==5){document.getElementById("search_community").value="Search videos"}else{if(val1==6){document.getElementById("search_community").value="Search mentors"}else{if(val1==7){document.getElementById("search_community").value="Search communities"}else{if(val1==8){document.getElementById("search_community").value="Search questions"}}}}}}}}}}function trim(stringToTrim){return stringToTrim.replace(/^\s+|\s+$/g,"")}function valid(i){var url=i;if(trim(document.searchfrm.search.value)==""){changetext()}if(trim(document.searchfrm.search.value)==""||document.searchfrm.search.value=="Type keyword (name, city, company, title)"||document.searchfrm.search.value=="Search news"||document.searchfrm.search.value=="Search blogs"||document.searchfrm.search.value=="Search jobs"||document.searchfrm.search.value=="Search videos"||document.searchfrm.search.value=="Search mentors"||document.searchfrm.search.value=="Search communities"||document.searchfrm.search.value=="Search questions"||document.searchfrm.search.value=="Search bloggers"){alert("Enter search string");document.searchfrm.search.value="";document.searchfrm.search.focus();return false}else{var val1=document.getElementById("select_search").value;if(val1==1){document.searchfrm.bsearchtype.value=val1;document.searchfrm.action="/category/searchresult"}else{if(val1==9){document.searchfrm.bsearchtype.value=val1;document.searchfrm.action="/category/searchresult"}else{if(val1==2){document.searchfrm.action=url+"/network/membersearch.php"}else{if(val1==3){document.searchfrm.action=url+"/news/searchnews.php"}else{if(val1==4){document.searchfrm.keywords.value=document.searchfrm.search.value;document.searchfrm.action=url+"/career/jobsearch.php"}else{if(val1==5){document.searchfrm.action=url+"/university/coursesearch.php"}else{if(val1==6){document.searchfrm.action=url+"/mentorship_new1/mentorship_search.php"}else{if(val1==7){document.searchfrm.action="http://communities.siliconindia.com/searchresult"}else{if(val1==8){document.searchfrm.action=url+"/answers/questions_search.php"}}}}}}}}}document.searchfrm.submit()}}function hidediv(id1,id2){if(id1!=""){document.getElementById(id1).style.display="none"}if(id2!=""){document.getElementById(id2).style.display="block"}}function hidediv11(id1,id2){if(id1!=""){document.getElementById(id1).style.display="none"}if(id2!=""){document.getElementById(id2).style.display="block"}}function printThis(){var usertype=navigator.userAgent.toLowerCase();if(window.print){setTimeout("window.print();",200)}else{if(usertype.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 showhide(st){if(st==1){document.getElementById("Layer1").style.display="block";document.getElementById("Layer4").style.display="block"}else{document.getElementById("Layer1").style.display="none";document.getElementById("Layer4").style.display="none"}}function ValidateSendEmail(theForm,i){var theForm=theForm;var url=i;if(theForm.toaddress.value==""||theForm.toaddress.value==0){alert("Please enter receiver's email");theForm.toaddress.focus();return false}var emailvalue=theForm.toaddress.value;var mytool_array=emailvalue.split(",");for(i=0;i<mytool_array.length;i++){if(echeck(trim(mytool_array[i]))==false){theForm.toaddress.value="";theForm.toaddress.focus();return false}}if(theForm.fromname.value==""||theForm.fromname.value==0){alert("Please enter your name");theForm.fromname.focus();return false}if(theForm.fromaddress.value==""||theForm.fromaddress.value==0){alert("Please enter your email");theForm.fromaddress.focus();return false}var emailfrom=theForm.fromaddress;if(echeck(emailfrom.value)==false){emailfrom.value="";emailfrom.focus();return false}if(theForm.body.value==""||theForm.body.value==0){alert("Please enter your message");theForm.body.focus();return false}if(theForm.message.value==""||theForm.message.value==0){alert("Please enter the verification code");theForm.message.focus();return false}document.sendemail.action=url+"/forwardemail.php";document.sendemail.submit()}function echeck(str){var at="@";var dot=".";var lat=str.indexOf(at);var lstr=str.length;var ldot=str.indexOf(dot);if(str.indexOf(at)==-1){alert("Invalid E-mail ID");return false}if(str.indexOf(at)==-1||str.indexOf(at)==0||str.indexOf(at)==lstr){alert("Invalid E-mail ID");return false}if(str.indexOf(dot)==-1||str.indexOf(dot)==0||str.indexOf(dot)==lstr){alert("Invalid E-mail ID");return false}if(str.indexOf(at,(lat+1))!=-1){alert("Invalid E-mail ID");return false}if(str.substring(lat-1,lat)==dot||str.substring(lat+1,lat+2)==dot){alert("Invalid E-mail ID");return false}if(str.indexOf(dot,(lat+2))==-1){alert("Invalid E-mail ID");return false}if(str.indexOf(" ")!=-1){alert("Invalid E-mail ID");return false}return true}function login_validate(frm,i){var frm=frm;var url=i;var mail=echeck1(frm.email.value);if(mail==false){frm.email.value="";frm.email.focus();return false}var pass=trim(frm.password.value);if(pass==""){alert("Enter a password");frm.password.value="";frm.password.focus();return false}frm.action=url+"/blogs/blogsothers/signin1.php";frm.submit()}function echeck1(email){var email=email;if(email==""){alert("Please enter email -id");return false}else{var reg=/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;if(reg.test(email)==false){alert("Invalid email address");email="";return false}}}var sho=0;function sho_hide(){if(sho==0){showregularly(30,0);sho=1}else{hideregularly1(285,500);sho=0}}function showregularly(hgt,wdth){var hg=document.getElementById("cmntsouter").style.height;var x=hg.split("p");sho=1;hg=Number(x[0]);var brVer=navigator.userAgent;var brVerId=brVer.indexOf("MSIE");brNum=brVer.substr(brVerId,8);if(navigator.appName=="Microsoft Internet Explorer"&&brNum=="MSIE 6.0"){if(hg<250){if(hgt<300){document.getElementById("cmntsouter").style.height=hgt+"px";document.getElementById("examples1").style.height=hgt+"px";document.getElementById("incomments").style.clip="rect(0px, "+wdth+"px,"+hgt+"px, 0px)";hgt=hgt+10;wdth=547;setTimeout("showregularly("+hgt+","+wdth+")",20)}}}else{if(hg<300){if(hgt<300){document.getElementById("cmntsouter").style.height=hgt+"px";document.getElementById("examples1").style.height=hgt+"px";document.getElementById("incomments").style.clip="rect(0px, "+wdth+"px,"+hgt+"px, 0px)";hgt=hgt+10;wdth=wdth+21;setTimeout("showregularly("+hgt+","+wdth+")",20)}}}}function hideregularly1(hgt,wdth){sho=0;if(hgt>10){document.getElementById("cmntsouter").style.height=hgt+"px";document.getElementById("examples1").style.height=hgt+"px";document.getElementById("incomments").style.clip="rect(0px, "+wdth+"px,"+hgt+"px, 0px)";wdth-=15;hgt=hgt-10;setTimeout("hideregularly1("+hgt+","+wdth+")",20)}else{document.getElementById("incomments").style.clip="rect(0px 600px 0px 0px)"}}function sho_hide1(num,cntcount){examples="examples"+num;document.getElementById(examples).style.display="block";for(i=2;i<=cntcount+1;i++){if(i!=num){examples="examples"+i;document.getElementById(examples).style.display="none"}}}function sho_hide2(num){examples="examples"+num;document.getElementById(examples).style.display="none"}function login_chek(){document.getElementById("newmahi").style.display="block";document.getElementById("newmahi2").style.display="block"}function validate_post(){title=document.postblog.blog_title;description=document.postblog.description;if(trim(title.value)==""){alert("please enter title of your blog");title.value="";title.focus();return false}if(trim(description.value)==""){alert("please enter blog description");description.value="";description.focus();return false}var return2=check_email(document.postblog.email.value);if(trim(document.postblog.email.value)==""){alert("Please enter your email");document.postblog.email.value="";document.postblog.email.focus();return false}else{if(return2==false){alert("Please input a valid email address!");document.postblog.email.value="";document.postblog.email.focus();return false}}if(trim(document.postblog.password.value)==""){alert("Please Enter your Password");document.postblog.password.value="";document.postblog.password.focus();return false}document.getElementById("joinsiliconindia").style.display="none"}function textCounter(c,a,b){if(c.value.length>b){c.value=c.value.substring(0,b)}else{a.value=b-c.value.length}};
function loadadds(){document.getElementById('antop_hide').style.display="none";document.getElementById('antopadd1').innerHTML=document.getElementById('topadd').innerHTML;var inanhid=document.getElementById('anshow').value;if(inanhid==1)
{document.getElementById('sameadd1').innerHTML=document.getElementById('adds2').innerHTML;}
else if(inanhid==2){document.getElementById('sameadd2').innerHTML=document.getElementById('adds2').innerHTML;}
if(inanhid!=2){document.getElementById('adsright12334').innerHTML=document.getElementById('riggh444t1').innerHTML;document.getElementById('rightus123').innerHTML=document.getElementById('rigg3222234ht2').innerHTML;}
document.getElementById('bottom121').innerHTML=document.getElementById('bottom123').innerHTML;document.getElementById('bottom212').innerHTML=document.getElementById('bottom2123').innerHTML;var inanhid2=document.getElementById('rrrrright1').value;if(inanhid2==1)
{document.getElementById('rightnewfinfind1').innerHTML=document.getElementById('rightaddsfindss1').innerHTML;}
else if(inanhid2==2){document.getElementById('rightbewrightfinds2').innerHTML=document.getElementById('rightaddsfindss2').innerHTML;}}
function pageview_blog_new1(blogtopicid,page){var parameters="blogtopicid="+blogtopicid;if(page=="out"){var url="/updatepageview.php"}if(page=="in"){var url="/updatepageview.php"}var xhr=getXhr();if(xhr){xhr.onreadystatechange=function(){if(xhr.readyState==4&&xhr.status==200){var xx=xhr.responseText}}}xhr.open("POST",url,true);xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");xhr.setRequestHeader("Content-length",parameters.length);xhr.setRequestHeader("Connection","close");xhr.send(parameters)}function getXhr(){var xmlHttp;try{xmlHttp=new XMLHttpRequest()}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){alert("Your browser does not support AJAX!");return false}}}return xmlHttp};
function slide_move(clk,n)
{var myarr=new Array();for(var j=1;j<=n;j++)
{myarr[j-1]=document.getElementById("composition"+j).style.display;}
if(clk=='R')
{for(var k=0;k<3;k++){var end=myarr.pop();var l=myarr.unshift(end);}
for(var i=1;i<=n;i++)
{document.getElementById("composition"+i).style.display=myarr[i-1];}}
if(clk=='L')
{for(var a=0;a<3;a++){var first=myarr.shift();var l=myarr.push(first);}
for(var i=1;i<=n;i++)
{document.getElementById("composition"+i).style.display=myarr[i-1];}}
if(myarr[0]=='none')
{document.getElementById("composition_left_new").style.display='block';}
else{document.getElementById("composition_left_new").style.display='none';}
if(myarr[n-1]=='block')
{document.getElementById("composition_right_new").style.display='none';}
else
{document.getElementById("composition_right_new").style.display='block';}}
