// Copyright by Stefan Trinkwalder <st@dplusc.de> 01/2001
// (c) 2003 axl jung, dplusc neue medien GmbH <aj@dplusc.de>

<!--

	// bei zentrierten Seiten den tatsächlichen Wert für die Seitenbreite eintragen
	// bei linksbündigen Seiten den Wert '0' eintragen

	var seitenbreite = '730';


	// --- AB HIER NICHTS MEHR ÄNDERN ---

  var el='';
  var wert='';
  var editor = null;
  var selects = new Array();
  var select = '';
  var oldhere = '';
  var cidtext = new Array();
  xpos=0;
  ypos=0;
  posy=0;
  posx=0;
  eposy=0;
  eposx=0;
  actt=0;
  actd=0;

if (navigator.appName=="Netscape") {
     if (parseFloat(navigator.appVersion)>=5) UA = 'NS6'; else UA = 'NS4';
     }
else if (navigator.appVersion.indexOf("MSIE") != -1) {
      appVer = navigator.appVersion;
      iePos = appVer.indexOf('MSIE');
      ver = parseFloat(appVer.substring(iePos+5,appVer.indexOf(';',iePos)));
      if (ver < 5) UA = 'IE4'; else UA = 'IE5';
}

var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) UA = 'opera';

function getel(wert) {
	if ((UA=='IE5')||(UA=='NS6')||(UA=='opera')) {
	  	el=document.getElementById(wert);
	  } else if (UA=='NS4') {
        el=document.layers[wert]; 
      } else if (UA=='IE4') {
        el=document.all[wert];
      }
   return el;
}

function startpos() {
     if ((UA=='NS6')||(UA=='NS4')) xpos=((window.innerWidth - seitenbreite) / 2);
     if (UA=='opera') xpos=((window.innerWidth - seitenbreite) / 2)+9;
     if (UA=='IE5') xpos=((document.body.clientWidth-seitenbreite) / 2);
     if (UA=='IE4') xpos=((document.body.clientWidth-seitenbreite) / 2);
     if ( seitenbreite == '0' ) {
	 	if ( UA=='NS6' && navigator.userAgent.indexOf('Linux') != -1 ) xpos=9; else xpos=0;
	}

	 ypos=0;
     return xpos;
}

function move_el(el,posx,posy) {
     startpos();
     if ((UA=='NS6')||(UA=='IE5')) {
       el.style.left=xpos+posx+"px";
       el.style.top=ypos+posy+"px";
     }
     else if (UA=='opera') {
       el.style.pixelLeft=xpos+posx;
       el.style.pixelTop=ypos+posy;
     }
     else if (UA=='IE4') {
       el.style.left=xpos+posx;
     }
     else if (UA=='NS4') {
       posx=xpos+posx;
       el.moveTo(posx,posy);
     }
 }

 function visi_on(el) {
     if ((UA=='NS6') || (UA=='IE5') || (UA=='opera')) el.style.visibility="visible";
     if (UA=='IE4') el.style.visibility="visible";
     if (UA=='NS4') el.visibility="visible";
     }

 function visi_off(el) {
     if ((UA=='NS6') || (UA=='IE5') || (UA=='opera')) el.style.visibility="hidden";
     if (UA=='IE4') el.style.visibility="hidden";
     if (UA=='NS4') el.visibility="hidden";
     }


  function actlay(was,posx,posy) {
  startpos();
  getel(was);
  move_el(el,posx,posy);
  visi_on(el);
  }


function acttlay(was,posx,posy) {
    od = "d"+actd;
    ot = "t"+actt;
    if (actd!=0) {
        getel(od);
        visi_off(el);
      }
    if (actt!=0) {
        getel(ot);
        visi_off(el);
      }
      alt="t"+was;
      getel(alt);
      if (el) {
		visi_on(el);
      	move_el(el,posx,posy);
		actt = was;
	}
}

function actdlay(was,posx,posy) {
      if (actd!=0) {
        od="d"+actd;
        getel(od);
        visi_off(el);
      }
      lod="d"+was;
      getel(lod);
      visi_on(el);
      move_el(el,posx,posy);
actd=was;
}

function declay(was) {
  getel(was);
  visi_off(el);
}

function dopointerstyle() {
	if ( UA == 'IE5' ) {
		return 'hand';
	} else {
		return 'pointer';
	}
}

function dobgcolor(color,elem) {

	object=getel(elem);
	object.style.backgroundColor=color;

}

function MM(e) {
   yposi=450;
   startpos();
   if ((UA=='IE5')||(UA=='IE4')||(UA=='opera')) eposx=event.clientX;
   else if ((UA=='NS6')||(UA=='NS4')) eposx=e.pageX;
   if ((UA=='IE5')||(UA=='IE4')||(UA=='opera')) eposy=event.clientY;
   else if ((UA=='NS6')||(UA=='NS4')) eposy=e.pageY;
   at="t"+actt;
   ad="d"+actd;
   xposi=xpos+750;
   if ((eposy>yposi) || (eposx>xposi) && (actt!=0)) {
   if (actt!=0) {
   		getel(at);
   //alert(at);
   		visi_off(el);
	}
   if(actd!=0) {
     getel(ad);
     visi_off(el);
   }
  }
}

