function openwindowablage(dateiname,breite,hoehe) {
	zwab = window.open(dateiname,'zwischenablage','dependent=yes,toolbar=no,scrollbars=yes,status=no,menubar=no,location=no,resizable=yes,width='+breite+',height='+hoehe+',left=0,top=0');
	zwab.focus();
}

/* old since version 5.492
function disableInlineEdit(cookieName) {
	// Ablaufdatum des Cookies einfach in die Vergangenheit
	temp = '';
	document.cookie = cookieName + "=" + temp + "; expires=Thu, 01-Jan-70 00:00:01 GMT;";

	document.location.reload();
}
*/

// for admin panel
function changeDatasetPublishmentBehaviour(cookieName, value) {
	document.cookie = cookieName + "=" + value;
	document.location.reload();
}


/* PopUp fuer Modul Link */

function openLinkWindow(link, breite, hoehe, left, top, scrollbars, resizable, status) {
	var linkPopUp = window.open(link, 'LinkPopUp', 'toolbar=no,scrollbars='+scrollbars+',status='+status+',menubar=no,location=no,resizable='+resizable+',width='+breite+',height='+hoehe+',left='+left+',top='+top);

	if (linkPopUp.opener == null)
		linkPopUp.opener = self;
	linkPopUp.focus();
}


// Notwendige Funktion zur Umsetzung der Paging-Klasse im Frontend mit POST-Werten
function NFYPagingSubmit(FormName,costart_val) {
	window.document.forms[FormName].elements['costart'].value=costart_val;
	window.document.forms[FormName].submit();
}

// Kopieren der Daten von der Lieferaddresse in die Rechnungsaddresse
function CopyAddressData(FormName){
	window.document.forms[FormName].elements['LKZ_Rechnungsempfaenger_Vorname'].value = window.document.forms[FormName].elements['LKZ_Vorname'].value;
	window.document.forms[FormName].elements['LKZ_Rechnungsempfaenger_Nachname'].value = window.document.forms[FormName].elements['LKZ_Nachname'].value;
	window.document.forms[FormName].elements['LKZ_Rechnungsempfaenger_Firma'].value = window.document.forms[FormName].elements['LKZ_Firma'].value;
	window.document.forms[FormName].elements['LKZ_Rechnungsempfaenger_Adresszusatz'].value = window.document.forms[FormName].elements['LKZ_Adresszusatz'].value;
	window.document.forms[FormName].elements['LKZ_Rechnungsempfaenger_Strasse'].value = window.document.forms[FormName].elements['LKZ_Strasse'].value;
	window.document.forms[FormName].elements['LKZ_Rechnungsempfaenger_Hausnummer'].value = window.document.forms[FormName].elements['LKZ_Hausnummer'].value;
	window.document.forms[FormName].elements['LKZ_Rechnungsempfaenger_PLZ'].value = window.document.forms[FormName].elements['LKZ_PLZ'].value;
	window.document.forms[FormName].elements['LKZ_Rechnungsempfaenger_Ort'].value = window.document.forms[FormName].elements['LKZ_Ort'].value;
}

// Submit des Formulars fuer Reload
// setzen des notwendigen Formularwertes reload auf true
function localChange(FormName) {
 	window.document.forms[FormName].reload.value = 'true';
 	window.document.forms[FormName].send_form.value = '0';
	window.document.forms[FormName].submit();

 };

 // Submit des Formulars
// setzen des notwendigen Formularwertes reload auf false
function SubmitForm(FormName) {
 	window.document.forms[FormName].reload.value = 'false';
 	window.document.forms[FormName].send_form.value = '1';
	window.document.forms[FormName].submit();

 };

 // Gallery-PopUp oeffnen
function OpenGalleryPopUp(link){
	var GalleryPopUp = window.open(link, 'LKZGallery', 'toolbar=no,scrollbars=no,status=no,menubar=no,location=no,resizable=no,width=700,height=600,left=50,top=50');

	if (GalleryPopUp.opener == null)
		GalleryPopUp.opener = self;
	GalleryPopUp.focus();
}

function ContentPrint(link){
	var ContentPrintPopUp = window.open(link, 'LKZContentPrint', 'toolbar=no,scrollbars=yes,status=no,menubar=no,location=no,resizable=no,width=518,height=600,left=50,top=50');

	if (ContentPrintPopUp.opener == null)
		ContentPrintPopUp.opener = self;
	ContentPrintPopUp.focus();
}

// JavaScript Funktion zur Formularverarbeitung mit XAJAX
function xajaxsubmitForm(formname, artikelid, pubid, pageid)
{
	xajax_ArtikelSendFormProcess(xajax.getFormValues(formname), artikelid, pubid, pageid);
	return false;
}

// JavaScript Funktion zur Formularverarbeitung mit XAJAX
function xajaxsubmitFormVideo(formname, videoid, pubid, pageid)
{
	xajax_VideoSendFormProcess(xajax.getFormValues(formname), videoid, pubid, pageid);
	return false;
}

// JavaScript Funktion zur Formularverarbeitung mit XAJAX bei Umfrage
function xajaxsubmitFormSurvey(formname, surveyid, pubid)
{
	//because of ie problem - changed by mkress - 07-02-2011
	//xajax_SurveySendFormProcess(xajax.getFormValues(formname), surveyid, pubid);
	xajax_SurveySendFormProcess(xajax.getFormValues(formname), surveyid);
	return false;
}


// Setzen eines Cookies ueber JavaScript
// Notwendig fuer Umfrage
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "; path=/" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}

function openAdminPanel() {
	document.getElementById('adminpanel').style.left = 0;
	document.getElementById('adminpanelopener').style.display = 'none';

}

function closeAdminPanel() {
	document.getElementById('adminpanel').style.left = -200+'px';
	document.getElementById('adminpanelopener').style.display = 'inline';
}

// inElement muss ein Formularfeld sein
function copyToClipboard (inElement) {
	if (inElement.createTextRange) {
    	var range = inElement.createTextRange();
    	if (range) // IE
      		range.execCommand('Copy');
  		} else {
    		var flashcopier = 'flashcopier';
		    if(!document.getElementById(flashcopier)) {
		     var divholder = document.createElement('div');
		     divholder.id = flashcopier;
		     document.body.appendChild(divholder);
    	}
	    document.getElementById(flashcopier).innerHTML = '';
	    var divinfo = '<embed src="/redFACT/kernel/flash/clipboard.swf" FlashVars="clipboard='+encodeURIComponent(inElement.value)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
	    document.getElementById(flashcopier).innerHTML = divinfo;
  	}
}
