function hidediv(id,status)
{
	window.status=id;
	var container=document.getElementById(id);
	if(status==0)
	{
	container.style.visibility="hidden";
	container.style.height='1px';
	}
	else
	{
	container.style.visibility="visible";
	container.style.height="auto";
	}
}
function entsub(e)
{
	var keynum;
	var keychar;
	var numcheck;
	
	if(window.event) // IE
	{
	  keynum = e.keyCode;
	}
	
	else if(e.which) // Netscape/Firefox/Opera
	{
	  keynum = e.which;
	  
	}

	if (e.keyCode == 13||e.which == 13)
	{
		
		validate_login('txtlogin','txtpwd','login','smc');
		//window.location="contactpost.php?email="+document.getElementById('txtlogin').value+"&password="+document.getElementById('txtpwd').value+"&login="+document.getElementById(login).value;
	}
}
function validate_campus(id_uniname,id_city,id_desc,id_name,id_email)
{

	var	email =document.getElementById(id_email).value;
	
	if(document.getElementById(id_uniname).value=="")
	{
		alert("Please enter university name.");
		document.getElementById(id_uniname).focus();
		return false;
	}
	if(document.getElementById(id_city).value=="")
	{
		alert("Please enter city name.");
		document.getElementById(id_city).focus();
		return false;
	}
	if(document.getElementById(id_desc).value=="")
	{
		alert("Please write some comments.");
		document.getElementById(id_desc).focus();
		return false;
	}
	if(document.getElementById(id_name).value=="")
	{
		alert("Please enter your name.");
		document.getElementById(id_name).focus();
		return false;
	}
	if(email==""||email=="Your Email")
	{
		alert("Please enter the email.");
		document.getElementById(id_email).focus();
		return false;
	}
	else if(!emailCheck(email))
	{
			alert("Please enter valid Email ID.");
			document.getElementById(id_email).focus();
			document.getElementById(id_email).value="";
			return false;
	}

	return true;
}

function validation_admin_post(value)
{

	var id;

	if(document.getElementById('arealist').options[document.getElementById('arealist').selectedIndex].value=="")
	{
		alert("Please select near by campus");
		document.getElementById('arealist').focus();
		return false;
	}	
	if(document.getElementById('adtitle').value=="")
	{
		alert("Please enter title.");
		document.getElementById('adtitle').focus();
		return false;
	}
	if(document.getElementById('name').value=="")
	{
		alert("Please enter name.");
		document.getElementById('name').focus();
		return false;
	}

	if(document.getElementById('email').value=="" && document.getElementById('mobile').value=="")
	{
		alert("Atleast provide an email or mobile number.");
		
		return false;
	}
	if(document.getElementById('addesc').value=="")
	{
		alert("Please write some description.");
		document.getElementById('addesc').focus();
		return false;

	}

	if((document.getElementById('adtitle').value.charAt(0)=='E') && (document.getElementById('adtitle').value.charAt(1)=='x') && (document.getElementById('adtitle').value.charAt(2)=='a')&&(document.getElementById('adtitle').value.charAt(3)=='m')&&(document.getElementById('adtitle').value.charAt(4)=='p')&&(document.getElementById('adtitle').value.charAt(5)=='l') && (document.getElementById('adtitle').value.charAt(6)=='e'))
	{
		alert("Please enter title.");
		document.getElementById('adtitle').focus();
		document.getElementById('adtitle').select();
	
		return false;
	}
	if	((document.getElementById('addesc').value.charAt(0)=='E') && (document.getElementById('addesc').value.charAt(1)=='x') && (document.getElementById('addesc').value.charAt(2)=='a')&&(document.getElementById('addesc').value.charAt(3)=='m')&&(document.getElementById('addesc').value.charAt(4)=='p')&&(document.getElementById('addesc').value.charAt(5)=='l') && (document.getElementById('addesc').value.charAt(6)=='e'))
	{
		alert("Please write some description.");
		document.getElementById('addesc').focus();
		document.getElementById('addesc').select();
		return false;
	}


	if(document.getElementById('area2').value=="")
	{
		alert("Please Specify the Location.");
		document.getElementById('area2').focus();
		return false;
	}


	
	
	if(document.getElementById('resume').value!="")
	{
		
		extArray = new Array(".txt", ".doc");
		file=document.getElementById('resume').value;
		allowSubmit = false;
		if (!file) return false;
		while (file.indexOf("\\") != -1)
		file = file.slice(file.indexOf("\\") + 1);
		ext = file.slice(file.indexOf(".")).toLowerCase();
		for (var i = 0; i < extArray.length; i++) {
		if (extArray[i] == ext) { allowSubmit = true; break; }
		}
		if (allowSubmit){
        return true;
		 }
		else
		{
		alert("Please only upload files that end in types:  " 
		+ (extArray.join("  ")) + "\nPlease select a new "
		+ "file to upload and Post again.");
		return false;
	
	
		}
	}
}


function validation_post(value)
{

	var id;
if(document.getElementById('adtitle').value.length < 20)
	{
		alert("Title should have atleast 20 characters.");
		document.getElementById('adtitle').focus();
		return false;
	}
	if(document.getElementById('addesc').value.length < 40)
	{
		alert("Description should have atleast 40 characters.");
		document.getElementById('addesc').focus();
		return false;
	}
	if(document.getElementById('arealist').options[document.getElementById('arealist').selectedIndex].value=="")
	{
		alert("Please select near by campus");
		document.getElementById('arealist').focus();
		return false;
	}	
	if(document.getElementById('adtitle').value=="")
	{
		alert("Please enter title.");
		document.getElementById('adtitle').focus();
		return false;
	}
	if(document.getElementById('addesc').value=="")
	{
		alert("Please write some description.");
		document.getElementById('addesc').focus();
		return false;
	}
	if(document.getElementById('area2').value=="")
	{
		alert("Please Specify the Location.");
		document.getElementById('area2').focus();
		return false;
	}
	if(document.getElementById('ch_mobile'))
	{
		if(document.getElementById('ch_mobile').checked==true)
		{
			
			if(document.getElementById('mobile').readOnly==false)
			{
				alert("Please submit your mobile number using the SUBMIT button to receive response on mobile");
				return false;
			}
		}
	}
	
	if(document.getElementById('resume') && document.getElementById('resume').value!="")
	{
		
		extArray = new Array(".txt", ".doc");
		file=document.getElementById('resume').value;
		allowSubmit = false;
		if (!file) return false;
		while (file.indexOf("\\") != -1)
		file = file.slice(file.indexOf("\\") + 1);
		ext = file.slice(file.indexOf(".")).toLowerCase();
		for (var i = 0; i < extArray.length; i++) {
		if (extArray[i] == ext) { allowSubmit = true; break; }
		}
		if (allowSubmit){
        return true;
		 }
		else
		{
		alert("Please only upload files that end in types:  " 
		+ (extArray.join("  ")) + "\nPlease select a new "
		+ "file to upload and Post again.");
		return false;
	
	
		}
	}
	document.getElementById('longbar').style.visibility='visible';
	
}		

