// JavaScript Document
/**
	############################ Code for reassigning Starts Here#################################
*/
function ShowDropDownMenu(count)
{
	if ($('popup_container').style.display == 'block')
	{
		for (passVariable = 1; passVariable <= count ; passVariable++)
		{
			$('drop_down'+passVariable).style.display = 'none';			
		}
		$('popup_container').style.display = 'none';
	}
	else
	{
		for (passVariable = 1; passVariable <= count ; passVariable++)
		{
			$('drop_down'+passVariable).style.display = 'block';
		}
		$('popup_container').style.display = 'block';
		$('err_hid_venu_id').style.visibility = 'hidden';
	}
}
function SetSelectedValue(thisVar,CategoryId,totalCount)
{
	ShowDropDownMenu(totalCount);
	$('selected_option').innerHTML = thisVar.innerHTML;
	$('hid_venu_id').value = CategoryId;
}

function changeOption(thisVar,CategoryId)
{
	thisVar.className='active_corperate_list';
	$('selected_option').innerHTML = thisVar.innerHTML;
	$('hid_venu_id').value = CategoryId;
}
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

function ShowDropDownMenuCat(count)
{
	if ($('popup_container_cat').style.display == 'block')
	{
		for (passVariable = 1; passVariable <= count ; passVariable++)
		{
			$('drop_down_cat'+passVariable).style.display = 'none';			
		}
		$('popup_container_cat').style.display = 'none';
	}
	else
	{
		for (passVariable = 1; passVariable <= count ; passVariable++)
		{
			$('drop_down_cat'+passVariable).style.display = 'block';
		}
		$('popup_container_cat').style.display = 'block';
		$('err_hid_catering_id').style.visibility = 'hidden';
	}
}
function SetSelectedValueCat(thisVar,CategoryId,totalCount)
{
	ShowDropDownMenuCat(totalCount);
	$('selected_option_cat').innerHTML = thisVar.innerHTML;
	$('hid_catering_id').value = CategoryId;
}

function changeOptionCat(thisVar,CategoryId)
{
	thisVar.className='active_corperate_list';
	$('selected_option_cat').innerHTML = thisVar.innerHTML;
	$('hid_catering_id').value = CategoryId;
}

/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

function ShowDropDownMenuTrophies(count)
{
	if ($('popup_container_Trophies').style.display == 'block')
	{
		for (passVariable = 1; passVariable <= count ; passVariable++)
		{
			$('drop_down_Trophies'+passVariable).style.display = 'none';			
		}
		$('popup_container_Trophies').style.display = 'none';
	}
	else
	{
		for (passVariable = 1; passVariable <= count ; passVariable++)
		{
			$('drop_down_Trophies'+passVariable).style.display = 'block';
		}
		$('popup_container_Trophies').style.display = 'block';
		$('err_hid_Trophies_id').style.visibility = 'hidden';
	}
}
function SetSelectedValueTrophies(thisVar,CategoryId,totalCount)
{
	ShowDropDownMenuTrophies(totalCount);
	$('selected_option_Trophies').innerHTML = thisVar.innerHTML;
	$('hid_Trophies_id').value = CategoryId;
}

function changeOptionTrophies(thisVar,CategoryId)
{
	thisVar.className='active_corperate_list';
	$('selected_option_Trophies').innerHTML = thisVar.innerHTML;
	$('hid_Trophies_id').value = CategoryId;
}
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
function ShowDropDownMenuPhotography(count)
{
	if ($('popup_container_Photography').style.display == 'block')
	{
		for (passVariable = 1; passVariable <= count ; passVariable++)
		{
			$('drop_down_Photography'+passVariable).style.display = 'none';			
		}
		$('popup_container_Photography').style.display = 'none';
	}
	else
	{
		for (passVariable = 1; passVariable <= count ; passVariable++)
		{
			$('drop_down_Photography'+passVariable).style.display = 'block';
		}
		$('popup_container_Photography').style.display = 'block';
		$('err_hid_Photography_id').style.visibility = 'hidden';
	}
}
function SetSelectedValuePhotography(thisVar,CategoryId,totalCount)
{
	ShowDropDownMenuPhotography(totalCount);
	$('selected_option_Photography').innerHTML = thisVar.innerHTML;
	$('hid_Photography_id').value = CategoryId;
}

