// Zentrales Includefile für Javascript Funktionen
//
// Filename: global.js
//

current_overID = '';
last_img = '';
last_clickID = '';

function MakeArray()	{
	var lngth = MakeArray.arguments.length;
	for ( i = 0 ; i < lngth ; i++ )	{
		this[i]=MakeArray.arguments[i];
	}
}

function mouseover (imgName)	{
	if (document.images)    {
		if (last_clickID != imgName)	{
			self.document.images[imgName].src =	"/images/" +[imgName] + ".2.gif";
		}
		if (last_img != '' && last_img != imgName && last_clickID != last_img)	{
			self.document.images[last_img].src = "/images/" +[imgName] + ".1.gif";
		}
		last_img = imgName;
	}
}
	
function	mouseoff (imgName)	{
	if (document.images)    {
		if (last_clickID != imgName)	{
			self.document.images[imgName].src = "/images/" +[imgName] + ".1.gif";
		}
		if (last_clickID != '')	{
			self.document.images [last_clickID].src = "/images/" + [imgName] + ".2.gif";
		}
		last_img = '';
	}
}




function newwindow(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=yes,dependent,height=600,width=800");
  newwindow.focus();
  return(newwindow);
}

function viewerwindow(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,scrollbars=yes,dependent,height=600,width=800");
  newwindow.focus();
  // return(newwindow);
}

function popup(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,dependent,height=550,width=400");
  newwindow.focus();

  // return(newwindow);
}

function impressum_popup(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,dependent,height=400,width=550");
  newwindow.focus();

  // return(newwindow);
}

function wcam_popup(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,dependent,height=600,width=700");
  newwindow.focus();

  // return(newwindow);
}

function shop_popup(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,scrollbars=yes,dependent,height=750,width=550");
  newwindow.focus();

  // return(newwindow);
}

function votes_popup(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,scrollbars=no,dependent,height=300,width=500");
  newwindow.focus();

  // return(newwindow);
}

function gewinn_popup(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,scrollbars=no,dependent,height=400,width=600");
  newwindow.focus();

  // return(newwindow);
}

function stadtplan_popup(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,dependent,height=600,width=800");
  newwindow.focus();

  // return(newwindow);
}

function vibus_popup(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,dependent,height=700,width=800");
  newwindow.focus();

  // return(newwindow);
}


function wetter_popup(url,windowname) {
  if( url != "" ) {
    newwindow = window.open(url, windowname, "toolbar=no,scrollbars=yes,dependent,height=600,width=800");
    newwindow.focus();
  }
  // return(newwindow);
}

function premiumpopup(url,windowname) {
  if( url != "" ) {
    newwindow = window.open(url, windowname, "toolbar=no,dependent,height=350,width=350");
    newwindow.focus();
  }
  // return(newwindow);
}

function video_dsl_popup(url,windowname) {
  if( url != "" ) {
    newwindow = window.open(url, windowname, "toolbar=no,dependent,height=325,width=310");
    newwindow.focus();
  }
  // return(newwindow);
}

function video_auswahl_popup(url,windowname) {
  if( url != "" ) {
    newwindow = window.open(url, windowname, "toolbar=no,dependent,height=325,width=310");
    newwindow.focus();
  }
  // return(newwindow);
}

function video_modem_popup(url,windowname) {
  if( url != "" ) {
    newwindow = window.open(url, windowname, "toolbar=no,dependent,height=267,width=310");
    newwindow.focus();
  }
  // return(newwindow);
}

function popup_max(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,dependent,scrollbars=yes,height=630,width=600");
  newwindow.focus();

  // return(newwindow);
}

function popup_medium(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,dependent,scrollbars=yes,height=450,width=450");
  newwindow.focus();

  // return(newwindow);
}

function popup_big(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,dependent,scrollbars=yes,height=750,width=600");
  newwindow.focus();

  // return(newwindow);
}

function popup_bigger(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,dependent,scrollbars=yes,height=900,width=440");
  newwindow.focus();

  // return(newwindow);
}


function popup_small(url,windowname) {

  x = window.screenX;
  y = window.screenY;
  sizex = window.outerWidth;
  sizey = window.outerHeight;

  xoffset = Math.round(x+((sizex-350)/2));
  yoffset = Math.round(y+((sizey-170)/2));

  newwindow = window.open(url, windowname, "toolbar=no,dependent,screenX=xoffset,screenY=yoffset,height=170,width=350");

  newwindow.moveTo(xoffset,xoffset);
  newwindow.focus();

  // return(newwindow);
}

