/**
* 
* 
* INSAO PLAY
* 
* @copyright	 		(c) 2007-2010 PR23 Limited. All Rights Reserved
* @author 				PR23 :: Paul Winterhalder
*
* @category 			INSAO PLAY 1.0.0.1
* @package 				/insao-play/
* @subpackage 			/www/
* @name 				screen.js
* 
*
* ---------------------------------------------
*
*
*/	
kback 					= 	new Image(5,5);
kback.src 				= 	'/-/images/filter_black/png/'; 

var ua 					= 	navigator.userAgent.toLowerCase();
var isIE 				= 	((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1));
var isGecko 			= 	(ua.indexOf("gecko") != -1);
var isSafari 			= 	(ua.indexOf("safari") != -1);
var isKonqueror 		= 	(ua.indexOf("konqueror") != -1);
var DDSPEED 			= 	5;
var DDTIMER 			= 	15;
var fadebgcolor			=	"white"
var fadearray			=	new Array() //array to cache saorotator instances
var fadeclear			=	new Array() //array to cache corresponding clearinterval pointers
var dom					=	(document.getElementById) //modern dom browsers
var iebrowser			=	document.all

/* ---------------------------------------------
*
*
*/
function clearAnObject(thisObj,entermsg) {
	
	if(thisObj.childNodes[0].nodeValue == entermsg) {
		thisObj.childNodes[0].nodeValue = '';
	} 
}

/* ---------------------------------------------
*
*
*/	
function paintCanvas() {
	var bdp 			= 	document.createElement("div");
	bdp.id 				= 	(isIE == true) ? "coat_ui_ie" : "coat_ui";
	bdp.style.height 	= 	parseInt(document.documentElement.clientHeight) + 1000 +'px';
	bdp.style.backgroundImage = "url("+kback.src+")";
	document.body.appendChild(bdp);
}

/* ---------------------------------------------
*
*
*/	
function popupimage(imgsrc,imgheight,imgwidth, altext) {
	paintCanvas();
	
	var popup 						= 	document.createElement("div");
	popup.id 						= 	"popbox_ui";
	popup.style.left				=	((parseInt(document.documentElement.clientWidth) - parseInt(imgwidth) - 8) / 2) + 'px';
	
	var popupi 						= 	document.createElement("div");
	popupi.style.width				=	imgwidth + 'px';
	
	popupi.style.padding 			=	'0.2em';	
	popupi.style.backgroundColor	=	'#ffffff'
	nweimg							= 	document.createElement("img");	
	nweimg.src						=	imgsrc
	nweimg.height					=	imgheight
	nweimg.width					=	imgwidth
	
	var popbottom 					= 	document.createElement("div");
	popbottom.style.textAlign		=	'center';
	popbottom.style.paddingTop		=	'0.4em';
	popbottom.style.border			=	'1px solid #fff';
	
	var popbottomleft1 				= 	document.createElement("div");
	popbottomleft1.className		=	'popuplowerbox';
	
	var popbottomleft23 			= 	document.createElement("div");
	popbottomleft23.className		=	'popuptextbox';
	var newText 					= 	document.createTextNode(altext);
	popbottomleft23.appendChild(newText);
	
	var popbottomleft2 				= 	document.createElement("div");
	popbottomleft2.className		=	'popuplowerbox';
			
	var popclose 					= 	document.createElement("a");
	popclose.href					=	'#';
	popclose.onclick 				= 	new Function("return popClose(); return false;");  
	var newClose 					= 	document.createTextNode("Close");
	popclose.appendChild(newClose);
	popbottomleft2.appendChild(popclose);
		
	var popbottomleft3 				= 	document.createElement("div");
	popbottomleft3.className		=	'popuplowerbox';
		
	var popbottomclear 				= 	document.createElement("div");
	popbottomclear.className		=	'popupclear';
					
	popupi.appendChild(nweimg);
	popbottom.appendChild(popbottomleft23);
	popbottom.appendChild(popbottomleft1);
	popbottom.appendChild(popbottomleft2);
	popbottom.appendChild(popbottomleft3);
	popbottom.appendChild(popbottomclear);
	
	popupi.appendChild(popbottom);
	popup.appendChild(popupi);
	document.body.appendChild(popup);
	sethash	=	(isIE == true) ? "coat_ui_ie" : "coat_ui";
	
	window.location.hash	=	sethash;
}