function changeOptionPhotography(thisVar,CategoryId)
{
	thisVar.className='active_corperate_list';
	$('selected_option_Photography').innerHTML = thisVar.innerHTML;
	$('hid_Photography_id').value = CategoryId;
}
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

function ShowDropDownMenuChampagne(count)
{
	if ($('popup_container_Champagne').style.display == 'block')
	{
		for (passVariable = 1; passVariable <= count ; passVariable++)
		{
			$('drop_down_Champagne'+passVariable).style.display = 'none';			
		}
		$('popup_container_Champagne').style.display = 'none';
	}
	else
	{
		for (passVariable = 1; passVariable <= count ; passVariable++)
		{
			$('drop_down_Champagne'+passVariable).style.display = 'block';
		}
		$('popup_container_Champagne').style.display = 'block';
		$('err_hid_Champagne_id').style.visibility = 'hidden';
	}
	
}
function SetSelectedValueChampagne(thisVar,CategoryId,totalCount)
{
	ShowDropDownMenuChampagne(totalCount);
	$('selected_option_Champagne').innerHTML = thisVar.innerHTML;
	$('hid_Champagne_id').value = CategoryId;
}

function changeOptionChampagne(thisVar,CategoryId)
{
	thisVar.className='active_corperate_list';
	$('selected_option_Champagne').innerHTML = thisVar.innerHTML;
	$('hid_Champagne_id').value = CategoryId;
}

/** 
	############################ Code for drop Downs Ends Here	#################################
*/
function checkLapTiming ()
{
	if ($('hidLapTiming').value == 1)
	{
		$('laptrue').style.display 	= 'none';
		$('lapfalse').style.display = 'block';
		$('hidLapTiming').value		= 0;
	}
	else
	{
		$('lapfalse').style.display = 'none';
		$('laptrue').style.display 	= 'block';
		$('hidLapTiming').value		= 1;
	}
}

