urls=[];
urls[0]=["home"];
urls[1]=["leistungen_1", "leistungen_2", "leistungen_3", "leistungen_4", "leistungen_5", "leistungen_6"];
urls[2]=["projekte_1", "projekte_2", "projekte_3", "projekte_4", "projekte_5", "projekte_6", "projekte_7", "projekte_8"];
urls[3]=["awards"];
urls[4]=["kontakt"];
//
loaded=false;
bildstreifen=[
["01-home.png"], 
["02-LeistungenInt.png", "021-LeistungenKonz.png", "022-Leistungen-Illust.png", "023-LeistungenLernS.png", "024-LeistungenCDRom.png", "025-LeistungenWeb.png"], 
["03-ProjekteInt.png", "031-Projekte-OkayStart.png", "032-Projekte-OkayGo-on.png", "033-Projekte-Max.png", "034-Projekte-Lilli.png", "035-ProjekteSounds.png", "036-ProjekteWebCoach.png", "037-ProjekteIdeeKis.png"], 
["04-Awards.png"], 
["05-Kontakt.png"]
];
has_flash=false;
flash_connected=false;
c_normal="#1b3a25";
c_hover="#b10000";
lang=-1;
langfolders=["de", "en"];
menutexts=[];
menutexts[0]=["home", "leistungen", "projekte", "awards", "kontakt"];
menutexts[1]=["home", "offers", "projects", "awards", "contact"];
my_num=1;
page_num=5;
sub_num=1;
abspath="";
document.onmouseup=function(){
	for(i=0; i<document.links.length; i++){
		document.links[i].blur();
	}
}
var ie=false;
var ieVersion=-1;
function pic_loaded(img){
	if(img.src.indexOf("blind.gif")==img.src.length-9){
		return;
	}
	img.parentNode.style.top=754+38-img.offsetHeight;
	id("black_bottom").style.top=750;
	call_flash();
	if(ie&&ieVersion>=5.5&&ieVersion<7){
		check_transparent_pngs();
	}
}
function geladen(){
	if(navigator.plugins.length==0){
		ie=true;
		ieVersion=parseFloat(navigator.appVersion.split("MSIE ")[1]);
	}
	loaded=true;
	abspath=document.location.href.substring(0, document.location.href.lastIndexOf("/")+1);

	win_resize();
	id("main_content").style.visibility="visible";
	setLang(0);
	setHighlight();
	flag_out(1);
	if(ie&&ieVersion>=5.5&&ieVersion<7){
		check_transparent_pngs();
	}
}
function win_resize(){
	var w, h, x, y;
	if(window.innerWidth){
		w=window.innerWidth;
		h=window.innerHeight;
	}else{
		w=document.body.offsetWidth-6;
		h=document.body.offsetHeight-6;
	}
	x=Math.round((w-1000)/2);
	if(x<0)x=0;
	id("main_content").style.left=x;
}
function m_over(num){
	id("a_"+num).style.color=c_hover;
}
function m_out(num){
	if(num!=my_num)id("a_"+num).style.color=c_normal;
}
function setHighlight(){
	for(i=1; i<=page_num; i++){
		if(i==my_num)id("a_"+i).style.color=c_hover;
		else id("a_"+i).style.color=c_normal;
	}
}

function GoToPage(num){
	m_click(num, 1);
}
function GoToSubpage(num){
	m_click(my_num, num);
}
function m_click(num, subnum){
	my_num=num;
	sub_num=subnum;
	setHighlight();
	setPage(my_num, sub_num);
	var tmp_url=abspath+langfolders[lang]+"/"+(urls[my_num-1][sub_num-1])+".html";
	window.frames["ifr"].document.location.href=tmp_url;
}
function black_link(n1, n2){
	m_click(n1, n2);
}
//
function setPage(num, subnum){
	id("bildstreifen").src="pics/Bildstreifenunten/"+bildstreifen[num-1][subnum-1];
}
//
function check_transparent_pngs(){
	for(i=0; i<document.images.length; i++){
		if(document.images[i].className.toLowerCase()=="transe"){
			var tmp_src=document.images[i].src;
			document.images[i].src="pics/blind.gif";
			document.images[i].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+tmp_src+"');";
		}
	}
}
function id(s){
	return document.getElementById(s);
}
function tags(s){
	return document.getElementsByTagName(s);
}
function setLang(num){
	if(num==lang)return;
	lang=num;
	m_click(my_num, sub_num);
	continueSetLang();
}
function continueSetLang(){
	for(i=1; i<=5; i++){
		id("a_"+i).innerHTML=menutexts[lang][i-1];
	}
	var visi;
	for(i=0; i<langfolders.length; i++){
		visi="hidden";
		if(i==lang)visi="visible";
		id("kontakt_"+langfolders[i]).style.visibility=visi;
	}
	for(i=0; i<langfolders.length; i++){
		visi="visible";
		if(i==lang)visi="hidden";
		id("flag_"+langfolders[i]).style.visibility=visi;
	}
}
function Sprachwechsel(num){
	setLang(num);
}
function flag_over(num){
	if(ie){
		id("flag_"+langfolders[num]).style.filter="Alpha(opacity=100)";
	}
	else{
		id("flag_"+langfolders[num]).style.opacity=1;
	}
}
function flag_out(num){
	if(ie){
		id("flag_"+langfolders[num]).style.filter="Alpha(opacity=50)";
	}
	else{
		id("flag_"+langfolders[num]).style.opacity=0.5;
	}
		
}
function debbie(s, append){
	if(append)id("deb").innerHTML=id("deb").innerHTML+"<br>"+s;
	else id("deb").innerHTML=s;
}

function adjustHistoryBack(url){
	var i, tmp, lang_in_url, filename, new_num, new_sub_num;
	tmp=url.split("/");
	lang_in_url=tmp[tmp.length-2];
	filename=tmp[tmp.length-1];
	filename=filename.substring(0, filename.lastIndexOf("."));
	for(i=0; i<urls.length; i++){
		for(k=0; k<urls[i].length; k++){
			if(urls[i][k]==filename){
				if(my_num!=(i+1)||sub_num!=(k+1)){
					my_num=i+1;
					sub_num=k+1;
					setHighlight();
					setPage(my_num, sub_num);
					try{
					window.frames["ifr"].triggerOnload();
					}catch(e){}
				}
			}
		}
	}
}

function flash_init(){
	flash_connected=true;
}
var ccc=10;
function call_flash(){

	// Ausgeloest durch 'pic_loaded': Sobald Grafik geladen 
	if(!has_flash)return;
	if(has_flash&&!flash_connected){
		setTimeout("call_flash()", 2000);
		return;
	}
	var FL;
	if(ie){
		FL=window["ani_halter"];
	}else FL=document.embeds["ani_halter"];
	try{
		FL.triggerAni(""+my_num+"x"+sub_num);
	}
	catch(e){
	}
}