//////////////new function for discuss validation ////////////////////////
function validation_discusspost(value)
{
	var id;

	if(document.getElementById('adtitle').value=="")
	{
		alert("Please enter title.");
		document.getElementById('adtitle').focus();
		return false;
	}
	if(document.getElementById('addesc').value=="")
	{
		alert("Please write some description.");
		document.getElementById('addesc').focus();
		return false;
	}
	if(document.getElementById('ch_mobile').checked==true)
	{
		
		if(document.getElementById('mobile').readOnly==false)
		{
			alert("Please submit your mobile number using the SUBMIT button to receive response on mobile");
			return false;
		}
	}
	
}


	
function setfocus(id_email)
{
	document.getElementById(id_email).focus;
	alert("id_email");
}
function removetext(id)
{	
	
	if(document.getElementById(id).value.toUpperCase()=="TITLE" || document.getElementById(id).value.toUpperCase()=="DESCRIPTION")
	{
	document.getElementById(id).value="";
	document.getElementById(id).focus();
	}
}
function showsubcat(id_catid,containerid,grpid)
{
	//document.getElementById('pb2').style.visibility="visible";
	catid = document.getElementById(id_catid).value;

	var url ='subcat.php?catid='+catid+'&groupid='+grpid;
	show(url,containerid );
}
function showsubcat_smallfont(id_catid,containerid,grpid)
{
	catid = document.getElementById(id_catid).value;
	var url ='subcat_smallfont.php?catid='+catid+'&groupiid='+grpid;
	show(url,containerid );
}
function adminsubcat(id_catid,containerid)
{
	catid = document.getElementById(id_catid).value;
	var url ='adminsubcat.php?catid='+catid;
	show(url,containerid );
}


function logout(username,containerid)
{

	var url ='logout.php?username='+username;
	show(url,containerid );
}

function showadmincatz(id_catid,containerid)
{
	catid = document.getElementById(id_catid).value;
	document.getElementById('post_home1').innerHTML='<select name="homesubcatid" id="homesubcatid" style="font-family:Arial, Helvetica, sans-serif;font-size:10pt;color:#000; width:140px;" ><option>Choose Subcategory</option></select>';
	var url ='../admincat.php?catid='+catid;
	show(url,containerid );
}
function showcatz(id_catid,containerid,grpid)
{
	//alert(grpid);
	catid = document.getElementById(id_catid).value;
	
	//document.getElementById('pgif1').style.visibility="visible";
	document.getElementById('post_home1').innerHTML='<select name="homesubcatid" id="homesubcatid" style="font-family:Arial, Helvetica, sans-serif;font-size:10pt;color:#000; width:140px;" ><option>Choose Subcategory</option></select>';
	var url ='../cat.php?catid='+catid+'&groupiid='+grpid;
	show(url,containerid );
}

function showcatz_smallfont(id_catid,containerid,grpid)
{

	catid = document.getElementById(id_catid).value;
	document.getElementById('post_home1').innerHTML='<select name="homesubcatid" id="homesubcatid" style="font-family:Arial, Helvetica, sans-serif;font-size:8pt;color:#666; width:140px;" ><option>Choose Subcategory</option></select>';
	var url ='../cat_smallfont.php?catid='+catid+'&groupiid='+grpid;
	show(url,containerid );
}



function useravailiblity(user,containerid)

{
	document.getElementById('processu').style.visibility="visible";
	username = document.getElementById(user).value;
	var url ='http://www.searchmycampus.com/check_user_availiblity.php?username='+username;
	show(url,containerid );
}

function passwordvalidation(passw,containerid)

{
	document.getElementById('processpass').style.visibility="visible";
	passwd = document.getElementById(passw).value;
	var url ='http://www.searchmycampus.com/check_password_aval.php?pass='+passwd;
	show(url,containerid );
}


function admin_homepost_new(id_name,id_adtitle,id_catid,id_subcatid,id_email,id_addesc,cityid,catpos,fetpos,groupid)
{
	var catid = document.getElementById(id_catid).options[document.getElementById(id_catid).selectedIndex].value;
	var name =document.getElementById(id_name).value;
	var title =document.getElementById(id_adtitle).value;
	var email =document.getElementById(id_email).value;
	var desc =document.getElementById(id_addesc).value;
		var cityid =document.getElementById('homeunivid').value;
	var subcatid =document.getElementById(id_subcatid).options[document.getElementById(id_subcatid).selectedIndex].value;
	
	if(catid=="")
	{
		alert("Please select category");
		document.getElementById(id_catid).focus();
		return false;
	}
	else if(subcatid=="")
	{
		alert("Please select sub category");
		document.getElementById(id_catid).focus();
		return false;
	}

	else
	{
	title = escape(title);
		desc = escape(desc);
			
		//window.location= "http://www.searchmycampus.com/homepost.php?view=feature&featureview=post.php&groupid=" +groupid +"&cityid=" + cityid + "&catid=" + catid + "&subcatid=" + subcatid + "&cat_pos=" + catpos + "1&fet_pos=2&name=" + name + "&adtitle=" + title + "&emailid=" + email + "&addesc=" +desc;
	window.location= "http://www.searchmycampus.com/campus.php?view=feature&featureview=adminpost.php&groupid=" +groupid +"&cityid=" + cityid + "&catid=" + catid + "&subcatid=" + subcatid + "&cat_pos=" + catpos + "1&fet_pos=2&name=" + name + "&adtitle=" + title + "&emailid=" + email + "&addesc=" +desc;
		return true;
		
	}
	
}


