
var menuSel = 0;
var themenSel = 0;
var themenSel2 = 0;
var projekteSel = 0;

var navi_img = new Array('','referenz','logo','kontakt','impressum');
var themen_img = new Array('','arbeit','messe','nacht','farbe','kinder','alter','produkt','gestaltung','wand');
var themen_img2 = new Array('','produkt_design','interior_design','lichtplanung','arbeitsweise','kompetenz','ziel','team');

var img_width = new Array();
img_width["1-1"] = 3363;
img_width["1-2"] = 5029;
img_width["1-3"] = 4013;
img_width["1-4"] = 3892;
img_width["1-5"] = 2083;
img_width["1-6"] = 3021;
img_width["1-7"] = 2882;

img_width["2-1"] = 5318;
img_width["2-2"] = 1080;
img_width["2-3"] = 3651;
img_width["2-4"] = 1911;

img_width["3-1"] = 4463;
img_width["3-2"] = 2762;
img_width["3-3"] = 2234;
img_width["3-4"] = 2809;

img_width["4-1"] = 5165;

img_width["5-1"] = 2849;
img_width["5-2"] = 2268;

img_width["6-1"] = 5666;
img_width["6-2"] = 4058;
img_width["6-3"] = 3912;
img_width["6-4"] = 2535;

img_width["7-1"] = 4438;
img_width["7-2"] = 4480;
img_width["7-3"] = 1754;
img_width["7-4"] = 900;
img_width["7-5"] = 900;

img_width["7-6"] = 2542;
img_width["7-7"] = 10013;

img_width["8-1"] = 6608;
img_width["8-2"] = 15857;

img_width["9-1"] = 2965;
img_width["9-2"] = 2451;
img_width["9-3"] = 4506;

var img_width2 = new Array();
img_width2["1"] = 900;
img_width2["2"] = 900;
img_width2["3"] = 900;
img_width2["4"] = 900;
img_width2["5"] = 900;
img_width2["6"] = 900;
img_width2["7"] = 900;



var	pnimg = new Array('','../bilder/eins.png','../bilder/zwei.png','../bilder/drei.png','../bilder/vier.png','../bilder/fuenf.png','../bilder/sechs.png','../bilder/sieben.png');
var	poimg = new Array('','../bilder/eins_over.png','../bilder/zwei_over.png','../bilder/drei_over.png','../bilder/vier_over.png','../bilder/fuenf_over.png','../bilder/sechs_over.png','../bilder/sieben_over.png');

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function naviOver(n) {
	if (menuSel != n) {
		newimg = navi_img[n];
		newsrc = "../bilder/navi_" + newimg + "_over.gif";
		$("#" + newimg).attr('src', newsrc);
	}
}

function naviOut(n) {
	if (menuSel != n) {
		newimg = navi_img[n];
		newsrc = "../bilder/navi_" + newimg + ".gif";
		$("#" + newimg).attr('src', newsrc);
	}
}

function naviAktiviere(n) {
	if (menuSel != 0) {
		oldimg = navi_img[menuSel];
		oldsrc = "../bilder/navi_" + oldimg + ".gif";
		$("#" + oldimg).attr('src', oldsrc);
	}
	
	menuSel = n;
	themenSel = 0;

	newimg = navi_img[menuSel];
	newsrc = "../bilder/navi_" + newimg + "_over.gif";
	$("#" + newimg).attr('src', newsrc);
	
  $("#bilderleiste").height(305);      $("#bilder").attr("height", 300);
}

function startReferenzen() {
	naviAktiviere(1);
	$("#contentarea").hide();
	$("#firma").hide();

	$("#themenmenu").show();
	$("#referenzen").show();
	$("#projektbeschreibung").show();	

	
	projekteAuflisten(1,7); 
}

function startFirma() {
	naviAktiviere(2);

	$("#contentarea").hide();
	$("#referenzen").hide();	
	$("#projektbeschreibung").hide();	
	 
	$("#firma").show();
	
	themenAktiviere2(1);
}

function startKontakt() {
	naviAktiviere(3);
	$("#referenzen").hide(); 
	$("#firma").hide();

	$("#contentarea").load("kontakt.html"); 
	$("#contentarea").show(); 
}

function startImpressum() {
	naviAktiviere(4);
	$("#referenzen").hide(); 
	$("#firma").hide();

	$("#contentarea").load("impressum.html");
	$("#contentarea").show(); 
}


function themenOver(n) {
	if (themenSel != n) {
		newimg = themen_img[n];
		newsrc = "../bilder/navi2_" + newimg + "_over.gif";
		$("#" + newimg).attr('src', newsrc);
	}
}

