﻿var DHTML=0,DOM=0,MS=0,NS=0,OP=0;
function DHTML_init(){
	if(window.opera){
		OP=1
	}
	if(document.getElementById){
		DHTML=1;DOM=1
	}
	if(document.all&&!OP){
		DHTML=1;
		MS=1
	}
	if(document.layers&&!OP){
		DHTML=1;NS=1
	}
}

function getElem(d,c,b){
	var a;
	if(DOM){
		if(d.toLowerCase()=="id"){
			if(typeof document.getElementById(c)=="object"){
				a=document.getElementById(c)
			}
			else{
				a=void (0)
			}
			return(a)
		}
		else{
			if(d.toLowerCase()=="name"){
				if(typeof document.getElementsByName(c)=="object"){
					a=document.getElementsByName(c)[b]
				}
				else{
					a=void (0)
				}
				return(a)
			}
			else{
				if(d.toLowerCase()=="tagname"){
					if(typeof document.getElementsByTagName(c)=="object"||(OP&&typeof document.getElementsByTagName(c)=="function")){
						a=document.getElementsByTagName(c)[b]
					}
					else{
						a=void (0)
					}
					return(a)
				}
				else{
					return void (0)
				}
			}
		}
	}
	else{
		if(MS){
			if(d.toLowerCase()=="id"){
				if(typeof document.all[c]=="object"){
					a=document.all[c]
				}
				else{
					a=void (0)
				}
				return(a)
			}
			else{
				if(d.toLowerCase()=="tagname"){
					if(typeof document.all.tags(c)=="object"){
						a=document.all.tags(c)[b]
					}
					else{
						a=void (0)
					}
					return(a)
				}
				else{
					if(d.toLowerCase()=="name"){
						if(typeof document[c]=="object"){
							a=document[c]
						}
						else{
							a=void (0)
						}
						return(a)
					}
					else{
						return void (0)
					}
				}
			}
		}
		else{
			if(NS){
				if(d.toLowerCase()=="id"||d.toLowerCase()=="name"){
					if(typeof document[c]=="object"){
						a=document[c]
					}
					else{
						a=void (0)
					}
					return(a)
				}
				else{
					if(d.toLowerCase()=="index"){
						if(typeof document.layers[c]=="object"){
							a=document.layers[c]
						}
						else{
							a=void (0)
						}
						return(a)
					}
					else{
						return void (0)
					}
				}
			}
		}
	}
}



function getCont(d,c,a){
	var b;
	if(DOM&&getElem(d,c,a)&&getElem(d,c,a).firstChild){
		if(getElem(d,c,a).firstChild.nodeType==3){
			b=getElem(d,c,a).firstChild.nodeValue
		}
		else{
			b=""
		}
		return(b)
	}
	else{
		if(MS&&getElem(d,c,a)){
			b=getElem(d,c,a).innerText;return(b)
		}
		else{
			return void (0)
		}
	}
}
function getAttr(e,d,b,a){
	var c;
	if((DOM||MS)&&getElem(e,d,b)){
		c=getElem(e,d,b).getAttribute(a);
		return(c)
	}
	else{
		if(NS&&getElem(e,d)){
			if(typeof getElem(e,d)[b]=="object"){
				c=getElem(e,d)[b][a]
			}
			else{
				c=getElem(e,d)[a]
			}
			return c
		}
		else{
			return void (0)
		}
	}
}
function setCont(d,c,b,a){
	if(DOM&&getElem(d,c,b)&&getElem(d,c,b).firstChild){
		getElem(d,c,b).firstChild.nodeValue=a
	}
	else{
		if(MS&&getElem(d,c,b)){
			getElem(d,c,b).innerText=a
		}
		else{
			if(NS&&getElem(d,c,b)){
				getElem(d,c,b).document.open();
				getElem(d,c,b).document.write(a);
				getElem(d,c,b).document.close()
			}
		}
	}
}

DHTML_init();

function toggleDisplay(b,a){
	if(getElem("id",b,null).style.display=="none"){
		getElem("id",b,null).style.display="block";
		getElem("id",a,null).style.display="none"
	}
	else{
		getElem("id",a,null).style.display="block";
		getElem("id",b,null).style.display="none"
	}
}
function showLayer(a){
	getElem("id",a,null).style.visibility="visible";
	getElem("id",a,null).style.display="block"
}
function hideLayer(a){
	getElem("id",a,null).style.visibility="hidden";
	getElem("id",a,null).style.display="none"
}
function setActive(a){
	getElem("id",a,null).style.backgroundColor="#DD0000";
	getElem("id",a,null).style.color="white"
}
function setInactive(a){
	getElem("id",a,null).style.backgroundColor="#DDDDDD";
	getElem("id",a,null).style.color="#666666"
}
function setInactiveSelected(a){
	getElem("id",a,null).style.backgroundColor="#777777";
	getElem("id",a,null).style.color="white"
}
imageSwapper={};

var preloadFlag=false;

imageSwapper.init=
function(){
	if(document.images){
		this.images=new Array();
		for(var a=0;a<this.init.arguments.length;a++){
			this.images[a]=this.createImage(this.init.arguments[a])
		}
		preloadFlag=true
	}
};

