// LaurelCorona.com JavaScript Document
var menu=function(){
	var t=15,z=550,s=6,a;
	function dd(n){this.n=n; this.h=[]; this.c=[]}
	dd.prototype.init=function(p,c){
		a=c; var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, i=0;
		for(i;i<l;i++){
			var h=s[i].parentNode; this.h[i]=h; this.c[i]=s[i];
			h.onmouseover=new Function(this.n+'.st('+i+',true)');
			h.onmouseout=new Function(this.n+'.st('+i+')');
		}
	}
	dd.prototype.st=function(x,f){
		var c=this.c[x], h=this.h[x], p=h.getElementsByTagName('a')[0];
		clearInterval(c.t); c.style.overflow='hidden';
		if(f){
			p.className+=' '+a;
			if(!c.mh){c.style.display='block'; c.style.height=''; c.mh=c.offsetHeight; c.style.height=0}
			if(c.mh==c.offsetHeight){c.style.overflow='visible'}
			else{c.style.zIndex=z; z++; c.t=setInterval(function(){sl(c,1)},t)}
		}else{p.className=p.className.replace(a,''); c.t=setInterval(function(){sl(c,-1)},t)}
	}
	function sl(c,f){
		var h=c.offsetHeight;
		if((h<=0&&f!=1)||(h>=c.mh&&f==1)){
			if(f==1){c.style.filter=''; c.style.opacity=1; c.style.overflow='visible'}
			clearInterval(c.t); return
		}
		var d=(f==1)?Math.ceil((c.mh-h)/s):Math.ceil(h/s), o=h/c.mh;
		c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')';
		c.style.height=h+(d*f)+'px'
	}
	return{dd:dd}
}();

var TINY={};

function T$(i){return document.getElementById(i)}
function T$$(e,p){return p.getElementsByTagName(e)}

TINY.dropdown=function(){
	var p={fade:1,slide:1,active:0,timeout:200}, init=function(n,o){
		for(s in o){p[s]=o[s]} p.n=n; this.build()
	};
	init.prototype.build=function(){
		this.h=[]; this.c=[]; this.z=1000;
		var s=T$$('ul',T$(p.id)), l=s.length, i=0; p.speed=p.speed?p.speed*.1:.5;
		for(i;i<l;i++){
			var h=s[i].parentNode; this.h[i]=h; this.c[i]=s[i];
			h.onmouseover=new Function(p.n+'.show('+i+',1)');
			h.onmouseout=new Function(p.n+'.show('+i+')')
		}
	};
	init.prototype.show=function(x,d){
		var c=this.c[x], h=this.h[x];
		clearInterval(c.t); clearInterval(c.i); c.style.overflow='hidden';
		if(d){
			if(p.active&&h.className.indexOf(p.active)==-1){h.className+=' '+p.active}
			if(p.fade||p.slide){
				c.style.display='block';
				if(!c.m){
					if(p.slide){
						c.style.visibility='hidden'; c.m=c.offsetHeight; c.style.height='0'; c.style.visibility=''
					}else{
						c.m=100; c.style.opacity=0; c.style.filter='alpha(opacity=0)'
					}
					c.v=0
				}
				if(p.slide){
					if(c.m==c.v){
						c.style.overflow='visible'
					}else{
						c.style.zIndex=this.z; this.z++; c.i=setInterval(function(){slide(c,c.m,1)},20)
					}
				}else{
					c.style.zIndex=this.z; this.z++; c.i=setInterval(function(){slide(c,c.m,1)},20)
				}
			}else{
				c.style.zIndex=this.z; c.style.display='block'
			}
		}else{
			c.t=setTimeout(function(){hide(c,p.fade||p.slide?1:0,h,p.active)},p.timeout)
		}
	};
	function hide(c,t,h,s){
		if(s){h.className=h.className.replace(s,'')}
		if(t){c.i=setInterval(function(){slide(c,0,-1)},20)}else{c.style.display='none'}
	}
	function slide(c,t,d){
		if(c.v==t){
			clearInterval(c.i); c.i=0;
			if(d==1){
				if(p.fade){c.style.filter=''; c.style.opacity=1}
				c.style.overflow='visible'
			}
		}else{
			c.v=(t-Math.floor(Math.abs(t-c.v)*p.speed)*d);
			if(p.slide){c.style.height=c.v+'px'}
			if(p.fade){var o=c.v/c.m; c.style.opacity=o; c.style.filter='alpha(opacity='+(o*100)+')'}
		}
	}
	return{init:init}
}();

