<!--
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
////////////////////////////////////Popup öffenen und Daten nachladen
function showpopup(folder,first) { 
	document.getElementById("popup").style.display = "block";
	document.getElementById("graudrueber").style.display = "block";
	document.getElementById("Schatten1").style.display = "block";
	loadData(folder,first);
	}
////////////////////////////////////Popup schließen und Daten leeren
function hidepopup()
{ 
	document.getElementById("popup").style.display = "none";
	document.getElementById("graudrueber").style.display = "none";
	document.getElementById("Schatten1").style.display = "none";
	document.getElementById("bigimg").innerHTML ="";
	document.getElementById("Kunde_c").innerHTML ="";
	document.getElementById("popup_right").innerHTML ="";
	document.getElementById("status").value =0;
 }


// globale Instanz von XMLHttpRequest
var xmlHttp = false;

// xmlHttpRequest-Instanz erstellen
// ... für Internet Explorer
try {
    xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
    try {
        xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
        xmlHttp  = false;
    }
}
// ... für Mozilla, Opera und Safari
if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}


// aktuelle Daten laden
function loadData(folder,first)
	{
 if (xmlHttp) { 

	 var uri2 = 'functions/first_img.php?image=http://grafikallerart.de/referenzen/'+folder+'/'+first+'.jpg'+'&h=300&w=360';
		 xmlHttp.open('GET', uri2, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {           
			 document.getElementById("bigimg").innerHTML = xmlHttp.responseText;
			 loadtext(folder,first);
		  } 

     };
	 xmlHttp.send(null);
 }
//loadtext(folder,first);
//setTimeout("loadtext(folder,first)",1000);
}
function loadtext(folder,first)
	{
 if (xmlHttp) { 
		 var uri = 'referenzen/'+folder+'/info.html';
		 xmlHttp.open('GET', uri, true);
     	xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {           
		 document.getElementById("Kunde_c").innerHTML = xmlHttp.responseText;
		 load_right(folder,first);
		  } 

     };
     xmlHttp.send(null);
 }
}
function load_right(folder,first)
	{
 if (xmlHttp) { 
 		if (document.getElementById("status").value == 0)
		{
			document.getElementById("status").value = first;
			var firstfirst = first;
		}
		else {
			var firstfirst = document.getElementById("status").value;
		}
		 var uri = 'functions/read_dir.php?dir=../referenzen/'+folder+'/&first='+first+"&chdir="+folder+"&firstfirst="+firstfirst;
		 xmlHttp.open('GET', uri, true);
     	xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {           
		 document.getElementById("popup_right").innerHTML = xmlHttp.responseText;
		  } 

     };
     xmlHttp.send(null);
 }
}


///////////////////////////////////////////////////77
//////////////////////////////////////////////////
// KONTAKT / IMPRESSUM ...

function showcontent(folder,first) { 
	document.getElementById("popup").style.display = "block";
	document.getElementById("graudrueber").style.display = "block";
	document.getElementById("Schatten1").style.display = "block";
	loadContent(folder,first);
	}
	
function loadContent(folder,first)
	{
         		
			 document.getElementById("bigimg").innerHTML = '<iframe src="'+folder+'/'+first+'_form.html'+'" scrolling="no" height="360" width="100%" frameborder="0" id="iframe" name="iframe"></iframe>';
			//setTimeout(parent.iframe.location.href = folder+'/'+first+'_form.html',1000);
			//parent.iframe.location.href = folder+'/'+first+'_form.html';
			content_text(folder,first);
			
}


//////////////////Überschrift
function content_text(folder,first)
	{  
	if (first == "kontakt") { 
		document.getElementById("Kunde_c").innerHTML = "<strong style='font-size:12px;'>Kontakt</strong>";
	}
	if (first == "impressum") { 
		document.getElementById("Kunde_c").innerHTML = "<strong style='font-size:12px;'>Impressum</strong>";
	}
	if (first == "tellafriend") { 
		document.getElementById("Kunde_c").innerHTML = "<strong style='font-size:12px;'>Seite empfehlen</strong>";
	}
	content_right(folder,first);
}

///////////////// Text Rechts
function content_right(folder,first)
	{
 if (xmlHttp) { 

	 var uri2 = folder+'/'+first+'_text.html';
		 xmlHttp.open('GET', uri2, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {           
			 document.getElementById("popup_right").innerHTML = xmlHttp.responseText;
		  } 

     };
	 xmlHttp.send(null);
 }
}
