function lightdiv(mydiv)
{
	// This function is going to change the css class associated  to this div, to highlight the fact that it is being hovered over
	
	// Get the divs in question
	var div = document.getElementById(mydiv);	
	var ldiv = document.getElementById('l' + mydiv);
	var rdiv = document.getElementById('r' + mydiv);
	
	// See what class they are at the moment, and change them accordingly
	if( div.className == "menutabs")
	{
		div.className = "hoveredmenutabs";
	}
	
	if( ldiv.className == "leftspacer")
	{
		ldiv.className = "hoveredleftspacer";
	}
	
	if( rdiv.className == "rightspacer")
	{
		rdiv.className = "hoveredrightspacer";
	}
}

function unlightdiv(mydiv)
{
	// This function is going to change the css class associated  to this div, to highlight the fact that it is being hovered over
	
	// Get the divs in question
	var div = document.getElementById(mydiv);	
	var ldiv = document.getElementById('l' + mydiv);
	var rdiv = document.getElementById('r' + mydiv);
	
	// See what class they are at the moment, and change them accordingly
	if( div.className == "hoveredmenutabs")
	{
		div.className = "menutabs";
	}
	
	if( ldiv.className == "hoveredleftspacer")
	{
		ldiv.className = "leftspacer";
	}
	
	if( rdiv.className == "hoveredrightspacer")
	{
		rdiv.className = "rightspacer";
	}
}

function togglenavbar()
{	
	var div = document.getElementById('navbarmenu');	
	div.style.display = 'block';
}

function checkdate()
{
	if(window.event.keyCode == 47) return true;	// slash symbol
	if(window.event.keyCode < 48 || window.event.keyCode > 57)
	{
      		return false;
	}

	return true;	
}

function checkfigure()
{
	if(window.event.keyCode == 46) return true;	// Return key
	if(window.event.keyCode == 45) return true;	// Minus symbol
	if(window.event.keyCode == 37) return true;	// Percentage symbol
	if(window.event.keyCode < 48 || window.event.keyCode > 57)
	{
      		return false;
	}

	return true;
}

function checkint()
{
	if(window.event.keyCode == 46) return true;
	if(window.event.keyCode < 48 || window.event.keyCode > 57)
	{
      		return false;
	}

	return true;
}

function checkvaliddate(vdate, des)
{	
	// setting up array pattern for date checking...
	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})\2(\d{1,4})$/;	
		
	//checking to see if date entered matches formating array...
	
	var matchArray = vdate.match(datePat);
	if (matchArray == null) 
	{
		alert(des + " is NOT in a valid format");
		return false;
	}
		
	//split date string in to its components	
	month = matchArray[3];// parse date into variables
	day = matchArray[1]; 
	year = matchArray[4];

	//verify day component....
	if (day < 1 || day > 31) 
	{
		alert(des + " - Day must be between 1 and 31.");
		return false;
	}
						
	//verify month component.....
	if (month < 1 || month > 12) 
	{
		alert(des + " - Month must be between 1 and 12.");
		return false;
	}
		
	//verify month component has correct number of days in the month selected....
	if ((month==4 || month==6 || month==9 || month==11) && day==31) 
	{
		alert(des + " - Month "+month+" doesn't have 31 days!");
		return false;
	}

	//leap year checks
	if (month == 2) 
	{ 
		//checking year component for leap year	
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
			
		//verifying days for feb as and when leap year occurrs
		if (day>29 || (day==29 && !isleap)) 
		{
			alert(des + " - February " + year + " doesn't have " + day + " days!");
			return false;
		}
	}
	
	// if dates ok then return true...
	return true;		

}//end of verification of date....

function addbookmark(){
if (document.all)
  window.external.AddFavorite(location.href, document.title);
else if (window.sidebar)
  window.sidebar.addPanel(document.title, location.href, '')
}

function show_div(id)
{
  document.getElementById(id).style.display='block';
}

function hide_div(id)
{
  document.getElementById(id).style.display='none';
}

function ct()
{
  Tip('To compare products tick up to five boxes and click Compare to view side by side');
}

function nct()
{
  UnTip();
}