/* ---------------------------------------------
*
*
*/	
function popClose() {
	bdp		= 	(isIE == true) ? "coat_ui_ie" : "coat_ui";
	document.body.removeChild(document.getElementById('popbox_ui')); 
	document.body.removeChild(document.getElementById(bdp)); 
	return false;
}

/** ----------------------------------------------
*
* Google Maps Show Address 
*
* @param (str)	address
* @param (str)	aa
* @param (str)	bb
* @param (str)	mode
* @param (str)	marker
*
**/				
function showAddress(address,aa,bb,marker,mode) {
	var mode  	=  (typeof(mode) != 'undefined') 		? 	parseInt(mode) 		: 	6;
	var marker  =  (typeof(marker) != 'undefined') 		? 	((marker == 1)	?	true	:	false)				: 	false;

	if (aa) {
		aa.getLatLng(
		address,
			function(point) {
				if (!point) {
					//alert(address + " not found");
				} else {
					bb.setCenter(point, mode);
					if(marker == true) {
						bb.addOverlay(new GMarker(point))
					}
				}
			}
		);
	}
}

/* ---------------------------------------------
*
*
*/	
function changeCode() {
	var dlimg 		= 	document.getElementById('sccs_code');
	var ranrdnum 	= 	Math.floor(Math.random() * 1534234) +1;
	
	if(dlimg != null) {
		dlimg.src = dlimg.src + '&new='+ranrdnum+''
	}
}

/* ---------------------------------------------
*
*
*/	
function sayCode() {
	window.open ("/speakcode.html","mywindow", "status=0,toolbar=0,height=45,width=310");
}

/* ---------------------------------------------
* Horizontal drop down menu
*
*/
function ddVerticalMenu(thisObj,id){
	var cc = document.getElementById('in_' + id + '-ddcontent');
	if(cc != null) {
		if(cc.style.height == '' || cc.style.height == '0px') {
			ddMenu(id,1)
		} else {
			ddMenu(id,-1)
		}
	}
}

/* ---------------------------------------------
* Horizontal drop down menu
*
*/
function ddMenu(id,d, mvonoff){
	var h 		= document.getElementById('in_' + id + '-ddheader');
	var a 		= document.getElementById('in_' + id + '-aheader');
	var c 		= document.getElementById('in_' + id + '-ddcontent');
	
	if(c != null) {
		clearInterval(c.timer);
	
		if(d == 1){
			clearTimeout(h.timer);
				
			if(c.maxh && c.maxh <= c.offsetHeight) {
				return;
			
			} else if(!c.maxh) {
				c.style.display = 	'block';
				c.style.height 	= 	'auto';
				c.maxh 			= 	c.offsetHeight;
				c.style.height 	= 	'0px';	
			}
			
			a.className		=	'hover';
			
			c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
		
		} else {
			c.timer = setTimeout(function(){ddCollapse(c,a)},50)	
		}
	}
}

/* ---------------------------------------------
* Horizontal drop down menu
*
*/
function ddCollapse(c,a){
  c.timer = setInterval(function(){ddSlide(c,-1)},DDTIMER);
  a.className	=	'';
}

/* ---------------------------------------------
* Horizontal drop down menu
*
*/
function cancelHide(id){
	var h = document.getElementById('in_' + id + '-ddheader');
	var c = document.getElementById('in_' + id + '-ddcontent');
	if(c != null) {
		clearTimeout(h.timer);
		clearInterval(c.timer);
	
		if(c.offsetHeight < c.maxh) {
			c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
		}
	}
}

