// this function gets the cookie, if it exists
function Get_Cookie( 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 ) );
}

 
   //var tmpcookie = new Date();
   //chkcookie = (tmpcookie.getTime() + '');
   
   var chkcookie = Get_Cookie("chkcookie");
   parseFloat(chkcookie);
   chkcookie++;
   
   document.cookie = "chkcookie=" + chkcookie + "; path=/";
    //if (document.cookie.chkcookie == 1) {
    if (document.cookie.indexOf(chkcookie,0) < 0) {
	  //document.write("no cookies here");
      }
    else if(chkcookie<2) {
      //window.location = 'cookies.html';
	  //document.write("cookies are ok");
	  window.location = (location.href);
    }
 //-->
/***********************************************
* Dynamic Resource Centre animation script- © Open iWorld (www.openiworld.com)
* Written by Chris Sylvester - not to be copied without prior written permission
* Contact Chris Sylvester at www.openiworld.com/contact.php for details
***********************************************/

y='';
size=0 // Initial size.
function expand_boxes(){ 
  if(size<316) { //If box is not fully expanded

    size+=79; // increase selected box by 79 pixels on each loop
	shrinker=316;
	shrinker-=size; // decrease expanded box by same amount as growing box
	document.getElementById(y).style.height=size+"px";
	var last_click=y;
	if(y!='res1_window' && document.getElementById("res1_window").style.height!='0px'){
	document.getElementById("res1_window").style.height=shrinker+"px";
	}
	if(y!='res2_window' && document.getElementById("res2_window").style.height!='0px'){
	document.getElementById("res2_window").style.height=shrinker+"px";
	}
	if(y!='res3_window' && document.getElementById("res3_window").style.height!='0px'){
	document.getElementById("res3_window").style.height=shrinker+"px";
	}
	if(y!='res4_window' && document.getElementById("res4_window").style.height!='0px'){
	document.getElementById("res4_window").style.height=shrinker+"px";
	}
    setTimeout("expand_boxes()",1); 
  }
  else
    size=0 //reset box size
}
function id_sender(x){

y=x;
	if(document.getElementById(y).style.height=="0px"){
		expand_boxes();
	}
} 



//start code to fade rollovers
var base=0
function gradinc(fadeobj){
	//alert (document.getElementById("info_panel"));
	imgobj=fadeobj
	browser=fadeobj.filters? "ie" : typeof fadeobj.style.MozOpacity=="string"? "mozilla" : ""
	instantset(base)
	highlighting=setInterval("fade(imgobj)",50)
}

function graddec(fadeobj){
	cleartimer()
	instantset(base)
}

function instantset(degree){
	if (browser=="mozilla")
	imgobj.style.MozOpacity=degree/100
	else if (browser=="ie")
	imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
	if (window.highlighting) clearInterval(highlighting)
}

function fade(incr){
	if (browser=="mozilla" && incr.style.MozOpacity<1)
	incr.style.MozOpacity=Math.min(parseFloat(incr.style.MozOpacity)+0.2, 0.99)
	else if (browser=="ie" && incr.filters.alpha.opacity<100)
	incr.filters.alpha.opacity+=25
	else if (window.highlighting)
	clearInterval(highlighting)
}
/***********************************************
* End Fader code for schematic diagrams
***********************************************/
function validate(message)
{
	conf = confirm(message);
	return conf;
}