
function MM_preloadImages() { //v2.0
  if (document.images) {
    var imgFiles = MM_preloadImages.arguments;
    if (document.preloadArray==null) document.preloadArray = new Array();
      var i = document.preloadArray.length;
      with (document) for (var j=0; j<imgFiles.length; j++) 
        if (imgFiles[j].charAt(0)!="#"){
          preloadArray[i] = new Image;
          preloadArray[i++].src = imgFiles[j];
		
    }
  }
}

function MM_swapImgRestore(aktiv_menu) { //v2.0
  if (document.MM_swapImgData != null) {
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2) 
      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
  }
}


function MM_swapImage() { //v2.0
  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
      swapArray[j++] = obj;
      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
      obj.src = MM_swapImage.arguments[i+2];
  } }
  document.MM_swapImgData = swapArray; //used for restore
}

function Fensterweite () 
{
  if (self.innerHeight) // all except Explorer
  {
        return self.innerWidth;
  }
  else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
  {
	return document.documentElement.clientWidth;
  }
  else if (document.body) // other Explorers
  {
	return document.body.clientWidth;
  }
}

function Fensterhoehe () 
{
  if (self.innerHeight) // all except Explorer
  {
	return self.innerHeight;
  }
  else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
  {
 	return document.documentElement.clientHeight;
  }
  else if (document.body) // other Explorers
  {
	return document.body.clientHeight;
  }
}

var 	tipwin = null; 
	breite = null;
	hoehe  = null;
	wbreite= null;
	whoehe = null;	
	bild_name = null;
	bild_text = null;
  	rest = null;
 	filename = null;   // "main.html";
	newname  = "main.html";
	Weite = null;
	initialized = 0;


function opentip (name, bildtext, format) {
        

	if (format == "1") {
	  breite=375;   // 383
	  hoehe=500;    // 530 
	}
	else {
	  breite=500;   // 508
	  hoehe=375;    // 405
	  //hoehe = Fensterhoehe();
	};
	
     wbreite=breite; // + 32;
	 whoehe=hoehe + 85;   // + 56;
	 // whoehe = Fensterhoehe() + 30;   // + 56;

	if (bildtext != "") 
	{
	   whoehe = whoehe + 30;
	}
	
 tipwin=window.open("",'popup','width='+wbreite+',height='+whoehe+',left=20, top=20, resizable=yes, scrollbars=no');
        tipwin.opener = self;

        tipwin.document.open();
        with (tipwin.document) {
     	  write('<html><head>');
     	  write('<title>Schwarzw&auml;der Spinnstube<\/title><\/head>');
     	  write('<body leftmargin=0 topmargin=0><div align="center"><center>');
    write ('<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="'+breite+'">');
          write ('<tr>');
          write ('<td bgcolor="#FFFFFF" width="100%">');
          write ('<img border="0" src="'+name+'" width="'+breite+'" height="'+hoehe+'">');
          write ("<\/td><\/tr>");  

          if (bildtext != "") {
            write ('<tr>');
            write ('<td width="100%" align="center" valign="middle" bgcolor="#FFFFFF" height="30">');
            write ('<p> <font size="2" face="Arial">'+bildtext+'<\/font><\/p>');
            write ("<\/td>");
            write ("<\/tr>");  
          } 
          write ("<\/table><\/center><\/div><\/body><\/head><\/html>");

	}
  	 tipwin.document.close();
        tipwin.resizeTo(wbreite,whoehe);
        tipwin.focus();

    


       // str='display.html?'+name+','+bildtext+';';
   	
	//str=name;

       // tipWin = window.open(str, 'tipwin', 'width='+ breite + ',height=' + hoehe + ', dependent=yes, resizable=no, scrollbars=no');
        //tipWin.opener = self;
        //tipWin.resizeTo(breite,hoehe);
        //tipwin.document.open();

	//tipWin.focus();
  	//tipwin.document.write ('<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" align="left">');
	//tipwin.document.write ('<tr>');
	//tipwin.document.write ('<td bgcolor="#FFFF33" width="100%">');
	//tipwin.document.write (name);
	//tipwin.document.write ("<\/td><\/tr>");  

}



function GetInitialized (){
  return initialized;
}


