
FirstNavImg = 6;
NavImgCount = 10;

var bild = new Array();

bild[0] = new Image();
bild[0].src = "img/buttons/home_on.gif";

bild[1] = new Image();
bild[1].src = "img/buttons/vita_on.gif";

bild[2] = new Image();
bild[2].src = "img/buttons/news_on.gif";

bild[3] = new Image();
bild[3].src = "img/buttons/kinotv_e_on.gif";

bild[4] = new Image();
bild[4].src = "img/buttons/theater_e_on.gif";

bild[5] = new Image();
bild[5].src = "img/buttons/galerie_e_on.gif";

bild[6] = new Image();
bild[6].src = "img/buttons/video_on.gif";

bild[7] = new Image();
bild[7].src = "img/buttons/presse_e_on.gif";

bild[8] = new Image();
bild[8].src = "img/buttons/kontakt_e_on.gif";

for (c=0; c < document.images.length; c++) {
	document.images[c].selected=false;
}

function GetImageByName(imgName)
{
	c=0;
	for (c=FirstNavImg; c < FirstNavImg+NavImgCount; c++)
		{
			if (document.images[c].name == imgName)
				return document.images[c];
		}
		
	return "cw";
}				

function doOn(imgName)
        {
			GetImageByName(imgName).src = "img/buttons/" + imgName + "_on.gif";
        }

function doOff(imgName)
        {
			if (!GetImageByName(imgName).selected)
				GetImageByName(imgName).src = "img/buttons/" + imgName + "_off.gif";
        }

function doClick(imgName)
       {
			parent.image.document.images['vis'].src="img/visuals/vis_"+imgName+".jpg";
			
			for (c=FirstNavImg; c < FirstNavImg+NavImgCount; c++)
				if (document.images[c].name != imgName)
				{
					document.images[c].selected=false;
					doOff(document.images[c].name);
				}
  			GetImageByName(imgName).selected=true;
			doOn(imgName);
		}

function switchLangE() { 
	parent.footer.document.images['lange'].src="img/buttons/englisch_on.gif";
	parent.footer.document.images['langd'].src="img/buttons/deutsch_off.gif";
	parent.content.location.href="home.html";
}

function switchLangD() { 
	parent.footer.document.images['lange'].src="img/buttons/englisch_off.gif";
	parent.footer.document.images['langd'].src="img/buttons/deutsch_on.gif";
	parent.content.location.href="home.html";
}


var newWin;

function cwpopup(page,width,height) {
	
	if (newWin && newWin.closed!=true) newWin.close();
	
	var posx = (screen.width/2) - (width/2);		
	var posy = (screen.height/2) - (height/2);
		
	 var propsZ=(document.all||document.getElementById)?('top=' + posy + ',left=' + posx):('screenX=' + posx + ',screenY=' + posy);
	
	props = 'width=' + width + ',height=' + height + ',' + propsZ + ',marginwidth=0,marginheight=0,resizable=no,scrollbars=1,status=0,toolbar=0,menubar=0,location=0';
	newWin = window.open('','pop',props);
	newWin.location.href = page;
}
