
/* javascript, 2004 orange8 interactive ag */

var hTimOut;
var iimgs = new Array();
var vimgs = new Array();

function showDiv(name)
{
	hideTopNav();
	window.clearTimeout(hTimOut);
	hTimOut = window.setTimeout('hideTopNav()', 3000);

	var divToShow = document.getElementById(name);
	if(divToShow)
	{
		divToShow.style.visibility = 'visible';
		divToShow.style.display = 'block';
	}
}
function hideColors()
{
	if(document.getElementById('colors_weiss'))
		document.getElementById('colors_weiss').style.visibility = 'hidden';
	if(document.getElementById('colors_schwarz'))
		document.getElementById('colors_schwarz').style.visibility = 'hidden';
	if(document.getElementById('colors_braun'))
		document.getElementById('colors_braun').style.visibility = 'hidden';
	if(document.getElementById('colors_chrom'))
		document.getElementById('colors_chrom').style.visibility = 'hidden';
	if(document.getElementById('colors_schwarzspiegel'))
		document.getElementById('colors_schwarzspiegel').style.visibility = 'hidden';
}
function showColorDiv(name)
{	
	hideColors();
	var divToShow = document.getElementById(name);
	if(divToShow)
		divToShow.style.visibility = 'visible';
}

function hideTopNav()
{
	if(document.getElementById('topnav_home'))
		document.getElementById('topnav_home').style.visibility = 'hidden';
	if(document.getElementById('topnav_products'))
		document.getElementById('topnav_products').style.visibility = 'hidden';
	if(document.getElementById('topnav_service'))
		document.getElementById('topnav_service').style.visibility = 'hidden';
	if(document.getElementById('topnav_docs'))
		document.getElementById('topnav_docs').style.visibility = 'hidden';
	if(document.getElementById('topnav_company'))
		document.getElementById('topnav_company').style.visibility = 'hidden';
	if(document.getElementById('topnav_de'))
		document.getElementById('topnav_de').style.visibility = 'hidden';
	if(document.getElementById('topnav_fr'))
		document.getElementById('topnav_fr').style.visibility = 'hidden';
	if(document.getElementById('topnav_it'))
		document.getElementById('topnav_it').style.visibility = 'hidden';
	if(document.getElementById('topnav_partner'))
		document.getElementById('topnav_partner').style.visibility = 'hidden';
	if(document.getElementById('topnav_notepad'))
		document.getElementById('topnav_notepad').style.visibility = 'hidden';
	if(document.getElementById('topnav_productsearch'))
		document.getElementById('topnav_productsearch').style.visibility = 'hidden';
	if(document.getElementById('topnav_webshop'))
		document.getElementById('topnav_webshop').style.visibility = 'hidden';

	if(document.getElementById('topnav_news'))
		document.getElementById('topnav_news').style.visibility = 'hidden';
	if(document.getElementById('topnav_orders'))
		document.getElementById('topnav_orders').style.visibility = 'hidden';
	if(document.getElementById('topnav_support'))
		document.getElementById('topnav_support').style.visibility = 'hidden';
	if(document.getElementById('topnav_study'))
		document.getElementById('topnav_study').style.visibility = 'hidden';
	if(document.getElementById('topnav_userprofile'))
		document.getElementById('topnav_userprofile').style.visibility = 'hidden';

	if(document.getElementById('topnav_ext'))
		document.getElementById('topnav_ext').style.display = 'none';
	if(document.getElementById('topnav_elu'))
		document.getElementById('topnav_elu').style.display = 'none';
	if(document.getElementById('topnav_aeg'))
		document.getElementById('topnav_aeg').style.display = 'none';
	if(document.getElementById('topnav_zan'))
		document.getElementById('topnav_zan').style.display = 'none';
	if(document.getElementById('topnav_logout'))
		document.getElementById('topnav_logout').style.display = 'none';

	if(document.getElementById('gaf_husqvarna'))
		document.getElementById('gaf_husqvarna').style.visibility = 'hidden';
	if(document.getElementById('gaf_jonsered'))
		document.getElementById('gaf_jonsered').style.visibility = 'hidden';
	if(document.getElementById('gaf_aspen'))
		document.getElementById('gaf_aspen').style.visibility = 'hidden';
	if(document.getElementById('gaf_partner'))
		document.getElementById('gaf_partner').style.visibility = 'hidden';
	if(document.getElementById('gaf_mcculloch'))
		document.getElementById('gaf_mcculloch').style.visibility = 'hidden';
	if(document.getElementById('gaf_flymo'))
		document.getElementById('gaf_flymo').style.visibility = 'hidden';
	if(document.getElementById('gaf_automower'))
		document.getElementById('gaf_automower').style.visibility = 'hidden';
}

function openwnd(fil, width, height)
{
	openWnd(fil, width, height);
}

function openWnd(fil, width, height)
{
	var wnd = window.open(fil,'popup','left='+((screen.availWidth-width)/2)+',top='+((screen.availHeight-height)/2)+',width='+width+',height='+height+',directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes');
	if(wnd!=null) wnd.focus();
}

function openAcrobat()
{
	openWnd('http://www.adobe.com/products/acrobat/readstep2.html', 800, 600);
}

function openElectroluxGroup()
{
	openWnd('http://www.electrolux.com', 1000, 750);
}

function openB2CProcorner()
{
	window.open('http://procorner.electrolux.com/brand_e50/login/login_CHE.htm', 'procorner', 'height=400,width=475,left=300,top=300,status=yes');
}
function openB2CProcornerFR()
{
	window.open('http://procorner.electrolux.com/brand_e50/login/login_CHE_FR.htm', 'procorner', 'height=400,width=475,left=300,top=300,status=yes');
}
function openB2CProcornerIT()
{
	window.open('http://procorner.electrolux.com/brand_e50/login/login_CHE_IT.htm', 'procorner', 'height=400,width=475,left=300,top=300,status=yes');
}

