var genreContemporary = true;
var genreJazz = true;
var genreSpecial = true;
var genreQuery = "";
var genreHTML = "";
	
//------------------------------------------------------------------------------------------------------

function reset_menu()
	{
	if (document.getElementsByTagName)
		{
		var allTD = document.getElementsByTagName("TD");
		for (i=0; i<allTD.length; i++) allTD[i].style.backgroundColor = 'transparent';
		var allLinks = document.getElementsByTagName("A");
		for (i=0; i<allLinks.length; i++) allLinks[i].style.color = 'rgb(255,255,255)';
		}
	}
	
//------------------------------------------------------------------------------------------------------

function hi (ident)
	{
	ident.src = ident.src.replace(/low/, "high");
	}
	
//------------------------------------------------------------------------------------------------------

function lo (ident)
	{
	ident.src = ident.src.replace(/high/, "low");
	}
	
//------------------------------------------------------------------------------------------------------

function update_genre()
	{
	genreContemporary = document.getElementById("checkboxContemporary").checked;
	genreJazz = document.getElementById("checkboxJazz").checked;
	genreSpecial = document.getElementById("checkboxSpecial").checked;
	if (!genreContemporary && !genreJazz && !genreSpecial)
		{
		document.getElementById("checkboxContemporary").checked = true;
		document.getElementById("checkboxJazz").checked = true;
		document.getElementById("checkboxSpecial").checked = true;
		genreContemporary = true;
		genreJazz = true;
		genreSpecial = true;
		}
	genreQuery = "";
	genreHTML = "";
	if (!(genreContemporary && genreJazz && genreSpecial))
		{
		if (genreContemporary)
			{
			genreQuery = " katZeit";
			genreHTML = " &amp; CONTEMPORARY";
			}
		if (genreJazz)
			{
			genreQuery += " katJazz";
			genreHTML += " &amp; JAZZ";
			}
		if (genreSpecial)
			{
			genreQuery += " katKlassik";
			genreHTML += " &amp; CLASSICS";
			}
		genreQuery = "&equals['" + genreQuery.substring(1) + "','yes']";
		genreHTML = genreHTML.substring(7);
		}
	update_content();
	}	
	
//------------------------------------------------------------------------------------------------------

function go_home()
	{
	var newLoc = locHome;
	newLoc += "&querySearch=equals%5B%27showWeb%27%2C%27yes%27%5D"+escape(genreQuery);
	parent.contentframe.location.href = newLoc;
	}
	
//------------------------------------------------------------------------------------------------------

function open_catalog()
	{
	var newLoc = locCatalog;
	newLoc += "&queryType=archive";
	newLoc += "&querySort=abc";
	newLoc += "&queryText=nachname";
	newLoc += "&catCategory=all";
	newLoc += "&catSort=composers";
	newLoc += "&catSearch=";
	newLoc += "&querySearch=equals%5B%27showWeb%27%2C%27yes%27%5D"+escape(genreQuery);
	parent.contentframe.location.href = newLoc;
	}
	
//------------------------------------------------------------------------------------------------------

function show_artists()
	{
	var newLoc = locArtists;
	newLoc += "&queryType=archive";
	newLoc += "&querySort=abc";
	newLoc += "&queryText=sortname";
	newLoc += "&catSort=sortname";
	newLoc += "&catSearch=&navInit=1";
	newLoc += "&querySearch=equals%5B%5C%5C%5C%27showWeb%5C%5C%5C%27%2C%5C%5C%5C%27yes%5C%5C%5C%27%5D"+escape(genreQuery);
	parent.contentframe.location.href = newLoc;
	}
	
//------------------------------------------------------------------------------------------------------

function open_newsarchive(language)
	{
	var newLoc = locNewsArchive;
	var letter = "E";
	if (thisLang == "german") letter = "D";
	else if (thisLang == "french") letter = "F";
	else if (thisLang == "italian") letter = "I";
	else if (thisLang == "spanish") letter = "S";
	newLoc += "&querySort=newfirst";
	newLoc += "&catSort=newfirst";
	newLoc += "&catSearch=";
	newLoc += "&querySearch=equals%5B%27show" + letter + "%27%2C%27yes%27%5D";
	parent.contentframe.location.href = newLoc;
	}
	
//------------------------------------------------------------------------------------------------------

function update_content()
	{
	if (self == parent) return;
	if (!parent.contentframe) return;
	if (!parent.contentframe.location) return;
	var currLoc = parent.contentframe.location.href;
	if (currLoc.indexOf("template="+thisLang+"-home") != -1) go_home();
	else if (currLoc.indexOf("template="+thisLang+"-catalog") != -1) open_catalog();
	else if (currLoc.indexOf("template="+thisLang+"-artists") != -1) show_artists();
	}
			
//------------------------------------------------------------------------------------------------------

function update_cartlogo()
	{
	if (parent == self) return;
	if (!parent.headerframe) return;
	if (!parent.hiddenframe) return;
	if (!parent.headerframe.document) return;
	if (!parent.hiddenframe.document) return;
	if (parent.hiddenframe.cartItems > 0) parent.headerframe.document.getElementById("cart").style.display = "inline";
	else parent.headerframe.document.getElementById("cart").style.display = "none";
	} 
