document.write('<script type="text/javascript" src="/icms/javascript/swfobject.js"></script>');
document.write('<script type="text/javascript" src="/icms/javascript/prototype.js"></script>');

var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;
var ie4 = document.all;
offsetX = 0;
offsetY = 20;
var toolTipSTYLE="";
function initToolTips()
{
  if(ns4||ns6||ie4)
  {
    if(ns4) toolTipSTYLE = document.toolTipLayer;
    else if(ns6) toolTipSTYLE = document.getElementById("toolTipLayer").style;
    else if(ie4) toolTipSTYLE = document.all.toolTipLayer.style;
    if(ns4) document.captureEvents(Event.MOUSEMOVE);
    else
    {
      toolTipSTYLE.visibility = "visible";
      toolTipSTYLE.display = "none";
    }
    document.onmousemove = moveToMouseLoc;
  }
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function toolTip(msg, ox, fg, bg)
{
  if(toolTip.arguments.length < 1) 
  {
    if(ns4) toolTipSTYLE.visibility = "hidden";
    else toolTipSTYLE.display = "none";
  }
  else 
  {
    if(toolTip.arguments.length > 1)
    {
	  offsetX=ox;
    }
	else
	{
      offsetX=0;
	}
	moveToMouseLoc();
	if(!fg) fg = "#777777";
    if(!bg) bg = "#FFFFFF";
    var content =
    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + fg + '"><td>' +
    '<table border="0" cellspacing="0" cellpadding="1" bgcolor="' + bg +
    '"><td align="center"><font face="sans-serif" color="' + fg +
    '" size="-2">&nbsp\;' + msg +
    '&nbsp\;</font></td></table></td></table>';
    if(ns4)
    {
      toolTipSTYLE.document.write(content);
      toolTipSTYLE.document.close();
      toolTipSTYLE.visibility = "visible";
    }
    if(ns6)
    {
      document.getElementById("toolTipLayer").innerHTML = content;
      toolTipSTYLE.display='block'
    }
    if(ie4)
    {
      document.all("toolTipLayer").innerHTML=content;
      toolTipSTYLE.display='block'
    }
  }
}
function moveToMouseLoc(e)
{
  if(ns4||ns6)
  {
    x = e.pageX;
    y = e.pageY;
  }
  else
  {
		x = event.x + document.body.scrollLeft;
    	y = event.y + document.body.scrollTop;
  }
  toolTipSTYLE.left = x + offsetX;
  toolTipSTYLE.top = y + offsetY;
  return true;
}


function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var remote;
function openPopup(initHtmlFile,winName)
{
	GP_AdvOpenWindow(initHtmlFile,winName,'fullscreen=no,toolbar=no,location=no,status=yes,menubar=no,scrollbars=no,resizable=no',400,180,'center','ignoreLink','',0,'');return document.MM_returnValue;

}

function checkBlank()
{
if (document.userid_form.elements[0].value == "" || document.userid_form.elements[1].value == ""){
  alert('please enter user-id and password');
   return false;
}
return true;
}
function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) 
  {
	if (document.all || document.layers || document.getElementById) 
	{
		w = screen.availWidth; h = screen.availHeight;
	}
	if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
	if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
	if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0; 						
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;
  }
  popupWindow = window.open(theURL,winName,features);
  if (popupWindow.opener == null) 
  { 
  	popupWindow.opener = self;  
  }
  popupWindow.opener.name = "opener";
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;

/*
	if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) { popupWindow[wp].opener = self;  popupWindow[wp].opener.name = "opener";}
  if (document.all || document.layers || document.getElementById) 
  {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") 
	{
    	ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
    	popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; 
	}
    if (autoCloseTime && autoCloseTime > 0) 
	{
		popupWindow[wp].document.body.onbeforeunload = function() 
		{
  			if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
    		window.onbeforeunload = null;	
		}  
   		autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); 
	  	window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; 
	}
  }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
  */
}
function checksubmit(initHtmlFile,winName)
{
  if (checkBlank())
  {
	openPopup(initHtmlFile,"popup");
	//prüfen ob ausgeblendeter Submit-Button vorhanden ist -> dann Formular über Submit-Button abschicken 
	//damit autocomplete funktioniert
	if(document.getElementById('userIDFormSubmitButton')!=null)	
	{
		window.setTimeout("document.getElementById('userIDFormSubmitButton').click();", 300);
	}else
	{
		window.setTimeout("document.userid_form.submit();", 300);
	}
  }
}