if (UA=='NS4') {
    document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
}

document.onmousemove = MM;

function wopen(file,name,w,h,params) {
	var win = null;
	win=window.open(file,name,"width="+w+",height="+h+","+params);
	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
  }
function wprint() {
    window.print();
  }

	// zentriertes popup-fenster	
function centerwindow(file,name,width,height,scroll,resizeable){
  var win = null;
  var winl = (screen.width-width)/2;
  var wint = (screen.height-height)/2;
  var settings  ='height='+height+',';
      settings +='width='+width+',';
      settings +='top='+wint+',';
      settings +='left='+winl+',';
      settings +='scrollbars='+scroll+',';
      settings +='resizable='+resizeable+'';
  win=window.open(file,name,settings);
  if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}


  function acteditlay(was) {

  getel('editcms');
  if ((UA=='IE5')||(UA=='IE4')||(UA=='opera')) move_el(el,eposx-xpos,document.body.scrollTop+eposy-ypos);
  else move_el(el,eposx-xpos,eposy-ypos);
  document.editcms.id.value=was;
  //document.editcms.text.value=was2.replace(/<br \/>/gi,"\n");
  document.editcms.text.value=cidtext[was];
  document.editcms.ref.value=window.location;
  visi_on(el);
//	if ( !document.getElementById("_text_editor") ) {
//		editor_generate('text');
//	} else {
//		editor_setHTML('text',document.editcms.text.value);
//  	}
   if ( editor == null ) {
	editor = new HTMLArea("text");
	editor.registerPlugin("TableOperations");
	editor.generate();
   } else {
   	editor.setHTML(document.editcms.text.value);
   }
  return false;
  }

  function editsubmit() {
	//document.editcms.onsubmit();
	document.editcms.text.value = editor.getHTML();
	document.editcms.submit();
  }

	function actlayhere(was) {
	if ( oldhere ) {
		getel(oldhere);
		visi_off(el);
	}
	getel(was);
  if ((UA=='IE5')||(UA=='IE4')||(UA=='opera')) move_el(el,eposx-xpos,document.body.scrollTop+eposy-ypos);
  else move_el(el,eposx-xpos,eposy-ypos);
  visi_on(el);
  oldhere=was;
	}
	
	function hideselect() {
		for ( select in selects ) {
			getel(selects[select]);
			visi_off(el);
		}
	}
	function showselect() {
		for ( select in selects ) {
			getel(selects[select]);
			visi_on(el);
		}
	}
	
function reisen_edititem_submit() {
	document.reisen.re_desc_n.value = redesc.getHTML();
	document.reisen.submit();
}

function reisen_editpix_submit() {
	var breaking = false;
	with (document.editpix) {
		if ( act_select_1_n.value != 0 && (act_select_1_n.value == act_select_2_n.value || act_select_1_n.value == act_select_3_n.value || act_select_1_n.value == act_select_4_n.value || act_select_1_n.value == act_select_5_n.value || act_select_1_n.value == act_select_6_n.value )) breaking = true;
		if ( act_select_2_n.value != 0 && (act_select_2_n.value == act_select_1_n.value || act_select_2_n.value == act_select_3_n.value || act_select_2_n.value == act_select_4_n.value || act_select_2_n.value == act_select_5_n.value || act_select_2_n.value == act_select_6_n.value )) breaking = true;
		if ( act_select_3_n.value != 0 && (act_select_3_n.value == act_select_2_n.value || act_select_3_n.value == act_select_1_n.value || act_select_3_n.value == act_select_4_n.value || act_select_3_n.value == act_select_5_n.value || act_select_3_n.value == act_select_6_n.value )) breaking = true;
		if ( act_select_4_n.value != 0 && (act_select_4_n.value == act_select_2_n.value || act_select_4_n.value == act_select_3_n.value || act_select_4_n.value == act_select_1_n.value || act_select_4_n.value == act_select_5_n.value || act_select_4_n.value == act_select_6_n.value )) breaking = true;
		if ( act_select_5_n.value != 0 && (act_select_5_n.value == act_select_2_n.value || act_select_5_n.value == act_select_3_n.value || act_select_5_n.value == act_select_4_n.value || act_select_5_n.value == act_select_1_n.value || act_select_5_n.value == act_select_6_n.value )) breaking = true;
		if ( act_select_6_n.value != 0 && (act_select_6_n.value == act_select_2_n.value || act_select_6_n.value == act_select_3_n.value || act_select_6_n.value == act_select_4_n.value || act_select_6_n.value == act_select_5_n.value || act_select_6_n.value == act_select_1_n.value )) breaking = true;
	}
	if ( breaking == true ) {
		alert('Sie dürfen eine Stellenangabe (1-3) nur einmal verwenden! Nicht zu verwendende Bilder bitte auf 0 stellen!');
		return false;
	} else {
		return true;
	}
}

//-->