function homepost(id_name,id_adtitle,id_catid,id_subcatid,id_email,id_addesc,cityid,catpos,fetpos,groupid)
{
	
	var catid = document.getElementById(id_catid).options[document.getElementById(id_catid).selectedIndex].value;
	var name =document.getElementById(id_name).value;
	var title =document.getElementById(id_adtitle).value;
	var email =document.getElementById(id_email).value;
	var desc =document.getElementById(id_addesc).value;
	var subcatid =document.getElementById(id_subcatid).options[document.getElementById(id_subcatid).selectedIndex].value;
	
	if(catid=="")
	{
		alert("Please select category");
		document.getElementById(id_catid).focus();
		return false;
	}
	else if(subcatid=="")
	{
		alert("Please select sub category");
		document.getElementById(id_catid).focus();
		return false;
	}
	

	else if(title==""||title=="Title")
	{
		alert("Please enter title.");
		document.getElementById(id_adtitle).focus();
		return false;
	}
	else if(desc==""||desc=="Description")
	{
		alert("Please enter the desc.");
		document.getElementById(id_desc).focus();
		return false;
	}
	else
	{
	
					title =document.getElementById('adtitle').value;
		desc = document.getElementById('addesc').value;
		//window.location= "http://www.searchmycampus.com/homepost.php?view=feature&featureview=post.php&groupid=" +groupid +"&cityid=" + cityid + "&catid=" + catid + "&subcatid=" + subcatid + "&cat_pos=" + catpos + "1&fet_pos=2&name=" + name + "&adtitle=" + title + "&emailid=" + email + "&addesc=" +desc;
		window.location= "http://www.searchmycampus.com/campus.php?view=feature&featureview=post.php&groupid=" +groupid +"&cityid=" + cityid + "&catid=" + catid + "&subcatid=" + subcatid + "&cat_pos=" + catpos + "1&fet_pos=2&name=" + name + "&adtitle=" + title + "&emailid=" + email + "&addesc=" +desc;
		return true;
		
	}
	
}


function homepost_new(id_name,id_adtitle,id_catid,id_subcatid,id_email,id_addesc,cityid,catpos,fetpos,groupid)
{
	var catid = document.getElementById(id_catid).options[document.getElementById(id_catid).selectedIndex].value;
	if(document.getElementById(id_name) != null ){	var name =document.getElementById(id_name).value; } 
	if(document.getElementById(id_adtitle) != null ){	var title =document.getElementById(id_adtitle).value; } 
	if(document.getElementById(id_email) != null ){	var email =document.getElementById(id_email).value; } 
	if(document.getElementById(id_addesc) != null ){	var desc =document.getElementById(id_addesc).value; } 


		var cityid =document.getElementById('homeunivid').value;
	var subcatid =document.getElementById(id_subcatid).options[document.getElementById(id_subcatid).selectedIndex].value;
	
	if(catid=="")
	{
		alert("Please select category");
		document.getElementById(id_catid).focus();
		return false;
	}
	else if(subcatid=="")
	{
		alert("Please select sub category");
		document.getElementById(id_catid).focus();
		return false;
	}

	else
	{
	title = escape(title);
		desc = escape(desc);
			
		//window.location= "http://www.searchmycampus.com/homepost.php?view=feature&featureview=post.php&groupid=" +groupid +"&cityid=" + cityid + "&catid=" + catid + "&subcatid=" + subcatid + "&cat_pos=" + catpos + "1&fet_pos=2&name=" + name + "&adtitle=" + title + "&emailid=" + email + "&addesc=" +desc;
	window.location= "http://www.searchmycampus.com/campus.php?view=feature&featureview=post.php&groupid=" +groupid +"&cityid=" + cityid + "&catid=" + catid + "&subcatid=" + subcatid + "&cat_pos=" + catpos + "1&fet_pos=2&name=" + name + "&adtitle=" + title + "&emailid=" + email + "&addesc=" +desc;
		return true;
		
	}
	
}











//Function to Show text in componnets...
function toggleInputText(text,id,flag)
{	input.innerHTML=text;alert(input.innerHTML);
	var input=document.getElementById(id);
	if(flag==1)
	{
	
		
	}
	else if(flag==2)
	{
		input.inerHTML="";
	}
	
}
function showsubcatfeild(id_subcat,catid,cityid,catpos,fetpos,groupid,catpos)
{

	var subcat	= document.getElementById(id_subcat).value;
	
	window.location= "http://www.searchmycampus.com/campus.php?view=feature&cityid= "+cityid+"&catid="+catid+"&cat_pos="+catpos+"&groupid="+groupid+"&subcatid="+subcat+"&featureview=post.php&cat_pos="+catpos+"&fet_pos="+fetpos;
	
	document.getElementById(id_subcat).value = subcat;
}


function showsubcats(id_subcat,uniname,cityname,cityid,groupname,groupid,catname,catid,featurename,fetpos)
{
	var subcat	= document.getElementById(id_subcat).value;
	
	window.location = "Main/"+uniname+"/"+cityname+"-"+cityid+"/"+groupname+"-"+groupid+"/"+catname+"-"+catid +"/" + featurename + "-" + fetpos + "/Post.html";
	
	document.getElementById(id_subcat).value = subcat;
}


var xmlHttp
var flags=1
////////////////////////////
function sendsms(mobile,msg)
{
	var val= mobile.length-9;
	no=mobile.charAt(val);
	
	
	//if (no==2 || no==3)
	//{
	
		//var url="http://api.znisms.com/post/message.asp?userid=valyoo&pwd=smc007&messageid="+msg+"&senderid=9899980668&sendto=" +mobile+"&flash=no"
		var phone='91'+mobile;
		url="sendsms.php?messageid="+msg+"&sendto="+phone;
		//url="message.php?messageid="+msg+"&sendto=" +mobile;
		
//	}
	
	//else
	//{
		//var url="http://api.znisms.com/post/message.asp?userid=valyoo&pwd=valyoo@1&messageid="+msg+"&senderid=your post&sendto=" +mobile+"&flash=no"
	//}
	 
	
	var newwin=window.open(url,'','width=25, height=77');
	newwin.close();
}
/////////////////////