function checkEnter(e,initHtmlFile)
{ 	var characterCode 

	 if(e && e.which)
	 { 		 e = e
		 characterCode = e.which 
	 }
	 else
	 {
	 	e = event
		 characterCode = e.keyCode 
	 }


	 if(characterCode == 13)
	 { 	checksubmit(initHtmlFile);
		 return false
	 }
	 else
	 {
	 	return true
	 }


}


var refer=true;
function showComboPanel() 
{
	obj=MM_findObj("comboPanel");
	if (refer) 
	{
	  	obj.style.visibility="visible";
	  	refer=false;
	}
	else 
	{
		obj.style.visibility="hidden";
		refer=true;
	}
}


var refer2=true;
function showComboPanel2() 
{
	obj=MM_findObj("comboPanel2");
	if (refer2) 
	{
		obj.style.visibility="visible";
		refer2=false;
	}
	else 
	{
		obj.style.visibility="hidden";
		refer2=true;
	}
}

function scrollToElement(elementId)
{
	obj=MM_findObj(elementId);
//	alert(obj);
	obj.scrollIntoView(true)
//	alert("test");
}

function showElement(elementId)
{
	obj=MM_findObj(elementId);
	obj.style.visibility="visible";
//	alert(obj);
}

function hideElement(elementId)
{
	obj=MM_findObj(elementId);
	obj.style.visibility="hidden";
//	alert(obj);
}

var ajaxXmlHttp = false;

function getAjaxInstance(key)
{
	var ajaxInstance=null;

	if (typeof(XMLHttpRequest) != 'undefined') 
	{
		ajaxInstance = new XMLHttpRequest();
//			alert(ajaxInstance);
//			ajaxInstance.setRequestHeader("Content-type","application/x-www-form-urlencoded");
			//ajaxXmlHttp.setRequestHeader("Content-Type", "text/html; charset=ISO-8859-1");
			//ajaxXmlHttp.setRequestHeader("Content-Transfer-Encoding", "8bit");
	}
	if (!ajaxInstance) 
	{
		// Internet Explorer 6 und älter
		try {
			ajaxInstance  = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				ajaxInstance  = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				ajaxInstance  = false;
			}
		}
	}
	if (!ajaxInstance) 
	{
		alert("error creating ajax instance");
	}
	return ajaxInstance;
}
ajaxXmlHttp=getAjaxInstance();


function ajaxLoad(url,elementId,asynchronous,afterLoad)
{
	if (afterLoad)
	{
		if (asynchronous==false)
		{
			new Ajax.Updater(elementId, url, {   
				asynchronous: false,
				onComplete: afterLoad
			}); 
		}
		else
		{
			new Ajax.Updater(elementId, url, {   
				onComplete: afterLoad
			}); 
		}
	}
	else
	{
		if (asynchronous==false)
		{
			new Ajax.Updater(elementId, url, {   
				asynchronous: false
			}); 
		}
		else
		{
			new Ajax.Updater(elementId, url); 
		}
	}
}

function ajaxLoadSynchronous(url,elementId)
{
	return ajaxLoad(url,elementId,false);
}

function openEditorWindow(url)
{
	GP_AdvOpenWindow(url,'','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes',1000,750);
}

function showPleaseWait()
{
	document.getElementById('pleaseWaitPanel').style.display = 'block';
}

function hidePleaseWait()
{
	document.getElementById('pleaseWaitPanel').style.display = 'none';
}

function beginLoading()
{
	if (window.addEventListener)
	window.addEventListener("load", endLoading, false)
	else if (window.attachEvent)
	window.attachEvent("onload", endLoading)

	pwTimer=window.setTimeout("showPleaseWait()",2000);
}

function endLoading()
{
	hidePleaseWait();
	window.clearTimeout(pwTimer);
}

