// config

// inner html
var ahtml = "";
ahtml += '<table id="popup2show" class="{innerCSSclass}" cellpadding="0" cellspacing="0" border="0" style="margin-top:{margin_top}px; background-color:#FFFFFF;">';
ahtml += '	<tr>';
ahtml += '		<td style="padding:10px;" align="left">';
ahtml += '			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="{innerCSSclass}">';
ahtml += '				<tr>';
ahtml += '					<td align="right"><img src="/VAImageBox/close.gif" alt="{text_Close}" title="{text_Close}" style="cursor:pointer;border:0px;" type="image" onClick="close_gallery(); return false;"><br>&nbsp;</td>';
ahtml += 				'</tr>';
ahtml += '			</table>';
ahtml += '			<table cellpadding="0" cellspacing="0" border="0" width="100%" class="{innerCSSclass}">';
ahtml += '				<tr>';
ahtml += '					<td style="min-width:100px; min-height:100px;" id="gallery_ajax"></td>';
ahtml += '				</tr>';
ahtml += 			'</table>';
ahtml += '		</td>';
ahtml += '	</tr>';
ahtml += '</table>';
//

//ajax functions

var http = null;
var timeout = null;
var http_active = false;
var element_id = null;
var opendiv = true;
if (window.XMLHttpRequest) {
   http = new XMLHttpRequest();
} else if (window.ActiveXObject) {
   http = new ActiveXObject("Microsoft.XMLHTTP");
}
function loadPage(cont, el)
{
	if(http_active==true) abbrechen();
	http_active = true;
	element_id = el;
	if (http != null) {
	   http.open("GET", cont, true);
	   http.onreadystatechange = ausgeben;
	   http.send(null);
	   timeout = window.setTimeout("abbrechen()", 100000);
	}
}
function ausgeben() {
   if (http.readyState == 4) {
	  ergebnis = http.responseText;
	  xjs = find_js(ergebnis);
      document.getElementById(element_id).innerHTML = ergebnis;
      window.clearTimeout(timeout);
	  http_active = false;
	  eval(xjs);
   }
}
function abbrechen() {
   http.abort();
   //document.getElementById('contentbox').style.display='none';
   http_active = false;
   doucment.getElementById(element_id).innerHTML = 'Fehler. Bitte versuchen Sie es erneut.';
   // alert("Zeituevberschreitung. Versuchs nochmal..");
}
function find_js(file_string)
{
	start = 0;
	contin=true;
	js="";
	text = file_string;
	while(contin==true)
	{
		p1 = text.indexOf('<script');
		p2 = text.indexOf('</script>')+9;// +9 weil "</script>" 9 zeichen lang ist
		if(p1 != -1)
		{
			js += text.substring(p1,p2);
			text = text.substr(p2);
		}
		else contin = false;
	}
	js = js.replace(/<script>/gi, "");
	js = js.replace(/<script type="text\/javascript">/gi, "");
	js = js.replace(/<\/script>/gi, "");
	//alert(js);
	//eval(js);
	return js;
	//document.write('<scr'+'ipt>'+js+'</scr'+'ipt>');
}
//