function switchDiv(box, div_id)
{
  var style_sheet = getStyleObject(div_id);
  if (style_sheet)
  {
	var status = checkBoxState(box);
	if (status)
	{

	changeObjectVisibility(div_id, "block");
  } else {
	   hide(div_id);
	   }
  } else  {
	alert("sorry, this only works in browsers that do Dynamic HTML");
  }
}

function getStyleObject(objectId) {
// checkW3C DOM, then MSIE 4, then NN 4.
  //
  if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId).style;
   }
   else if (document.all && document.all(objectId)) {  
	return document.all(objectId).style;
   } 
   else if (document.layers && document.layers[objectId]) { 
	return document.layers[objectId];
   } else {
	return false;
   }
}

function changeObjectVisibility(objectId, newVisibility) {
// first get the object's stylesheet
	var styleObject = getStyleObject(objectId);

	// then if we find a stylesheet, set its visibility
	// as requested
	//
	if (styleObject) {
	styleObject.display = newVisibility;
	return true;
	} else {
	return false;
	}
}

function hide(div_id)
{
   changeObjectVisibility(div_id,"none");
}


function shiftDiv(i){
	if (document.getElementById){
		if (document.getElementById('contentblock'+i).style.display=='block') {
			document.getElementById('contentblock'+i).style.display='none';
			document.getElementById('contentblockCollapse').style.display='none';
			document.getElementById('contentblockMore').style.display='block';
		}
		else {
			document.getElementById('contentblock'+i).style.display='block';
			document.getElementById('contentblockCollapse').style.display='block';
			document.getElementById('contentblockMore').style.display='none';
		}
	}
}
/***********************************************
* DHTML slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice must stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var photos=new Array()
var photoslink=new Array()
var caption=new Array()
var which=0
var linkornot=1
var captions=1

var lft_img_on="images/left_arrow_on.gif"
var lft_img_off="images/left_arrow_off.gif"
var rt_img_on="images/right_arrow_on.gif"
var rt_img_off="images/right_arrow_off.gif"



var preloadedimages=new Array()
for (i=0;i<photos.length;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=photos[i]
}

function changecaption() {
document.getElementById('caption').innerHTML=caption[which]
}

function keeptrack(){
window.status="Image "+(which+1)+" of "+photos.length
}

function backward(){
if (which==1){
which--
document.images.photoslider.src=photos[which]
document.images.lft_img.src=lft_img_off
document.images.rt_img.src=rt_img_on
keeptrack()
changecaption()
} else if (which>0) {
which--
document.images.photoslider.src=photos[which]
document.images.lft_img.src=lft_img_on
document.images.rt_img.src=rt_img_on
keeptrack()
changecaption()
} else {
document.images.lft_img.src=lft_img_off
}
}

function forward(){
if (which+1==photos.length-1){
which++
document.images.photoslider.src=photos[which]
document.images.rt_img.src=rt_img_off
document.images.lft_img.src=lft_img_on
keeptrack()
changecaption()
} else if (which<photos.length-1) {
which++
document.images.photoslider.src=photos[which]
document.images.rt_img.src=rt_img_on
document.images.lft_img.src=lft_img_on
keeptrack()
changecaption()
} else {
document.images.rt_img.src=rt_img_off
}
}

function transport(){
window.location=photoslink[which]
}

