
function visiblehint()

{
document.getElementById('hintwhy').style.display='inline';

document.getElementById('hintwhy').style.position='absolute';
}

function hidehint()
{
document.getElementById('hintwhy').style.display='none';


}
function cancel()
{
	window.location('http://www.searchmycampus.com/Campus/Delhi/Delhi-University-1/Home-7/Post-Free-Ad-3/-18/postfreead.html');
}
function IsNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.-";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

  // -->

function dedupe_list()
{
	var count = 0;
	var mainlist = document.getElementById('mainlist').value;
	mainlist = mainlist.replace(/\r/gi, "\n");
	mainlist = mainlist.replace(/\n+/gi, "\n");
	
	var listvalues = new Array();
	var newlist = new Array();
	
	listvalues = mainlist.split("\n");
	
	var hash = new Object();
	
	for (var i=0; i<listvalues.length; i++)
	{
		if (hash[listvalues[i].toLowerCase()] != 1)
		{
			newlist = newlist.concat(listvalues[i]);
			hash[listvalues[i].toLowerCase()] = 1
		}
		else { count++; }
	}
	var k = newlist.join("\r\n");
	//alert('Removed ' + count + ' duplicate values from list. . .');
	document.getElementById('ces1').innerHTML='<select onchange="showt(this.value,\'it\');javascript:hidexx(\'non\');" name="itcity" id="itcity"><option value="-99">-Select-</option>'+k+'</select>';
}


function dedupe_list2()
{
	var count = 0;
	var mainlist =document.getElementById('mainlist2').value;
	mainlist = mainlist.replace(/\r/gi, "\n");
	mainlist = mainlist.replace(/\n+/gi, "\n");
	
	var listvalues = new Array();
	var newlist = new Array();
	
	listvalues = mainlist.split("\n");
	
	var hash = new Object();
	
	for (var i=0; i<listvalues.length; i++)
	{
		if (hash[listvalues[i].toLowerCase()] != 1)
		{
			newlist = newlist.concat(listvalues[i]);
			hash[listvalues[i].toLowerCase()] = 1
		}
		else { count++; }
	}
	var k = newlist.join("\r\n");
	//alert('Removed ' + count + ' duplicate values from list. . .');
	document.getElementById('ces2').innerHTML=	'<select onchange="showt(this.value,\'non\');javascript:hidexx(\'it\');" name="nonitcity" id="nonitcity"><option value="-99">-Select-</option>'+k+'</select>';
}
//-->


function timedMsg()
{
var t=setTimeout("openAjaxConfirm();",2000);
}



function enableall()
{
	setDisabled('nonitdiv', false);
		setDisabled('itdiv', false);
}
function setDisabled(id, disabled)
{
if ( !document.getElementById
|| !document.getElementsByTagName) return;

var nodesToDisable = {button :'', input :'', optgroup :'',
option :'', select :'', textarea :''};

var node, nodes;
var div = document.getElementById(id);
if (!div) return;

nodes = div.getElementsByTagName('*');
if (!nodes) return;

var i = nodes.length;
while (i--){
node = nodes[i];
if ( node.nodeName
&& node.nodeName.toLowerCase() in nodesToDisable ){
node.disabled = disabled;
}
}
}



function hidexx(var_id){
			if (var_id=='non'){

			setDisabled('nonitdiv', true);
			document.getElementById('itdeselect').innerHTML='<span style="cursor:pointer;color:#0000ff;" onclick="enableall();">Clear Selection</span>';
			document.getElementById('nonitdeselect').innerHTML='';
				}

if (var_id=='it'){

			
			
			setDisabled('itdiv', true);
			document.getElementById('nonitdeselect').innerHTML='<span style="cursor:pointer;color:#0000ff;" onclick="enableall();">Clear Selection</span>';
			document.getElementById('itdeselect').innerHTML='';
				}
	
			
			
	
}
function emp_final(emailid_id,mobileno_id,universitynonit_id,nonitcity_id,universityit_id,itcity_id)

