//GLOBAL VARIABLES

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);

//GLOBAL FUNCTIONS

//Pick appropriate style sheet (due to larger IE font sizes)

function getStyleSheet(level) {
        var url  = window.location.toString();

        if(level = 0)
        {

            if ((browserName == "Netscape") && (browserVer <= 4) )
			{

              	document.write("<link rel=\"stylesheet\" href=\"shop_lib/global_9.css\" type=\"text/css\">");

			}
            else
			{

			document.write("<link rel=\"stylesheet\" href=\"shop_lib/global_9.css\" type=\"text/css\">");

			}
        }

        if(level = 1)
        
        {

            if ((browserName == "Netscape") && (browserVer <= 4) )
			{

			document.write("<link rel=\"stylesheet\" href=\"../shop_lib/global_9.css\" type=\"text/css\">");

			}
            else
			{

			document.write("<link rel=\"stylesheet\" href=\"../shop_lib/global_9.css\" type=\"text/css\">");
			
			}
        }

        if(level = 2)
        
        {

            if ((browserName == "Netscape") && (browserVer <= 4) )
			{

			document.write("<link rel=\"stylesheet\" href=\"../../shop_lib/global_9.css\" type=\"text/css\">");

			}
            else
			{

			document.write("<link rel=\"stylesheet\" href=\"../../shop_lib/global_9.css\" type=\"text/css\">");

      			}

        }

        if(level = 3)
        
        {

            if ((browserName == "Netscape") && (browserVer <= 4) )
			{

			document.write("<link rel=\"stylesheet\" href=\"../../../shop_lib/global_9.css\" type=\"text/css\">");

			}
            else
			{

			document.write("<link rel=\"stylesheet\" href=\"../../../shop_lib/global_9.css\" type=\"text/css\">");

    			}
	 }

        if(level = 4)
        
        {

            if ((browserName == "Netscape") && (browserVer <= 4) )
			{

				document.write("<link rel=\"stylesheet\" href=\"../../../../shop_lib/global_9.css\" type=\"text/css\">");

			}
            else
			{

			    document.write("<link rel=\"stylesheet\" href=\"../../../../shop_lib/global_9.css\" type=\"text/css\">");
			}

        }

}

//Fix Netscape 4 bug which loses CSS info with window resize

function fixNetscapeCSS() {
  if (document.debug.fixNetscapeCSS.initWindowWidth != window.innerWidth ||  document.debug.fixNetscapeCSS.initWindowHeight != window.innerHeight)
  {
    document.location = document.location;
  }
}

function fixNetscapeCSS_Init() {
  // Set all resize events to be handled by the fixNetscapeCSS() function
  if ((browserName == 'Netscape') && (browserVer == 4))
  	{
  	  if (typeof document.debug == 'undefined'){
      document.debug = new Object;
    }
    if (typeof document.debug.scaleFont == 'undefined') {
      document.debug.fixNetscapeCSS = new Object;
      document.debug.fixNetscapeCSS.initWindowWidth = window.innerWidth;
      document.debug.fixNetscapeCSS.initWindowHeight = window.innerHeight;
    }
    window.onresize = fixNetscapeCSS;
  }
}

var newWindow;

function openPlainWin(thisURL,winName,winWidth,winHeight,xPos,yPos) {
  if (!newWindow || newWindow.closed) {
    winOpts = "width=" + winWidth + ",height=" + winHeight + ",toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes";
    if (xPos != "") winOpts += ",screenX=" + xPos + ",left=" + xPos;
    if (yPos != "") winOpts += ",screenY=" + yPos + ",top=" + yPos;
    newWindow = window.open("",winName,winOpts);
    newWindow.location.href = thisURL;
    if (!newWindow.opener) {
      newWindow.opener = window;
    }
  }
  else {
    // window's already open; bring to front
    newWindow.focus();
    newWindow.location.href = thisURL;
  }
}


//INITIALIZATION

getStyleSheet(1);
fixNetscapeCSS_Init();
//if (top != self) top.location.href = location.href; // Bust out of frames
document.writeln(""); // Netscape's workaround for their resize bug




// PopupWindow wird erstellt.

function popupWindow(url)
	{

     window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=600,height=600,screenX=150,screenY=100,top=50,left=150');
    }


// Resize des Productimagefensters.

function resize()
{
  if (document.images[0]) window.resizeTo(document.images[0].width + 35, document.images[0].height + 60);
  self.focus();
}

