$(function(){
$("#nav ul li a.active").parent().prev().addClass("noLine");
$("#right-area ul.appointment li:odd").addClass("odd");
$("#right-area ul.appointment li:last, #right-area ul.appointment li:nth-child(5)").addClass("lastChild");
$("#nav ul li:last").addClass("lastChild");
$("#nav ul li:first").addClass("firstChild");
$("#right-area ul.appointment li input:image").addClass('auto');
$("#nav ul li a").hover(
  function () {
    $(this).parent().addClass("noLine");
	  $(this).parent().prev().addClass("noLine");
  }, 
  function () {
	$(this).parent().removeClass("noLine");
	$(this).parent().prev().removeClass("noLine");
	}
);
$("#nav ul li:first a").hover(
  function () {
    $(this).parent().parent().parent().addClass("active");
  }, 
  function () {
	$(this).parent().parent().parent().removeClass("active");
	}
);
$("#nav ul a.active").hover(
  function () {
   $("#nav ul li a.active").parent().prev().addClass("noLine");
  }, 
  function () {
	$("#nav ul li a.active").parent().prev().addClass("noLine");
	}
);
$("#nav ul li:first a.active").hover(
  function () {
    $(this).parent().parent().parent().addClass("active");
  }, 
  function () {
	 $(this).parent().parent().parent().addClass("active");
	}
);
	var homeSelect = $("#nav ul li:first a").attr('class');
//	alert(homeSelect);
	if(homeSelect == 'active' ){
		$("#nav").addClass("active")
		}
});

////////////////////////////////
function echeck(email) 
{
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   if(reg.test(email) == false) 
   {
      return false;
   }
}
////////////////////////////////
function validate_booking()
{
var d=document.book_form;
var flag=1;
var msg="Errors have occured during the process of your form.\n\nPlease make the following corrections:\n";
	if(d.name.value=="")
	{ 
		msg+="\n* Plesae enter your Name.";
		flag=0;
	}
	if(echeck(d.email.value)==false)
	{
		msg+="\n* Enter a valid E-mail ID.";
		flag=0;
	}
	if(d.phone.value=="")
	{ 
		msg+="\n* Plesae enter Phone No.";
		flag=0;
	}
	if(d.date.value=="")
	{ 
		msg+="\n* Plesae enter Date & Time.";
		flag=0;
	}
	if(d.security_code.value=="")
	{ 
		msg+="\n* Plesae enter Security Code.";
		flag=0;
	}
if(flag==0)
{
	alert(msg);
	return false;
}		
}

