 var $aurora =  jQuery.noConflict();
 
 function aurora_mainmenu(){
$aurora(" #nav a").removeAttr("title"); // flickering bug fix
$aurora(" #nav ul ").css({display: "none"}); // Opera Fix
$aurora(" #nav li").hover(function(){
		$aurora(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown(200);
		},function(){
		$aurora(this).find('ul:first').css({visibility: "hidden"});
		});
}

function aurora_footer(){
$aurora(".footer_head").addClass("footer_slide_button")	.append('<a href=""></a>');
$aurora("#footer_body").css({display: "none"});
$aurora(".footer_head a").bind ("click",function(){
										 $aurora("#footer_body").slideToggle('slow');
										 $aurora(".footer_head").toggleClass('slidebutton2');
										 return false;							  
																		  });

	}


function my_smothscroll(){
$aurora('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
    && location.hostname == this.hostname) {
      var $target = $aurora(this.hash);
      $target = $target.length && $target
      || $aurora('[name=' + this.hash.slice(1) +']');
      if ($target.length) {
        var targetOffset = $target.offset().top;
        $aurora('html,body')
        .animate({scrollTop: targetOffset}, 700);
       return false;
      }
    }
  });

	}




 $aurora(document).ready(function(){
	aurora_mainmenu();
	aurora_footer();
	my_smothscroll();
});
 
 
 function validEmail(email) 
		{
			invalidChars = " /:,;"
	
			if (email == "") {				// cannot be empty
				return false
			}
			for (i=0; i<invalidChars.length; i++) {	// does it contain any invalid characters?
				badChar = invalidChars.charAt(i)
				if (email.indexOf(badChar,0) > -1) {
					return false
				}
			}
			atPos = email.indexOf("@",1)		// there must be one "@"symbol
			if (atPos == -1) {
				return false
			}
			if (email.indexOf("@",atPos+1) != -1) {	// and only one "@" symbol
				return false
			}
			periodPos = email.indexOf(".",atPos)
			if (periodPos == -1) {			// and at least one "." after the "@"
				return false
			}
			if (periodPos+3 > email.length)	{// must be at least 2 characters after the "."
				return false
			}	
			return true
		}
		function validDigit(number)
		{
  			 var checkOK = "0123456789-+() ";
  			 var checkStr = number;
 			 var allValid = true;
  			 var decPoints = 0;
 			 var allNum = "";
  			 for (i = 0;  i < checkStr.length;  i++)
  			 {
    			ch = checkStr.charAt(i);
   				 for (j = 0;  j < checkOK.length;  j++)
      				if (ch == checkOK.charAt(j))
       			 break;
    			if (j == checkOK.length)
    			{
     				 allValid = false;
      				break;
   				 }
    			allNum += ch;
 			 }
			return allValid;
		}
		function submitIt(theForm)
		{
			  if (theForm.name.value == "")
			  {
			    alert("Please enter a value for the \"name\" field.");
			    theForm.name.focus();
			    theForm.name.select();
			    return (false);
			  }
			    if (theForm.email.value == "")
			  	{
					alert("Please enter a value for the \"email\" field.");
				    theForm.email.focus();
				    return (false);
			  	}				
				if (!validEmail(theForm.email.value))
			 	{
			  		alert("Please enter a valid email address!")
					theForm.email.focus();
				    theForm.email.select();
				    return (false);
			  	}
			  	if (theForm.number.value.length < 7)
			  	{
				    alert("Please enter at least 7 digits in the \"Phone\" field.");
				    theForm.number.focus();
				    theForm.number.select();
				    return (false);
				}
				
				if (!validDigit(theForm.number.value))
				{
				  alert("Please enter only digits in the \"Phone\" field.")
				    theForm.number.focus();
				    theForm.number.select();
				    return (false);
				}
				if (theForm.company.value == "")
			  	{
			    	alert("Please enter a value for the \"company\" field.");
			    	theForm.company.focus();
			    	theForm.company.select();
			    	return (false);
			  	}
			  	if (theForm.message.value == "")
			  	{
			    	alert("Please enter a value for the \"message\" field.");
			    	theForm.message.focus();
			    	theForm.message.select();
			    	return (false);
			  	}
				return true
		}
