//Kirk & Kaludis Web 2.0 Library
// Copyright Kirk & Kaludis 2010

//Global Functions
	
	function $() {														//Return an div selector or array of div selectors by id.
		var elements = new Array();										//Initialize array to store selected divs.
		for (var i = 0; i < arguments.length; i++) {					//For each argument.
			var element = arguments[i];									//Get argument.
			if (typeof element == 'string')								//If argument is a string and not a div selector
				element = document.getElementById(element);				//Get element by its id.
			if (arguments.length == 1)									//If there is only one argument
				return element;											//return the result.
			elements.push(element);										//If there are more than one arguments, add them to the array.
		}																//End looping through arguments.
		return elements;												//Return the array of selected divs.
	}

	function getElementsByClass(searchClass,node,tag) {					//Return array of div selectors by class name.
		var classElements = new Array();								//Initialize array to store selected divs.
		if ( node == null )												//If parent node isn't specified
			node = document;											//make it document.
		if ( tag == null )												//If tag type isn't specified
			tag = '*';													//make it all.
		var els = node.getElementsByTagName(tag);						//Get all tags of specified type.
		var elsLen = els.length;										//Initialize number of elements found.
		var pattern = new RegExp('\\b'+searchClass+'\\b');	//Initialize regular expression to search.
		for (i = 0, j = 0; i < elsLen; i++) {							//For each element found.
			if ( pattern.test(els[i].className) ) {						//If the class name is found
				classElements[j] = els[i];								//Add element to array.
				j++;													//
			}															//
		}																//
		return classElements;											//
	}																	//
		
	function getCSSRule(ruleName, deleteFlag) { 	          			// Return requested style obejct
	   ruleName=ruleName.toLowerCase();                       			// Convert test string to lower case.
	   if (document.styleSheets) {                            			// If browser can play with stylesheets
		  for (var i=0; i<document.styleSheets.length; i++) { 			// For each stylesheet
			 var styleSheet=document.styleSheets[i];          			// Get the current Stylesheet
			 var ii=0;                                        			// Initialize subCounter.
			 var cssRule=false;                               			// Initialize cssRule. 
			 do {                                             			// For each rule in stylesheet
				if (styleSheet.cssRules) {                    			// Browser uses cssRules?
				   cssRule = styleSheet.cssRules[ii];         			// Yes --Mozilla Style
				} else {                                      			// Browser usses rules?
				   cssRule = styleSheet.rules[ii];            			// Yes IE style. 
				}                                             			// End IE check.
				if (cssRule)  {                               			// If we found a rule...
				   if (cssRule.selectorText.toLowerCase()==ruleName) {	//  match ruleName?
					  if (deleteFlag=='delete') {             			// Yes.  Are we deleteing?
						 if (styleSheet.cssRules) {           			// Yes, deleting...
							styleSheet.deleteRule(ii);       			// Delete rule, Moz Style
						 } else {                            			// Still deleting.
							styleSheet.removeRule(ii);        			// Delete rule IE style.
						 }                                    			// End IE check.
						 return true;                         			// return true, class deleted.
					  } else {                                			// found and not deleting.
						 return cssRule;                      			// return the style object.
					  }                                       			// End delete Check
				   }                                          			// End found rule name
				}                                             			// end found cssRule
				ii++;                                         			// Increment sub-counter
			 } while (cssRule)                                			// end While loop
		  }                                                   			// end For loop
	   }                                                      			// end styleSheet ability check
	   return false;                                         			// we found NOTHING!
	}                                                         			// end getCSSRule 
	
	function killCSSRule(ruleName) {                          			// Delete a CSS rule   
	   return getCSSRule(ruleName,'delete');                  			// just call getCSSRule w/delete flag.
	}                                                         			// end killCSSRule
	
	function addCSSRule(ruleName) {                           			// Create a new css rule
	   if (document.styleSheets) {                            			// Can browser do styleSheets?
		  if (!getCSSRule(ruleName)) {                        			// if rule doesn't exist...
			 if (document.styleSheets[0].addRule) {           			// Browser is IE?
				document.styleSheets[0].addRule(ruleName, null,0);      // Yes, add IE style
			 } else {                                         			// Browser is IE?
				document.styleSheets[0].insertRule(ruleName+' { }', 0); // Yes, add Moz style.
			 }                                                			// End browser check
		  }                                                   			// End already exist check.
	   }                                                      			// End browser ability check.
	   return getCSSRule(ruleName);                           			// return rule we just created.
	} 
		
	function getPosition(div){
		var x=0;
		var y=0;		
		if(div.offsetParent){
				do {
					x += div.offsetLeft;
					y += div.offsetTop;
				} while (div=div.offsetParent)
		}
		return {x: x,
				y: y};
	}	
	
	function getStyle(div){
		var result=new Object();
		for(var i=1; i<arguments.length; i++){
		if (div.currentStyle){
			result[arguments[i].replace(/-/g,"").toLowerCase()]=div.currentStyle[arguments[i].replace(/\-(.)/g, function(m, l){return l.toUpperCase()})];		
			}
		else if (window.getComputedStyle)
			result[arguments[i].replace(/-/g,"")]=document.defaultView.getComputedStyle(div, null).getPropertyValue(arguments[i]);
		}
		return result;
	}
	
	function detectBrowser(){
		var browser=navigator.appName;
		var rawVersion=navigator.appVersion;
		var version=parseFloat(rawVersion);
		var result=new Object();
		
		if (browser=="Microsoft Internet Explorer"){
			result["name"]="IE";
			version=parseFloat(navigator.appVersion.split("MSIE")[1]);}
		else if (browser=="Netscape" || browser=="Firefox" || browser=="Opera"){
		  result["name"]="Gecko";}
		else {
		result["name"]="Other";}
		result["rawVersion"]=rawVersion;
		result["version"]=version;
		return result;
	}
	
