/********openWindow() Version 3.2 02.04.2003********/

function openWindow(URL,b,h,popupname,scrollbars)
{
	var PopUpName = popupname || 'PopUp';
	var breite = b || 410;
	var hoehe = h || 450;
	var ScrollBars = scrollbars || 'no';
	var xPos = (screen.availWidth - breite) / 2
	var yPos = (screen.availHeight - hoehe ) / 2
	var fenster = window.open(URL,PopUpName,'width='+breite+',height='+hoehe+',scrollbars='+ScrollBars+',toolbar=no,menubar=no,screenX='+xPos+',screenY='+yPos+',left='+xPos+',top='+yPos)
	fenster.focus();
}

function openKontakt() {
	PopUp(root_path_country+'siteutilities/kontakt.asp','Siteutilities',589,684,'no');
}

function openImpressum() {
	PopUp(root_path_country+'siteutilities/impressum.asp','Siteutilities',589,684,'no');
}

function openDatenschutz() {
	PopUp(root_path_country+'siteutilities/datenschutz.asp','Siteutilities',589,684,'no');
}

function openNewsletter() {
	PopUp(root_path_country+'siteutilities/newsletter.asp','Siteutilities',589,684,'no');
}

function openHome() {
	window.open('http://www.laetta.de'+root_path_country);
}

function closeLayer() {
	document.getElementById('flashcontent').style.display = 'none';
}