function show(url,containerid)
{
if(containerid=='loginspace'){
		document.getElementById('processem').style.visibility='visible';
		}	
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
    {
		alert("Your Browswer does not support AJAX!");
		return;
    }
	// xmlHttp.onreadystatechange=stateChanged;
   //var url="contactpost.php?email=" + document.getElementById('txtlogin').value +"&pass=" + document.getElementById('txtpwd').value + "&q=" + Math.random()
   
    xmlHttp.onreadystatechange=function()
	{
		stateChanged(containerid);
	}
	xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
}
function stateChanged(containerid) 
{
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        { 
			var mText;
			mText=xmlHttp.responseText;
			//document.getElementById('member_div').innerHTML=xmlHttp.responseText;
			//alert(mText);
			
			//document.write(mText);
			try
			{
				//alert(containerid);
				//document.getElementById(id_member);
						
				document.getElementById(containerid).innerHTML="div recognise";
			
				var check = document.getElementById(containerid);
			
				check.innerHTML += " " + mText;
				
				document.getElementById(containerid).innerHTML= " " + mText;
				if(containerid=='loginspace'){
						
				document.getElementById(containerid).innerHTML= " " + mText+ "<img src='progress_submit.gif' style='visibility:hidden' id='processem' /> ";
				}
				
				
			}
			catch(e)
			{
			//	alert(containerid);
			//	alert("div member");
			//	alert(e);
			}
			//document.getElementById('contactdetails').style.visibility="hidden";			
			
			try
			{
				//document.getElementById('contactdetails').style.visibility="hidden";
			}
			catch(e)
			{
			}
			try
			{
				var showdiv = document.getElementById('showdiv').value;	

			}
			catch(e)
			{
			}
				//document.getElementById('pgif1').style.visibility="hidden";
				//document.getElementById('pb2').style.visibility="hidden";
	if(containerid=='loginspace'){
				document.getElementById('processem').style.visibility="false";
				}
			if(showdiv=="il")
			{
				var url="http://www.searchmycampus.com/signin.php";
				xmlHttp.open("GET",url,true);
			    xmlHttp.send(null);
				//document.getElementById('contactdetails').style.visibility="hidden";				
			}
			else if(showdiv=="ue")
			{
				var url="http://www.searchmycampus.com/signup.php";
				xmlHttp.open("GET",url,true);
			    xmlHttp.send(null);
				//document.getElementById('contactdetails').style.visibility="hidden";
			}
			else if(showdiv=="cp")
			{
				var url="http://www.searchmycampus.com/changepassword.php";
				xmlHttp.open("GET",url,true);
			    xmlHttp.send(null);
				//document.getElementById('contactdetails').style.visibility="hidden";
			}
			else if(showdiv=="cd")
			{
				document.getElementById('username').value=document.getElementById('c_username').value;
				document.getElementById('name').value=document.getElementById('c_name').value;
				document.getElementById('email').value=document.getElementById('c_email').value;
				
				
				
				if(document.getElementById('c_mobileno').value!='')
				{
					document.getElementById('mobile').value=document.getElementById('c_mobileno').value;
//					document.getElementById('mobile').disabled='disabled';
					document.getElementById('mobile').readOnly=true;
					document.getElementById('mobile').style.backgroundColor='#F3F3F3';
					//document.getElementById('mobile_sms').innerHTML='To change your mobile number click on the Change Number link and enter your new number.';
					document.getElementById('rpl_mobile').checked=true;

					document.getElementById('divverification').style.visibility="visible";
					
					show1('http://www.searchmycampus.com/verify_sms.php?i=1','mobile_verify',document.getElementById('mobile').value);
					
				}
				else
				{
					document.getElementById('divverification').style.visibility="hidden";
						
							document.getElementById('rpl_mobile').readonly=true;
					}
					

					/////////////for email checking//////////
					
					if(document.getElementById('c_email').value!='')
				{
						
						
						document.getElementById('rpl_email').checked=true;
						if (document.getElementById('kkupdate'))
						{
							document.getElementById('kkupdate').checked=true;
						}
						
						document.getElementById('email').value=document.getElementById('c_email').value;
//					document.getElementById('mobile').disabled='disabled';
					document.getElementById('email').readOnly=true;
					document.getElementById('email').style.backgroundColor='#F3F3F3';
					//document.getElementById('mobile_sms').innerHTML='To change your mobile number click on the Change Number link and enter your new number.';
					
					document.getElementById('email_verify').innerHTML= ' <b style="color:#0000ff; font-size:9pt;text-decoration:underline; font-weight:normal;cursor:pointer;"  onclick="javascript:changeemail();" name="verify_em" id="verify_em" />Change Email</b>&nbsp;&nbsp;<img src="progress_submit.gif" style="visibility:hidden" id="processem" />';
					
				}
				else{
				document.getElementById('rpl_email').readonly=true;
				}
		
					
				
													
				document.getElementById('contactdetails').style.visibility="visible";
				document.getElementById('smcmember').style.visibility="hidden";
				document.getElementById('smcmember').style.display="none";
								

			}
			
		}
}

///////////////////////////////////////////////////////////////

function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	  {
		  // Firefox, Opera 8.0+, Safari
		  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
		  try
			{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
		  catch (e)
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
	  }
	return xmlHttp;
}
//////////////////////////////////////////////////////








/////////////////////



















function show1(url,containerid,mobile_no)
{
	
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null)
    {
		alert("Your Browswer does not support AJAX!");
		return;
    }
	// xmlHttp.onreadystatechange=stateChanged;
   //var url="contactpost.php?email=" + document.getElementById('txtlogin').value +"&pass=" + document.getElementById('txtpwd').value + "&q=" + Math.random()
   
    xmlHttp.onreadystatechange=function()
	{
		stateChanged1(containerid,mobile_no);
	}
	xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
}
function stateChanged1(containerid,mobile_no) 
{
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        { 
			var mText;
			mText=xmlHttp.responseText;
			//document.getElementById('member_div').innerHTML=xmlHttp.responseText;
			//alert(mText);
			
			//document.write(mText);
			try
			{
				//alert(containerid);
				//document.getElementById(id_member);
				//alert(mText);
				document.getElementById(containerid).innerHTML="div recognise";
			
				var check = document.getElementById(containerid);
			
				check.innerHTML += " " + mText;
				
				document.getElementById(containerid).innerHTML= " " + mText;
				document.getElementById('rd_member_no').checked='checked';
				document.getElementById('mobile').value=mobile_no;	
			}
			catch(e)
			{
				//alert(containerid);
				//alert("div member");
				//alert(e);
			}
		}
}
///////////////////////////////////////////
function changeno()
{
	document.getElementById('mobile').readOnly=false;
	document.getElementById('mobile').style.backgroundColor='#FFFFFF';
	document.getElementById('mobile_verify').innerHTML="";
	document.getElementById('mobile_verify').innerHTML=" "+"<b style='color:#0000ff; font-size:9pt;text-decoration:underline; font-weight:normal;cursor:pointer;' onclick=\"javascript:check_validate();\" name='verify' id='verify' />Submit</b>&nbsp;&nbsp;<img src='progress_submit.gif' style='visibility:hidden' id='process' />";

	}


	function changeemail()
		{
		document.getElementById('email').readOnly=false;
		
		document.getElementById('email').style.backgroundColor='#FFFFFF';
		document.getElementById('email_verify').innerHTML="";
		document.getElementById('email_verify').innerHTML=" "+"<b   style='color:#0000ff; font-size:9pt;text-decoration:underline; font-weight:normal;cursor:pointer;' onclick=\"javascript:check_email22();\" name='verify' id='verify' />Submit</b>&nbsp;&nbsp;<img src='progress_submit.gif' style='visibility:hidden' id='processem' />";

	}


	function check_email22()
		{
					var email;
				
					email=document.getElementById('email').value;
					username=document.getElementById('username').value;
					//alert(email);
					//alert(username);

					if(document.getElementById('email').value!='')
					{
						
								var url;
								if(!emailCheck(email))
								{
									alert("Please enter valid Email ID.");
									document.getElementById('email').focus();
									document.getElementById('email').value="";
									return false;
								}

								else
								{

									document.getElementById('processem').style.visibility="visible";
									url='http://www.searchmycampus.com/updateemail.php?email='+document.getElementById('email').value+'&username='+document.getElementById('username').value;
									show(url,'qj');
									
									document.getElementById('email').readOnly=true;
									document.getElementById('email').style.backgroundColor='#F3F3F3';
									document.getElementById('email_verify').innerHTML= ' <b style="color:#0000ff; font-size:9pt;text-decoration:underline; font-weight:normal;cursor:pointer;" onclick="javascript:changeemail();" name="verify_em" id="verify_em" />Change Email</b>&nbsp;&nbsp;<img src="progress_submit.gif" style="visibility:hidden" id="processem" />';
									
								}
					}
					else
					{
						alert('enter your email address');
						return false;
					}
 	
 }
	