/* ---------------------------------------------
* Horizontal drop down menu
*
*/
function ddSlide(c,d){
	var currh = c.offsetHeight;
	var dist;
	
	if(d == 1) {
		dist = (Math.round((c.maxh - currh) / DDSPEED));
	} else {
		dist = (Math.round(currh / DDSPEED));
	}
	
	if(dist <= 1 && d == 1){
		dist = 1;
	}
		c.style.height = currh + (dist * d) + 'px';
		c.style.opacity = currh / c.maxh;
		c.style.filter = 'alpha(opacity=' + (currh * 100 / c.maxh) + ')';
		
		if((currh < 2 && d != 1) || (currh > (c.maxh - 2) && d == 1)){
			clearInterval(c.timer);
		}
		
		if((currh < 3 && d != 1)) {
			c.style.height 	= 	'0px';	
		}
}


/* ---------------------------------------------
* Horizontal drop down menu
* For secondary menus
*/
function dsVerticalMenu(thisObj,id){
	var ccs = document.getElementById('sn_' + id + '-ddcontent');
	if(ccs != null) {
		if(ccs.style.height == '' || ccs.style.height == '0px') {
			dsMenu(id,1)
		} else {
			dsMenu(id,-1)
		}
	}
}


/* ---------------------------------------------
* Horizontal drop down menu
*
*/
function dsMenu(id,ds, mvonoff){
	var hs 		= document.getElementById('sn_' + id + '-ddheader');
	var as 		= document.getElementById('sn_' + id + '-aheader');
	var cs		= document.getElementById('sn_' + id + '-ddcontent');
	
	if(cs != null) {
		clearInterval(cs.timer);
	
		if(ds == 1){
			clearTimeout(hs.timer);
				
			if(cs.maxh && (cs.maxh <= cs.offsetHeight)) {
				return;
			
			} else if(!cs.maxh) {
				cs.style.display 	= 	'block';
				cs.style.height 	= 	'auto';
				cs.maxh 			= 	cs.offsetHeight;
				cs.style.height 	= 	'0px';	
			}
			
			as.className	=	'hover';
			cs.timer 		= setInterval(function(){dsSlide(cs,1)},DDTIMER);
		
		} else {
			cs.timer = setTimeout(function(){dsCollapse(cs,as)},50)	
		}
	}
}

/* ---------------------------------------------
* Horizontal drop down menu
*
*/
function dsCollapse(cs,as){
  cs.timer = setInterval(function(){dsSlide(cs,-1)},DDTIMER);
  as.className	=	'';
}

/* ---------------------------------------------
* Horizontal drop down menu
*
*/
function cancelDHide(id){
	var hs = document.getElementById('sn_' + id + '-ddheader');
	var cs = document.getElementById('sn_' + id + '-ddcontent');
	if(cs != null) {
		clearTimeout(hs.timer);
		clearInterval(cs.timer);
	
		if(cs.offsetHeight < cs.maxh) {
			cs.timer = setInterval(function(){dsSlide(cs,1)},DDTIMER);
		}
	}
}

/* ---------------------------------------------
* Horizontal drop down menu
*
*/
function dsSlide(cs,ds){
	var currhs = cs.offsetHeight;
	var dists;
	
	if(ds == 1) {
		dists = (Math.round((cs.maxh - currhs) / DDSPEED));
	} else {
		dists = (Math.round(currhs / DDSPEED));
	}
	
	if(dists <= 1 && ds == 1){
		dists = 1;
	}
		cs.style.height = currhs + (dists * ds) + 'px';
		cs.style.opacity = currhs / cs.maxh;
		cs.style.filter = 'alpha(opacity=' + (currhs * 100 / cs.maxh) + ')';
		
		if((currhs < 2 && ds != 1) || (currhs > (cs.maxh - 2) && ds == 1)){
			clearInterval(cs.timer);
		}
		
		if((currhs < 3 && ds != 1)) {
			cs.style.height 	= 	'0px';	
		}
}

