

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

//var cap1 =  MM_findObj("c1");

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}




var statusc1 ="idle";
var statusc2 ="idle";
var statusc3 ="idle";
var statusc4 ="idle";
var statusc5 ="idle";
var statusc6 ="idle";
var statusc7 ="idle";
var statusc8 ="idle";
var statusc9 ="idle";
var statusc10 ="idle";
var statusc11 ="idle";
var statusc12 ="idle";
var statusc13 ="idle";
var statusc14 ="idle";
var statusc15 ="idle";
var statusc16 ="idle";
var statusc17 ="idle";
var statusc18 ="idle";
var statusc19 ="idle";
var statusc20 ="idle";

var mouseat ="";
function setmouse(id){
	mouseat = id;
	mouse.value = id;	
}
function setstate(id, state){
	switch(id){
        case 'c1':   statusc1 = state; break
        case 'c2':   statusc2 = state; break
        case 'c3':   statusc3 = state; break
        case 'c4':   statusc4 = state; break
        case 'c5':   statusc5 = state; break
        case 'c6':   statusc6 = state; break
        case 'c7':   statusc7 = state; break
        case 'c8':   statusc8 = state; break
        case 'c9':   statusc9 = state; break
        case 'c10':   statusc10 = state; break
        case 'c11':   statusc11 = state; break
        case 'c12':   statusc12 = state; break
        case 'c13':   statusc13 = state; break
        case 'c14':   statusc14 = state; break
        case 'c15':   statusc15 = state; break
        case 'c16':   statusc16 = state; break
        case 'c17':   statusc17 = state; break
        case 'c18':   statusc18 = state; break
        case 'c19':   statusc19 = state; break
        case 'c20':   statusc20 = state; break
        default:    alert("Invalid ID provided");         
    }
}
function doclick(oid){
	lunnyup(oid);
	var oid = MM_findObj(oid);	
	var imgdiv = oid.parentNode.id;
	//imgdiv = imgdiv.id.value;
	//alert ("image div is "+imgdiv);
	//new Effect.Puff(imgdiv);
	//Effect.setOptions("speed:2");
	var c = MM_findObj('container');
	setTimeout("new Effect.BlindUp('container',  {duration:.75, afterFinish:function(){ setProjectDetail('oid'); }})",250);// let lunny up finish
	//setTimeout("new Effect.SlideDown('container', {duration:1})",4250);
	
	//alert("Hey!! Dont click "+ id+"!!");
}

function setProjectDetail(oid){
		var c = MM_findObj('container');
		c.style.height=364;	
		c.innerHTML  = '<img src="../images/what/expo1.jpg" name="bigimages" width="764" height="363" id="bigimages">';
		new Effect.BlindDown('container', {duration:.75})
}


