/* ================================================================ 
This copyright notice must be kept untouched in the stylesheet at 
all times.

The original version of this script and the associated (x)html
is available at http://www.stunicholls.com/menu/pro_drop_1.html
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This script and the associated (x)html may be modified in any 
way to fit your requirements.
=================================================================== */
	stuHover = function()
	{
		var cssRule;
		var newSelector;
		for (var i = 0; i < document.styleSheets.length; i++)
			for (var x = 0; x < document.styleSheets[i].rules.length ; x++)
				{
				cssRule = document.styleSheets[i].rules[x];
				if (cssRule.selectorText.indexOf("LI:hover") != -1)
				{
					 newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");
					document.styleSheets[i].addRule(newSelector , cssRule.style.cssText);
				}
			}
		var getElm = document.getElementById("nav").getElementsByTagName("LI");
		for (var i=0; i<getElm.length; i++)
		{
			getElm[i].onmouseover=function()
			{
				this.className+=" iehover";
			}
			getElm[i].onmouseout=function()
			{
				this.className=this.className.replace(new RegExp(" iehover\\b"), "");
			}
		}
	}

	if (window.attachEvent)
	{
		window.attachEvent("onload", stuHover);
	}





	// Set slideShowSpeed (seconds)
	var slideShowSpeed = 4;
	// Duration of crossfade (seconds)
	var crossFadeDuration = 1;
	// Specify the image files
	var Pic = new Array();
	// to add more images, just continue
	// the pattern, adding to the array below
	
	Pic[0] = 'pics/pagebg/startimg1.jpg'
	Pic[1] = 'pics/pagebg/startimg2.jpg'
	Pic[2] = 'pics/pagebg/startimg3.jpg'
	Pic[3] = 'pics/pagebg/startimg4.jpg'
	Pic[4] = 'pics/pagebg/startimg5.jpg'
	Pic[5] = 'pics/pagebg/startimg6.jpg'
	
	// do not edit anything below this line
	var t;
	var j = 0;
	var p = Pic.length;
	var preLoad = new Array();
	
	for (i = 0; i < p; i++)
	{
		preLoad[i] = new Image();
		preLoad[i].src = Pic[i];
	}
	
	function runSlideShow()
	{
		if (document.all)
		{
			document.images.SlideShow.style.filter="blendTrans(duration="+ crossFadeDuration +")";
			document.images.SlideShow.filters.blendTrans.Apply();
		}
		document.images.SlideShow.src = preLoad[j].src;
		if (document.all)
		{
			document.images.SlideShow.filters.blendTrans.Play();
		}
		j = j + 1;
		if (j > (p - 1))
		{
			j = 0;
		}
		t = setTimeout('runSlideShow()', slideShowSpeed * 1000);
	}




/*	Fix the problem in IE6 width transperent .png-images	*/
/*	     In the imag-tagg add: onload="fixPNG(this)" 	*/

	var arVersion = navigator.appVersion.split("MSIE")
	var version = parseFloat(arVersion[1])
	
	function fixPNG(myImage) 
	{
	    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
	    {
	       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
		   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
		   var imgTitle = (myImage.title) ? 
			             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
		   var imgStyle = "display:inline-block;" + myImage.style.cssText
		   var strNewHTML = "<span " + imgID + imgClass + imgTitle
	                  + " style=\"" + "width:" + myImage.width 
	                  + "px; height:" + myImage.height 
	                  + "px;" + imgStyle + ";"
	                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
	                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
		   myImage.outerHTML = strNewHTML	  
	    }
	}
