 function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function changeFontSize(size)
{
/*
  var p = document.getElementsByTagName('p');
  for(n=0; n<p.length; n++) {    
    p[n].style.fontSize = inc + 'px';
   }
*/  
 location.href = location.pathname+"?fontchange="+size;  
}


	  
function clock() {	   
  var obj=document.getElementById("time").innerHTML;  
  var hour = obj.split(":")[0]; 
  var minute = obj.split(":")[1];   
  minute++; 
  hour++;
  hour--;
  if (minute % 60 == 0) {
     minute = "0"; 
	 hour++; 
	 if (hour % 24 == 0) {
	    hour = "0"; 
	 }
  }  
  temp ="";   
  if (hour < 10) {
	temp = temp.concat("0"); 
  }
  temp = temp.concat(hour).concat(":");   
  if (minute < 10) {
    temp = temp.concat("0");
  }  
  temp = temp.concat(minute);   
  with (document) if (getElementById && ((obj=getElementById("time"))!=null)) {
       obj.innerHTML = temp; 
  }  
  id = setTimeout("clock()",60000)
}

function changeBarrierFree(trueorfalse) {
  location.href = location.pathname+"?barrierfree="+trueorfalse; 

}



function getCookie( name ) {
  var start = document.cookie.indexOf( name + "=" );
  var len = start + name.length + 1;
  if ( ( !start ) &&
     ( name != document.cookie.substring( 0, name.length ) ) ) {
     return null;
  }
  if ( start == -1 ) return null;
  var end = document.cookie.indexOf( ";", len );
  if ( end == -1 ) end = document.cookie.length;
  return unescape( document.cookie.substring( len, end ) );
}

function deleteCookie( name ) {
  if ( getCookie( name ) ) document.cookie = name + "=" +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}


function sfHover() {
         var aMenu =document.getElementById("menu"); 
         if (!aMenu ) return; 
	var sfEls = aMenu.getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

/*
 * Original from: http://brainerror.net/scripts/javascript/blendtrans/demo.html
 *
 * Edits by ASC:
 *   - Removed unnecessary OO code that caused MSIE to choke
 *   - Added pause between setting bg image and setting opacity to zero to
 *     prevent MSIE image flash
 *   - Increased opacity check argument to 103 for completely smooth fade
 *
 */

//find next image
function nextDiv(o) {
    do o = o.nextSibling;
    while(o && o.tagName != 'DIV');
    return o;
}

//find first image inside an element
function firstChildDiv(o) {
    
    o = o.firstChild;
        
    while(o && o.tagName != 'DIV') {
        o = o.nextSibling;
    }
    
    return o;
}

//find next image
function lastDiv(o) {
    do o = o.previousSibling;
    while(o && o.tagName != 'DIV');
    return o;
}

//find first image inside an element
function lastChildDiv(o) {
    
    o = o.lastChild;
        
    while(o && o.tagName != 'DIV') {
        o = o.previousSibling;
    }
    
    return o;
}

//set the opacity of an element to a specified value
function setOpacity(obj, o) {

    obj.style.opacity = (o / 100);
    obj.style.MozOpacity = (o / 100);
    obj.style.KhtmlOpacity = (o / 100);
    obj.style.filter = 'alpha(opacity=' + o + ')';
}

//make image invisible and set next one as current image
function getNextDiv(aDiv) {

    if (prev = lastDiv(aDiv)) {
       prev.style.zIndex = 0;
    } else {
       prev = lastChildDiv(aDiv.parentNode); 
       prev.style.zIndex = 0; 
    }
    
	
    if (next = nextDiv(aDiv)) {
       setOpacity(next, 0); 
	aDiv.style.zIndex = 100;
	next.style.zIndex = 101;
	
	

    } else {
	//if there is not a next image, get the first image again
	next = firstChildDiv(aDiv.parentNode);
	setOpacity(next, 0); 
	next.style.zIndex = 101;
	aDiv.style.zIndex = 100;
    }

    return next;
}

function getPrevDiv(aDiv) {
	
    if (prev= lastDiv(aDiv)) {
       setOpacity(prev, 0); 
	aDiv.style.zIndex = 100;
	prev.style.zIndex = 101;
	
	

    } else {
	//if there is not a next image, get the first image again
	prev= lastChildDiv(aDiv.parentNode);
	setOpacity(next, 0); 
	prev.style.zIndex = 101;
	aDiv.style.zIndex = 100;
    }

    return prev;
}



//set default values for parameters and starting image
function blendImages(id, speed, pause, caption) {

    if(speed == null) {
        speed = 30;
    }
    
    if(pause == null) {
        pause = 1500;
    }

    var blend = document.getElementById(id);

    var aDiv = firstChildDiv(blend);
    aDiv.style.display = 'block';  

    setTimeout(function(){continueFadeImage(aDiv, 103, speed, pause, caption)},pause/2);
}

//make image a block-element and set the caption
function startBlending(aDiv, speed, pause, caption) {

    aDiv.style.display = 'block';

    if(caption != null) {
	document.getElementById(caption).innerHTML = image.alt;
    }

    continueFadeImage(aDiv, 0, speed, pause, caption);
}


//set an increased opacity and check if the image is done blending
function continueFadeImage(aDiv, opacity, speed, pause, caption) {

    opacity = opacity + 10;

    if (opacity < 103) {

	setTimeout(function() {fadeImage(aDiv, opacity, speed, pause, caption)}, speed);

    } else {
	setOpacity(aDiv,100);
	
	//get the next image and start blending it again
	aDiv = getNextDiv(aDiv);
	setTimeout(function() {startBlending(aDiv, speed, pause, caption)}, pause);		
    }
}

//set the opacity to a new value and continue the fading
function fadeImage(aDiv, opacity, speed, pause, caption) {
    setOpacity(aDiv,opacity);
    continueFadeImage(aDiv, opacity, speed, pause, caption);
}

function init() {
     clock();   
     blendImages('blendme', 120, 5000);
     if (window.attachEvent) sfHover(); 

}

function resize() {
   //window.resizeTo(800,600);
   if (window.innerHeight)  {
      window.innerHeight = 570;
      window.innerWidth = 769;
   } else if (document.body.offsetHeight) {
       document.body.offsetHeight = 570;
       document.body.offsetWidth = 769;
   }
   
   
}

//if (window.attachEvent) window.attachEvent("onload", sfHover());

//--><!]]></script>

	

	  