function doLinkMeTo(destination, location) {
	location = root_path_country.toLowerCase();
	switch (location)	{
		case "/ch/fr/":
			switch (destination) {
				case 'ecard1':
					window.location.href = root_path_country+"laetta_genuss/leckere_einladungen/detail.asp?motiv=1";
					break;
				case 'ecard2':
					window.location.href = root_path_country+"laetta_genuss/leckere_einladungen/detail.asp?motiv=2";
					break;
				case 'ecard3':
					window.location.href = root_path_country+"laetta_genuss/leckere_einladungen/detail.asp?motiv=3";
					break;
				case 'code_promo':
					window.location.href = root_path_country+"laetta_aktuell/laetta_gewinnspiel/index.asp";
					break;
				case 'codepromoteilnahme':
					PopUp(root_path_country+'laetta_aktuell/laetta_gewinnspiel/teilnahmebedingungen.asp','Siteutilities',589,684,'no');
					break;
				case 'Kontakt':
					PopUp(root_path_country+'siteutilities/kontakt.asp','Siteutilities',589,684,'no');
					break;
				case 'Impressum':
					PopUp(root_path_country+'siteutilities/impressum.asp','Siteutilities',589,684,'no');
					break;
				case 'Datenschutz':
					PopUp(root_path_country+'siteutilities/datenschutz.asp','Siteutilities',589,684,'no');
					break;
				case 'produkte':
					window.location.href = root_path_country+"laetta_produkte.asp";
					break;
				case 'produkt1':
					window.location.href = root_path_country+"laetta_produkte/laetta_classic.asp";
					break;
				case 'produkt2':
					window.location.href = root_path_country+"laetta_produkte/laetta_extra_fit.asp";
					break;
				case 'duscherin':
					window.location.href = root_path_country+"laetta_aktuell/deine_tischsets.asp";
					break;
				default:
					window.location.href = root_path_country+"index.asp";
				    break;
			}
			break;
		case "/ch/de/":
			switch (destination) {
				case 'ecard1':
					window.location.href = root_path_country+"laetta_genuss/leckere_einladungen/detail.asp?motiv=1";
					break;
				case 'ecard2':
					window.location.href = root_path_country+"laetta_genuss/leckere_einladungen/detail.asp?motiv=2";
					break;
				case 'ecard3':
					window.location.href = root_path_country+"laetta_genuss/leckere_einladungen/detail.asp?motiv=3";
					break;
				case 'code_promo':
					window.location.href = root_path_country+"laetta_aktuell/laetta_gewinnspiel/index.asp";
					break;
				case 'codepromoteilnahme':
					PopUp(root_path_country+'laetta_aktuell/laetta_gewinnspiel/teilnahmebedingungen.asp','Siteutilities',589,684,'no');
					break;
				case 'Kontakt':
					PopUp(root_path_country+'siteutilities/kontakt.asp','Siteutilities',589,684,'no');
					break;
				case 'Impressum':
					PopUp(root_path_country+'siteutilities/impressum.asp','Siteutilities',589,684,'no');
					break;
				case 'Datenschutz':
					PopUp(root_path_country+'siteutilities/datenschutz.asp','Siteutilities',589,684,'no');
					break;
				case 'produkte':
					window.location.href = root_path_country+"laetta_produkte.asp";
					break;
				case 'produkt1':
					window.location.href = root_path_country+"laetta_produkte/laetta_classic.asp";
					break;
				case 'produkt2':
					window.location.href = root_path_country+"laetta_produkte/laetta_extra_fit.asp";
					break;
				case 'erlebedieneuekraft':
					window.location.href = root_path_country+"laetta_produkte.asp";
					break;
				case 'duscherin':
					window.location.href = root_path_country+"laetta_aktuell/deine_tischsets.asp";
					break;
				default:
					window.location.href = root_path_country+"index.asp";
				    break;
			}
			break;
		case "/at/":
			switch (destination) {
				case 'ecard1':
					window.location.href = root_path_country+"laetta_genuss/leckere_einladungen/detail.asp?motiv=1";
					break;
				case 'ecard2':
					window.location.href = root_path_country+"laetta_genuss/leckere_einladungen/detail.asp?motiv=2";
					break;
				case 'ecard3':
					window.location.href = root_path_country+"laetta_genuss/leckere_einladungen/detail.asp?motiv=3";
					break;
				case 'code_promo':
					window.location.href = root_path_country+"laetta_aktuell/laetta_gewinnspiel/index.asp";
					break;
				case 'codepromoteilnahme':
					PopUp(root_path_country+'laetta_aktuell/laetta_gewinnspiel/teilnahmebedingungen.asp','Siteutilities',589,684,'no');
					break;
				case 'Kontakt':
					PopUp(root_path_country+'siteutilities/kontakt.asp','Siteutilities',589,684,'no');
					break;
				case 'Impressum':
					PopUp(root_path_country+'siteutilities/impressum.asp','Siteutilities',589,684,'no');
					break;
				case 'Datenschutz':
					PopUp(root_path_country+'siteutilities/datenschutz.asp','Siteutilities',589,684,'no');
					break;
				case 'produkte':
					window.location.href = root_path_country+"laetta_produkte.asp";
					break;
				case 'produkt1':
					window.location.href = root_path_country+"laetta_produkte/laetta_classic.asp";
					break;
				case 'produkt2':
					window.location.href = root_path_country+"laetta_produkte/laetta_extra_fit.asp";
					break;
				case 'duscherin':
					window.location.href = root_path_country+"laetta_aktuell/deine_tischsets.asp";
					break;
				default:
					window.location.href = root_path_country+"index.asp";
				    break;
			}
			break;
		default :	// Default ist die deutsche Seite à la 'case "/de/":'
			switch (destination) {
				case 'Kontakt':
					PopUp(root_path_country+'siteutilities/kontakt.asp','Siteutilities',589,684,'no');
					break;
				case 'Impressum':
					PopUp(root_path_country+'siteutilities/impressum.asp','Siteutilities',589,684,'no');
					break;
				case 'ImpressumDACH':
					PopUp(root_path_country+'siteutilities/impressum.asp?promo=DACH','Siteutilities',589,684,'no');
					break;
				case 'Datenschutz':
					PopUp(root_path_country+'siteutilities/datenschutz.asp','Siteutilities',589,684,'no');
					break;
				case 'code_promo':
					window.location.href = root_path_country+"laetta_aktuell/deine_tischsets.asp";
					break;
				case 'codepromoteilnahme':
					PopUp(root_path_country+'laetta_aktuell/laetta_gewinnspiel/teilnahmebedingungen.asp','Siteutilities',589,684,'no');
					break;
				case 'Newsletter':
					PopUp(root_path_country+'siteutilities/newsletter.asp','Siteutilities',589,684,'no');
					break;
				case 'Experten':
					window.open('/experten/index.asp');
					break;
				case 'ecard1':
					window.location.href = root_path_country+"fitness_und_fun/leckere_einladungen/detail.asp?motiv=1";
					break;
				case 'ecard2':
					window.location.href = root_path_country+"fitness_und_fun/leckere_einladungen/detail.asp?motiv=2";
					break;
				case 'ecard3':
					window.location.href = root_path_country+"fitness_und_fun/leckere_einladungen/detail.asp?motiv=3";
					break;
				case 'erlebedieneuekraft':
					openWindow(root_path+'probiotik/index2.asp',1000,660,'probiotik','no');
					break;
				case 'duscherin':
					window.location.href = root_path_country+"laetta_aktuell/deine_tischsets.asp";
					break;
				case 'probiotik_microsite_produkt_probiotik':
					openWindow(root_path+'probiotik/index2.asp?scr=10',1000,660,'probiotik','no');
					break;
				case 'probiotik':
					openWindow(root_path+'probiotik/index.asp?scr=10',1000,660,'Probiotik','no');
					break;
				case 'produkte':
					window.location.href = root_path_country+"laetta_produkte.asp";
					break;
				case 'produkt1':
					window.location.href = root_path_country+"laetta_produkte/laetta_mit_joghurt.asp";
					break;
				case 'produkt2':
					window.location.href = root_path_country+"laetta_produkte/laetta_probiotik.asp";
					break;
				case 'produkt3':
					window.location.href = root_path_country+"laetta_produkte/laetta_classic.asp";
					break;
				case 'produkt4':
					window.location.href = root_path_country+"laetta_produkte/laetta_extra_fit.asp";
					break;
				case 'Rezept_1':
					openWindow(root_path_country+'art/download/Rezept_1.pdf',580,600,'Rezeptpdf','yes');
					//openWindow(root_path_country+'laetta_genuss/rezept_pdf.asp?id=8D7D0496ED216C05819D90F77770899E541F70',580,600,'Rezeptpdf','yes');
					break;	
				case 'Rezept_2':
					openWindow(root_path_country+'art/download/Rezept_2.pdf',580,600,'Rezeptpdf','yes');
					//openWindow(root_path_country+'laetta_genuss/rezept_pdf.asp?id=4F21A3E0A6E9F624D5D12A65730FA6C7541F7A',580,600,'Rezeptpdf','yes');
					break;	
				case 'Rezept_3':
					openWindow(root_path_country+'art/download/Rezept_3.pdf',580,600,'Rezeptpdf','yes');
					//openWindow(root_path_country+'laetta_genuss/rezept_pdf.asp?id=91C3B9540EC01DBB3F450DC1E7F11401541F7D',580,600,'Rezeptpdf','yes');
					break;	
				case 'Rezept_4':
					openWindow(root_path_country+'art/download/Rezept_4.pdf',580,600,'Rezeptpdf','yes');
					//openWindow(root_path_country+'laetta_genuss/rezept_pdf.asp?id=3DE03789A74F47F91F7177A47614AFAE5F',580,600,'Rezeptpdf','yes');
					break;	
				case 'Rezept_5':
					openWindow(root_path_country+'art/download/Rezept_5.pdf',580,600,'Rezeptpdf','yes');
					//openWindow(root_path_country+'laetta_genuss/rezept_pdf.asp?id=2182892F829E85C1EFDB6B3F66316DEF541979',580,600,'Rezeptpdf','yes');
					break;		
				default:
					window.location.href = root_path_country+"index.asp";
				    break;
			}
	}	
}