function SubmitEnquiry()
{
	if(trim($('txtCompanyName').value) == '' )
	{
		$('err_txtCompanyName').style.visibility = 'visible';
		$('txtCompanyName').style.border	  = '1px solid #FF0000';
		$('err_txtCompanyName').innerHTML  	  = '* Required field.';
		$('txtCompanyName').focus();
		return false;
	}
	else if(trim($('txtContactName').value) == '' )
	{
		$('err_txtContactName').style.visibility = 'visible';
		$('txtContactName').style.border	  = '1px solid #FF0000';
		$('err_txtContactName').innerHTML  	  = '* Required field.';
		$('txtContactName').focus();
		return false;
	}
	else if(trim($('txtEmail').value) == '' )
	{
		$('err_txtEmail').style.visibility = 'visible';
		$('txtEmail').style.border	  = '1px solid #FF0000';
		$('err_txtEmail').innerHTML  	  = '* Required field.';
		$('txtEmail').focus();
		return false;	
	}
	else if (! /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(trim($('txtEmail').value)))
	{
		$('err_txtEmail').style.visibility = 'visible';
		$('txtEmail').style.border	  = '1px solid #FF0000';
		$('err_txtEmail').innerHTML  	  = ' Enter a Valid Email .';
		$('txtEmail').focus();
		return false;
	}
	/*else if(trim($('txtTeamCount').value) == '' )
	{
		$('err_txtTeamCount').style.visibility = 'visible';
		$('txtTeamCount').style.border	  = '1px solid #FF0000';
		$('err_txtTeamCount').innerHTML  	  = '* Required field.';
		$('txtTeamCount').focus();
		return false;	
	}
	else if(isNaN(trim($('txtTeamCount').value)))
	{
		$('err_txtTeamCount').style.visibility = 'visible';
		$('txtTeamCount').style.border	  = '1px solid #FF0000';
		$('err_txtTeamCount').innerHTML  	  = ' Enter a Numeric Value .';
		$('txtTeamCount').focus();
		return false;	
	}*/
	else if(trim($('txtStreetnameandnumber').value) == '' )
	{
		$('err_txtStreetnameandnumber').style.visibility = 'visible';
		$('txtStreetnameandnumber').style.border	  = '1px solid #FF0000';
		$('err_txtStreetnameandnumber').innerHTML  	  = '* Required field.';
		$('txtStreetnameandnumber').focus();
		return false;	
	}
	/*else if(trim($('txtDriverCount').value) == '' )
	{
		$('err_txtDriverCount').style.visibility = 'visible';
		$('txtDriverCount').style.border	  = '1px solid #FF0000';
		$('err_txtDriverCount').innerHTML  	  = '* Required field.';
		$('txtDriverCount').focus();
		return false;
	}
	else if(isNaN(trim($('txtDriverCount').value)) )
	{
		$('err_txtDriverCount').style.visibility = 'visible';
		$('txtDriverCount').style.border	  = '1px solid #FF0000';
		$('err_txtDriverCount').innerHTML  	  = 'Enter a Numeric Value.';
		$('txtDriverCount').focus();
		return false;
	}*/
	else if(trim($('txtTownname').value) == '' )
	{
		$('err_txtTownname').style.visibility = 'visible';
		$('txtTownname').style.border	  = '1px solid #FF0000';
		$('err_txtTownname').innerHTML  	  = '* Required field.';
		$('txtTownname').focus();
		return false;	
	}
	else if(trim($('txtCity').value) == '' )
	{
		$('err_txtCity').style.visibility = 'visible';
		$('txtCity').style.border	  = '1px solid #FF0000';
		$('err_txtCity').innerHTML  	  = '* Required field.';
		$('txtCity').focus();
		return false;	
	}
	else if(trim($('txtPostcode').value) == '' )
	{
		$('err_txtPostcode').style.visibility = 'visible';
		$('txtPostcode').style.border	  = '1px solid #FF0000';
		$('err_txtPostcode').innerHTML  	  = '* Required field.';
		$('txtPostcode').focus();
		return false;	
	}
	else if(trim($('txtTelephonenumber').value) == '' )
	{
		$('err_txtTelephonenumber').style.visibility = 'visible';
		$('txtTelephonenumber').style.border	  = '1px solid #FF0000';
		$('err_txtTelephonenumber').innerHTML  	  = '* Required field.';
		$('txtTelephonenumber').focus();
		return false;	
	}
	else if(trim($('hid_venu_id').value) == '' )
	{
		$('err_hid_venu_id').style.visibility = 'visible';
		//$('txtDriverCount').style.border	  = '1px solid #FF0000';
		$('err_hid_venu_id').innerHTML  	  = '* Required field.';
		//$('txtDriverCount').focus();
		return false;
	}
	else if(trim($('hid_catering_id').value) == '' )
	{
		$('err_hid_catering_id').style.visibility = 'visible';
		//$('txtDriverCount').style.border	  = '1px solid #FF0000';
		$('err_hid_catering_id').innerHTML  	  = '* Required field.';
		//$('txtDriverCount').focus();
		return false;
	}
	else if(trim($('hid_Photography_id').value) == '' )
	{
		$('err_hid_Photography_id').style.visibility = 'visible';
		//$('txtDriverCount').style.border	  = '1px solid #FF0000';
		$('err_hid_Photography_id').innerHTML  	  = '* Required field.';
		//$('txtDriverCount').focus();
		return false;
	}
	/*else if(trim($('hid_Trophies_id').value) == '' )
	{
		$('err_hid_Trophies_id').style.visibility = 'visible';
		//$('txtDriverCount').style.border	  = '1px solid #FF0000';
		$('err_hid_Trophies_id').innerHTML  	  = '* Required field.';
		//$('txtDriverCount').focus();
		return false;
	}*/
	/*else if(trim($('hid_Champagne_id').value) == '' )
	{
		$('err_hid_Champagne_id').style.visibility = 'visible';
		//$('txtDriverCount').style.border	  = '1px solid #FF0000';
		$('err_hid_Champagne_id').innerHTML  	  = '* Required field.';
		//$('txtDriverCount').focus();
		return false;
	}*/
	else
	{
		thisForm.txtWhat2Do.value = 'SEND_CORPERATE_ENQUIRY';	
		thisForm.submit();
	}
}
function removerror(varthis)
{
	varthis.style.border = 'none';
	$('err_'+varthis.id).style.visibility = 'hidden';
	
}