var myimages = new Array()

function preloadimages() {
	for (i=0;i<preloadimages.arguments.length;i++) {
	myimages[i]=new Image()
	myimages[i].src=preloadimages.arguments[i]
	}
}
preloadimages("/images/nav1_high.gif","/images/nav2_high.gif","/images/nav3_high.gif","/images/nav4_high.gif","/images/nav5_high.gif","/images/pfeil_high.gif","/images/send_high.gif","/images/next_high.gif","/images/back_high.gif","/images/overview_high.gif","/images/print_high.gif","/images/close_high.gif","/images/anfragen_high.gif","/images/anfragen_bilder.gif","/images/plan_high.gif","/images/absenden_high.gif","/images/versenden_high.gif");

function restore() {
	var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function find(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=find(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function showLayers() {
  	var i,p,v,obj,args=showLayers.arguments;
  	for (i=0; i<(args.length-2); i+=3) if ((obj=find(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 swap() {
	var i,j=0,x,a=swap.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=find(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function jumpMenu(targ,selObj,restore){
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function popUpWindow(URLStr,height,width,toolbar,scrollbars) {
	var popUpWin = 0; var left = 200; var top = 30;

	if(popUpWin) { if (!popUpWin.closed) popUpWin.close(); }
	popUpWin = open(URLStr,'popUpWin','toolbar='+toolbar+',location=no,directories=no,status=no,scrollbars='+scrollbars+',resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function setFirst(strField) {
	document.objectView[strField].select()
	document.objectView[strField].style.backgroundColor = "#FFFFFF";
}

function check_Homepage() {

	var status = 0;
	var nodeID = document.objectView.objectID.value;

	if ((document.objectView.objectID.value.length=="0") || (document.objectView.objectID.value=="Bitte um eine Eingabe - z.B.: 352") || (document.objectView.objectID.value=="z.B.: 352") || (isNaN(nodeID)==true)) {
	document.objectView.objectID.style.backgroundColor = "#C5E4EC";
	document.objectView.objectID.value = "Bitte um eine Eingabe - z.B.: 352";
	status = 1;
	}

	if ((nodeID >= 9000) || (nodeID <= 100)) {
	document.objectView.objectID.style.backgroundColor = "#C5E4EC";
	document.objectView.objectID.value = "Falsche Objektnummer!";
	status = 1;
	}

	if (status!=1) {
	window.open("/object-details.php?objectID=" + nodeID + "",'Details','toolbar=yes,status=no,menubar=yes,scrollbars=yes,width=600,height=600');
	}

	return !status;
}
