// Enable correct resizing in Navigator 4.x
 // (IE 4+ and Navigator 6 do it perfectly)
 // Usage: Just LINK to your HTML page 

 function handleResize() 
 {
   if (window.prevWidth != window.innerWidth || 
       window.prevHeight != window.innerHeight) 
   {
     history.go(0);
     return false;
   }
 }

 if (navigator.appName.indexOf("Netscape") >= 0 &&  
     parseInt(navigator.appVersion) == 4)
 {
   window.prevWidth = window.innerWidth;
   window.prevHeight = window.innerHeight;
   window.captureEvents(Event.RESIZE);
   window.onresize = handleResize;
 }


 
 // convert all characters to lowercase to simplify testing 
var agt=navigator.userAgent.toLowerCase(); 

//BROWSER VERSION
// Note: On IE5, these return 4, so use is_ie5up to detect IE5. 
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion); 

//BROWSER TYPE 
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
            && (agt.indexOf('webtv')==-1));
            
var is_nav4up = (is_nav && (is_major >= 4));
var is_nav6up = (is_nav && (is_major >= 5)); 
 
 
var is_ie   = (agt.indexOf("msie") != -1); 
var is_ie3  = (is_ie && (is_major < 4)); 
var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
var is_ie4up  = (is_ie  && (is_major >= 4));
var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );  
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);  
var is_dom = (document.getElementById);

//PLATFORM 
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac    = (agt.indexOf("mac")!=-1);
var is_sun   = (agt.indexOf("sunos")!=-1);
var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
var is_hpux  = (agt.indexOf("hp-ux")!=-1);
var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
var is_linux = (agt.indexOf("inux")!=-1);
var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
var is_unixware = (agt.indexOf("unix_system_v")!=-1); 
var is_mpras    = (agt.indexOf("ncr")!=-1); 
var is_reliant  = (agt.indexOf("reliantunix")!=-1);
var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
       (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
       (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
var is_sinix = (agt.indexOf("sinix")!=-1);
var is_freebsd = (agt.indexOf("freebsd")!=-1);
var is_bsd = (agt.indexOf("bsd")!=-1);
var is_unix  = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux || 
             is_sco ||is_unixware || is_mpras || is_reliant || 
             is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);




// unterschiedliche Stylesheets fuer PC und MAC    
// Files and directory structures
var cssDir = "styles/index.html";
var winNSCSS = "ns.css";
var winIECSS = "main.css";
var macCSS = "mac.css";
var unixCSS = "main.css";


//  Select the appropriate stylesheet
if ((is_nav4up ||is_nav6up || is_ie4up) || (!is_nav && !is_ie)) {
  ChooseStyleSheet();
}


// Function to choose the style sheet for use based on the platform and browser version
function ChooseStyleSheet() {

var fileHead = cssDir;
var styles;

//Windows
if (is_win) {
  //Netscape Win
  if (is_nav) {
    styles = fileHead + winNSCSS;
  } 
  
  if (is_nav4up) {
    styles = fileHead + winNSCSS;

  } 
  else

  if (is_nav6up) {
    styles = fileHead + winIECSS;
    
  } 
  else 
  {
  // Windows Netscape fonts need to be larger than those for IE
  styles = fileHead + winIECSS;
  }
} 

//Mac
else if (is_mac) {
  //Internet Explorer 5
  if (is_ie5up) {
    // Default font settings for Mac IE5 match Win IE fonts
    styles = fileHead + winIECSS;
  }
  else

  if (is_nav) {
    styles = fileHead + macCSS;
    
  } 
  else
  {
    //rest of Mac
    styles = fileHead + macCSS;
  }
} 

//Unix
else if (is_unix) {
  styles = fileHead + unixCSS;
}

//rest
else 
{
  // Default style = macCSS,
  // Macintosh stylesheets have the largest font sizes, which will ensure readability
  styles = fileHead + macCSS;
}

  document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + styles + "\">");
  return true;
}

var activeSub=0;
var SubNum=0;

//function reDo(){ window.location.reload() }
//   window.onresize = reDo;
    
screeny=screen.availHeight/2-300;
screenx=screen.availWidth/2-400;


    //Define global variables

	    var timerID = null;
		var timerOn = false;
		var timecount = 1000;
		var what = null;
		var newbrowser = true;
		var check = false;

    	function init(){
    	//  alert ("Running Init");
          if (document.layers) {
                      //  alert ("Running Netscape 4");
                        layerRef="document.layers";
                        styleSwitch="";
                        visibleVar="show";
			screenSize = window.innerWidth;
			what ="ns4";


          }else if(document.all){
                      //  alert ("Running IE");
                        layerRef="document.all";
                        styleSwitch=".style";
                        visibleVar="visible";
			screenSize = document.body.clientWidth + 18;
			what ="ie";

		  }else if(document.getElementById){
                      //  alert ("Running Netscape 6");
                        layerRef="document.getElementByID";
                        styleSwitch=".style";
                        visibleVar="visible";
			what="moz";
		  
		  }else{
		  	//alert("Older than 4.0 browser.");
			what="none";
			newbrowser = false;
		  }
		  
 
		window.status='* * * Sassa Mode - Underwear fashion * * *';
		check = true;
  	 	}

	// Turns the layers on and off
        function showLayer(layerName){
        	if(check){
        		if (what =="none"){
        			return;
        			}
	        	else if (what == "moz"){
        			document.getElementById(layerName).style.visibility="visible";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="visible"');
                  }
		 }
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
		}

        function hideLayer(layerName){
        	if(check){
        		if (what =="none"){
        			return;
        			}
        		else if (what == "moz"){
        			document.getElementById(layerName).style.visibility="hidden";
        			}
        		else{
                  eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"');
				}
        
        	}
        	else {// alert ("Please wait for the page to finish loading.");
        		return;}
        }

// Funktion, um Layer der 3. Navigationsebene zu verstecken          
        function hidebasics(){			
                hideLayer('basics');				
				}
                
		function startTimebig() {
	        if (timerOn == false) {
                timerID=setTimeout( "hidebig()" , timecount);
                timerOn = true;
	        }
		}

// Funktion, um Layer der 2. Navigationsebene zu verstecken        
		function hideAll(){
				hideLayer('unternehmen');
				hideLayer('kollektionen');
             	hideLayer('basics');
				
				}

		function startTime() {
	        if (timerOn == false) {
                timerID=setTimeout( "hideAll()" , timecount);
                timerOn = true;
	        }
		}

		function stopTime() {
	        if (timerOn) {
    	        clearTimeout(timerID);
                timerID = null;
                timerOn = false;
	        }
		}
		
		
		function sw_openDialogWindow(url, width, height) {
        
                attribs = "left=50,top=50,width=" + width + ",height="+ height + ",toolbar=no,scrollbars=no";
                wnd = window.open(url,name,attribs);
        }

		function onLoad(){
			init();			
			}
            
            
            