imageSwapper.createImage=
function(b){
	if(document.images){
		var a=new Image();
		a.src=b;return a
	}
};
imageSwapper.setImage=
function(c,b){
	if(document.images&&preloadFlag){
		var a=getElem("id",c,null);
		a.src=b
	}
};
imageSwapper.setImage2=
function(f,b,c,e){
	if(document.images&&preloadFlag){
		var a=getElem("id",f,null);
		a.src=b;var d=getElem("id",c,null);
		d.src=E
	}
};
imageSwapper.setImageShowLayer=
function(d,c,a){
	if(document.images&&preloadFlag){
		var b=getElem("id",d,null);
		b.src=c
	}
	getElem("id",a,null).style.visibility="visible";
	getElem("id",a,null).style.display="block"
};
imageSwapper.setImageHideLayer=
function(d,c,b){
	if(document.images&&preloadFlag){
		var a=getElem("id",d,null);
		a.src=c
	}
	getElem("id",b,null).style.visibility="hidden";
	getElem("id",b,null).style.display="none"
};

function sineInOut(a){
	return(1-Math.cos(a*Math.PI))/2
}
function showEmail(a,b){document.write(a+"@"+b)}
function showEmailLink(a,b){parent.location="mailto:"+a+"@"+b}

function SlideShow(c,b,a){
	this.slideshowDivID=c;
	this.slideshowImageID=b;
	this.slideshowLinkID=a;
	this.preloadFlag=false;
	this.currentImageID=0;
	this.nextImageID=1;
	this.slideDuration=2000;
	this.transitionDuration=1000;
	this.random=false
}
SlideShow.prototype.setRandom=
function(a){
	this.random=a
};
SlideShow.prototype.setSlideDuration=
function(a){
	this.slideDuration=a
};
SlideShow.prototype.setTransitionDuration=
function(a){
	this.transitionDuration=a
};
SlideShow.prototype.setImages=
function(){
	if(document.images){
		this.images=new Array();
		for(var a=0;a<this.setImages.arguments.length;a++){
			this.images[a]=this.createImage(this.setImages.arguments[a])
		}
		this.preloadFlag=true
	}
};
SlideShow.prototype.setLinks=
function(){
	this.links=new Array();
	for(var a=0;a<this.setLinks.arguments.length;a++){
		this.links[a]=this.setLinks.arguments[a]
	}
};
SlideShow.prototype.createImage=
function(b){
	if(document.images){
		var a=new Image();
		a.src=b;return a
	}
};
SlideShow.prototype.sineInOut=
function(a){
	return(1-Math.cos(a*Math.PI))/2
};
SlideShow.prototype.loop=
function(){
	var b=new Date().getTime();
	this.position=(b-this.startTime)/this.transitionDuration;
	if(this.position>0.99){
		this.position=0.99;
		clearInterval(this.interval)
	}
	var a=this.sineInOut(this.position);
	this.setOpacity(this.objectStyle,a)
};
SlideShow.prototype.setOpacity=
function(b,a){
	b.opacity=(a);
	b.MozOpacity=(a);
	b.KhtmlOpacity=(a);
	b.filter="alpha(opacity="+a*100+")"
};
SlideShow.prototype.startTransition=
function(c,b){
	document.getElementById(this.slideshowDivID).style.backgroundImage="url("+c+")";
	this.objectStyle=document.getElementById(this.slideshowImageID).style;
	this.setOpacity(this.objectStyle,0);
	this.nextImage=b;
	var a=this;
	window.setTimeout(function(){	a.startInterval()},10)
};
		
SlideShow.prototype.setLink=
function(a){
	if(this.slideshowLinkID!=""){
		document.getElementById(this.slideshowLinkID).href=a;
		if(a.indexOf('http://')!=-1)
			document.getElementById(this.slideshowLinkID).target = "_new";
		else
			document.getElementById(this.slideshowLinkID).target = "";
	}
};

SlideShow.prototype.startInterval=
function(){
	document.getElementById(this.slideshowImageID).src=this.nextImage;
	this.startTime=new Date().getTime();
	var a=this;
	this.interval=setInterval(function(){a.loop()},10)
};
		
SlideShow.prototype.showNextImage=
function(){
	if(document.images&&this.preloadFlag){
		if(this.random){
			this.nextImageID=Math.round(Math.random()*(this.images.length-1))
		}
		else{
			this.nextImageID=this.currentImageID+1
		}
		if(this.nextImageID>this.images.length-1){
			this.nextImageID=0
		}
		if(this.links!=null){
			this.setLink(this.links[this.nextImageID])
		}
		this.startTransition(this.images[this.currentImageID].src,this.images[this.nextImageID].src);
		this.currentImageID=this.nextImageID
	}
	var a=this;
	window.setTimeout(function(){a.showNextImage()},this.slideDuration)
};
		
SlideShow.prototype.start=function(){
	var a=this;
	window.setTimeout(function(){a.showNextImage()},this.slideDuration)
};
function initAll(){
	imageSwapper.init("http://artschoolvets.com/gfx/n_home_over.gif","http://artschoolvets.com/gfx/n_news_over.gif","http://artschoolvets.com/gfx/n_blogs_over.gif","http://artschoolvets.com/gfx/n_features_over.gif","http://artschoolvets.com/gfx/n_faces-spaces_over.gif","http://artschoolvets.com/gfx/n_store_over.gif");
	clearExecuteMessage=
function(){
	if(document.getElementById("execute_message")!=null){
		document.getElementById("execute_message").innerHTML=""
	}
};
window.setTimeout("clearExecuteMessage()",5000)};