//////////////////////
//used to call the send_email or send_sms file from showad 

	//function adsend_email(containerid)
//	{
//			alert('email');
//			show('contact_email.php',containerid );
//	}
//
//	function adsend_sms(containerid)
//	{
//			alert('sms');
//			show('contact_sms.php',containerid );
//	}



//used to call the sign in or sign up files from post resume on condition are you a member or not

	function member(containerid,id_member,name,emailid)
	{
		var val=document.getElementById(id_member);
		var rd_val = val.value;
		if(rd_val=="yes")
		{
			//alert(containerid);
			//document.getElementById(containerid).innerHTML="div recognise";
			url ='http://www.searchmycampus.com/signin.php?name='+name+'&emailid='+emailid;
			show(url,containerid );
			//ajaxpage('signin.php',containerid );
		}
		else if(rd_val=="no")
		{
			var cityid=document.getElementById('cityid').value;	
			url ='http://www.searchmycampus.com/signup.php?name='+name+'&emailid='+emailid+'&cityid='+cityid;
			//document.getElementById(containerid).innerHTML="div recognise";
			show(url,containerid );
		}
	}
	
	//for check the value are valid or not in sign in
	
	function validate_login(id_login,id_pwd,login,containerid)
	{

		var val=document.getElementById(id_login);
		username=val.value;
				
		if (username == "" || username == null || username.charAt(0) == ' ')
		{
			alert("Please enter your Email ID");
			document.getElementById(id_login).focus();
			return false;
		}
		/*else if(!emailCheck(username))
		{
			alert("Please enter valid Email ID.");
			document.getElementById(id_login).focus();
			document.getElementById(id_login).value="";
			return false;
		}*/
		else
		{
			var val=document.getElementById(id_pwd);
			password=val.value;
			if (password == "" || password == null || password.charAt(0) == ' ')
			{
				alert("Password cannot be blank");
				document.getElementById(id_pwd).focus();
				return false;
			}
			else
			{
				//var val=document.getElementById(login);
				var login=1;
				/* AJAX page function code*/
				document.getElementById('process').style.visibility='visible';
				document.getElementById('contactdetails').style.height='100%';
				
				
				var url="http://www.searchmycampus.com/contactpost.php?username="+username+"&pass="+password+"&login="+login;
				
				
				show(url,containerid);
				
			
				return true;
			}
		}
	}

//used for check the validation in sign up



function findwho1(option)
{
	document.getElementById('showuniversity').style.visibility = "hidden";

	document.getElementById('showuniversity').style.visibility = "visible";




}



