$.fn.droppy = function(options) {
  options = $.extend({speed: 250}, options || {});
  this.each(function() {var root = this, zIndex = 1000;function getSubnav(ele) {  if (ele.nodeName.toLowerCase() == 'li') {var subnav = $('> ul', ele);return subnav.length ? subnav[0] : null;  } else {return ele;  }}function getActuator(ele) {  if (ele.nodeName.toLowerCase() == 'ul') {return $(ele).parents('li')[0];  } else {return ele;  }}function hide() {  var subnav = getSubnav(this);  if (!subnav) return;  $.data(subnav, 'cancelHide', false);  setTimeout(function() {if (!$.data(subnav, 'cancelHide')) {  $(subnav).hide(options.speed);}  }, 100);}
  function show() {  var subnav = getSubnav(this);  if (!subnav) return;  $.data(subnav, 'cancelHide', true);  $(subnav).css({zIndex: zIndex++}).show(options.speed);  if (this.nodeName.toLowerCase() == 'ul') {var li = getActuator(this);$(li).addClass('hover');$('> a', li).addClass('hover');  }}$('ul, li', this).hover(show, hide);$('li', this).hover(  function() { $(this).addClass('hover'); $('> a', this).addClass('hover'); },  function() { $(this).removeClass('hover'); $('> a', this).removeClass('hover'); });});
};
$(function() {
    $('#nav').droppy();
  });
function CheckForm()
{
	with(document.form)
	{
			if(name.value == "")
			{
				alert("Enter Your Name");
				name.focus();
				return false;
			}
				
				if ((email.value==null)||(email.value=="")){
					alert("Please Enter your Email ID")
					email.focus()
					return false
				}
				if (echeck(email.value)==false){
					email.value=""
					email.focus()
					return false
				}
				if (msg.value == '') 
				{
				alert('Please Enter Your Message');
			   	msg.focus(); 	
   	   			return false;
				}
	}
}
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
		 }
				
	}
