// JavaScript Document

/////////// Function for cookie set/reset as a part of Remember me in index header //////////////
/*function cky_index()
{
	if(document.index_log.coo_email.value==document.index_log.uname.value)
	{
		var a = document.index_log.coo_pword.value;
		document.index_log.upass.value=a;
	}
}*/
	
//////// Functions begin for toggle display Name/Phone No./Email/Website //////////
function uname_blur(val)
{	
	if(val!="")
	{
		//cky_index();
		document.evalFrm.uname.value=val;
		document.evalFrm.uname.style.color='#000000';
		trimstr("evalFrm","uname");
	}
	else
	{			
		document.evalFrm.uname.value="Name :";
		document.evalFrm.uname.style.color='#979797';
	}
}
function uname_focus(val)
{
	if(val!="Name :")
	{
		document.evalFrm.uname.value=val;			
	}
	else
	{
		document.evalFrm.uname.value='';			
	}
	document.evalFrm.uname.style.color='#000000';
}

function phone_blur(val)
{
	if(val!="")
	{
		document.evalFrm.phoneNo.value=val;
		document.evalFrm.phoneNo.style.color='#000000';
		trimstr2("evalFrm","phoneNo");
	}
	else
	{			
		document.evalFrm.phoneNo.value="Phone No. :";
		document.evalFrm.phoneNo.style.color='#979797';
	}
}
function phone_focus(val)
{
	if(val!="Phone No. :")
	{
		document.evalFrm.phoneNo.value=val;			
	}
	else
	{
		document.evalFrm.phoneNo.value='';			
	}
	document.evalFrm.phoneNo.style.color='#000000';
}

function uemail_blur(val)
{
	if(val!="")
	{
		document.evalFrm.userEmail.value=val;
		document.evalFrm.userEmail.style.color='#000000';		
	}
	else
	{			
		document.evalFrm.userEmail.value="Email :";
		document.evalFrm.userEmail.style.color='#979797';
	}
}
function uemail_focus(val)
{
	if(val!="Email :")
	{
		document.evalFrm.userEmail.value=val;			
	}
	else
	{
		document.evalFrm.userEmail.value='';			
	}
	document.evalFrm.userEmail.style.color='#000000';
}

function usite_blur(val)
{
	if(val!="")
	{
		document.evalFrm.userSite.value=val;
		document.evalFrm.userSite.style.color='#000000';		
	}
	else
	{			
		document.evalFrm.userSite.value="Website :";
		document.evalFrm.userSite.style.color='#979797';
	}
}
function usite_focus(val)
{
	if(val!="Website :")
	{
		document.evalFrm.userSite.value=val;			
	}
	else
	{
		document.evalFrm.userSite.value='';			
	}
	document.evalFrm.userSite.style.color='#000000';
}
//////// Functions begin for toggle display "Comment :" in Index page ////////
function comment_blur(val)
{
	if(val!="")
	{
		document.getElementById('txtComment').value=val;
		document.getElementById('txtComment').style.color='#000000';		
	}
	else
	{			
		document.getElementById('txtComment').value="Comment :";
		document.getElementById('txtComment').style.color='#979797';
	}
}
function comment_focus(val)
{
	//alert(val);
	if(val!="Comment :")
	{
		document.getElementById('txtComment').value=val;			
	}
	else
	{
		document.getElementById('txtComment').value='';			
	}
	document.getElementById('txtComment').style.color='#000000';
}

/////// Function for check form of Quick contact ////////
function checkForm()
{
	if(document.evalFrm.uname.value=="" || document.evalFrm.uname.value=="Name :")
	{
		alert("Please enter your Name");
		document.evalFrm.uname.focus();
		return false;
	}
	if(document.evalFrm.userEmail.value=="" || document.evalFrm.userEmail.value=="Email :")
	{
		alert("Please enter your Email ID");
		document.evalFrm.userEmail.focus();
		return false;
	}
	if(checkemail("evalFrm","userEmail","")==false)
		return false;
	
	checkcode(document.evalFrm.txtCaptcha.value)
	if(document.getElementById("valid_captcha_code").innerHTML==0) 
	{ 
		document.getElementById('imgCaptcha1').src = document.getElementById('imgCaptcha1').src + '?' + (new Date()).getMilliseconds();
		alert('The entered code was not correct. Please try again'); 
		document.evalFrm.txtCaptcha.value=''; 
		document.evalFrm.txtCaptcha.focus(); 
		return false;
	}
}

//////// Functions for Slot differ in Header parts ////////////
function mouseOverSlot1()
{
	document.getElementById("t1").bgColor="#FFFFE5";
	document.getElementById("slotDiffer").innerHTML='<img src="images/seo_banner.gif" border="0" alt="" />';
	//alert("Slot2");
	//return false;
}
function mouseOutSlot1()
{
	document.getElementById("t1").bgColor="";
	//window.location.reload('top2.php');
}

function mouseOverSlot2()
{
	document.getElementById("t2").bgColor="#FFFFE5";
	document.getElementById("slotDiffer").innerHTML='<img src="images/sem_banner.gif" border="0" alt="" />';
	//alert("Slot2");
	//return false;
}
function mouseOutSlot2()
{
	document.getElementById("t2").bgColor="";
	//window.location.reload('top2.php');
}	

function mouseOverSlot3()
{
	document.getElementById("t3").bgColor="#FFFFE5";
	document.getElementById("slotDiffer").innerHTML='<img src="images/smm_banner.gif" border="0" alt="" />';
	//alert("Slot2");
	//return false;
}
function mouseOutSlot3()
{
	document.getElementById("t3").bgColor="";
	//window.location.reload('top2.php');
}

function mouseOverSlot4()
{
	document.getElementById("t4").bgColor="#FFFFE5";
	document.getElementById("slotDiffer").innerHTML='<img src="images/rep.jpg" border="0" alt="" />';
	//alert("Slot2");
	//return false;
}
function mouseOutSlot4()
{
	document.getElementById("t4").bgColor="";
	//window.location.reload('top2.php');
}

////////////// Function for validation of Password /////////////////////
/*function valid_password()
{
	var a=document.getElementById("pass");
	var b= document.getElementById("confirm_pass");
	
	if(b.value=="")
	{
		document.getElementById("pwdchk").innerHTML="<img src='images/wrong.png' height='20' width='20'>&nbsp;&nbsp;&nbsp;Please confirm your Password".fontcolor("Red");		
		//b.focus();
		return false;
	}
	else if(a.value != b.value)	
	{
		//alert("Password & Confirm Password Are Different!");
		document.getElementById("pwdchk").innerHTML="<img src='images/wrong.png' height='20' width='20'>&nbsp;&nbsp;&nbsp;Password & Confirm Password Are Different!";
		b.value = "";
		//b.focus();
		return false;
	}
	else
	{	
		for(var i=0; i<a.value.length; i++)
		{
			if(a.value.charCodeAt(i) == 32)
			{				
				document.getElementById("pwdchk").innerHTML="<img src='images/wrong.png' height='20' width='20'>&nbsp;&nbsp;&nbsp;Please enter valid Password. It should not contain Spaces".fontcolor("Red");
				a.value = "";
				return false;	
			}
		}
		document.getElementById("pwdchk").innerHTML="<img src='images/tick.png' height='21' width='20'>";//fontcolor("Green");
		return true;
	}
}*/