function WM_netscapeCssFix() {
  /*
    Source: Webmonkey Code Library
    (http://www.hotwired.com/webmonkey/javascript/code_library/)

    Author: Taylor
    Author Email: taylor@wired.com
    Author URL: http://www.taylor.org/
    */

  // This part was inspired by Matthew_Baird@wayfarer.com
  // It gets around another unfortunate bug whereby Netscape 
  // fires a resize event when the scrollbars pop up. This 
  // checks to make sure that the window's available size 
  // has actually changed.
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function WM_netscapeCssFixCheckIn() {
  // This function checks to make sure the version of Netscape 
  // in use contains the bug; if so, it records the window's 
  // width and height and sets all resize events to be handled 
  // by the WM_netscapeCssFix() function.
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}

WM_netscapeCssFixCheckIn()

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

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.0
  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 && document.getElementById) x=document.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];}
}

//params for random images on projectpage
var maxpicts = 12;
var pics_in_document = 9;
var imageurl = "random-mini/";
var rtime = 100;
var dir = "up";
var loadimg;
var running;

function rotate(img, time) {
	if (document.images) {
		rand = Math.floor(Math.random() * maxpicts) + 1;
		setTimeout("document."+img+".src='"+imageurl+loadimg+rand+".gif'", time);
		//eval ("document."+img+".src='"+imageurl+loadimg+ rand+".gif'");
		//self.status = "rand: " + rand
	}
}

//initialize projektpage random image stuff
//MM_preloadImages("random_mini/a0.gif","random_mini/a1.gif","random_mini/a2.gif","random_mini/a3.gif","random_mini/a4.gif","random_mini/a5.gif","random_mini/a06gif","random_mini/a7.gif","random_mini/a8.gif","random_mini/a9.gif","random_mini/a10.gif","random_mini/a11.gif","random_mini/a12.gif")

function init_rndpix_p() {
loadimg = "a";
maxpicts = 12;
imageurl = "random-mini/";
if (running) clearInterval(running);
running = setInterval("flupp()",700);
}

//initialize shoppage random swines
//MM_preloadImages("random_mini/a0.gif","random_mini/a1.gif","random_mini/a2.gif","random_mini/a3.gif","random_mini/a4.gif","random_mini/a5.gif","random_mini/a06gif","random_mini/a7.gif","random_mini/a8.gif","random_mini/a9.gif","random_mini/a10.gif","random_mini/a11.gif","random_mini/a12.gif")

function init_rndpix_s() {
loadimg = "swine";
maxpicts = 19;
imageurl = "random-swines/";
if (running) clearInterval(running);
running = setInterval("flupp()",900);
}

function flupp() {
rand = Math.floor(Math.random() * pics_in_document) + 1;
ntime = (Math.floor(Math.random() * (rtime/2)) + 1) * 100;
if (dir=="up") rtime += ntime;
if (dir=="dwn") rtime -= ntime;
if (rtime>3500) dir = "dwn";
if (rtime<=0) { dir = "up"; rtime = 0; }
randPic = "r" + rand;
rotate(randPic, rtime);
}

function ZweiFrames(F0,URL1,F1,URL2){
	parent.frames[F0].location.href=URL1;
	parent.frames[F1].location.href=URL2;
}