/* ---------------------------------------------
* Fading Rotator
*
*/
function saorotator(theimages, fadewidth, fadeheight, borderwidth, delay, pause, displayorder) {
		
		this.clase 						= 	false
		this.timefactor					=	72;
		this.windoScalToL				=	null
		this.windoScalToT				=	null
		this.setInitTop					=	null
		this.setInitleft				=	null				
		this.selectedimage				=	0
		this.pausecheck					=	pause
		this.mouseovercheck				=	0
		this.delay						=	delay
		this.degree						=	50 
		this.curimageindex				=	0
		this.nextimageindex				=	1
		fadearray[fadearray.length]		=	this
		this.slideshowid				=	fadearray.length-1
		this.canvasbase					=	"canvas" + this.slideshowid
		this.curcanvas					=	this.canvasbase+"_0"
		if (typeof displayorder!="undefined")
		theimages.sort(function() {return 0.5 - Math.random();}) 
		this.theimages=theimages
		this.imageborder=parseInt(borderwidth)
		this.postimages=new Array() //preload images

		for (p=0;p<theimages.length;p++){
			this.postimages[p]		=	new Image(fadewidth,fadeheight)
			this.postimages[p].src	=	theimages[p][0]
		}
	 
	var fadewidth	=	fadewidth + this.imageborder * 2
	var fadeheight	=	fadeheight + this.imageborder * 2
	 
	if (iebrowser&&dom||dom) {
		document.write('<div id="master'+this.slideshowid+'" style="position:relative;width:'+fadewidth+'px;height:'+fadeheight+'px;overflow:hidden;"><div id="'+this.canvasbase+'_0" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div><div id="'+this.canvasbase+'_1" style="position:absolute;width:'+fadewidth+'px;height:'+fadeheight+'px;top:0;left:0;filter:progid:DXImageTransform.Microsoft.alpha(opacity=10);opacity:0.1;-moz-opacity:0.1;-khtml-opacity:0.1;background-color:'+fadebgcolor+'"></div></div>')
	
	} else {
		document.write('<div><img name="defaultslide'+this.slideshowid+'" src="'+this.postimages[0].src+'" /></div>')
	} 
	
	if (iebrowser&&dom||dom) {
		this.startit()
		
	} else {
		this.curimageindex++
		setInterval("fadearray["+this.slideshowid+"].rotateimage()", this.delay)
	}
}

/* ---------------------------------------------
* Fading Rotator
*
*/
function fadepic(obj){
	
	if (obj.degree < 100) {
		
		obj.degree+=10
		
		if (obj.tempobj.filters&&obj.tempobj.filters[0]) {
			if (typeof obj.tempobj.filters[0].opacity=="number") {
				obj.tempobj.filters[0].opacity=obj.degree
			} else {
				obj.tempobj.style.filter="alpha(opacity="+obj.degree+")"
			}
		} else if (obj.tempobj.style.MozOpacity) {
			obj.tempobj.style.MozOpacity=obj.degree/101
			
		} else if (obj.tempobj.style.KhtmlOpacity) {
			obj.tempobj.style.KhtmlOpacity=obj.degree/100
			
		} else if (obj.tempobj.style.opacity&&!obj.tempobj.filters) {
			obj.tempobj.style.opacity=obj.degree/101
		}
		
	} else{
		clearInterval(fadeclear[obj.slideshowid])
		obj.nextcanvas=(obj.curcanvas==obj.canvasbase+"_0")? obj.canvasbase+"_0" : obj.canvasbase+"_1"
		obj.tempobj=iebrowser? iebrowser[obj.nextcanvas] : document.getElementById(obj.nextcanvas)
		obj.populateslide(obj.tempobj, obj.nextimageindex)
		obj.nextimageindex=(obj.nextimageindex<obj.postimages.length-1)? obj.nextimageindex+1 : 0
		setTimeout("fadearray["+obj.slideshowid+"].rotateimage()", obj.delay)
	}
}
 
/* ---------------------------------------------
* Fading Rotator
*
*/
saorotator.prototype.populateslide=function(picobj, picindex){
	
	var slideHTML=""
	
	if (this.theimages[picindex][1] != "") {
		slideHTML='<a href="'+this.theimages[picindex][1]+'" target="'+this.theimages[picindex][2]+'">'	
	}
	
	slideHTML+='<img src="'+this.postimages[picindex].src+'" border="'+this.imageborder+'px" />'
	
	if (this.theimages[picindex][1] != "") {
		slideHTML+='</a>'
	}
			
	picobj.innerHTML=slideHTML	
}
 
