function extern(url) {
	breite = 1012;
	hoehe = 598;
	x=0; //abstand links
	y=0; //abstand oben       
        //alert("Hello:" + url);
        extFenster = open(url,'extWindow','height='+hoehe+',width='+breite+',menubar=1,resizable=1,scrollbars=1,status=1,titlebar=1,location=1,toolbar=1,left=' + x +',top=' + y + ',screenX=' + x + ',screenY=' + y);
        extFenster.focus();
}

function submitForm() {
  document.forms[0].submit();
}
  
function _submitForm(formName, fieldText ) {
	for (i=0; i<document.forms[formName].elements.length; i++) {
		if (document.forms[formName].elements[i].title == "action" ) {
  		document.forms[formName].elements[i].value = fieldText;
  	}
  }
  document.forms[formName].submit();
}

function absoluteLocationHref(loc){
    var b = document.getElementsByTagName('base');
    if (b && b[0] && b[0].href) {
      if (b[0].href.substr(b[0].href.length-1) == '/' && loc.charAt(0) == '/'){
        loc = loc.substr(1);
      }
      loc = b[0].href + loc;
    }
    return loc;
}

function changeLocation(relUrl){
  self.location.href=absoluteLocationHref(relUrl);
}

function openPrintLayout(){
  tagLink ("PRINTVIEW");
  var href = window.location.href;
  if (href.indexOf('?') >= 0){
    href += "&";
  } else {
    href += "?";
  }
  href += "printLayout=true";
  extern(href);
}

function externPDF(url) {
  breite = 1012;
  hoehe = 598;
  x=0; //abstand links
  y=0; //abstand oben
        extFensterPDF = open(url,'extWindowPDF','height='+hoehe+',width='+breite+',menubar=1,resizable=1,scrollbars=1,status=1,titlebar=1,location=1,toolbar=1,left=' + x +',top=' + y + ',screenX=' + x + ',screenY=' + y);
        extFensterPDF.focus();
}

function externNewSpaces(url) {
 breite = 1010;
 hoehe = 650;
 x=100; //abstand links
 y=100; //abstand oben       
        //alert("Hello:" + url);
        extFenster = open(url,'extWindow','height='+hoehe+',width='+breite+',menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,location=0,toolbar=0,left=' + x +',top=' + y + ',screenX=' + x + ',screenY=' + y);
        extFenster.focus();
}

function externPortal(myfile) {
	breite = 1012;
	hoehe = 598;
	x=0; //abstand links
	y=0; //abstand oben
        extFenster = open(myfile,'extWindow','height='+hoehe+',width='+breite+',menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,location=0,toolbar=0,left=' + x +',top=' + y + ',screenX=' + x + ',screenY=' + y);
        extFenster.focus();
}

// open popup with given width and height
function popupXY(url, sizeX, sizeY) {
    self.focus();
	var x=0; //abstand links
	var y=0; //abstand oben
	extFenster = open(url, 'extWindow', 'height=' + sizeY + ', width=' + sizeX + ', menubar=0, resizable=0, scrollbars=0, status=0, titlebar=0, location=0, toolbar=0, left=' + x +', top=' + y + ', screenX=' + x + ', screenY=' + y);
	//extFenster.focus();
}

////////////////////////////////
//
// Checkbox utility functions.
//

function selectUnselectCheckboxes(checkboxName, checkboxValue) {
  var checkboxes = document.getElementsByName(checkboxName);
  if (!checkboxes) {
    return;
  }
  var count = checkboxes.length;
  if (!count) {
    checkboxes.checked = checkboxValue;
  } else {
    var i = 0;
    while (i < count) {
      checkboxes[i].checked = checkboxValue;
      i++;
    }
  }
}

function tagLink (linkName, param1, param2, param3) {
	tagLinkSend (linkName, 'o', param1, param2, param3);
}

function tagLinkExtern (linkName, param1, param2, param3) {
	tagLinkSend (linkName, 'e', param1, param2, param3);
}

function tagLinkSend (linkName, linkType, param1, param2, param3) {
	try {
		s.linkTrackVars="prop1,prop2,prop3,prop4";
		s.prop1 = s.pageName;
		if(!(typeof param1 == "undefined")) s.prop2 = param1;
		if(!(typeof param2 == "undefined")) s.prop3 = param2;
		if(!(typeof param3 == "undefined")) s.prop4 = param3;
		s.tl(this, linkType, linkName);
	} catch (e) {}
}

function tagDownload (downloadFileName) {
	try {
		s.linkTrackVars='eVar8,events,prop14,prop15';
		s.linkTrackEvents='event4';
		s.events='event4';
		s.eVar8=downloadFileName;
		s.prop14=s.pageName;
		s.prop15=s.eVar8;
		s.tl(this,'d',downloadFileName);
	} catch (e) {}
}

function tagProduct (productName) {
	try {
		s.events="prodView,event3";
		s.products=";" + productName;
		s.prop12=productName;
	} catch (e) {}
}

function tagParam1 (param) {
	try {
		s.prop1 = param;
	} catch (e) {}
}

function tagParam2 (param) {
	try {
		s.prop2 = param;
	} catch (e) {}
}

function tagParam3 (param) {
	try {
		s.prop3 = param;
	} catch (e) {}
}

function isFlashEnabled () {
	return swfobject && swfobject.hasFlashPlayerVersion("9,0,28,0");
}
