
if (document.layers){
    window.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
    window.onmousedown=rightclick;
    window.onmouseup=rightclick;
    function rightclick(e) {
    if (e.which == 3) {
    //alert('Sorry: Deaktiviert.');
    return false; 
    } else {     return true; }
    }
}
if (document.all){
    function click() {
    if (event.button==2) {
    //alert('Sorry: Deaktiviert.'); 
	}
    if (event.button==3) {
    //alert('Sorry: Deaktiviert.');
	}
    } document.onmousedown=click
}

//Zentriertes Window aufpoppen--------------------------------------------------------------------------
function popIt(URL, breite, hoehe)
{
	if (!breite){var breite=420;}
	if (!hoehe)	{var hoehe=415;}
	
	var top=(screen.availHeight-hoehe)/2;
	var left=(screen.availWidth-breite)/2;
	var args = "height="+hoehe+", width="+breite+",menubar=0,resizable=1,scrollbars=0,status=0,titlebar=0,toolbar=0,left="+left+",top="+top;
	popwin=window.open(URL,'popname',args);
	popwin.focus();
}



function getImgByName(name){
  for(var i=0; i<document.images.length; i++){
    if (document.images[i].name==name){
      return eval(document.images[i]);
    }
  }
}

function resizeForImg(){
  var img = getImgByName("bild");
  var breite = img.width+20;
  var hoehe = img.height+70;
//  alert ("breite "+breite);
//  alert ("hoehe "+hoehe);
//  window.resizeBy(breite-250,hoehe-80);
  window.resizeTo(breite,hoehe);
  window.moveTo((screen.width-breite)/2, (screen.height-hoehe)/2);
  self.focus();
}




//Zentriertes Window aufpoppen--------------------------------------------------------------------------
function poptext(URL, breite, hoehe)
{
	if (!breite){var breite=420;}
	if (!hoehe)	{var hoehe=415;}
	
	var top=(screen.availHeight-hoehe)/2;
	var left=(screen.availWidth-breite)/2;
	var args = "height="+hoehe+", width="+breite+",menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,left="+left+",top="+top;
	poptextwin=window.open(URL,'poptextname',args);
	poptextwin.focus();
}

function mediumize(img){
	//aufruf: onClick="mediumize(eval(this))"
	var src_str=img.src;
	//Sucht, ob in src  ".gif" vorkommt...
	if (src_str && src_str.match(/\_s.gif$/)){
		//var ausdruck = /^(.*)\_s.gif$/;
		//ausdruck.exec(src_str);
		//...und ersetzt ihn wenn ja durch "_m.gif"
		//document.medium.src = RegExp.$1 + "_m.gif";
		
	} else if (src_str) {
		//wenn nicht wird ".jpg"...
		var ausdruck = /^(.*)\_s.jpg$/;
		ausdruck.exec(src_str);
		//...durch "_medium.jpg" ersetzt
		document.medium.src = RegExp.$1 + "_m.jpg";
	}
}


function enlarge(img){
	//aufruf: onClick="mediumize(eval(this))"
	var src_str=img.src;
	//Sucht, ob in src  ".gif" vorkommt...
	if (src_str && src_str.match(/\.gif$/)){
		var ausdruck = /^(.*)\.gif$/;
		ausdruck.exec(src_str);
		//...und ersetzt ihn wenn ja durch "_l.gif"
		//var largeImg = RegExp.$1 + "_l.gif";
		alert('no preview loaded - move mouse over picture');
		
	} else if (src_str) {
		//wenn nicht wird ".jpg"...
		var ausdruck = /^(.*)\_s.jpg$/;
		ausdruck.exec(src_str);
		//...durch "_medium.jpg" ersetzt
		var largeImg = RegExp.$1 + "_l.jpg";
		popIt('showpic.php?pic='+largeImg, 250, 80);
	}
	return false;

}


function enlargeSWF(link){
	//aufruf: onClick="enlargeSWF(eval(this))"
	var src_str=link.href;
	//Sucht, ob in src  ".gif" vorkommt...
	if (src_str && src_str.match(/\.swf/)){
    	    popIt('showswf.php?swf='+src_str, 250, 80);
	} else {
	    alert('only SWF supported');
	}
	return false;

}





function flip(img){
	//aufruf: onMouseOver="flip(eval(this))" onMouseOut="flip(eval(this))"
	var src_str=img.src;
	//Sucht, ob in src des files der String "_over.gif" vorkommt...
	if (src_str.match(/_over\.gif$/)){
		var ausdruck = /^(.*)_over\.gif$/;
		ausdruck.exec(src_str);
		//...und ersetzt ihn wenn ja durch ".gif"
		img.src = RegExp.$1 + ".gif";
		
	} else {
		//wenn nicht wird ".gif"...
		var ausdruck = /^(.*)\.gif$/;
		ausdruck.exec(src_str);
		//...durch "_over.gif" ersetzt
		img.src = RegExp.$1 + "_over.gif";
	}
}

function YY_showHideLayers(L2show, L2hide) { //v3.01
//copyright (c)1998-2000 Yaromat.com
  if (document.layers){ //ns
    for (i=0; i<(document.layers.length); i++){
      if (document.layers[i].name.search(L2hide) != -1){document.layers[i].visibility = 'hide';}
      if (document.layers[i].name.search(L2show) != -1){document.layers[i].visibility = 'show';}
    }
  }else
 
  if (document.getElementById){ //mz
    var yydiv = document.getElementsByTagName("DIV");
    for (i=0; i<(yydiv.length); i++){
      if (yydiv[i]) {var yydivname = yydiv[i].id;} else {var yydivname = '';}
      if (yydivname.search(L2hide) != -1) document.getElementById(yydivname).style.visibility = 'hidden';
      if (yydivname.search(L2show) != -1) document.getElementById(yydivname).style.visibility = 'visible';
    }
  }

 else
  if (document.all != null){ //ie
    var yydiv = document.all.tags("DIV");
    for (i=0; i<(yydiv.length); i++){
      if (yydiv[i]) {var yydivname = yydiv[i].id;} else {var yydivname = '';}
      if (yydivname.search(L2hide) != -1) document.all[yydivname].style.visibility = 'hidden';
      if (yydivname.search(L2show) != -1) document.all[yydivname].style.visibility = 'visible';
        }
  }
}