//Active Div

	function activeDiv(divID){
		this.div=document.getElementById(divID);
		
		var divStyles=getStyle(this.div, "width", "height", "top", "left", "opacity", "filter");
		this.width=parseInt(divStyles.width);
		this.height=parseInt(divStyles.height);
		this.top=parseInt(divStyles.top);
		this.left=parseInt(divStyles.left);
		if(divStyles.opacity!=null) {
			this.opacity=parseInt(divStyles.opacity);}
		else if(divStyles.filter!=null) {
			this.opacity=parseInt(divStyles.filter)/100;}
		else {
			this.opacity=1;	
		}
		delete divStyles;
		
		this.framerate=24;
		this.target=new Object();
		this.target.width=this.width;
		this.target.height=this.height;
		this.target.top=this.top;
		this.target.left=this.left;
		this.target.opacity=this.opacity;
		
		this.diff=new Object();
		this.diff.width=0;
		this.diff.height=0;
		this.diff.top=0;
		this.diff.left=0;
		this.diff.opacity=0;
		
		this.controller = function(){
			if (this.diff.width!=0){
			this.width=this.width+this.diff.width;
				if(this.width<=this.target.width+(Math.abs(this.diff.width)) && this.width>=this.target.width-(Math.abs(this.diff.width))){
					this.width=this.target.width;
					this.diff.width=0;
				}
				this.div.style.width=(this.width)+"px";
			}
			if (this.diff.height!=0){
				
			this.height=this.height+this.diff.height;
				if(this.height<=this.target.height+(Math.abs(this.diff.height)) && this.height>=this.target.height-(Math.abs(this.diff.height))){
					this.height=this.target.height;
					this.diff.height=0;
				}
				this.div.style.height=(this.height)+"px";
			}
			
			if (this.diff.top!=0){
			
			this.top=this.top+this.diff.top;
				if(this.top<=this.target.top+(Math.abs(this.diff.top)) && this.top>=this.target.top-(Math.abs(this.diff.top))){
					this.top=this.target.top;
					this.diff.top=0;
				}
				this.div.style.top=(this.top)+"px";
			}
			
			if (this.diff.left!=0){
			
			this.left=this.left+this.diff.left;
				if(this.left<=this.target.left+(Math.abs(this.diff.left)) && this.left>=this.target.left-(Math.abs(this.diff.left))){
					this.left=this.target.left;
					this.diff.left=0;
				}
				this.div.style.left=(this.left)+"px";
			}
			
			if (this.diff.opacity!=0){
				
				this.opacity=this.opacity+this.diff.opacity;
				if(this.opacity<=this.target.opacity+(Math.abs(this.diff.opacity)) && this.opacity>=this.target.opacity-(Math.abs(this.diff.opacity))){
					this.opacity=this.target.opacity;
					this.diff.opacity=0;
				}
				this.div.style.zoom="1";
				this.div.style.opacity=(this.opacity);
				//this.div.filters.item("Alpha").Opacity=(this.opacity*100);
			}
			
			if (this.diff.width==0 && this.diff.height==0 && this.diff.top==0 && this.diff.left==0 && this.diff.opacity==0){
				clearInterval(this.interval);
				this.interval=null;
			}
		}
		


		this.move = function(newX, newY, dur, durtype, lock, pos){
			if(!durtype){var durtype="duration";}
			if (!(lock==1 && (this.diff.width!=0 || this.diff.height!=0 || this.diff.top!=0 || this.diff.left!=0))){
				clearInterval(this.interval);
				this.interval=null;
				if (pos=="absolute"){
					this.div.style.position="absolute";
				} else if (pos=="relative"){
					this.div.style.position="relative";
				}
				if (durtype=="duration"){
					if (newX!=null){
						this.target.left=newX;
						this.diff.left=(this.target.left-this.left)/(dur*1000/this.framerate);
					}
					if (newY!=null){
						this.target.top=newY;
						this.diff.top=(this.target.top-this.top)/(dur*1000/this.framerate);
					}
				} else if (durtype=="speed"){
					if (newX!=null){
						this.target.left=newX;
						this.diff.left=dur;
					}
					if (newY!=null){
						this.target.top=newY;
						this.diff.top=dur;
					}
				}
				this.interval=setInterval("$('"+this.div.id+"').activeDiv.controller();", this.framerate);
			}
		}
		
		this.scale = function(newWidth, newHeight, dur, dir, durtype, lock, pos){
			if(!durtype){var durtype="duration";}
			if (!(lock==1 && (this.diff.width!=0 || this.diff.height!=0 || this.diff.top!=0 || this.diff.left!=0))){
				clearInterval(this.interval);
				this.interval=null;
				if (pos=="absolute"){
					this.div.style.position="absolute";
				} else if (pos=="relative"){
					this.div.style.position="relative";
				}
				if (durtype=="duration"){
					if (dir.indexOf("right")!=-1 && dir.indexOf("left")!=-1){
						this.target.width=newWidth;
						this.move(this.left-((newWidth-this.width)/2), null, dur, durtype);
						this.diff.width=(this.target.width-this.width)/(dur*1000/this.framerate);
					} else if (dir.indexOf("right")!=-1) {
						this.target.width=newWidth;
						this.diff.width=(this.target.width-this.width)/(dur*1000/this.framerate);
					} else if (dir.indexOf("left")!=-1) {
						this.target.width=newWidth;
						this.move(this.left-((newWidth-this.width)), null, dur, durtype);
						this.diff.width=(this.target.width-this.width)/(dur*1000/this.framerate);
					}
					
					if (dir.indexOf("up")!=-1 && dir.indexOf("down")!=-1){
						this.target.height=newHeight;
						this.move(null, this.top-((newHeight-this.height)/2), dur, durtype);
						this.diff.height=(this.target.height-this.height)/(dur*1000/this.framerate);
					} else if (dir.indexOf("down")!=-1) {
						this.target.height=newHeight;
						this.diff.height=(this.target.height-this.height)/(dur*1000/this.framerate);
					} else if (dir.indexOf("up")!=-1) {
						this.target.height=newHeight;
						this.move(null, this.top-((newHeight-this.height)), dur, durtype);
						this.diff.height=(this.target.height-this.height)/(dur*1000/this.framerate);
					}
				} else if (durtype="speed"){
					if (dir.indexOf("right")!=-1 && dir.indexOf("left")!=-1){
						this.target.width=newWidth;
						this.move(this.left-((newWidth-this.width)/2), null, dur*-1, durtype);
						this.diff.width=dur;
					} else if (dir.indexOf("right")!=-1) {
						this.target.width=newWidth;
						this.diff.width=dur;
					} else if (dir.indexOf("left")!=-1) {
						this.target.width=newWidth;
						this.move(this.left-((newWidth-this.width)), null, dur*-1, durtype);
						this.diff.width=dur;
					}
					
					if (dir.indexOf("up")!=-1 && dir.indexOf("down")!=-1){
						this.target.height=newHeight;
						this.move(null, this.top-((newHeight-this.height)/2), dur*-1, durtype);
						this.diff.height=dur;
					} else if (dir.indexOf("down")!=-1) {
						this.target.height=newHeight;
						this.diff.height=dur;
					} else if (dir.indexOf("up")!=-1) {
						this.target.height=newHeight;
						this.move(null, this.top-((newHeight-this.height)), dur*-1, durtype);
						this.diff.height=dur;
					}
				}
						
				this.interval=setInterval("$('"+this.div.id+"').activeDiv.controller();", this.framerate);
			}
		}
	

		
		this.fade = function(newOpacity, dur, durtype, lock){
		if(!durtype){var durtype="duration";}
			if (!(lock==1 && this.diff.opacity!=0)){
				clearInterval(this.interval);
				this.interval=null;
				this.target.opacity=newOpacity;
				if (durtype=="duration"){
					this.diff.opacity=(this.target.opacity-this.opacity)/(dur*1000/this.framerate);
				} else if (durtype=="speed"){
					this.diff.opacity=dur;
				}
				this.interval=setInterval("$('"+this.div.id+"').activeDiv.controller();", this.framerate);
			}
		}
	}
	
	//InstantShadow
	
	function instantShadow (divID, transparency, size, direction){
		if(!divID){return false;}
		if(!direction){var direction="down right"}
		if(!transparency){var transparency=3;}
		if(!size){var size=4;}
	   this.containerDiv=$(divID);
	   this.div=this.containerDiv.cloneNode(true);
	   if(shadowContainerStyle = addCSSRule("#"+this.div.id+"shadowcontainer")){
	   shadowContainerStyle.style.cssText = getCSSRule("#"+this.div.id).style.cssText;
	   this.div.style.cssText=shadowContainerStyle.style.cssText;}
	   var divStyles=getStyle(this.div, "display", "padding-top", "padding-bottom", "padding-left", "padding-right", "width", "height");
	   this.containerDiv.style.padding="0px";
		if(divStyles.width!="auto"){  
		   this.containerDiv.style.width=(parseInt(divStyles.width)+parseInt(divStyles.paddingright)+parseInt(divStyles.paddingleft))+"px";
		}
		if(divStyles.height!="auto") {  
		   this.containerDiv.style.height=(parseInt(divStyles.height)+parseInt(divStyles.paddingtop)+parseInt(divStyles.paddingbottom))+"px";
		}
		if(divStyles.display=="none"){
				this.div.style.display="block";
		}
	   this.containerDiv.style.backgroundColor="transparent";
	   this.containerDiv.style.backgroundImage="url('')";
	   this.containerDiv.style.overflow="visible";
	   this.containerDiv.style.border="none";
	   this.containerDiv.innerHTML="";
	   this.containerDiv.id=this.div.id+"shadowcontainer";
	   this.div.style.position="relative";
	   this.div.style.top="0px";
	   this.div.style.left="0px";
	   this.div.style.margin="0px";
	   this.containerDiv.appendChild(this.div);
	   if(direction.indexOf("right")!=-1){
		   this.xchange=1;
	   } else if (direction.indexOf("left")!=-1){
		   this.xchange=-1;
	   }
	   
	   if(direction.indexOf("down")!=-1){
		   this.ychange=1;
	   } else if (direction.indexOf("up")!=-1){
		   this.ychange=-1;
	   }
	   var newDiv;
       for (var s=1; s<=size; s++){
			newDiv=document.createElement("div");
			newDiv.style.position="absolute";
			newDiv.style.display="block";
			newDiv.style.width="100%";
			newDiv.style.height="100%";
			newDiv.style.top=(s*this.ychange)+"px";
			newDiv.style.left=(s*this.xchange)+"px";
			newDiv.style.background="#000";
			newDiv.style.opacity=(transparency/50)-(s/32/size);
			newDiv.style.filter="alpha(opacity="+(((transparency/50)-(s/32/size))*100)+")";
			this.containerDiv.appendChild(newDiv);
        }
	return true;
	}
	
	function instantShadowInit(trans, size, direction){
		var shadowingDivs = getElementsByClass("shadow");
		for (x in shadowingDivs){
			if((shadowingDivs[x].parentNode.id!=shadowingDivs[x].id+"shadowcontainer") && (shadowingDivs[x].id.indexOf("shadowcontainer")==-1)){
				instantShadow(shadowingDivs[x], trans, size, direction);
			}
		}
	}

