//   Code by Fritz Design, 01/2011


//activeSite = "";


function start(seite,anzahl)
{
	//activeSite = seite;
	//seite_inter = seite;
	//menge = anzahl;
	
	headerName = 'img/header/header_'+seite+'.jpg';
    eval("document.getElementById('table').style.backgroundImage = 'url(" + headerName +")';");

	document.pfeil.src = "img/div/pfeilea.gif";
	
	
	if (anzahl != "")
	{
		intervall(seite,anzahl);
	}
}


function intervall(seite_inter,y)
{ 
	x = y;
	section = seite_inter;
	
	if (document.images)
	{
		theimages = new Array(y);
		for (var i =  1; i < y+1; i++)
		{
			theimages[i] = new Image(144,85);
			theimages[i].src =  "img/wimg/"+seite_inter+"/"+seite_inter+""+i+".jpg";
		}
	}
	thename = 0;
	var aktiv = window.setInterval("changeImage(section,x)",3000);
}




function changeImage(section,y)
{
	if (thename < y)
	{
		thename++;	
	}
	else
	{
		thename = 1;
	}
	document.wimg.src = "img/wimg/"+section+"/"+section+""+thename+".jpg";
}



function mover(id)
{
	
	if (document.images)
	{
		eval('document.images.'+id+'.src = "img/nav/n_'+id+'_o.gif";');
	}
	

}

function mout(id)
{
	
		if (document.images)
	{
		eval('document.images.'+id+'.src = "img/nav/n_'+id+'.gif";');
	}
}



function openWin(url,name,b,h,fenster_nr)
{
	eval('fenster'+fenster_nr+'= window.open(url,name,"width='+b+'px,height='+h+'px,left=0,top=0,location=no,menubar=no,scrollbars=yes,resizable=no,status=no,toolbar=no")');

}



function doMail(sn,dom)
{
	theCMD = '<B><A HREF = "mailto:' + sn + '@' + dom + '">'+sn+'@'+dom+'</A></B>';
	document.write(theCMD);
}



// -------------- Extra-Fenster Impressionen

function drawAnsicht(id)
{
	theNewIMG = "img/inside/i"+id+"o.gif";
	theOldIMG = "img/inside/i"+oldid+".gif";
	eval('document.i'+oldid+'.src = theOldIMG;');
	eval('document.i'+id+'.src = theNewIMG;');
	document.ansicht.src = "img/inside/ansichten/inside"+id+".jpg";
	oldid = id;
}

function vorAnsicht()
{
	if (oldid == 10)
	{
	y = drawAnsicht(1);
	}
	
	else
	y = drawAnsicht(oldid+1);
}

function zurueckAnsicht()
{
	if (oldid == 1)
	{
	y = drawAnsicht(10);
	}
	
	else
	y = drawAnsicht(oldid-1);
}


// ----------------------------------------


// -------------- Formular-Überprüfung


function isRequired()
{
	theCompany = document.forms[0].firma.value;
	theName = document.forms[0].name.value;
	theMail = document.forms[0].email.value;
	
	if ((theMail != "") && (theName !="") && (theCompany != ""))
	{
			document.forms[0].action = "includes/domymail.php";
			document.forms[0].submit();
	}
	else
	{
		alert("Bitte fuellen Sie die mit * gekennzeichneten Felder aus.");
	}
}

// ----------------------------------------




//____________________ BEISPIELE


function preLoadImg()
{
	if (document.images)
	{
		
	}
}

function bsp()
{
	result = preLoadImg();
	theSection = "pr";
	oldid = 1;
	theLink = new Array(12);
	for (var i = 0; i < 11; i++)
	{
		theLink[i] = "";
	}
	
	theLink[1] = "http://www.infostore-ecm.com/";
	theLink[2] = "http://www.faszination-garten.de/";
	theLink[3] = "http://www.consilium-gmbh.de/";
	theLink[4] = "http://www.exxellin.de/";
	theLink[5] = "http://www.blattskulpturen.de";
	theLink[6] = "http://www.the-balance.de";
	theLink[7] = "http://www.ulbrich-spieledesign.de";
	theLink[8] = "http://www.teamix.de";
	theLink[9] = "http://www.ornamentale-kunst.de/";
	theLink[10] = "http://www.fritzdesign.de/customers/telecavoice/index.html";
}



function draw(id)
{
	theNewIMG = "img/bsp/nav_quer/"+id+"o.gif";
	theOldIMG = "img/bsp/nav_quer/"+oldid+".gif";
	eval('document.b'+oldid+'.src = theOldIMG;');
	eval('document.b'+id+'.src = theNewIMG;');
	document.example.src = "img/bsp/"+theSection+"/"+theSection+id+".jpg";
	oldid = id;
	if (theSection == "web")
	{
		document.adresse.src = "img/bsp/web/url"+id+".gif";
		document.links[17].target = "examples";
		document.links[17].href = theLink[id];
	}
	else
	{
		document.adresse.src = "img/bsp/web/url.gif";
		document.links[17].href = "#";
		document.links[17].target = "";
	}
}





function vor()
{
	//x = mover('bspvor');
	//z = mout('bspvor');
	
	if (oldid == 10)
	{
	y = draw(1);
	}
	
	else 
	{
		y = draw(oldid+1);
	}
}

function zurueck()
{
	if (oldid == 1)
	{
	y = draw(10);
	}
	
	else 
	{
		y = draw(oldid-1);
	}
}



function changeSection(id)
{
	theSectionOff = "img/bsp/nav_bereich/bsp_"+theSection+".gif";
	eval('document.'+theSection+'.src = theSectionOff;');	

	theSectionOn = "img/bsp/nav_bereich/bsp_"+id+"_o.gif";
	eval('document.'+id+'.src = theSectionOn;');

	theSection = id;

	theNewIMG = "img/bsp/nav_quer/1o.gif";
	theOldIMG = "img/bsp/nav_quer/"+oldid+".gif";

	eval('document.b'+oldid+'.src = theOldIMG;');
	document.b1.src = theNewIMG;
	document.example.src = "img/bsp/"+theSection+"/"+theSection+"1.jpg";

	document.s9.src = "img/bsp/separator.gif";
	document.b10.src = "img/bsp/nav_quer/10.gif";
	document.links[17].href = "javaScript:draw(10);";
	document.links[17].target = "";
	

	if (theSection == "web")
	{
		document.adresse.src = "img/bsp/web/url1.gif";
		document.links[17].target = "examples";
		document.links[17].href = theLink[1];
	}
	else
	{
		document.adresse.src = "img/bsp/web/url.gif";
		document.links[17].href = "#";
		document.links[17].target = "";
	}
	oldid = 1;
}