{

var email=document.getElementById(emailid_id).value;
//var name=document.getElementById('namewa').value;
var mobileno=document.getElementById(mobileno_id).value;
var universitynonit=document.getElementById(universitynonit_id).value;
var nonitcity=document.getElementById(nonitcity_id).value;
var universityit=document.getElementById(universityit_id).value;
var itcity=document.getElementById(itcity_id).value;

/*if(name=='' ){
alert('Please Enter Your Name');

document.getElementById('namewa').focus();
return false;

}*/

if(mobileno=='' && email==''){
alert('Please Enter either Mobile or Email');

document.getElementById(emailid_id).focus();
return false;

}

if(email!='' && mobileno==''){
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){

}
else {
	 alert("Please enter a valid email address!");
	document.getElementById(emailid_id).focus();
	return false;
}
}
if(email=='' && mobileno!=''){
if (IsNumeric(mobileno) == false) 
      {
      alert("Please enter a valid phone number!");
	  document.getElementById(mobileno_id).focus();
	  return false;
      }

	 var str = mobileno;
	if( str.length<10){
 
        alert("Please enter a valid phone number!");
		 document.getElementById(mobileno_id).focus();
		return false;
	}

  
}
if(itcity=='-99' && nonitcity=='-99') {
alert('Please Select City/University');

document.getElementById(itcity_id).focus();
return false;

}



showtt1('../emp_landing_dbstore.php?itcity='+escape(itcity)+'&name='+escape(name)+'&universityit='+escape(universityit)+'&nonitcity='+escape(nonitcity)+'&universitynonit='+escape(universitynonit)+'&mobileno='+escape(mobileno)+'&email='+escape(email),'invipro');


}
function showt(v1,v2)
  {  
		if (v2=='it'){
				if(v1!='-99'){
			showtt('http://www.searchmycampus.com/emp_landing_uni_it.php?&itcity='+v1,'it');
					}
			else{
					alert('Select City First');
					return false;
				}

			}  
		if (v2=='non'){
				if(v1!='-99'){

			showtt('http://www.searchmycampus.com/emp_landing_uni_nonit.php?&nonitcity='+v1,'nonit');
					}
			else{
					alert('Select City First');
					return false;
				}

			} 
	


		
}




function showtt(url,containerid)
  {    
			xmlHttp=GetXmlHttpObject();
			if (xmlHttp==null)
			{
				alert("Your Browswer does not support AJAX!");
				return;
			}
			
			xmlHttp.onreadystatechange=function()
			{
				stateChanged(containerid);
			}
			xmlHttp.open("POST",url,true);
			xmlHttp.send(null);
}

function showtt1(url,containerid)
  {    

	  var nonitcity=document.getElementById('nonitcity').value;
var universityit=document.getElementById('universityit').value;
var itcity=document.getElementById('itcity').value;
var universitynonit=document.getElementById('universitynonit').value;

			xmlHttp=GetXmlHttpObject();
			if (xmlHttp==null)
			{
				alert("Your Browswer does not support AJAX!");
				return;
			}
			xmlHttp.open("POST",url,true);

			if(universityit!='' & universityit !='-99')
	{
		window.location='http://www.searchmycampus.com/campus.php?emp=landingred&cityid='+universityit;
	}
	else if(universitynonit!='' & universitynonit !='-99')
	{
		window.location='http://www.searchmycampus.com/campus.php?emp=landingred&cityid='+universitynonit;
	}
			xmlHttp.send(url);
}
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 stateChanged(containerid) 
{
	
			if (xmlHttp.readyState==4 && xmlHttp.status==200)
			{ 
				var mText;
				mText=xmlHttp.responseText;
				try
				{
					
							
					document.getElementById(containerid).innerHTML="div recognise";
				
					var check = document.getElementById(containerid);
				
					check.innerHTML += " " + mText;
					
					document.getElementById(containerid).innerHTML= " " + mText;
					
					
					
				}
				catch(e)
				{
					alert(containerid);
					alert("div member");
					alert(e);
				}
			
				
				
			
		
				

			}

}
function movetodown(val)
{
if (val==1)
{
document.getElementById('footer').focus();
}

}


////////////////////
function background_color()
{

		var box=document.getElementById('middlewrap');
		box.style.borderBottom='1px solid #E1E1E1';
		box.style.borderLeft='1px solid #E1E1E1';
		box.style.borderRight='1px solid #E1E1E1';
		box.style.borderTop='1px solid #E1E1E1';

}

function set_title()
{

}

  function openAjaxConfirm() {
      
		  Dialog.alert({url: "../emp_landing.php", options: {method: 'get'}}, {className: "alphacube",top: 90,bottom: 0, left: 275,width:670,height:500});

  }