//Menu Rollover Functions
if (detectBrowser().name!="IE"){
$("animals_menu")["activeDiv"]=new activeDiv("animals_menu");
$("dogs_btn")["activeDiv"]=new activeDiv("dogs_btn");
$("cats_btn")["activeDiv"]=new activeDiv("cats_btn");
$("other_btn")["activeDiv"]=new activeDiv("other_btn");
//$("foster_btn")["activeDiv"]=new activeDiv("foster_btn");
$("tails_btn")["activeDiv"]=new activeDiv("tails_btn");
$("about_menu")["activeDiv"]=new activeDiv("about_menu");
$("donate_btn")["activeDiv"]=new activeDiv("donate_btn");
$("membership_btn")["activeDiv"]=new activeDiv("membership_btn");
$("volunteer_btn")["activeDiv"]=new activeDiv("volunteer_btn");
$("cage_btn")["activeDiv"]=new activeDiv("cage_btn");
$("wish_btn")["activeDiv"]=new activeDiv("wish_btn");
$("contact_menu")["activeDiv"]=new activeDiv("contact_menu");
$("links_btn")["activeDiv"]=new activeDiv("links_btn");}
else {
$("animals_menu").style.overflow="hidden";
$("animals_menu").style.height="27px";
$("animals_menu").style.position="relative";
$("about_menu").style.overflow="hidden";
$("about_menu").style.height="27px";
$("about_menu").style.position="relative";
$("contact_menu").style.overflow="hidden";
$("contact_menu").style.height="27px";
$("contact_menu").style.position="relative";
}