function popup_list(url,windowname) {

  x = window.screenX;
  y = window.screenY;
  sizex = window.outerWidth;
  sizey = window.outerHeight;

  xoffset = Math.round(x+((sizex-350)/2));
  yoffset = Math.round(y+((sizey-400)/2));

  newwindow = window.open(url, windowname, "toolbar=no,dependent,scrollbars=yes,screenX=xoffset,screenY=yoffset,height=400,width=350");

  newwindow.moveTo(xoffset,xoffset);
  newwindow.focus();

  // return(newwindow);
}

function popup_full(url,windowname) {

  newwindow = window.open(url, windowname, "toolbar=no,dependent,scrollbars=yes,status=yes,screenX=xoffset,screenY=yoffset,height=500,width=700");

  newwindow.focus();

  // return(newwindow);
}

function popup_print(url,windowname) {

  newwindow = window.open(url, windowname, "toolbar=no,dependent,scrollbars=yes,status=yes,screenX=xoffset,screenY=yoffset,height=600,width=570");

  newwindow.focus();

  // return(newwindow);
}

function popup_forum(url,windowname) {

  var size_x = screen.width - 20;
  var size_y = screen.height - 20;
  if( size_x < 620 ) {
    size_x = 620;
  } else {
    if( size_x > 1024 ) {
      size_x = 1024;
    }
  }
 
  if( size_y < 460 ) {
    size_y = 460;
  } else {
    if( size_y > 768 ) {
      size_y = 768;
    }
  } 

  agt=navigator.userAgent.toLowerCase();
  if (agt.indexOf("mac")!= -1) {  
    if (browserName=="Microsoft Internet Explorer") {
      size_x = size_x - 16;
      size_y = size_y - 16;
    }
  }

  var pos_left = (screen.width - size_x) / 2;
  var pos_top = (screen.height - size_y) / 2;
  var browserName = navigator.appName;
  var winprops = 'height='+size_y+',width='+size_x+',top='+pos_top+',left='+pos_left+',toolbar=no,dependent,scrollbars=yes,status=no';

  newwindow = window.open(url, windowname, winprops);
  newwindow.focus();

  // newwindow = window.open(url, windowname, "toolbar=no,dependent,scrollbars=yes,status=no,screenX=xoffset,screenY=yoffset,height=650,width=780");

}


function popup_feratel(url,windowname) {

  var size_x = screen.width - 20;
  var size_y = screen.height - 20;
  if( size_x < 620 ) {
    size_x = 620;
  } else {
    if( size_x > 1024 ) {
      size_x = 1024;
    }
  }
 
  if( size_y < 460 ) {
    size_y = 460;
  } else {
    if( size_y > 768 ) {
      size_y = 768;
    }
  } 

  agt=navigator.userAgent.toLowerCase();
  if (agt.indexOf("mac")!= -1) {  
    if (browserName=="Microsoft Internet Explorer") {
      size_x = size_x - 16;
      size_y = size_y - 16;
    }
  }

  var pos_left = (screen.width - size_x) / 2;
  var pos_top = (screen.height - size_y) / 2;
  var browserName = navigator.appName;
  var winprops = 'height='+size_y+',width='+size_x+',top='+pos_top+',left='+pos_left+',toolbar=yes,dependent,scrollbars=yes,status=no';

  newwindow = window.open(url, windowname, winprops);
  newwindow.focus();

  // newwindow = window.open(url, windowname, "toolbar=yes,dependent,scrollbars=yes,status=no,screenX=xoffset,screenY=yoffset,height=650,width=780");

}


function galpopup_max(url,windowname) {
  newwindow = window.open(url, windowname, "toolbar=no,dependent,scrollbars=yes,height=630,width=500");
  newwindow.focus();

  // return(newwindow);
}

function closepopup(windowname) {
  windowname.close();
}

function closeself(homeurl) {
  opener.location=homeurl;
  self.close();
}


function openpopup(popurl){
  var winl = (screen.width - 650) / 2;
  var wint = (screen.height - 450) / 2;
  winprops = 'height=450,width=650,top='+wint+',left='+winl+'resizable=0';
   	 var browserName= navigator.appName; 
  if (browserName=="Netscape"){ winprops = 'height=425,width=650,top='+wint+',left='+winl+'resizable=0'; }
     agt=navigator.userAgent.toLowerCase();
  if (agt.indexOf("mac")!= -1)
     {  if (browserName=="Microsoft Internet Explorer")
        {  winprops = 'height=434,width=634,top='+wint+',left='+winl+'resizable=0';
        }
     }
     window.open(popurl,"",winprops);
}

