function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function confirmDelete(message) {
	var agree = confirm(message); 
	return agree;
}
function confirmDeleteSelected(message,url) {
	var agree = confirm(message); 
	if (agree) {
		location.href(url);
	}
}
function confirmSubmitSaveForgotten() {
	var agree = confirm('Möchten Sie die Änderungen speichern?');
	if (agree) {
		document.forms[0].submit();
	}
}
function saveProperties() {
	var agree = confirm('Möchten Sie die Änderungen speichern?');
	if (agree) {
		document.editForm.submit();
	}
}
function confirmSend(id) {
	var agree = confirm('Möchten Sie den Newsletter versenden?'); 
	if (agree)
		location.href(id);
	else
		return false ;
}

var http_request = false;
function macheRequest(url) {
	http_request = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
			// zu dieser Zeile siehe weiter unten
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}
	if (!http_request) {
		alert('Ende :( Kann keine XMLHTTP-Instanz erzeugen');
		return false;
	}
	http_request.onreadystatechange = alertInhalt;
	http_request.open('GET', url, true);
	http_request.send(null);
}
function alertInhalt() {
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			alert(http_request.responseText);
		} else {
			alert('Bei dem Request ist ein Problem aufgetreten.');
		}
	}
}

function getRefToDiv(divID,oDoc) {
	if( document.getElementById ) { return document.getElementById(divID); }
	if( document.all ) { return document.all[divID]; }
	if( !oDoc ) { oDoc = document; }
	if( document.layers ) {
		if( oDoc.layers[divID] ) {
			return oDoc.layers[divID];
		} else {
			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
				y = getRefToDiv(divID,oDoc.layers[x].document);
			}
			return y;
		}
	}
	return false;
}
function setTabHeight(oName,oVarII,oVar) {
	newHeight = (window.document.body.clientHeight-oVarII);
	newWidth = oVar;
	var myReference = getRefToDiv(oName), noPx = document.childNodes ? 'px' : 0;
	if( myReference.style ) { myReference = myReference.style; }
	if( myReference.resizeTo ) { myReference.resizeTo( newWidth, newHeight ); }
	myReference.width = newWidth + noPx; myReference.pixelWidth = newWidth;
	myReference.height = newHeight + noPx; myReference.pixelHeight = newHeight;
}
function setWindowHeight(oName,oVar) {
	newHeight = (window.document.body.clientHeight-oVar);
	newWidth = 630;
	var myReference = getRefToDiv(oName), noPx = document.childNodes ? 'px' : 0;
	if( myReference.style ) { myReference = myReference.style; }
	if( myReference.resizeTo ) { myReference.resizeTo( newWidth, newHeight ); }
	myReference.width = newWidth + noPx; myReference.pixelWidth = newWidth;
	myReference.height = newHeight + noPx; myReference.pixelHeight = newHeight;
}
/*var onloadloadingSKCMS = function () {
	document.write('<iframe src="inc/inc.loading.php" scroll=none frameborder=0 style="position:absolute;left:0;top:0;overflow:hidden;visibility:visible;z-index:999" id="loadingStyle"></iframe>');
	StatusCheck();
}*/
var StatusCheck = function () {
	if (navigator.appName != "Netscape") {
		if(document.readyState != "complete")
		{
			window.setTimeout(StatusCheck, 100);
			return false;
		}
	}
    window.setTimeout(Ausgabe, 100);
}
var Ausgabe = function () {
	var loadingDIV = window.document.getElementById('loadingStyle');
	loadingDIV.parentNode.removeChild(loadingDIV);
}
function writeNewArrayImg(imgArr) {
	newImg = 'newimg'+imgArr;
	document.getElementById(newImg).innerHTML = '<input name=\"price['+imgArr+']\" type=\"text\" id=\"price['+imgArr+']\" value=\"\" class=\"FromBoxEditWithTwoIcon\" readonly=\"true\">';
}
function deleteValue(deleteVar) {
	eval("document.forms[0]."+deleteVar+".value = '';");
}
/*if (navigator.appName != "Netscape") {
	onloadloadingSKCMS ();
}*/
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function sk_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=sk_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function sk_showHideLayers() {
  var i,p,v,obj,args=sk_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=sk_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function getRefToDiv(divID,oDoc) {
  if( !oDoc ) { oDoc = document; }
  if( document.layers ) {
      if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
          //repeatedly run through all child layers
          for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
              //on success, return that layer, else return nothing
              y = getRefToDiv(divID,oDoc.layers[x].document); }
          return y; } }
  if( document.getElementById ) {
      return document.getElementById(divID); }
  if( document.all ) {
      return document.all[divID]; }
  return false;
}
function getWindowHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerHeight ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return [ myHeight ];
}
function getWindowWidth() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return [ myWidth ];
}
function sk_drawLayers(html,width,height,isVisible,scrollBar) {
	/*width = 768;
	height = 442;*/
	if(html)
	{
	document.getElementById("iFrameLayer").innerHTML = "<iframe src='"+html+"'  width='"+width+"' height='"+height+"' scrolling='0' frameborder='0' name='iframe'></iframe>";
	}
	else
	{
	document.getElementById("iFrameLayer").innerHTML = "<html><body></body></html>";
	}
	myReference = getRefToDiv("iFrameLayer");
	//myReference2 = getRefToDiv("overlay");
	//
	if(myReference /*&& myReference2*/ && html && html != "") {
		
		if( myReference.style ) { myReference = myReference.style; }
		//if( myReference2.style ) { myReference2 = myReference2.style; }
		//
		newWidth = getWindowWidth();
		newHeight = getWindowHeight();
	
		myReference.marginLeft = (width/-2)+"px";
		myReference.marginTop = (height/-2)+"px";
		myReference.left = (50)+"%";
		myReference.top = (50)+"%";
		
		/*myReference2.left = 0;
		myReference2.top = 0;
		myReference2.width = newWidth+"px";
		myReference2.height = newHeight+"px";
		*/
		if(isVisible)
		{
		myReference.visibility = "visible";
		//myReference2.visibility = "visible";
		}
		else
		{
		//myReference2.visibility = "hidden";
		myReference.visibility = "hidden";
		}
	}
}