function valid_registration(id_username,id_email,id_pwd,id_cfpwd,id_name,id_type,id_mobile,containerid,id_cityid)
	{
		
		var	username = document.getElementById(id_username).value;
		var	email = document.getElementById(id_email).value;
		var password = document.getElementById(id_pwd).value;
		var cfpassword = document.getElementById(id_cfpwd).value;
		var name = document.getElementById(id_name).value;
		var type = document.getElementById(id_type).value;
		var mobile = document.getElementById(id_mobile).value;
		var cityid = id_cityid;
		var rpl_mobile = document.getElementById('rpl_mobile').value;
		var rpl_email = document.getElementById('rpl_email').value;

		var login= "3";
		var university = document.getElementById('university').value;
		
		if (university == "other")
		{
			alert("Sorry, we don't have your campus listed on SearchMyCampus right now. You must request your campus to continue. It'll only take a minute!");
			window.location = "http://www.searchmycampus.com/index.php?showuni_city=3";
			return false;
		}
		if (university == "" || university == null || university.charAt(0) == ' ')
		{
			alert("Please select your university");
			document.getElementById('university').focus();
			return false;
		}
		
		
		if (username == "" || username == null || username.charAt(0) == ' ')
		{
	
			alert("Please enter your Username");
			document.getElementById(id_login).focus();
			return false;
			////////////checking e-mail validation
			
		}


	
	var error = "";
    var illegalChars = /\W/; // allow letters, numbers, and underscores



 if(document.getElementById(id_username).value.length<4)
		{
			alert("Username should be between 4 to 15 characters");
			document.getElementById(id_username).focus();
			return false;
		}
		else if(document.getElementById(id_username).value.length>15)
		{
			alert("Username should be between 4 to 15 characters");
			document.getElementById(id_username).focus();
			return false;
		}


     if (illegalChars.test(document.getElementById(id_username).value)) {
        document.getElementById(id_username).style.background = 'Yellow'; 
       alert("The username contains illegal characters");
	   return false;
    } else {
        document.getElementById(id_username).style.background = 'White';
		
    }
   




		if ((email == "" || email == null || email.charAt(0) == ' ')&&(mobile == "" || mobile == null || mobile.charAt(0) == ' '))
		{
	
			alert("either email or phone is mandatory");
			//document.getElementById(id_login).focus();
			return false;
			////////////checking e-mail validation
			
		}

				else if(document.getElementById(id_pwd).value.length<6)
		{
			alert("Password should be between 6 to 20 characters");
			document.getElementById(id_pwd).focus();
			return false;
		}
		else if(document.getElementById(id_pwd).value.length>20)
		{
			alert("Password should be between 6 to 20 characters");
			document.getElementById(id_pwd).focus();
			return false;
		}

		if ((rpl_mobile == "" || rpl_mobile == null || rpl_mobile.charAt(0) == ' ')&&(rpl_email == "" || rpl_email == null || rpl_email.charAt(0) == ' '))
		{
	
			alert("either select response via mobile or email is mandatory");
			//document.getElementById(id_login).focus();
			return false;
			////////////checking e-mail validation
			
		}
		/*else if(!emailCheck(email))
		{
			alert("Please enter valid Email ID.");
			document.getElementById(id_login).focus();
			document.getElementById(id_login).value="";
			return false;
		}*/
		else if (password == "" || password == null || password.charAt(0) == ' ')
		{
			alert("Password cannot be blank");
			document.getElementById(id_pwd).focus();
			return false;
		}
		else if (cfpassword == "" || cfpassword == null || cfpassword.charAt(0) == ' ')
		{
			alert("confirm Password cannot be blank");
			document.getElementById(id_cfpwd).focus();
			return false;
		}


		else if ( password!=cfpassword )
		{
			alert("Passwords do not match.");
			document.getElementById(id_pwd).value="";
			document.getElementById(id_cfpwd).value="";
			document.getElementById(id_pwd).focus();
			return false;
		}
		else if (name == "" || name == null || name.charAt(0) == ' ')
		{
			alert("Please enter your name");
			document.getElementById(id_name).focus();
			return false;
		}
		else if (type == "" || type == null || type.charAt(0) == ' ')
		{
			alert("Please select your profession");
			document.getElementById(id_type).focus();
			return false;
		}
		
		else
		{
			if(document.getElementById('mobile').value!='')
			{
				var test;
				test=numeric_valid(mobile);
				if (test==false)
				{
					document.getElementById('mobile').focus();
					return false;
				}
			}
			document.getElementById('process').style.visibility='visible';
			if (mobile != "" || mobile != null || mobile.charAt(0) != ' '){
							document.getElementById('rpl_mobile').checked==true;

			}
				if (email != "" || email != null || email.charAt(0) != ' '){

				document.getElementById('rpl_email').checked==true;
				document.getElementById('receiveupdates').checked=true;

				}
			var url="http://www.searchmycampus.com/contactpost.php?cityid=" + cityid +"&username=" + username +"&email=" + email +"&pass=" + password +"&name=" + name +"&type=" + type +"&mobile=" + mobile+"&login=" + login +"&cityid="+cityid+ "&q=" + Math.random();
//			alert(url);
			//var containerid="div_member";
			var ie7 = (document.all && !window.opera && window.XMLHttpRequest) ? true : false;
			if( ie7==true){
			document.getElementById('contactdetails').style.height="100%";
			}

			if (navigator.userAgent.indexOf("Firefox")!=-1)
			{
							document.getElementById('contactdetails').style.height="100%";

			}
			show(url,containerid );
		}
		
	}
	function lostpassword(id_login,containerid)
	{
		var val=document.getElementById(id_login);
		username=val.value;
				
		if (username == "" || username == null || username.charAt(0) == ' ')
		{
			alert("Please enter your Username");
			document.getElementById(id_login).focus();
			return false;
		}
		
		else
		{
			var login="4";
			var url="http://www.searchmycampus.com/contactpost.php?username="+username+"&login="+login;
			show(url,containerid);
			return true;
		}
	}




	function lostpassword_new(containerid)
	{
		
		
			var url="http://www.searchmycampus.com/lost_password_form.php";
			show(url,containerid);
			return true;
		
	}
	
	
	function valid_reportabuse(id_login,id_type,id_message,id_capture)
	{
		var	username = document.getElementById(id_login).value;
		var type = document.getElementById(id_type).value;
		var message = document.getElementById(id_message).value;
		var capture = document.getElementById(id_capture).value;
		if (username == "" || username == null || username.charAt(0) == ' ')
		{
			alert("Please enter your Email");
			document.getElementById(id_login).focus();
			return false;
			////////////checking e-mail validation
			
		}
		else if(!emailCheck(username))
		{
			alert("Please enter valid Email ID.");
			document.getElementById(id_login).focus();
			document.getElementById(id_login).value="";
			return false;
		}
		else if (message == "" || message == null || message.charAt(0) == ' ')
		{
			alert("Comment cannot be blank");
			document.getElementById(id_message).focus();
			return false;
		}
		else if (capture == "" || capture == null || capture.charAt(0) == ' ')
		{
			alert("capture cannot be blank");
			document.getElementById(id_capture).focus();
			return false;
		}
		else if (type == "select" ||type == "" || type == null || type.charAt(0) == ' ')
		{
			alert("Please select a option ?");
			document.getElementById(id_type).focus();
			return false;
		}
		else
		{
			return true;
		}
	}
	
	function emailCheck (emailStr) 
	{

			/* The following variable tells the rest of the function whether or not
			to verify that the address ends in a two-letter country or well-known
			TLD.  1 means check it, 0 means don't. */
			
			var checkTLD=1;
			
			/* The following is the list of known TLDs that an e-mail address must end with. */
			
			var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
			
			/* The following pattern is used to check if the entered e-mail address
			fits the user@domain format.  It also is used to separate the username
			from the domain. */
			
			var emailPat=/^(.+)@(.+)$/;
			
			/* The following string represents the pattern for matching all special
			characters.  We don't want to allow special characters in the address. 
			These characters include ( ) < > @ , ; : \ " . [ ] */
			
			var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
			
			/* The following string represents the range of characters allowed in a 
			username or domainname.  It really states which chars aren't allowed.*/
			
			var validChars="\[^\\s" + specialChars + "\]";
			
			/* The following pattern applies if the "user" is a quoted string (in
			which case, there are no rules about which characters are allowed
			and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
			is a legal e-mail address. */
			
			var quotedUser="(\"[^\"]*\")";
			
			/* The following pattern applies for domains that are IP addresses,
			rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
			e-mail address. NOTE: The square brackets are required. */
			
			var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
			
			/* The following string represents an atom (basically a series of non-special characters.) */
			
			var atom=validChars + '+';
			
			/* The following string represents one word in the typical username.
			For example, in john.doe@somewhere.com, john and doe are words.
			Basically, a word is either an atom or quoted string. */
			
			var word="(" + atom + "|" + quotedUser + ")";
			
			// The following pattern describes the structure of the user
			
			var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
			
			/* The following pattern describes the structure of a normal symbolic
			domain, as opposed to ipDomainPat, shown above. */
			
			var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
			
			/* Finally, let's start trying to figure out if the supplied address is valid. */
			
			/* Begin with the coarse pattern to simply break up user@domain into
			different pieces that are easy to analyze. */
			
			var matchArray=emailStr.match(emailPat);

			if (matchArray==null)
			{

				/* Too many/few @'s or something; basically, this address doesn't even fit the general mould of a valid e-mail address. */

				//alert("Email address seems incorrect (check @ and .'s)");
				return false;
			}
			
			var user=matchArray[1];
			var domain=matchArray[2];

			// Start by checking that only basic ASCII characters are in the strings (0-127).

			for (i=0; i<user.length; i++)
			{
				if (user.charCodeAt(i)>127) 
				{
					//alert("Ths username contains invalid characters.");
					return false;
			   }
			}
			for (i=0; i<domain.length; i++) 
			{
				if (domain.charCodeAt(i)>127) 
				{
					//alert("Ths domain name contains invalid characters.");
					return false;
				}
			}

			// See if "user" is valid 

			if (user.match(userPat)==null) 
			{
				// user is not valid
				//alert("The username doesn't seem to be valid.");
				return false;
			}
			
			/* if the e-mail address is at an IP address (as opposed to a symbolic host name) make sure the IP address is valid. 
			
			var IPArray=domain.match(ipDomainPat);
			if (IPArray!=null) 
			{

				// this is an IP address

				for (var i=1;i<=4;i++) 
				{
					if (IPArray[i]>255) 
					{
						alert("Destination IP address is invalid!");
						return false;
					}
				}
				return true;
			}

			// Domain is symbolic name.  Check if it's valid.
 
			var atomPat=new RegExp("^" + atom + "$");
			var domArr=domain.split(".");
			var len=domArr.length;
			for (i=0;i<len;i++) 
			{
				if (domArr[i].search(atomPat)==-1) 
				{
					alert("The domain name does not seem to be valid.");
					return false;
				}
			}

			/* domain name seems valid, but now make sure that it ends in a known top-level domain (like com, edu, gov) or a two-letter word, representing country (uk, nl), and that there's a hostname preceding the domain or country. 

			if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1) 
			{
				alert("The address must end in a well-known domain or two letter " + "country.");
				return false;
			}

			// Make sure there's a host name preceding the domain.

			if (len<2) 
			{
				alert("This address is missing a hostname!");
				return false;
			}*/

			// If we've gotten this far, everything's valid!
			return true;
	}
	
	var loadedobjects=""
	var rootdomain="http://"+window.location.hostname
	var page_request;
	
	
	//when the login is failed return to the sign in page
	function login_failed(url,containerid)
	{
		alert("Login Failed");
		ajaxpage(url,containerid );
	}
					
	/*//used to call the sign in or sign up files from post resume on condition are you a member or not

	function member(containerid,id_member)
	{
		var val=document.getElementById(id_member);
		var rd_val = val.value;
		if(rd_val=="yes")
		{
			ajaxpage('signin.php',containerid );
			//ajaxpage('signin.php',containerid );
		}
		else if(rd_val=="no")
		{
			ajaxpage('signup.php',containerid );
		}
	}*/
	//for lost password

	function valid_lost_password(idemail,idmobile,containerid)
	{
		var val = document.getElementById(idemail);
		email = val.value;
		var val = document.getElementById(idmobile);
		mobile= val.value;
		

		
			if ((email == "" || email == null || email.charAt(0) == ' ')&&(mobile == "" || mobile == null || mobile.charAt(0) == ' '))

		{
			alert("Enter atleast one of the above fields");
			document.getElementById(idemail).focus();
			return false;
		}
		
		else
		{
			if(containerid=='lostpassword'){
						var url="http://www.searchmycampus.com/general_process_lostpassword.php?email=" + email + "&mobileno=" +mobile;
						show(url,containerid );
				}
				else{
						var url="http://www.searchmycampus.com/process_lostpassword.php?email=" + email + "&mobileno=" +mobile;
						show(url,containerid );
					}
		}
	}






	//for change password page validation 
	function valid_changepwd(idlogin,idoldpwd,idnewpwd,idcfpwd,containerid)
	{
		var val = document.getElementById(idlogin);
		username = val.value;
		var val = document.getElementById(idoldpwd);
		oldpassword = val.value;
		var val = document.getElementById(idnewpwd);
		newpassword = val.value;
		var val = document.getElementById(idcfpwd);
		cfpassword = val.value;
		if (username == "" || username == null || username.charAt(0) == ' ')
		{
			alert("Please enter your Username");
			document.getElementById(idlogin).focus();
			return false;
		}
		
		else if (oldpassword == "" || oldpassword == null || oldpassword.charAt(0) == ' ')
		{
			alert("Password cannot be blank");
			document.getElementById(idoldpwd).focus();
			return false;
		}
		else if (newpassword == "" || newpassword == null || newpassword.charAt(0) == ' ')
		{
			alert("Password cannot be blank");
			document.getElementById(idnewpwd).focus();
			return false;
		}
		else if (cfpassword == "" || cfpassword == null || cfpassword.charAt(0) == ' ')
		{
			alert("confirm Password cannot be blank");
			document.getElementById(idcfpwd).focus();
			return false;
		}
		else if ( newpassword!=cfpassword )
		{
			alert("Please enter correct password.");
			document.getElementById(idnewpwd).value="";
			document.getElementById(idcfpwd).value="";
			document.getElementById(idnewpwd).focus();
			return false;
		}
		else
		{
			var login='2';
			//var url = 'contactpost.php';
			//var params = "email="+username+"&oldpass="+oldpassword+"&newpass="+newpassword+"&login="+login;
			//ajaxpage_login(url, containerid, params);
			var url="http://www.searchmycampus.com/contactpost.php?username=" + username + "&oldpass=" + oldpassword + "&newpass=" + newpassword + "&login=" + login + "&q=" + Math.random();
			//var containerid="div_member";
			show(url,containerid );
		}
	}

	//call the cahnge password page from the sign in page
	function changepassword(id_member,containerid )
	{
		var val = document.getElementById(id_member);
		var username = val.value;
		var url = 'http://www.searchmycampus.com/changepassword.php?email=' + username;
		show(url,containerid);
		//ajaxpage_login(url, containerid, params);		
	}
	//for mobile checking or used in mobile verification
	function validsms(mobile,id_msg,idlogin,adphone,adtitle)
	{
//		username=document.getElementById(id_login).value;
		var val = document.getElementById(idlogin);
		var username = val.value;
		var msg = document.getElementById(id_msg).value;
		var sendermobile = document.getElementById(mobile).value;
		var receivermobile = document.getElementById(adphone).value;
		var title = document.getElementById(adtitle).value;
		alert(msg);
		title=title.substring(0,15);
		
		if (username == "" || username == null || username.charAt(0) == ' ')
		{
			alert("Please enter your Username");
			document.getElementById(idlogin).focus();
			return false;
		}
		
else if(!emailCheck(username))
		{
			alert("Please enter valid Email ID.");
			document.getElementById(idlogin).focus();
			document.getElementById(idlogin).value="";
			return false;
		}		else if((msg.length)>=100)
		{
			alert("Message legnth are not exceed 100 characters");
			return false
		}
		else if (sendermobile == "" || sendermobile == null || sendermobile.charAt(0) == ' ')
		{
			alert("Please enter your Mobile Number");
			document.getElementById(mobile).focus();
			return false;
		}
		else
		{
			msg = "Response to your Ad '" + title + "....' from: " + sendermobile + " " + msg;

			sendsms(receivermobile,msg);

			//sendsms(sendermobile,msg);
			return true;
		}
	}
	function validate(url,id_mobile,containerid)
	{
		
		var val=document.getElementById(id_mobile);
		var mobile_no = val.value;
		var v="?mobile=";
		url=url+v+mobile_no;
			
		if(numeric_valid(mobile_no))
		{
			var msg=Math.round(Math.random()*100000);
			url=url+"&msg="+msg;
			
			document.getElementById('mobile').readOnly=true;
			var comp_msg="SearchMyCampus.com- Your verification code is : "+ msg +". Please enter it in the space provided in the website. Thank you for using SearchMyCampus.com";
			sendsms(mobile_no,comp_msg);
			
			show(url,containerid);
		}
		else
		{
			document.getElementById(id_mobile).focus();
		}
	}
	//////////////////////////////////////////////////////
	
	function validate1(url,id_mobile,containerid)
	{
		
		
		var val=document.getElementById(id_mobile);
		var mobile_no = val.value;
		var v="?mobile=";
		url=url+v+mobile_no;
		
		if(numeric_valid(mobile_no))
		{
			var msg=Math.round(Math.random()*100000);
			url=url+"&msg="+msg;
			
			document.getElementById('mobile').readOnly=true;
			var comp_msg="SearchMyCampus.com- Your verification code is : "+ msg +". Please enter it in the space provided in the website. Thank you for using SearchMyCampus.com";
			sendsms(mobile_no,comp_msg);
			
			show1(url,containerid,mobile_no);
		}
		else
		{
			document.getElementById(id_mobile).focus();
		}
	}
	
		////// match validat code //////////////////
	function check_validate()
 {
	 var mobile;
	 mobile=document.getElementById('mobile').value;
	 
	 if(document.getElementById('mobile').value!='')
			{
				var test;
				var url;
				test=numeric_valid(mobile);
				if (test==false)
				{
					document.getElementById('mobile').focus();
					return false;
				}
				else
				{

				document.getElementById('process').style.visibility="visible";
								
				 url='http://www.searchmycampus.com/updatemobile.php?username='+document.getElementById('username').value+'&mobile='+document.getElementById('mobile').value;
				
				
					show(url,'qj');
					
					document.getElementById('mobile').readOnly=true;
					document.getElementById('mobile').style.backgroundColor='#F3F3F3';
					

					document.getElementById('mobile_verify').innerHTML= ' <b style="color:#0000ff; font-size:9pt;text-decoration:underline; font-weight:normal;cursor:pointer;" onclick="javascript:changeno();" name="verify" id="verify" />Change Number</b>&nbsp;&nbsp;<img src="progress_submit.gif" style="visibility:hidden" id="process" /></b>';
									
				}
			}
			else
			{
				alert('enter your mobile number');
				return false;
			}
	 
		//document.getElementById('ch_number').style.visibility='visible';
		//document.getElementById('spanvalid1').innerHTML="";
		//document.getElementById('spanvalid2').innerHTML="";
		//document.getElementById('divverification').style.visibility="visible";

		
	//}
	//else
	//{
	//	alert('Wrong Code Enter');
	//}
	
 	
 }





	
	//check the value is numeric or not
	function numeric_valid(str)
	{
		var valid;
		if(!(str.length=="10"|| str.length=="10"))
		{
			alert('Mobile number could not be less/more than 10 digit');
			return false;		
		}
		for(var i=0;i<str.length;i++)
		{
			valid=str.charCodeAt(i);
			if(!((valid>=48 && valid<= 57)))
			{
				alert('Only numeric digit acceptable');
				return false;
			}
			
		}
		return true;
	}
	
	//used to call the other page (using ajax) with passing some values through get method
	
	function ajaxpage_login(url, containerid, params)
	{
		var page_request = false
		if (window.XMLHttpRequest) // if Mozilla, Safari etc	
			page_request = new XMLHttpRequest()
		else if (window.ActiveXObject)
		{ // if IE
			try 
			{
				page_request = new ActiveXObject("Msxml2.XMLHTTP")
			} 
			catch (e)
			{
				try
				{
					page_request = new ActiveXObject("Microsoft.XMLHTTP")
				}
				catch (e){}
			}
		}
		else
			return false
	
		page_request.onreadystatechange=function()
		{
			loadpage(page_request, containerid)
		}
		page_request.open('GET', url+"?"+params, true)
		page_request.send(params)
	}
	/*
	function GetXmlHttpObject()
	{
	var xmlHttp=null;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	  }
	return xmlHttp;
	}*/
	
	function ajaxpage(url, containerid)
	{
		page_request=GetXmlHttpObject();
		if(page_request==null) 
		{
			alert("Your Browser doesn\'t support AJAX");
			return;
		}
	
		page_request.onreadystatechange=function()
		{
			loadpage(page_request, containerid)
		}
		page_request.open('GET', url, true)
		page_request.send(null)
	}
	/*
	function stateChanged() 
	{
			
        if (xmlHttp.readyState==4 && xmlHttp.status==200)
        { 
        var mText;
        mText=xmlHttp.responseText;
		alert(mText);
		//document.write(mText);
		document.getElementById('mydiv').innerHTML=mText;
		}
	}*/
	function loadpage(page_request, containerid)
	{
		if (page_request.readyState == 4 && page_request.status==200)// || window.location.href.indexOf("http")==-1))
			document.getElementById(containerid).innerHTML=page_request.responseText
	}
	
	function loadobjs()
	{
		if (!document.getElementById)
			return
	
		for (i=0; i<arguments.length; i++)
		{
			var file=arguments[i]
			var fileref=""
			if (loadedobjects.indexOf(file)==-1)
			{ //Check to see if this object has not already been added to page before proceeding
				if (file.indexOf(".js")!=-1)
				{ //If object is a js file
					fileref=document.createElement('script')
					fileref.setAttribute("type","text/javascript");
					fileref.setAttribute("src", file);
				}
				else if (file.indexOf(".css")!=-1)
				{ //If object is a css file
					fileref=document.createElement("link")
					fileref.setAttribute("rel", "stylesheet");
					fileref.setAttribute("type", "text/css");
					fileref.setAttribute("href", file);
				}
			}
			if (fileref!="")
			{
					document.getElementsByTagName("head").item(0).appendChild(fileref)
					loadedobjects+=file+" " //Remember this object as being already added to page
			}
		}
	}
function insertLink(link)
{
	if (link)
	{
		var editpane = document.frmPost.addesc;
		var linkcode = "[URL]http://" + link + "[/URL]";

		editpane.focus();
		/*if (document.selection)
		{
			document.selection.createRange().text = linkcode;
		}
		else*/
		if (editpane.selectionStart || editpane.selectionStart == '0')
		{
			var selstart = editpane.selectionStart;
			var selend = editpane.selectionEnd;
			
			editpane.value = editpane.value.substring(0, selstart) + linkcode + editpane.value.substring(selend);
			editpane.selectionStart = selstart + linkcode.length;
			editpane.selectionEnd = editpane.selectionStart;
		}
		else
		{
			editpane.value = editpane.value + linkcode;
		}

		editpane.focus();
	}

}
