/*$(document).ready(function(){
  $.preloadCssImages();
}); */


/*$(document).ready(function() {

	//Select all anchor tag with rel set to tooltip
	$('a[rel=tooltip]').mouseover(function(e) {
		
		//Grab the title attribute's value and assign it to a variable
		var tip = $(this).attr('title');	
		
		//Remove the title attribute's to avoid the native tooltip from the browser
		$(this).attr('title','');
		
		//Append the tooltip template and its value
		$(this).append('<div id="tooltip"><div class="tipHeader"></div><div class="tipBody">' + tip + '</div><div class="tipFooter"></div></div>');		
				
		//Show the tooltip with faceIn effect
		$('#tooltip').fadeIn('500');
		$('#tooltip').fadeTo('10',0.9);
		
	}).mousemove(function(e) {
	
		//Keep changing the X and Y axis for the tooltip, thus, the tooltip move along with the mouse
		$('#tooltip').css('top', e.pageY + 10 );
		$('#tooltip').css('left', e.pageX + 20 );
		
	}).mouseout(function() {
	
		//Put back the title attribute's value
		$(this).attr('title',$('.tipBody').html());
	
		//Remove the appended tooltip template
		$(this).children('div#tooltip').remove();
		
	});

});
 */
 
 
 function formchk()
{	
	if (document.formarea.name.value=="")
		{
		alert("Please Enter Your Name.");
		document.formarea.name.focus();	
		return false;
		}
		
		if(!EmailValid(document.formarea.emailid.value))
		{
		document.formarea.emailid.focus();
		return false;
		
		}
		if (document.formarea.phnumber.value=="")
		{
		alert("Please Enter Your Phone Number.");
		document.formarea.phnumber.focus();		
		return false;
		}
		if (document.formarea.company.value=="")
		{
		alert("Please Enter Your Company Name.");
		document.formarea.company.focus();		
		return false;
		}
		if (document.formarea.Website.value=="")
		{
		alert("Please Enter Your Website Address.");
		document.formarea.Website.focus();		
		return false;
		}
		if (document.formarea.ConCode.value=="")
		{
		alert("Please Solve the following captcha.");
		document.formarea.ConCode.focus();		
		return false;
		}
		if (document.formarea.ConCode.value!='18')
		{
		alert("wrong captcha.");
		document.formarea.ConCode.focus();
		document.formarea.ConCode.value="";
		return false;
		}
		
return true;
}

function EmailValid(email)
	{
		if(email=="")
		{
		alert("Please Enter Your Email Address.")
		return false
		}
		len = email.length
		
		if((email.charAt(1)=='@')||(email.charAt(1)=='.'))
		{
		alert("Invalid Email Please try again!")
		return false
		}
		if((email.charAt(len-2)=='@')||(email.charAt(len-2)=='.'))
		{
		alert("Invalid Email Please try again!")
		return false
		}

		count=0
		dotcount=0
	for (i=0; i< email.length; i++)
		{
			if(email.charAt(i)=='@')
			count++
			if(email.charAt(i)=='.')
			dotcount++
		 }
		
			 if((count !=1)||(dotcount >2))
			 	{
			 	alert("Invalid Email Please try again!")
			 	return false
			 	}
	return true
	}
	


