// JavaScript Document

function openChoosePicWindow(dasElement,dasBild,thumbtype){
	path = "_MEDIA/_INTERFACE/index.php?";
	if(dasElement!=undefined && dasElement!=0){
		path+= "element="+dasElement.id;
	}
	if(dasBild!=undefined && dasBild!=0){
		path+= "&bildID="+dasBild;
	}
	if(thumbtype!=undefined && thumbtype!=0){
		path+= "&thumbtype="+thumbtype;
	}
	window.open(path, "choosePic", "width=900,height=600,left=0,top=0,scrollbars=yes");
}


function openTerminWindow(){
	window.open("_TERMINE/_INTERFACE/index.php", "choosePic", "width=900,height=600,left=0,top=0,scrollbars=yes");
}

function openFileWindow(dasElement,derDownload){
	path = "_DATA/_INTERFACE/index.php?";
	if(dasElement!=undefined && dasElement!=0){
		path+= "element="+dasElement.id;
	}
	if(derDownload!=undefined && derDownload!=0){
		path+= "&downloadID="+derDownload;
	}
	window.open(path, "chooseDownload", "width=900,height=600,left=0,top=0,scrollbars=yes");
}


function setPic(element,wert,pfad){
		document.getElementById(element).value=wert;
		//document.getElementById(element.replace(/data/,"div")).innerHTML="<img src=\""+pfad+"\">";
		document.getElementById(element.replace(/data/,"div")).style.backgroundImage="url("+pfad+")";
}

function setFile(element,wert,titel,beschreibung){
		document.getElementById(element).value=wert;
		document.getElementById(element+'_head').innerHTML=unescape(titel);
		document.getElementById(element+'_desc').innerHTML=unescape(beschreibung);		
}

function deletePic(element){
	element.value=0;
	document.getElementById(element.id.replace(/data/,"div")).style.backgroundImage="url(standards/bilder/neuesBild.gif)";
	return false;
}
