$(function() {
	setupMenu();
	$("#menuhide").css({height:$('ul#products-menu').innerHeight() - 10 + 'px'});
});
/******************************/
function setupMenu() {
	$('div#menu ul li').hover(function() {
		$('ul#' + $(this).attr('id') + '-menu').show();
		if($(this).attr('id') == "products") $('#menuhide').show();
	}, function() {
		if($(this).attr('id') == "products") $('#menuhide').hide();
		$('ul#' + $(this).attr('id') + '-menu').hide();
	});
	$('div#submenus ul').hover(function() { 
		$(this).show(); 
		thisid = $(this).attr('id');
		parentid = thisid.substring(0,(thisid.length-5));
		$("#"+parentid+" a").addClass('selected');
		if(parentid == "products") $('#menuhide').show();
	}, function() { 
		$(this).hide(); 
		if(parentid == "products") $('#menuhide').hide();
		$("#"+parentid+" a").removeClass('selected');
	});
	$('div#submenus ul ul').hover(function() { $(this).show(); }, function() { $(this).show(); });	
}

/*
$(document).ready(function(){
	if(typeof sIFR == "function"){
		sIFR.replaceElement(named({sSelector:"body.en h1", sFlashSrc:base+"HelveticaNeue.swf", sColor:"#003366", sLinkColor:"#003366", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0,sWmode:"transparent"}));
	};
});
*/

function toggleSelected(el){
	alert(el);
}

function clearSearch(el){
	if(el.value == 'Search'){
		el.value = '';	
	}
}

function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

function goTo(url) {
	window.location = url;
}