var animalMenuTimeout;

function animalMenuOver(action){
	if (detectBrowser().name!="IE"){
	if(action=="in"){
		clearTimeout(animalMenuTimeout);
		$('animals_menu').activeDiv.scale(154, 162, 8, 'down', 'speed');
		//$('dogs_btn').activeDiv.fade(.75, .025, 'speed');
		//$('cats_btn').activeDiv.fade(.75, .02, 'speed');
		//$('other_btn').activeDiv.fade(.75, .015, 'speed');
		//$('foster_btn').activeDiv.fade(.75, .012, 'speed');
		//$('tails_btn').activeDiv.fade(.75, .01, 'speed');
	} else if (action=="out" && detectBrowser().name!="IE"){
		$('animals_menu').activeDiv.scale(154, 27, -10, 'down', 'speed');
		//$('dogs_btn').activeDiv.fade(0, -.02, 'speed');
		//$('cats_btn').activeDiv.fade(0, -.03, 'speed');
		//$('other_btn').activeDiv.fade(0, -.04, 'speed');
		//$('foster_btn').activeDiv.fade(0, -.05, 'speed');
		//$('tails_btn').activeDiv.fade(0, -.06, 'speed');
	} else if (action=="leave" && detectBrowser().name=="IE"){
		$('animals_menu').activeDiv.scale(154, 27, -10, 'down', 'speed');
		//$('dogs_btn').activeDiv.fade(0, -.02, 'speed');
		//$('cats_btn').activeDiv.fade(0, -.03, 'speed');
		//$('other_btn').activeDiv.fade(0, -.04, 'speed');
		//$('foster_btn').activeDiv.fade(0, -.05, 'speed');
		//$('tails_btn').activeDiv.fade(0, -.06, 'speed');
	}
	} else {
		if(action=="in"){
			$("animals_menu").style.overflow="visible";
			$("animals_menu").style.height="135px";
		} else if (action=="leave"){
			$("animals_menu").style.overflow="hidden";
			$("animals_menu").style.height="27px";
		}
	}
}