function display_frame(filename){

//filename="main.html";
//Abmessungen();


hoehe = Fensterhoehe();
weite = Fensterweite();
rest = hoehe - 110;
//alert("Hoehe vor IFRAME ="+hoehe);
//alert("Rest  vor IFRAME ="+rest);
document.write ('<iframe height="' + rest + '" width="625" frameborder="0" id="main_window"');
document.write ('name="main_window" src="' + filename + '" align="left" target="_self">');
}

function scrollbar()
{
posl = document.body.clientWidth + 2;
posr = document.body.clientWidth + 2 + 17;
if(window.event.x > posl && window.event.x < posr) //--> wenn Mauszeiger über der Scrollbar!
{
var sfc = '#4682B4'; //scrollbar-face-color
var sac = '#000000'; //scrollbar-arrow-color
var stc = '#4682B4'; //scrollbar-track-color
var s3c = '#000000'; //scrollbar-3dlight-color
var ssc = '#000000'; //scrollbar-shadow-color
var sdc = '#ffffff'; //scrollbar-darkshadow-color
var shc = '#4682B4'; //scrollbar-highlight-color
var sbc = '#4682B4'; //scrollbar-base-color

if(sfc > "") document.body.style.scrollbarFaceColor = sfc;
if(sac > "") document.body.style.scrollbarArrowColor = sac;
if(stc > "") document.body.style.scrollbarTrackColor = stc;
if(s3c > "") document.body.style.scrollbar3dLightColor = s3c;
if(ssc > "") document.body.style.scrollbarShadowColor = ssc;
if(sdc > "") document.body.style.scrollbarDarkshadowColor = sdc;
if(shc > "") document.body.style.scrollbarHighlightColor = shc;
if(sbc > "") document.body.style.scrollbarBaseColor = sbc;
}
else //--> wenn Mauszeiger nicht über der Scrollbar!
{
var sfc = '#4682B4'; //scrollbar-face-color
var sac = '#ffffff'; //scrollbar-arrow-color
var stc = '#4682B4'; //scrollbar-track-color
var s3c = '#ffffff'; //scrollbar-3dlight-color
var ssc = '#ffffff'; //scrollbar-shadow-color
var sdc = '#4682b4'; //scrollbar-darkshadow-color
var sdc = '#4682B4'; //scrollbar-highlight-color
var sbc = '#4682B4'; //scrollbar-base-color

if(sfc > "") document.body.style.scrollbarFaceColor = sfc;
if(sac > "") document.body.style.scrollbarArrowColor = sac;
if(stc > "") document.body.style.scrollbarTrackColor = stc;
if(s3c > "") document.body.style.scrollbar3dLightColor = s3c;
if(ssc > "") document.body.style.scrollbarShadowColor = ssc;
if(sdc > "") document.body.style.scrollbarDarkshadowColor = sdc;
if(shc > "") document.body.style.scrollbarHighlightColor = shc;
if(sbc > "") document.body.style.scrollbarBaseColor = sbc;
}
};

var storage = new function () {
	/* --------- Private Properties --------- */

	var dataContainer = {};

	/* --------- Private Methods --------- */

	function linearize () {
		var string = "", name, value;
		for (name in dataContainer) {
			name = encodeURIComponent(name);
			value = encodeURIComponent(dataContainer[name]);
			string += name + "=" + value + "&";
		}
		if (string != "") {
			string = string.substring(0, string.length - 1);
		}
		return string;
	}

	function read () {
		if (window.name == '' || window.name.indexOf("=") == -1) {
			return;
		}
		var pairs = window.name.split("&");
		var pair, name, value;
		for (var i = 0; i < pairs.length; i++) {
			if (pairs[i] == "") {
				continue;
			}
			pair = pairs[i].split("=");
			name = decodeURIComponent(pair[0]);
			value = decodeURIComponent(pair[1]);
			dataContainer[name] = value;
		}
	}

	function write () {
		window.name = linearize();
	}

	/* --------- Public Methods --------- */

	this.set = function (name, value) {
		dataContainer[name] = value;
		write();
	};

	this.get = function (name) {
		var returnValue = dataContainer[name];
		return returnValue;
	};

	this.getAll = function () {
		return dataContainer;
	};

	this.remove = function (name) {
		if (typeof(dataContainer[name]) != undefined) {
			delete dataContainer[name];
		}
		write();
	};

	this.removeAll = function () {
		dataContainer = {};
		write();
	};

	/* --------- Construction --------- */

	read();
};