function MM_dragLayer(objName,x,hL,hT,hW,hH,toFront,dropBack,cU,cD,cL,cR,targL,targT,tol,dropJS,et,dragJS) { //v4.01
  //Copyright 1998 Macromedia, Inc. All rights reserved.
  var i,j,aLayer,retVal,curDrag=null,curLeft,curTop,IE=document.all,NS4=document.layers;
  var NS6=(!IE&&document.getElementById), NS=(NS4||NS6); if (!IE && !NS) return false;
  retVal = true; if(IE && event) event.returnValue = true;
  if (MM_dragLayer.arguments.length > 1) {
    curDrag = MM_findObj(objName); if (!curDrag) return false;
    if (!document.allLayers) { document.allLayers = new Array();
      with (document) if (NS4) { for (i=0; i<layers.length; i++) allLayers[i]=layers[i];
        for (i=0; i<allLayers.length; i++) if (allLayers[i].document && allLayers[i].document.layers)
          with (allLayers[i].document) for (j=0; j<layers.length; j++) allLayers[allLayers.length]=layers[j];
      } else {
        if (NS6) { var spns = getElementsByTagName("span"); var all = getElementsByTagName("div"); 
          for (i=0;i<spns.length;i++) if (spns[i].style&&spns[i].style.position) allLayers[allLayers.length]=spns[i];}
        for (i=0;i<all.length;i++) if (all[i].style&&all[i].style.position) allLayers[allLayers.length]=all[i]; 
    } }
    curDrag.MM_dragOk=true; curDrag.MM_targL=targL; curDrag.MM_targT=targT;
    curDrag.MM_tol=Math.pow(tol,2); curDrag.MM_hLeft=hL; curDrag.MM_hTop=hT;
    curDrag.MM_hWidth=hW; curDrag.MM_hHeight=hH; curDrag.MM_toFront=toFront;
    curDrag.MM_dropBack=dropBack; curDrag.MM_dropJS=dropJS;
    curDrag.MM_everyTime=et; curDrag.MM_dragJS=dragJS;
    curDrag.MM_oldZ = (NS4)?curDrag.zIndex:curDrag.style.zIndex;
    curLeft= (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft; 
    if (String(curLeft)=="NaN") curLeft=0; curDrag.MM_startL = curLeft;
    curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop; 
    if (String(curTop)=="NaN") curTop=0; curDrag.MM_startT = curTop;
    curDrag.MM_bL=(cL<0)?null:curLeft-cL; curDrag.MM_bT=(cU<0)?null:curTop-cU;
    curDrag.MM_bR=(cR<0)?null:curLeft+cR; curDrag.MM_bB=(cD<0)?null:curTop+cD;
    curDrag.MM_LEFTRIGHT=0; curDrag.MM_UPDOWN=0; curDrag.MM_SNAPPED=false; //use in your JS!
    document.onmousedown = MM_dragLayer; document.onmouseup = MM_dragLayer;
    if (NS) document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  } else {
    var theEvent = ((NS)?objName.type:event.type);
    if (theEvent == 'mousedown') {
      var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
      var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
      var maxDragZ=null; document.MM_maxZ = 0;
      for (i=0; i<document.allLayers.length; i++) { aLayer = document.allLayers[i];
        var aLayerZ = (NS4)?aLayer.zIndex:parseInt(aLayer.style.zIndex);
        if (aLayerZ > document.MM_maxZ) document.MM_maxZ = aLayerZ;
        var isVisible = (((NS4)?aLayer.visibility:aLayer.style.visibility).indexOf('hid') == -1);
        if (aLayer.MM_dragOk != null && isVisible) with (aLayer) {
          var parentL=0; var parentT=0;
          if (NS6) { parentLayer = aLayer.parentNode;
            while (parentLayer != null && parentLayer.style.position) {             
              parentL += parseInt(parentLayer.offsetLeft); parentT += parseInt(parentLayer.offsetTop);
              parentLayer = parentLayer.parentNode;
          } } else if (IE) { parentLayer = aLayer.parentElement;       
            while (parentLayer != null && parentLayer.style.position) {
              parentL += parentLayer.offsetLeft; parentT += parentLayer.offsetTop;
              parentLayer = parentLayer.parentElement; } }
          var tmpX=mouseX-(((NS4)?pageX:((NS6)?parseInt(style.left):style.pixelLeft)+parentL)+MM_hLeft);
          var tmpY=mouseY-(((NS4)?pageY:((NS6)?parseInt(style.top):style.pixelTop) +parentT)+MM_hTop);
          if (String(tmpX)=="NaN") tmpX=0; if (String(tmpY)=="NaN") tmpY=0;
          var tmpW = MM_hWidth;  if (tmpW <= 0) tmpW += ((NS4)?clip.width :offsetWidth);
          var tmpH = MM_hHeight; if (tmpH <= 0) tmpH += ((NS4)?clip.height:offsetHeight);
          if ((0 <= tmpX && tmpX < tmpW && 0 <= tmpY && tmpY < tmpH) && (maxDragZ == null
              || maxDragZ <= aLayerZ)) { curDrag = aLayer; maxDragZ = aLayerZ; } } }
      if (curDrag) {
        document.onmousemove = MM_dragLayer; if (NS4) document.captureEvents(Event.MOUSEMOVE);
        curLeft = (NS4)?curDrag.left:(NS6)?parseInt(curDrag.style.left):curDrag.style.pixelLeft;
        curTop = (NS4)?curDrag.top:(NS6)?parseInt(curDrag.style.top):curDrag.style.pixelTop;
        if (String(curLeft)=="NaN") curLeft=0; if (String(curTop)=="NaN") curTop=0;
        MM_oldX = mouseX - curLeft; MM_oldY = mouseY - curTop;
        document.MM_curDrag = curDrag;  curDrag.MM_SNAPPED=false;
        if(curDrag.MM_toFront) {
          eval('curDrag.'+((NS4)?'':'style.')+'zIndex=document.MM_maxZ+1');
          if (!curDrag.MM_dropBack) document.MM_maxZ++; }
        retVal = false; if(!NS4&&!NS6) event.returnValue = false;
    } } else if (theEvent == 'mousemove') {
      if (document.MM_curDrag) with (document.MM_curDrag) {
        var mouseX = (NS)?objName.pageX : event.clientX + document.body.scrollLeft;
        var mouseY = (NS)?objName.pageY : event.clientY + document.body.scrollTop;
        newLeft = mouseX-MM_oldX; newTop  = mouseY-MM_oldY;
        if (MM_bL!=null) newLeft = Math.max(newLeft,MM_bL);
        if (MM_bR!=null) newLeft = Math.min(newLeft,MM_bR);
        if (MM_bT!=null) newTop  = Math.max(newTop ,MM_bT);
        if (MM_bB!=null) newTop  = Math.min(newTop ,MM_bB);
        MM_LEFTRIGHT = newLeft-MM_startL; MM_UPDOWN = newTop-MM_startT;
        if (NS4) {left = newLeft; top = newTop;}
        else if (NS6){style.left = newLeft; style.top = newTop;}
        else {style.pixelLeft = newLeft; style.pixelTop = newTop;}
        if (MM_dragJS) eval(MM_dragJS);
        retVal = false; if(!NS) event.returnValue = false;
    } } else if (theEvent == 'mouseup') {
      document.onmousemove = null;
      if (NS) document.releaseEvents(Event.MOUSEMOVE);
      if (NS) document.captureEvents(Event.MOUSEDOWN); //for mac NS
      if (document.MM_curDrag) with (document.MM_curDrag) {
        if (typeof MM_targL =='number' && typeof MM_targT == 'number' &&
            (Math.pow(MM_targL-((NS4)?left:(NS6)?parseInt(style.left):style.pixelLeft),2)+
             Math.pow(MM_targT-((NS4)?top:(NS6)?parseInt(style.top):style.pixelTop),2))<=MM_tol) {
          if (NS4) {left = MM_targL; top = MM_targT;}
          else if (NS6) {style.left = MM_targL; style.top = MM_targT;}
          else {style.pixelLeft = MM_targL; style.pixelTop = MM_targT;}
          MM_SNAPPED = true; MM_LEFTRIGHT = MM_startL-MM_targL; MM_UPDOWN = MM_startT-MM_targT; }
        if (MM_everyTime || MM_SNAPPED) eval(MM_dropJS);
        if(MM_dropBack) {if (NS4) zIndex = MM_oldZ; else style.zIndex = MM_oldZ;}
        retVal = false; if(!NS) event.returnValue = false; }
      document.MM_curDrag = null;
    }
    if (NS) document.routeEvent(objName);
  } return retVal;
}

function getAbsolutePos(element) {
	var r = { x: element.offsetLeft, y: element.offsetTop };

	do{
		element = element.offsetParent;
		r.x += element.offsetLeft;
		r.y += element.offsetTop;
	}while (element.id!="content" && element.offsetParent.id!="content")
	return r;
}

function changeFrameMode(url,hideId,showId,hideId2,showId2)
{
	$(hideId).hide();
	$(showId).show();
	if (hideId2!=null) $(hideId2).hide();
	if (showId2!=null) $(showId2).show();

//	if (hideId2!=null) new Effect.Fade(hideId2);
//	if (hideId2!=null) new Effect.SwitchOff(hideId2);
//	if (showId2!=null) new Effect.Grow(showId2);

	new Ajax.Request(url); 
//window.frames["loader"].window.location=url;
}