function lunnyup(id){
	switch(id){
        case 'c1':   
			if(statusc1 == "working"){
				setTimeout("lunnyup('c1')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c2':   
			if(statusc2 == "working"){
				setTimeout("lunnyup('c2')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c3':   
			if(statusc3 == "working"){
				setTimeout("lunnyup('c3')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c4':   
			if(statusc4 == "working"){
				setTimeout("lunnyup('c4')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c5':   
			if(statusc5 == "working"){
				setTimeout("lunnyup('c5')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c6':   
			if(statusc6 == "working"){
				setTimeout("lunnyup('c6')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c7':   
			if(statusc7 == "working"){
				setTimeout("lunnyup('c7')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c8':   
			if(statusc8 == "working"){
				setTimeout("lunnyup('c8')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c9':   
			if(statusc9 == "working"){
				setTimeout("lunnyup('c9')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c10':   
			if(statusc10 == "working"){
				setTimeout("lunnyup('c10')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c11':   
			if(statusc11 == "working"){
				setTimeout("lunnyup('c11')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c12':   
			if(statusc12 == "working"){
				setTimeout("lunnyup('c12')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c13':   
			if(statusc13 == "working"){
				setTimeout("lunnyup('c13')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c14':   
			if(statusc14 == "working"){
				setTimeout("lunnyup('c14')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c15':   
			if(statusc15 == "working"){
				setTimeout("lunnyup('c15')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c16':   
			if(statusc16 == "working"){
				setTimeout("lunnyup('c16')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c17':   
			if(statusc17 == "working"){
				setTimeout("lunnyup('c17')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c18':   
			if(statusc18 == "working"){
				setTimeout("lunnyup('c18')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c19':   
			if(statusc19 == "working"){
				setTimeout("lunnyup('c19')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        case 'c20':   
			if(statusc20 == "working"){
				setTimeout("lunnyup('c20')",250);
				state.value = "waiting";
			}else{
				new Effect.LunnySlideUp(id, {duration:.25 });
			}; 
		break
        default:    alert("only works on 1 to 20 so far. You asked for "+id);         
    }

}

function lunnydown(id){
	if(mouseat == id){ // dont bother going down if the mouse has moved on...
		switch(id){
			case 'c1':   
				if(statusc1 == "working"){
					setTimeout("lunnydown('c1')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c2':   
				if(statusc2 == "working"){
					setTimeout("lunnydown('c2')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c3':   
				if(statusc3 == "working"){
					setTimeout("lunnydown('c3')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c4':   
				if(statusc4 == "working"){
					setTimeout("lunnydown('c4')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c5':   
				if(statusc5 == "working"){
					setTimeout("lunnydown('c5')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c6':   
				if(statusc6 == "working"){
					setTimeout("lunnydown('c6')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c7':   
				if(statusc7 == "working"){
					setTimeout("lunnydown('c7')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c8':   
				if(statusc8 == "working"){
					setTimeout("lunnydown('c8')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c9':   
				if(statusc9 == "working"){
					setTimeout("lunnydown('c9')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c10':   
				if(statusc10 == "working"){
					setTimeout("lunnydown('c10')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c11':   
				if(statusc11 == "working"){
					setTimeout("lunnydown('c11')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c12':   
				if(statusc12 == "working"){
					setTimeout("lunnydown('c12')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c13':   
				if(statusc13 == "working"){
					setTimeout("lunnydown('c13')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c14':   
				if(statusc14 == "working"){
					setTimeout("lunnydown('c14')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c15':   
				if(statusc15 == "working"){
					setTimeout("lunnydown('c15')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c16':   
				if(statusc16 == "working"){
					setTimeout("lunnydown('c16')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c17':   
				if(statusc17 == "working"){
					setTimeout("lunnydown('c17')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c18':   
				if(statusc18 == "working"){
					setTimeout("lunnydown('c18')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c19':   
				if(statusc19 == "working"){
					setTimeout("lunnydown('c19')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			case 'c20':   
				if(statusc20 == "working"){
					setTimeout("lunnydown('c20')",250);
					state.value = "waiting";
				}else{
					new Effect.LunnySlideDown(id, {duration:.25 });
				}; 
			break
			default:    alert("Error:invalid ID");         
		}//end switch
	}//end if
}
Effect.LunnySlideDown = function(element) {
  element = $(element);
  var id = element.id;
	setstate(id, "working")
	state.value = "State = "+statusc1+" on "+element.id;	
  element.style.height   = '0px';
  Element.makeClipping(element);
  Element.cleanWhitespace(element);
  Element.makePositioned(element.firstChild);
  Element.show(element);
  return new Effect.Scale(element, 100, 
   Object.extend({ scaleContent: false, 
    scaleX: false, 
    scaleMode: 'contents',
    scaleFrom: 0,
    afterUpdate: function(effect) 
      { effect.element.firstChild.style.bottom = 
          (effect.originalHeight - effect.element.clientHeight) + 'px'; },
    afterFinish: function(effect) 
      {  Element.undoClipping(effect.element); 
	  	 setstate(id, "done");
      	 state.value = "State = "+statusc1+" on "+element.id;
	  }
    }, arguments[1] || {})
  );
}
  
Effect.LunnySlideUp = function(element) {
  element = $(element);
  var id = element.id;
	setstate(id, "working")
	state.value = "State = "+statusc1+" on "+element.id;	
  Element.makeClipping(element);
  Element.cleanWhitespace(element);
  Element.makePositioned(element.firstChild);
  Element.show(element);
  return new Effect.Scale(element, 0, 
   Object.extend({ scaleContent: false, 
    scaleX: false, 
    afterUpdate: function(effect) 
      { effect.element.firstChild.style.bottom = 
          (effect.originalHeight - effect.element.clientHeight) + 'px'; },
    afterFinish: function(effect)
      { 
        Element.hide(effect.element);
        Element.undoClipping(effect.element);
		setstate(id, "done");
      	state.value = "State = "+statusc1+" on "+element.id;
      }
   }, arguments[1] || {})
  );
}



Effect.deadLunnyBlindUp = function(element) {
  element = $(element);
    var id = element.id;
	setstate(id, "working")
	state.value = "State = "+statusc1+" on "+element.id;	
  Element.makeClipping(element);
  return new Effect.Scale(element, 0, 
    Object.extend({ scaleContent: false, 
      scaleX: false, 
      afterFinish: function(effect) 
        { 
          Element.hide(effect.element);
          Element.undoClipping(effect.element);
		  setstate(id, "done");
      	  state.value = "State = "+statusc1+" on "+element.id;
        } 
    }, arguments[1] || {})
  );
}

Effect.deadLunnyBlindDown = function(element) {
  element = $(element);
	var id = element.id;
	setstate(id, "working")
	state.value = "State = "+statusc1+" on "+element.id;	
  element.style.height = '0px';
  Element.makeClipping(element);
  Element.show(element);
  return new Effect.Scale(element, 100, 
    Object.extend({ scaleContent: false, 
      scaleX: false, 
      scaleMode: 'contents',
      scaleFrom: 0,
      afterFinish: function(effect) {
        Element.undoClipping(effect.element);
		// tell us the state
		setstate(id, "done");
      	state.value = "State = "+statusc1+" on "+element.id;
}
    }, arguments[1] || {})
  );
}