function themenOut(n) {
	if (themenSel != n) {
		newimg = themen_img[n];
		newsrc = "../bilder/navi2_" + newimg + ".gif";
		$("#" + newimg).attr('src', newsrc);
	}
}

function themenAktiviere(n) {
	if (themenSel != 0) {
		oldimg = themen_img[themenSel];
		oldsrc = "../bilder/navi2_" + oldimg + ".gif";
		$("#" + oldimg).attr('src', oldsrc);
	}
	
	themenSel = n;
	projekteSel = 1;

	newimg = themen_img[themenSel];
	newsrc = "../bilder/navi2_" + newimg + "_over.gif";
	$("#" + newimg).attr('src', newsrc);
}



function themenOver2(n) {
	if (themenSel2 != n) {
		newimg = themen_img2[n];
		newsrc = "../bilder/UN_" + newimg + "_over.png";
		$("#" + newimg).attr('src', newsrc);
	}
}

function themenOut2(n) {
	if (themenSel2 != n) {
		newimg = themen_img2[n];
		newsrc = "../bilder/UN_" + newimg + ".png";
		$("#" + newimg).attr('src', newsrc);
	}
}

function themenAktiviere2(n) {
	if (n != 5) {
		$("#refLink").hide(); 		
	} else {
		$("#refLink").show();
	} 			

	if (themenSel2 != 0) {
		oldimg = themen_img2[themenSel2];
		oldsrc = "../bilder/UN_" + oldimg + ".png";
		$("#" + oldimg).attr('src', oldsrc);
	}
	
	themenSel2 = n;

	newimg = themen_img2[themenSel2];
	newsrc = "../bilder/UN_" + newimg + "_over.png";
	$("#" + newimg).attr('src', newsrc);


	blimg = '../bilder/UBL_' + n + '.jpg';
	
	$("#bilder2").attr("src", blimg);
	$("#bilder2").attr("width", img_width2[n]);
}

function popupAufrufenAVC(url) {
	window.open(url,'',"width=1000,height=700,status=no,toolbar=no,menubar=no");
}

function popupAufrufenREF(url) {
	window.open(url,'',"width=1000,height=700,status=no,toolbar=no,menubar=no");
}

function mailerAufrufen(mailAdresse) {
	location.href = mailAdresse;
}


function projekteAuflisten(projNum,projAnzahl,bildBreite) {
	themenAktiviere(projNum);

	$("#projektmenu").empty();
	
	$("#projektmenu").html("<div class='projLinkIntro'> <img alt='Projekt' height='21' src='../bilder/projekt.png' width='54' /> </div>");
	
	for(var cnt=1; cnt <= 7; cnt++)
	{
		pid = "pro" + cnt;
		pnum = projNum + "-" + cnt;
		
		if(cnt <= projAnzahl)
		{
			$("#projektmenu").append("<div class='projLink' onmouseout=\"proOut('" + cnt + "')\" onclick=\"zeigePro('" + pnum + "', '" + cnt + "')\" onmouseover=\"proOver('" + cnt + "')\"> <img alt='" + cnt + "' id='" + pid + "' name='" + pid + "' cellpadding='0' cellspacing='0' height='21' border='0' align='bottom' src='" + pnimg[cnt] + "'  /> </div>");
		}
	}
	zeigePro(projNum + "-1",1);	
}


function proOver(n) {
	if (projekteSel != n) {
		newimg = "pro" + n;
		newsrc = poimg[n];
		$("#" + newimg).attr('src', newsrc);
	}
}

function proOut(n) {
	if (projekteSel != n) {
		newimg = "pro" + n;
		newsrc = pnimg[n];
		$("#" + newimg).attr('src', newsrc);
	}
}

function proAktiviere(n) {
	if (projekteSel != 0) {
		oldimg = "pro" + projekteSel;
		oldsrc = pnimg[projekteSel];
		$("#" + oldimg).attr('src', oldsrc);
	}
	
	projekteSel = n;

	newimg = "pro" + projekteSel;
	newsrc = poimg[projekteSel];
	$("#" + newimg).attr('src', newsrc);
}


function zeigePro(pnum,n) {
	proAktiviere(n);
	
	blimg = '../bilder/BL_' + pnum + '.jpg';
	pbhtml = 'PB_' + pnum + '.html';
	
	$("#bilder").attr("src", blimg);
	$("#bilder").attr("width", img_width[pnum]);

	CSBfleXcroll('bilderleiste');	
	
	$("#bilderleiste_hscrollerbar").css('left','0');
	$("#bilderleiste_contentwrapper").css('left','0');
	
	$("#projektbeschreibung").empty();
	$("#projektbeschreibung").load(pbhtml);
}