function PopUp(url,name,breite,hoehe,scrollbars) {
	var xPos = (screen.availWidth - breite) / 2;
	var yPos = (screen.availHeight - hoehe ) / 2;
	myWindow = window.open(url,name,"menubar=no,toolbar=no,resizeable=no,scrollbars="+scrollbars+",width="+breite+",height="+hoehe+",screenX="+xPos+",screenY="+yPos+",left="+xPos+",top="+yPos+",screenX="+xPos+",screenY="+yPos+",left="+xPos+",top="+yPos);
	
	try {
		myWindow.focus();
	}
	catch(err) {
		location.href = url;
	}
		
}

function resetMainNavi() {
	navArr = new Array("b_produkte","b_kochenallabertolli","b_mediterraneernaehrung","b_diemarkebertolli","b_interaktivnews");
	for(i=0;i<navArr.length;i++){
		if(document.images[navArr[i]])
		doImageChange(navArr[i],'lo');
	}
}


function open_p_udlGroup(countryid) {
	breite = 430;
	hoehe = 333
	var xPos = (screen.availWidth - breite) / 2;
	var yPos = (screen.availHeight - hoehe ) / 2;
	win = window.open("/" + countryid + "/popups/p_udlGroup.asp",'udlgroup','width='+breite+',height='+hoehe+',scrollbars=no,toolbar=no,menubar=no,screenX='+xPos+',screenY='+yPos+',left='+xPos+',top='+yPos)
	win.focus();
}


/********linkToOpener() Version 1.1 30.11.2006, 15:01 Uhr********/
/********linkToOpener() Version 1.0 01.09.2006, 11:11 Uhr********/

function linkToOpener(url,closepopup)
{
	try
	{
		window.opener.location.href = url;
	}
	catch(e)
	{
		window.open(url,'','location=yes,menubar=yes,personalbar=yes,scrollbars=yes,status=yes,toolbar=yes,directories=yes,resizable=yes');
	}
	if (closepopup != false)
	{
		self.close()
	}
}