// JavaScript Document
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
	
}

// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
if ( Get_Cookie( name ) ) document.cookie = name + "=" +
( ( path ) ? ";path=" + path : "") +
( ( domain ) ? ";domain=" + domain : "" ) +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function getHeight (id) {  
		var gh = document.getElementById(id).offsetHeight;
		var qgh = parseInt(gh*.25);
		//alert (qgh);
		//document.write(gh);
		d = document.getElementById('left-grey');
    d.style.height=gh+"px";
    e = document.getElementById('right-grey');
    e.style.height=gh+"px";
    //e= document.getElementById('innerpic');   
    //e.style.marginTop=gh-120+"px";
    //n= document.getElementById('navigation');   
    //n.style.marginTop=gh-qgh+"px";
    createCookie('navmargin',gh-qgh,7);
	}

  function toggleLayer( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  
  vis.display = (vis.display==""||vis.display=="block")?"none":"block"  ;
  var status = vis.display;
  //alert(status);
  //createCookie('status',status,7);
  
}

function toggleInfo( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = $( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  
  //vis.display = (vis.display==""||vis.display=="block")?"none":"block"  ;
  if(vis.display=="none"){
  Effect.toggle(whichLayer);
  }
  if(vis.display==""||vis.display=="block"){
  Effect.toggle(whichLayer);
  }
  
  
  var status = vis.display;
  //alert(status);
  //createCookie('status',status,7);
  

}


function hideLayer( whichLayer )
{
 if(whichLayer=="work"){
 d = document.getElementById('archive');
    d.style.display="none";
    i = document.getElementById('information');
    i.style.display="none";
 } 
 if(whichLayer=="archive"){
 a = document.getElementById('work');
    a.style.display="none";
    i = document.getElementById('information');
    i.style.display="none";
 } 
 if(whichLayer=="information"){
 b = document.getElementById('work');
    b.style.display="none";
    c = document.getElementById('archive');
    c.style.display="none";
    
 } 
 if(whichLayer=="exhibitions"){
 b = document.getElementById('work');
    b.style.display="none";
    c = document.getElementById('archive');
    c.style.display="none";
    i = document.getElementById('information');
    i.style.display="none";
 } 
}
function displayStatus(id){
var skin = document.getElementById(id).style.display;
  //alert (nav);
  
  createCookie('expanded',id);
}

	function navStatus(id){
  var nav = document.getElementById(id).style.display;
  //alert (nav);
  
  
  createCookie('lastClicked',id);
  }
function secStatus(id){
  var nav = document.getElementById(id).style.display;
  //alert (nav);
  
  //createCookie(id,nav,7);
  createCookie('activeSection',id);
  Delete_Cookie('expanded', '/', '') 
  }
  	function thumbStatus(id){
  var nav = document.getElementById(id).style.display;
  //alert (nav);
  
  //createCookie(id,nav,7);
  createCookie('thumbStatus',id,7);
  }

function InfoPages(){
 b = document.getElementById('work');
    b.style.display="none";
    c = document.getElementById('archive');
    c.style.display="none";
    
 } 
