/**
	IE6 bux fix for li:hover state
**/
		  
		var flag=0;
        
        //Implements Search function
		function search() 
		{
		
		if(flag>0)
		{
		
		}
		if(flag==0)
		{
			

				q = document.getElementById('search_txt');
				var searchKeyWord=q.value;
				
					if(searchKeyWord==null || searchKeyWord=="")
					{
						alert("Please Enter Search Keyword");
						
					}
					
				else
					{
						window.location.href = '/mySearchResults.aspx?k=' + q.value+'&cs=This Site&u=http://'+document.location.hostname+':'+document.location.port;
						return false;
						
					}
		}
		}
		 //Implements OnKeyPress event for Search Text Box
		function CheckKey(e)
		{
			if (e.keyCode == 13)
			{
					flag=0;
						
			}
			
		}
		//Implements OnKeyPress event for News Letter SignUp Text Box

	function CheckEvent(e)
		{
		
			if (e.keyCode == 13)
			{
						
						flag=1;
						fnNewsLetterSignUp();
			

		   	}
						
		}

		  //Implements SignUp for Updates Form - Newsletter Sign Up
		function fnNewsLetterSignUp() 
		{
			q = document.getElementById('email');
			var searchKeyWord=q.value;
			if(searchKeyWord==null || searchKeyWord=="")
			{
					alert("Please Enter Email Id");
				
			}
			else
			{
			if(ValidateEmail())
			{
				document.location = '/SHLForms/Pages/SignUpForUpdates.aspx?k='+ q.value;
			}
			else
			{
			alert("Invalid Email address"); 
			}
			}
					
		}         
	function ValidateEmail()
	{
		
			emailvalue= this.document.getElementById("email").value;
			if(this.document.getElementById("email").value!= "")
			{ 
				em =/^([a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z])$/; 			
				var filter=/^.+@.+\..{2,3}$/
				if(!(emailvalue.match(em)))
				{			
					return false;
				
				}
				
				else
				{
					return true;
				}
			}
		
			else{}
			

	}
	//Resets the flag on Mouseover of search button
	function ChangeFlag()
	{
		flag=0;
	}
	//implements keypress location textfield
	function CheckLocation(e)
	{
		if (e.keyCode == 13)
		{
		Location()
		}
	}
	//implements keypress location textfield
	function CheckEveLocation(e)
	{
		if (e.keyCode == 13)
		{
		EveLocation()
		}
	}
	//implements keypress course textfield
	function CheckCourse(e)
	{
		if (e.keyCode == 13)
		{
		Course();
		}
	}
	//implements keypress startdate textfield
	function CheckStartDate(e)
	{
		if (e.keyCode == 13)
		{
		StartDate();
		}
		if(e.keyCode == 46 || e.keyCode == 8)
		{
		document.getElementById('loc_SDsearch_txt').value="";
		}

	}
	//implements keypress enddate textfield
	function CheckEndDate(e)
	
	{
	    
		if (e.keyCode == 13)
		{
		EndDate();
		}
		if(e.keyCode == 46 || e.keyCode == 8)
		{
		document.getElementById('loc_EDsearch_txt').value="";
		}

	}

	
	//implements clickevent location button
	function Location()
	{
		flag=2;
		var StartDate=document.getElementById('loc_SDsearch_txt').value;
		var EndDate=document.getElementById('loc_EDsearch_txt').value;
		var Location=document.getElementById('ctl00_MSO_ContentDiv_PlaceHolderMain_g_5edf6eeb_3f6d_4853_805f_3c8315dd4de9_loc_search_txt').value;
			if(Location =='')
			{
				alert('Please Enter Some Keyword For Search');
			}
			else
			{
				if(StartDate!=''){StartDate=StartDate.substring(6,10)+StartDate.substring(3,5)+StartDate.substring(0,2);}
				if(EndDate!=''){EndDate=EndDate.substring(6,10)+EndDate.substring(3,5)+EndDate.substring(0,2);}
				document.location='?StartDate='+StartDate+'&EndDate='+EndDate+'&Location='+Location+'';
			}
	}
	//implements clickevent Event location button
	function EveLocation()
	{
		flag=2;
		var Location=document.getElementById('ctl00_MSO_ContentDiv_PlaceHolderMain_g_750110a9_75ee_4f06_acad_297e87727a62_loc_search_txt').value;
			if(Location =='')
			{
				alert('Please Enter Some Keyword For Search');
			}
			else
			{
				document.location='?Location='+Location+'';
			}
	}

//implements clickevent course button
	function Course()
	{
		flag=2;

		var Course=document.getElementById('loc_Crsearch_txt').value;
		if(Course=='')
		{
			alert('Please Enter Some Keyword For Search');
		}
		else
		{
			document.location='?Course='+Course+'';
		}
	}

//implements clickevent startdate button
	function StartDate()
	{
		flag=2;

		var StartDate=document.getElementById('loc_SDsearch_txt').value;
		var EndDate=document.getElementById('loc_EDsearch_txt').value;
		var Location=document.getElementById('ctl00_MSO_ContentDiv_PlaceHolderMain_g_5edf6eeb_3f6d_4853_805f_3c8315dd4de9_loc_search_txt').value;
		if(StartDate=='')
		{
			alert('Please Choose Start Date For Searchsss');
		}
		else
		{
			if(EndDate!=''){EndDate=EndDate.substring(6,10)+EndDate.substring(3,5)+EndDate.substring(0,2);}
			document.location='?StartDate='+StartDate.substring(6,10)+StartDate.substring(3,5)+StartDate.substring(0,2)+'&EndDate='+EndDate+'&Location='+Location+'';
		}
	}

//implements clickevent enddate button
	function EndDate()
	{
		flag=2;
		var StartDate=document.getElementById('loc_SDsearch_txt').value;
		var EndDate=document.getElementById('loc_EDsearch_txt').value;
		var Location=document.getElementById('ctl00_MSO_ContentDiv_PlaceHolderMain_g_5edf6eeb_3f6d_4853_805f_3c8315dd4de9_loc_search_txt').value;
		if(EndDate=='')
		{										
			alert('Please Choose End Date For Search');
		}
		else
		{
			if(StartDate!=''){StartDate=StartDate.substring(6,10)+StartDate.substring(3,5)+StartDate.substring(0,2);}
			document.location='?StartDate='+StartDate+'&EndDate='+EndDate.substring(6,10)+EndDate.substring(3,5)+EndDate.substring(0,2)+'&Location='+Location+'';
		}
	}


	function test()
	{
		flag=2;
	}