/* ---------------------------------------------
* Fading Rotator
*
*/
saorotator.prototype.rotateimage=function(){
	
	if (this.pausecheck==1) {
		var cacheobj=this
	}
	
	if (this.mouseovercheck==1) {
		setTimeout(function(){cacheobj.rotateimage()}, 100)
		
	} else if (iebrowser&&dom||dom) {
		this.resetit()
		var crossobj						=	this.tempobj	=	(iebrowser ? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas))
		crossobj.style.zIndex++
		fadeclear[this.slideshowid]			=	setInterval("fadepic(fadearray["+this.slideshowid+"])",50)
		this.curcanvas						=	(this.curcanvas==this.canvasbase+"_0") ? this.canvasbase+"_1" : this.canvasbase+"_0"
	
	} else {
		var ns4imgobj		=	document.images['defaultslide'+this.slideshowid]
		ns4imgobj.src		=	this.postimages[this.curimageindex].src
	}
	
	this.curimageindex=(this.curimageindex<this.postimages.length-1)? this.curimageindex+1 : 0
}

/* ---------------------------------------------
* Fading Rotator
*
*/
saorotator.prototype.overlayimg=function(newscrsrc,target,sobj,cobj){
	setTimeout(function(){sobj.growcell(newscrsrc,target,sobj,cobj)},0);
}

/* ---------------------------------------------
* Fading Rotator
*
*/
saorotator.prototype.setCooridnates=function(newscrsrc,target,sobj,cobj){
	var anicelluar	=	document.getElementById(cobj.id)
	anicelluarPos		=	sobj.getPosition(anicelluar)
	sobj.windoScalToL	=	anicelluarPos.x
	sobj.windoScalToT	=	anicelluarPos.y
	
	var inicelluar		=	document.getElementById(target.id)
	inicelluarPos		=	sobj.getPosition(inicelluar)
	sobj.setInitLeft 	= 	inicelluarPos.x
	sobj.setInitTop 	= 	inicelluarPos.y
}

/* ---------------------------------------------
* Fading Rotator
*
*/
saorotator.prototype.getPosition = function(obj) {
		var left = 0;
		var top  = 0;
		
		while (obj.offsetParent){
			left += parseInt(obj.offsetLeft);
			top  += parseInt(obj.offsetTop);
			obj = obj.offsetParent;
		}
		left += parseInt(obj.offsetLeft);
		top  += parseInt(obj.offsetTop);
		return {x:left, y:top};
}

