function openWindow(myurl, mywidth, myheight){
	focusWindow = window.open(myurl, 'myWindow', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + mywidth + ',height=' + myheight);
	//focusWindow = window.open(myurl, 'myWindow', 'toolbar=no,location=no,scrollbars=yes,resizable=yes,width=' + mywidth + ',height=' + myheight);
	focusWindow.focus();
}

function setLocation(url) {
	if (url != "") {
		location = url;
	}
}

// HilfeScript, Ausgabe in die Statuszeile 
function hilfe(hilfeTXT) { 
		window.status = hilfeTXT; 
} 

//*******************************************************************************************************
// CMS Functionen
//*******************************************************************************************************
function OnListeChanged(){
	document.forms[0].cms_listform_content_ids.value = document.forms[0].available_content.options[document.forms[0].available_content.options.selectedIndex].value;
}


// Verschieben von Einträgen in Listen
function InitIDPool () {
	document.forms[0].cms_object_relcontent_idpool.value = ""
	par = "";
	
	for ( x=0; x < document.forms[0].selected_content.options.length; x++) {
		par = par + document.forms[0].selected_content.options[x].value + ";";
	}
	document.forms[0].cms_object_relcontent_idpool.value = par;
}

function sort ( aUp ) {
	index = document.forms[0].selected_content.selectedIndex;
	if ( aUp ) {
		Offset = -1;
		if ( index == 0 ) return;
	}
	else {
		Offset = 1;
		if ( index > document.forms[0].selected_content.options.length - 3 ) return;
	}
	
	if ( ( index < 0 ) || ( document.forms[0].selected_content.options[index].value < 0 ) ){
		alert ( "Bitte markieren Sie einen Eintrag" );
		return;
	}
	TempOption = new Option;
	TempOption.text = document.forms[0].selected_content.options[index + Offset].text;
	TempOption.value = document.forms[0].selected_content.options[index + Offset].value;
	document.forms[0].selected_content.options[index + Offset].text = document.forms[0].selected_content.options[index].text;
	document.forms[0].selected_content.options[index + Offset].value = document.forms[0].selected_content.options[index].value;
	document.forms[0].selected_content.options[index + Offset].selected = true;
	document.forms[0].selected_content.options[index] = TempOption;
	InitIDPool();
}

function move( aSource, aDestination ) {
	if ( ( aSource.selectedIndex < 0 ) || ( aSource.options[aSource.selectedIndex].value < 0 ) ){
		alert ( "Bitte markieren Sie einen Eintrag" );
		return;
	}
	if ( aSource.options[aSource.selectedIndex].text != '' ) {
		aDestination.options[aDestination.options.length] = new Option;
		aDestination.options[aDestination.options.length - 1].text = aDestination.options[aDestination.options.length - 2].text;
		aDestination.options[aDestination.options.length - 1].value = aDestination.options[aDestination.options.length - 2].value;
		aDestination.options[aDestination.options.length - 2].text = aSource.options[aSource.selectedIndex].text;
		aDestination.options[aDestination.options.length - 2].value = aSource.options[aSource.selectedIndex].value;
		aSource.options[aSource.selectedIndex] = null;
	}
	InitIDPool();
}


// Verschiedene Aktionen vor dem Submit
function OnSubmit() {
	
}