function openB2CProcornerAT()
{
	window.open('http://procorner.electrolux.com/brand_e50/login/login_CHE_AEG.htm', 'procorner', 'height=400,width=475,left=300,top=300,status=yes');
}
function openB2CProcornerATFR()
{
	window.open('http://procorner.electrolux.com/brand_e50/login/login_CHE_AEG_FR.htm', 'procorner', 'height=400,width=475,left=300,top=300,status=yes');
}
function openB2CProcornerATIT()
{
	window.open('http://procorner.electrolux.com/brand_e50/login/login_CHE_AEG_IT.htm', 'procorner', 'height=400,width=475,left=300,top=300,status=yes');
}

function openTrilobiteWnd(fil, width, height)
{
	var wnd = window.open(fil,'popup','left='+((screen.availWidth-width)/2)+',top='+((screen.availHeight-height)/2)+',width='+width+',height='+height+',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes');
	if(wnd!=null) wnd.focus();
}

function openPrintWnd(fil, width, height)
{
	var wnd = window.open(fil,'print','left='+((screen.availWidth-width)/2)+',top='+((screen.availHeight-height)/2)+',width='+width+',height='+height+',directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes');
	if(wnd!=null) wnd.focus();
}

function OpenWindow(fil, width, height)
{
	var wnd = window.open(fil,'hotlinkPopup','left='+((screen.availWidth-width)/2)+',top='+((screen.availHeight-height)/2)+',width='+width+',height='+height+',directories=no,location=no,menubar=no,scrollbars=yes,status=yes,toolbar=no,resizable=yes');
	if(wnd!=null) wnd.focus();
}

function OpenWindowFlash(fil, width, height)
{
	var wnd = window.open(fil,'hotlinkPopup','left='+((screen.availWidth-width)/2)+',top='+((screen.availHeight-height)/2)+',width='+width+',height='+height+',directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,titlebar=no');
	if(wnd!=null) wnd.focus();
}

function checkProductSearch()
{
	var pageUrl = document.location.href;

	// login
	if(document.getElementById('ctl01_tbxUsername')!=null && document.getElementById('ctl01_tbxPassword')!=null)
		__doPostBack('ctl01$lnkBtnSubmit','');
		
	if(document.getElementById('ctl02_btnLogin')!=null)
		return true;
		
	//ProductConsultant	
	if(document.getElementById('ctl02_lbtnCompare')!=null)
		__doPostBack('ctl02$lbtnCompare','');

	/* search from header */	
	if(document.getElementById('productsearchinput')!=null) {
		if(document.getElementById('productsearchinput').value.toLowerCase()!='')
			__doPostBack('Topmenu1$ctl02$lnkBtnDoSearch','');
	}

	/* search from header (extranet) */	
	if(document.getElementById('productsearchinputext')!=null) {
		if(document.getElementById('productsearchinputext').value.toLowerCase()!='')
			__doPostBack('ExtranetLabels1','dosearch');
	}

	/* search page */	
	if(pageUrl.indexOf('products.productsearch')>-1) {
		if(document.getElementById('ctl01_tbxQuery').value.toLowerCase()!='')
			__doPostBack('ctl01$lnkBtnSubmit','');
	}

	/* search page (extranet) */	
	if(pageUrl.indexOf('partner.productsearch')>-1) {
		if(document.getElementById('ctl01_tbxQuery').value.toLowerCase()!='')
			__doPostBack('ctl01$lnkBtnSubmit','');
	}

	//return false;
	return true;
}
/* new */
/*$(function(){
	var debug = false;
	debugThis = function(str){
		if(debug){
			$("#debug").prepend(str+"<br/>");
		}
	}
	if(debug){		
		$("#content").append("<pre id='debug'></pre>");
	}
	
	var menu = $("#homenav");
	menu.closeTimer = false; 
	
	var showMenu = function(){
		menu.show();
		clearCloseout();
		$("#zonenav .zones li:first").addClass("active");
		
		debugThis("menu show");
	}
	var hideMenu = function(){
		menu.hide();
		clearCloseout();
		$("#zonenav .zones li:first").removeClass("active");
		closeSubmenus(menu.find("ul ul li"));
		
		debugThis("menu hide");
	}
	var setCloseOut = function(){
		clearCloseout();
		menu.closeTimer = window.setTimeout(function(){
			hideMenu();			
		}, 1000);
		
		debugThis("set closeout");
	}
	var clearCloseout = function(){
		window.clearTimeout(menu.closeTimer);
		
		debugThis("clear closeout");
	}
	var openSubmenu = function(elem){
		$(elem).next().show();
	}
	var closeSubmenus = function(elem){
		$(elem).find("ul").hide();
	}
	
	$("#zonenav .zones a:first")
		.click(function(event){
			event.preventDefault();
			if($("#homenav").css("display") == "none"){
				showMenu();
			}
			else{
				hideMenu();
			}
		})
		.mouseout(setCloseOut)
		.mouseover(clearCloseout);
		
	menu
		.mouseover(clearCloseout)
		.mouseout(setCloseOut)
		.find("ul ul li a")
			.mouseover(function(event){
				event.stopPropagation();
				closeSubmenus($(this).parent().parent());
				openSubmenu(this);
				clearCloseout();
			});	
			
	menu
		.find(":first-child").children()
		.mouseover(function(){
			closeSubmenus($(this).parent().find("ul"));
		});	
});
*/