/* ---------------------------------------------
* Fading Rotator
*
*/
saorotator.prototype.growcell=function(newscrsrc,target,sobj,cobj){

	var anicelluar	=	document.getElementById(cobj.id)
	
	windoScalToW	=	((anicelluar.style.width) 	? 	parseInt(anicelluar.style.width) 	:	parseInt(anicelluar.offsetWidth));
	windoScalToH	= 	((anicelluar.style.height) 	? 	parseInt(anicelluar.style.height) 	: 	parseInt(anicelluar.offsetHeight));
	windoScalToL	=	sobj.windoScalToL
	windoScalToT	=	sobj.windoScalToT
	
	
				
	if((document.getElementById(target.id + '_bigx') !=null) && (document.getElementById(target.id + '_bigxi') != null)) {
		var celluar		=	document.getElementById(target.id + '_bigx')
		var acelluar	=	document.getElementById(target.id + '_bigxi')
		var aspacer		=	document.getElementById('bigxi')
		
	} else {
		
		var inicelluar		=	document.getElementById(target.id)
	
		setInitWidth 		= 	((inicelluar.style.width) 	? 	parseInt(inicelluar.style.width) 	:	parseInt(inicelluar.offsetWidth));
		setInitHeight 		= 	((inicelluar.style.height) 	? 	parseInt(inicelluar.style.height) 	: 	parseInt(inicelluar.offsetHeight));
		setInitLeft 		= 	sobj.setInitLeft 
		setInitTop 			= 	sobj.setInitTop
		

		var celluar				=	document.createElement("div");
		celluar.id				=	target.id + '_bigx'
		celluar.className		=	 'whocare_big'
		celluar.style.position 	=	'absolute';
		celluar.style.left 		=	setInitLeft + 'px';
		celluar.style.top 		=	setInitTop + 'px';
		celluar.style.height 	=	setInitHeight + 'px';
		celluar.style.width 	=	setInitWidth + 'px';
		target.style.zIndex		=	parseInt(cobj.style.zIndex) + 2
		celluar.style.zIndex 	=	parseInt(cobj.style.zIndex) + 1

		celluar.name 			=	setInitLeft
		celluar.title 			=	setInitTop

		var acelluar			=	document.createElement("img");
		acelluar.src			=	newscrsrc;
		acelluar.id				=	target.id + '_bigxi'
		acelluar.height			=	setInitHeight
		acelluar.width			=	setInitWidth
		celluar.appendChild(acelluar);

		document.body.appendChild(celluar)
		
		var aspacer		=	document.createElement("div");
		aspacer.id		=	'bigxi'
		document.body.appendChild(aspacer)
		
	}


	setInitWidth 		= 	((celluar.style.width) 	? 	parseInt(celluar.style.width) 	:	parseInt(celluar.offsetWidth));
	setInitLeft 		= 	((celluar.style.left) 	? 	parseInt(celluar.style.left) 	:	parseInt(celluar.offsetLeft));
	setInitHeight 		= 	((celluar.style.height) ? 	parseInt(celluar.style.height) 	: 	parseInt(celluar.offsetHeight));
	setInitTop 			= 	((celluar.style.top) 	? 	parseInt(celluar.style.top) 	: 	parseInt(celluar.offsetTop));

	/* ================================================================ */
	/* GROW																*/
	/* ================================================================ */
	if((sobj.clase == false) && (parseInt(setInitWidth) < windoScalToW)) {


		xfactor				= 	(windoScalToW  - setInitWidth)
		yfactor				= 	(windoScalToH  - setInitHeight)
		lfactor				= 	(windoScalToL  - setInitLeft)
		tfactor				= 	(windoScalToT  - setInitTop)
		scalefactor			=	yfactor/xfactor

		if(xfactor < yfactor) {
			nscalefactor 	=	lfactor/yfactor
			tscalefactor 	=	tfactor/yfactor

		} else {
			nscalefactor 	=	lfactor/xfactor
			tscalefactor 	=	tfactor/xfactor
		}

		/* -------------------------------------------- */
		/* HORIZONTAL AXIS 								*/
		/* -------------------------------------------- */
		if( parseInt(setInitWidth) < (windoScalToW) ) {
			
			if( (parseInt(setInitWidth)  + sobj.timefactor) >  windoScalToW)  {
				celluar.style.width = parseInt(windoScalToW) + 'px';
				acelluar.width 		= parseInt(windoScalToW);
				
			} else {
				celluar.style.width = parseInt(setInitWidth)  + sobj.timefactor + 'px';
				acelluar.width 		= parseInt(setInitWidth)  + sobj.timefactor;
			}
		}

		if( (setInitLeft + (sobj.timefactor*nscalefactor)) < windoScalToL) {
			celluar.style.left = windoScalToL + 'px';
		} else {
			celluar.style.left = (setInitLeft + (sobj.timefactor*nscalefactor)) + 'px';
		}
		
		/* -------------------------------------------- */
		/* VERTICAL AXIS 								*/
		/* -------------------------------------------- */
		if( parseInt(setInitHeight) < windoScalToH) {
			
			if( (parseInt(setInitHeight) + (sobj.timefactor * scalefactor)) >  windoScalToH)  {
				celluar.style.height = windoScalToH + 'px';
				acelluar.height 	 = windoScalToH;
			
			} else {	
				celluar.style.height = parseInt(setInitHeight) + (sobj.timefactor * scalefactor) + 'px';
				acelluar.height = parseInt(setInitHeight) + (sobj.timefactor * scalefactor);
			}
		}

		if( (setInitTop + (sobj.timefactor*tscalefactor)) <  windoScalToT) {
			celluar.style.top = windoScalToT + 'px';
		} else {
			celluar.style.top = (setInitTop + (sobj.timefactor*tscalefactor)) + 'px';
		}

		/* -------------------------------------------- */
		/* CONTINUE LOOP ?								*/
		/* -------------------------------------------- */
		if(parseInt(celluar.style.width) < (windoScalToW) ) {
			sobj.overlayimg(newscrsrc,target,sobj,cobj);
			
		} else {
			cobj.childNodes[0].src	= newscrsrc	
			sobj.windoScalToL		=	null
			sobj.windoScalToT		=	null
			sobj.setInitTop			=	null
			sobj.setInitleft		=	null
			
			if(cobj.childNodes[0].src	== newscrsrc) {
				setTimeout(function(){sobj.removecell(celluar,aspacer,newscrsrc,cobj)}, 500)
			}
		}

	} 
}