var aboutMenuTimeout;

function aboutMenuOver(action){
	if (detectBrowser().name!="IE"){
	if(action=="in"){
		clearTimeout(aboutMenuTimeout);
		$('about_menu').activeDiv.scale(154, 162, 8, 'down', 'speed');
		//$('donate_btn').activeDiv.fade(.75, .025, 'speed');
		//$('membership_btn').activeDiv.fade(.75, .02, 'speed');
		//$('volunteer_btn').activeDiv.fade(.75, .015, 'speed');
		//$('cage_btn').activeDiv.fade(.75, .012, 'speed');
		//$('wish_btn').activeDiv.fade(.75, .01, 'speed');
	} else if (action=="out" && detectBrowser().name!="IE"){
		$('about_menu').activeDiv.scale(154, 27, -10, 'down', 'speed');
		//$('donate_btn').activeDiv.fade(0, -.02, 'speed');
		//$('membership_btn').activeDiv.fade(0, -.03, 'speed');
		//$('volunteer_btn').activeDiv.fade(0, -.04, 'speed');
		//$('cage_btn').activeDiv.fade(0, -.05, 'speed');
		//$('wish_btn').activeDiv.fade(0, -.06, 'speed');
	} else if (action=="leave" && detectBrowser().name=="IE"){
		$('about_menu').activeDiv.scale(154, 27, -10, 'down', 'speed');
		//$('donate_btn').activeDiv.fade(0, -.02, 'speed');
		//$('membership_btn').activeDiv.fade(0, -.03, 'speed');
		//$('volunteer_btn').activeDiv.fade(0, -.04, 'speed');
		//$('cage_btn').activeDiv.fade(0, -.05, 'speed');
		//$('wish_btn').activeDiv.fade(0, -.06, 'speed');
	}
	} else {
		if(action=="in"){
			$("about_menu").style.overflow="visible";
			$("about_menu").style.height="135px";
		} else if (action=="leave"){
			$("about_menu").style.overflow="hidden";
			$("about_menu").style.height="27px";
		}
	}
}

