var ns = (document.layers) ? 1 : 0;

function openClipping(page,clipping,name) { //v2.0
  	img = new Image();
	img.onload = function () {
		ScreenWidth = screen.width;
	 	ScreenHeight = screen.height;
		if(this.width > ScreenWidth){width = ScreenWidth;}else{width = this.width;};
		if(this.height > ScreenHeight){height = ScreenHeight;}else{height = this.height;};
		feat = 'width='+width+',height='+height+',menubar=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no';
		window.open(page,name,feat);
	}
	img.src = clipping;
}
function initSite(){
	if (window.screen) {
//		breite = screen.availWidth;
		window.resizeTo(screen.availWidth,screen.availHeight)
		window.moveTo(0,0);
	}
//	if (document.layers) {
//	  onresize = function() { if(innerWidth != screen.availWidth || innerHeight != screen.availHeight) location.reload(); }
//	}
//	else if (document.all) onresize = function() { window.location.reload(); }
}
function popup(url,name,w,h){    
	if(!window.opera){
		w = w +30
		h= h+30
		l    = 0
		t    = 0
	}
	else{
		w = w +30
		h= h+30
		l    = 0
		t    = 0
	}       
	win = window.open(url,name,'width='+w+',height='+h+',left='+l+',top='+t+',menubar=no,location=no,resizable=yes,scrollbars=yes,toolbar=no,status=no');
	win.focus();
} 
function newWindow(url,name,w,h){   
	if(!w)
	w=screen.availWidth-300;
	if(!h)
	h=screen.availHeight-300;

	if(!window.opera){
		l    = (screen.availWidth/2)-(w/2);
		t    = (screen.availHeight/2)-(h/2)-75;
	}
	else{
		l    = (window.innerWidth/2)-(w/2);
		t    = (window.innerHeight/2)-(h/2)-75;
	}       
	win = window.open(url,name,'width='+w+',height='+h+',left='+l+',top='+t+',menubar=yes,location=yes,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
	win.focus();
} 
function windowExtern(url){   
	win = window.open(url, "_blank","menubar=yes,location=yes,resizable=yes,scrollbars=yes,toolbar=yes,status=yes");
	win.moveTo(0,0);
	win.focus();
} 
function resizeWindow()
{
	self.moveTo(0,0);
		
	w = screen.availWidth;
	h = screen.availHeight;
		
	if (ns) {
		w = w - (this.outerWidth - this.innerWidth);
		h = h - (this.outerHeight - this.innerHeight);
	}
	self.resizeTo(w,h);
}
function initIndex(){
	window.onload = resizeWindow();
}
function pop_up(url,name,width,height)
  {my_pop_up = window.open(url,name,'width='+ width + ',height=' + height + ',left=0,top=0,scrollbars=yes,toolbar=no,resizable=yes,location=no,status=no,menubar=no');
  }
function openWin(theURL) {
	window.open(theURL);
	self.close();
}
function MM_preloadImages() { //v3.0
  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() { //v3.0
  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) { //v4.01
  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() { //v3.0
  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];}
}
//added by a.b. 2008-03-19
var newwindow = false; //this is the window, which plays the main flash movie
var newpopup = false; //this ist the window, which opens from within flash
var gallerypopup = false; //this is the window for janinmoscow etc
function popitup(url,name,width,height) {
    //use this function only for the main flash movie
    w = screen.availWidth;
	h = screen.availHeight;
	if (ns) {
		w = w - (this.outerWidth - this.innerWidth);
		h = h - (this.outerHeight - this.innerHeight);
	}
	if(!newwindow.closed && newwindow.location) {
		newwindow.location.href = url;
	}else{
		newwindow=window.open(url,name,'width='+ w + ',height=' + h + ',left=0,top=0,scrollbars=yes,toolbar=no,resizable=yes,location=no,status=no,menubar=no');
		if(!newwindow.opener) newwindow.opener = self;
	}
	if(window.focus) newwindow.focus();
	if(newwindow) {
	    try{
	        var popuptest = newwindow.name
	        if(typeof(popuptest) == 'undefined') {
	            return true; // opera blocker
	        }
	    }catch(e){
	        return true;
	    }
	    return false; //popup opened successfully
	}else{
	    return true; // ie6 blocker
	}
}
function flashpopup(url,name,width,height) {
    //use this function only for popups from within flash
    //returns true on success (popup open), false otherwise
	if(!newpopup.closed && newpopup.location) {
		newpopup.location.href = url;
	}else{
		newpopup=window.open(url,name,'width='+ width + ',height=' + height + ',left=0,top=0,scrollbars=yes,toolbar=no,resizable=yes,location=no,status=no,menubar=no');
		if(!newpopup.opener) newpopup.opener = self;
	}
	if(window.focus) newpopup.focus();
	if(newpopup) {
	    try{
	        var popuptest = newpopup.name
	        if(typeof(popuptest) == 'undefined') {
	            return false; // opera blocker
	        }
	    }catch(e){
	        return false;
	    }
	    return true; //popup opened successfully
	}else{
	    return false; // ie6 blocker
	}
}
function gallerypopup(url,name) {
    //use this function only for gallery-popups from within flash
    //returns true on success (popup open), false otherwise
    w = screen.availWidth;
	h = screen.availHeight;	
	if (ns) {
		w = w - (this.outerWidth - this.innerWidth);
		h = h - (this.outerHeight - this.innerHeight);
	}
	if(!gallerypopup.closed && gallerypopup.location) {
		gallerypopup.location.href = url;
	}else{
		gallerypopup=window.open(url,name,'width='+ w + ',height=' + h + ',left=0,top=0,scrollbars=yes,toolbar=no,resizable=yes,location=no,status=no,menubar=no');
		if(!gallerypopup.opener) gallerypopup.opener = self;
	}
	if(window.focus) gallerypopup.focus();
	if(gallerypopup) {
	    try{
	        var popuptest = gallerypopup.name
	        if(typeof(popuptest) == 'undefined') {
	            return false; // opera blocker
	        }
	    }catch(e){
	        return false;
	    }
	    return true; //popup opened successfully
	}else{
	    return false; // ie6 blocker
	}
}

function returnTrue(){
    return true;
}