/* ---------------------------------------------
* Fading Rotator
*
*/
saorotator.prototype.removecell=function(celluar,aspacer,newscrsrc,cobj){
	if(cobj.childNodes[0].src	== newscrsrc) {
		document.body.removeChild(celluar)
		document.body.removeChild(aspacer)
	}
}

/* ---------------------------------------------
* Fading Rotator
*
*/
saorotator.prototype.resetit=function(){
	this.degree				=	10
	var crossobj			= 	iebrowser? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
	var cacheobj			=	this
	document.onmousedown	=	function(ee) {
									ee       = ee || window.event;
									target 	 = ee.target || ee.srcElement;
									
									if(target.id.indexOf('rotator_thumb_') != -1) {
										cacheobj.mouseovercheck=1
										newscrsrc	=	target.src.replace(/_moff/, "")
										cacheobj.setCooridnates(newscrsrc,target,cacheobj,crossobj)
										cacheobj.overlayimg(newscrsrc,target,cacheobj,crossobj)
									}
								}
											
	if (crossobj.filters&&crossobj.filters[0]) {
		if (typeof crossobj.filters[0].opacity=="number") {
			crossobj.filters(0).opacity=this.degree
		} else {
			crossobj.style.filter="alpha(opacity="+this.degree+")"
		}
	
	} else if (crossobj.style.MozOpacity) {
		crossobj.style.MozOpacity=this.degree/101
		
	} else if (crossobj.style.KhtmlOpacity) {
		crossobj.style.KhtmlOpacity=this.degree/100
		
	} else if (crossobj.style.opacity&&!crossobj.filters) {
		crossobj.style.opacity=this.degree/101
	}
}

/* ---------------------------------------------
* Fading Rotator
*
*/
saorotator.prototype.startit=function(){
	var crossobj						=	iebrowser	? iebrowser[this.curcanvas] : document.getElementById(this.curcanvas)
	parentcontainer 					=	crossobj.parentNode.parentNode
	
	this.populateslide(crossobj, this.curimageindex)
	
	if (this.pausecheck==1) { 
		var cacheobj					=	this
		var crossobjcontainer			=	iebrowser	? iebrowser["master"+this.slideshowid] : document.getElementById("master"+this.slideshowid)

		parentcontainer.onmouseover		=	function(){cacheobj.mouseovercheck=1}
		parentcontainer.onmouseout		=	function(){
												if(document.getElementById('bigxi') != null) {
													cacheobj.mouseovercheck=1
												} else {
													cacheobj.mouseovercheck=0
												}
											}
											
		document.onmousedown			=	function(ee){
												ee       = ee || window.event;
												target 	 = ee.target || ee.srcElement;
												
												if(target.id.indexOf('rotator_thumb_') != -1) {
													cacheobj.mouseovercheck=1
													newscrsrc	=	target.src.replace(/_moff/, "")
													cacheobj.setCooridnates(newscrsrc,target,cacheobj,crossobj)
													cacheobj.overlayimg(newscrsrc,target,cacheobj,crossobj)
												}
											}
	} 
	
	this.rotateimage()	
}