var contactMenuTimeout;

function contactMenuOver(action){
	if (detectBrowser().name!="IE"){
	if(action=="in"){
		clearTimeout(contactMenuTimeout);
		$('contact_menu').activeDiv.scale(154, 54, 8, 'down', 'speed');
		//$('links_btn').activeDiv.fade(.75, .025, 'speed');
	} else if (action=="out" && detectBrowser().name!="IE"){
		$('contact_menu').activeDiv.scale(154, 27, -10, 'down', 'speed');
		//$('links_btn').activeDiv.fade(0, -.02, 'speed');
	} else if (action=="leave" && detectBrowser().name=="IE"){
		$('contact_menu').activeDiv.scale(154, 27, -10, 'down', 'speed');
		//$('links_btn').activeDiv.fade(0, -.02, 'speed');
	}
	} else {
		if(action=="in"){
			$("contact_menu").style.overflow="visible";
			$("contact_menu").style.height="54px";
		} else if (action=="leave"){
			$("contact_menu").style.overflow="hidden";
			$("contact_menu").style.height="27px";
		}
	}
}

/* Image Rotator */

var currentSlide=1;
var rotatorInterval;
var rotatorTimeout;

function fadeSlide(fSlide){
	$("rotator"+(fSlide)).activeDiv.fade(0, .1);
}

function switchSlide(){
	if(currentSlide<9){
		currentSlide++;
	} else {currentSlide=1;}
	
	if (currentSlide!=1){
		$("rotator"+(currentSlide-1)).style.zIndex="1";
		rotatorTimeout=setTimeout("fadeSlide("+(currentSlide-1)+");", 1500);
		$("rotator"+(currentSlide)).activeDiv.fade(1, 1);
		$("rotator"+(currentSlide)).style.zIndex="20";	
	}
	else if (currentSlide==1){
		$("rotator9").style.zIndex="1";		
		rotatorTimeout=setTimeout("fadeSlide(9);", 1500);
		$("rotator1").activeDiv.fade(1, 1);
		$("rotator1").style.zIndex="20";	
	}
}

function startRotator(){
	$("rotator1").style.opacity="1";
	$("rotator1").style.zIndex="20";
	$("rotator1")["activeDiv"]=new activeDiv("rotator1");
	$("rotator2")["activeDiv"]=new activeDiv("rotator2");
	$("rotator3")["activeDiv"]=new activeDiv("rotator3");
	$("rotator4")["activeDiv"]=new activeDiv("rotator4");
	$("rotator5")["activeDiv"]=new activeDiv("rotator5");
	$("rotator6")["activeDiv"]=new activeDiv("rotator6");
	$("rotator7")["activeDiv"]=new activeDiv("rotator7");
	$("rotator8")["activeDiv"]=new activeDiv("rotator8");
	$("rotator9")["activeDiv"]=new activeDiv("rotator9");
	
	rotatorInterval = setInterval("switchSlide();", 4000);
}

//Image Gallery

var displayingImage=false;

function openImage(src, title, alt){
	document.body.style.overflow="hidden";
	$("imageWrapper").style.display="block";
	$("imageImage").src="../images/gallery/"+src;
	$("imageText").innerHTML="<span class='blue'>"+title+"</span><br />"+alt;
	scroll(0,0);
}

function closeImage(){
	$("imageWrapper").style.display="none";
	document.body.style.overflow="visible";
}
