/*
====================================================

  http://www.GlobalWebCart.com - Version 2

  Copyright 2009 Internet Specialty Services, LLC.

  ANY UN-AUTHORIZED USE OR DISTRIBUTION OF THIS
  FILE OR IT'S CONTENTS IS STRICTLY PROHIBITED

====================================================
*/

/*
	v1.09@2011-10-01 15:45
	log:
	v1.09@2011-10-01 15:45
	1. fix a bug, for style 2, just show first div.
	v1.07@2011-06-26 23:25
	1. try to fix the bug for can't link to the right url
	v1.06@2011-05-17:
	1. fixed the bug about zIndex attribute(recover other elements)
	v1.05: fixed a bug: when click next or prev, show white page.
*/

var Rotator = function (sMainDivID){
	var _this = this;

	this.Name = sMainDivID;

// PUT HTML FOR LOADING HERE -----------------
// NEED IT CENTERED IN THE DIV

//s_$(sMainDivID).innerHTML='Loading...<br><img src="'+iUrl+'sys/loading2.gif">';
//debugger
var iOffsetWidth = this.GetValue(s_$(sMainDivID).style.width), iOffsetHeight = this.GetValue(s_$(sMainDivID).style.height);
if (iOffsetWidth <= 0){
	iOffsetWidth = 600;
}
if (iOffsetHeight <= 0){
	iOffsetHeight = 250;
}

s_$(sMainDivID).innerHTML='<div class="box" style="width:'+iOffsetWidth+'px;height:'+iOffsetHeight+'px; vertical-align:middle;display: table-cell;text-align:center;*display: block;*font-size: '+iOffsetHeight*(0.873)+'px;*font-family:Arial;"><img style="vertical-align:middle;" src="'+(typeof(iUrl) == "undefined" ? "" : iUrl)+'sys/loading2.gif"/></div>';



	this.bRuning = true;
	this.bFinishShow = true;
	
	this.oShowInfo = s_$(sMainDivID);
	this.sRelString = this.oShowInfo.attributes.getNamedItem("rel").value;
	
	this.iCurrentIndex = -1;
	this.ShowInfoPosition = getPosition(this.oShowInfo);
	
	this.flip = 3000;
	this.itemFlip = 1000;
	this.flip = parseInt(s_GetValueFromRel(this.sRelString, "flip"));
	this.itemFlip = parseInt(s_GetValueFromRel(this.sRelString, "itemFlip"));
	
	this.oDoc = s_$(s_GetValueFromRel(this.sRelString, "InfoID"));
	
	this.switchStyle = 1;
	if (parseInt(s_GetValueFromRel(this.sRelString, "style")) >= 1 
		&& parseInt(s_GetValueFromRel(this.sRelString, "style")) <= 3){
		this.switchStyle = parseInt(s_GetValueFromRel(this.sRelString, "style"));
	}
	
	this.iLength = 0;
	this.aAllinfo = new Array();
	this.InitInfoArray();
	this.SupportActiveX = window.ActiveXObject ? true : false;
	
	// init all Buttons
	if (this.switchStyle >= 1 && this.switchStyle <= 2){
		if (s_$(s_GetValueFromRel(this.sRelString, "PrevID"))){
			s_$(s_GetValueFromRel(this.sRelString, "PrevID")).style.cursor='pointer';
			s_$(s_GetValueFromRel(this.sRelString, "PrevID")).onclick = function(){_this.Prev();}
			}
		
		if (s_$(s_GetValueFromRel(this.sRelString, "NextID"))){
			s_$(s_GetValueFromRel(this.sRelString, "NextID")).style.cursor='pointer';
			s_$(s_GetValueFromRel(this.sRelString, "NextID")).onclick = function(){_this.Next();}
			}

		if (s_$(s_GetValueFromRel(this.sRelString, "StopID"))){
			s_$(s_GetValueFromRel(this.sRelString, "StopID")).style.cursor='pointer';
			s_$(s_GetValueFromRel(this.sRelString, "StopID")).onclick = function(){_this.Stop();}
			}

		if (s_$(s_GetValueFromRel(this.sRelString, "ContID"))){
			s_$(s_GetValueFromRel(this.sRelString, "ContID")).style.cursor='pointer';
			s_$(s_GetValueFromRel(this.sRelString, "ContID")).onclick = function(){_this.Continue();}
			}

		this.SetContAndStop();
		this.oShowInfoInterval = null;
		this.oItemInterval = null;
		
		this.transitionUnitTime = 50;
		if (this.itemFlip <= 100){
			this.transitionUnitTime = 10;
		}
	}
	
	if (this.switchStyle >= 2 && this.switchStyle <= 3){
		this.moveDirection = s_GetValueFromRel(this.sRelString, "direction");
		if (this.moveDirection.length <= 0){
			this.moveDirection = "t";
		}
	}
	
	_this = this;
	if (this.switchStyle == 3){
		// style 3#
		this.iLastPosition = 0;
		this.movePerTime = 1;
		this.moveIntervalTime = 1;
		this.bFirstSet = true;
		
		if (s_GetValueFromRel(this.sRelString, "movePerTime").length > 0){
			this.movePerTime = parseInt(s_GetValueFromRel(this.sRelString, "movePerTime"));
		}
		if (s_GetValueFromRel(this.sRelString, "moveIntervalTime").length > 0){
			this.moveIntervalTime = parseInt(s_GetValueFromRel(this.sRelString, "moveIntervalTime"));
		}
		
		callback = function(){ _this.startStyle3(); };
		if (window.addEventListener){
			window.addEventListener('load', callback, false);
			}
		else if (window.attachEvent) {
			window.attachEvent('onload', callback);
		}
		
		//this.startStyle3();
	}else{
		this.sMop = s_GetValueFromRel(this.sRelString, "mop");
		this.ClearInfo();
		if (this.switchStyle == 1){
			
			this.oItemIntervalFadeOut = null;
			this.itemOpacity = 0;
			this.oldItemOpacity = 0;
			this.MiniOpacity = 0;
			this.itemOpacityAdd = Math.ceil(( (100 - this.MiniOpacity) * 1.0) / (this.itemFlip / this.transitionUnitTime));
			
			for (var i = 0;i < this.aAllinfo.length;i++){
				this.oShowInfo.appendChild(this.aAllinfo[i]);
				this.SetObjectOpacity(this.aAllinfo[i], 0);
				this.aAllinfo[i].style.position = "absolute";
				this.aAllinfo[i].style.top = "0px";
				this.aAllinfo[i].style.left = "0px";
			}
		}else if (this.switchStyle == 2){
			this.firstShowEle = true;
			this.itemRestTime = 0;
			this.iNeedRemoveIndex = -1;
		}
		if (this.sMop == "1"){
			this.oShowInfo.onmouseover = function(){
				_this.Stop();
			}
			this.oShowInfo.onmouseout = function(){
				_this.Continue();
			}
		}
		this.ShowInfo(1, false);
	}
}

Rotator.prototype.GetValue = function(sWidth){
	var i = 0;
	sWidth = sWidth.replace("px", "");
	if (sWidth.length > 0){
		i = parseInt(sWidth);
	}
	return i;
}

Rotator.prototype.ClearInfo = function(){
	this.oShowInfo.innerHTML = "";
}

// remove the child node from oShowInfo when it isn't needed
Rotator.prototype.RemoveNeedMoveChild = function(){
	if (this.iNeedRemoveIndex != -1){
		this.oShowInfo.removeChild(this.aAllinfo[this.iNeedRemoveIndex]);
		this.iNeedRemoveIndex = -1;
	}
}

Rotator.prototype.ShowInfo = function(iAddValue, bTran){
	this.bFinishShow = false;
	this.SetCurrentInfoIndex(iAddValue)
	
	var _this = this;
	
	if (this.oShowInfo){
		if (!bTran){
			if (this.oShowInfoInterval != null){
				this.oShowInfoInterval = window.clearTimeout(this.oShowInfoInterval);
				this.oShowInfoInterval = null;
			}
			if (this.oItemInterval != null){
				window.clearInterval(this.oItemInterval);
				this.oItemInterval = null;
			}
			if (this.switchStyle == 1 && this.oItemIntervalFadeOut != null){
				window.clearInterval(this.oItemIntervalFadeOut);
				this.oItemIntervalFadeOut = null;
			}
		}
		
		if (this.aAllinfo[this.iCurrentIndex].chdZIndex && this.aAllinfo[this.iCurrentIndex].chdZIndex == true){
			this.aAllinfo[this.iCurrentIndex].style.zIndex = parseInt(this.aAllinfo[this.iCurrentIndex].style.zIndex) + 1;
			this.aAllinfo[this.iCurrentIndex].style.display = "block";
		}
		if (this.switchStyle == 1){
			if (bTran){
				this.itemOpacity = this.MiniOpacity;
				this.SetObjectOpacity(this.aAllinfo[this.iCurrentIndex], this.itemOpacity);
				if (this.bRuning){
					callback = function(){ _this.ItemOpacity(); };
					this.oItemInterval = window.setInterval(callback, this.transitionUnitTime);
				}
			}else{
				if (this.oItemIntervalFadeOut != null){
					window.clearInterval(this.oItemIntervalFadeOut);
					this.oItemIntervalFadeOut = null;
				}
			
				this.itemOpacity = 100;
				this.SetObjectOpacity(this.aAllinfo[this.iCurrentIndex], this.itemOpacity);
				this.aAllinfo[this.iCurrentIndex].style.display = "block";
				//this.aAllinfo[this.iCurrentIndex].style.zIndex += 10;
				if (this.iNeedRemoveIndex != -1){
					this.SetObjectOpacity(this.aAllinfo[this.iNeedRemoveIndex], 0);
				}
				if (this.bRuning){
					callback = function(){ _this.ItemShow(); };
					this.oShowInfoInterval = window.setTimeout(callback, this.flip);
				}
			}
		}else{
			if (this.FirstShowEle){
				this.ClearInfo();
				
				this.FirstShowEle = false;
			}
			this.oShowInfo.appendChild(this.aAllinfo[this.iCurrentIndex]);
			this.aAllinfo[this.iCurrentIndex].style.position = "absolute";
			this.aAllinfo[this.iCurrentIndex].style.display = "block";
			switch(this.moveDirection)
			{
				case "t":
					// top
					this.aAllinfo[this.iCurrentIndex].style.left = 0 + "px";
					this.aAllinfo[this.iCurrentIndex].style.top = (this.ShowInfoPosition.top 
						+ this.ShowInfoPosition.height) + "px";
					break
				case "b":
					// bottom
					this.aAllinfo[this.iCurrentIndex].style.left = 0 + "px";
					this.aAllinfo[this.iCurrentIndex].style.top = (this.ShowInfoPosition.top 
						- this.ShowInfoPosition.height) + "px";
					break
				case "l":
					// left
					this.aAllinfo[this.iCurrentIndex].style.left = (this.ShowInfoPosition.left 
						+ this.ShowInfoPosition.width) + "px";
					this.aAllinfo[this.iCurrentIndex].style.top = 0 + "px";
					break
				case "r":
					// right
					this.aAllinfo[this.iCurrentIndex].style.left = (this.ShowInfoPosition.left 
						- this.ShowInfoPosition.width) + "px";
					this.aAllinfo[this.iCurrentIndex].style.top = 0 + "px";
					break
			}
			
			if (!bTran){
				this.RemoveNeedMoveChild();
				
				this.aAllinfo[this.iCurrentIndex].style.left = "0px";
				this.aAllinfo[this.iCurrentIndex].style.top = "0px";
				if (this.bRuning){
					callback = function(){ _this.ShowInfo(1, true); };
					this.oShowInfoInterval = window.setTimeout(callback, this.flip);
				}
			}else{
				this.itemRestTime = this.itemFlip;
				if (this.bRuning){
					callback = function(){ _this.MoveOjbect(); };
					this.oItemInterval = window.setInterval(callback, this.transitionUnitTime);
				}
			}
		}
	}
	callback = null;
	this.bFinishShow = true;
}


/* move object */
Rotator.prototype.MoveOjbect = function(){
	this.itemRestTime -= this.transitionUnitTime;
	if (this.itemRestTime <= 0){
		var _this = this;
    	var callback;
		switch(this.moveDirection)
		{
			case "t":
				// top
				this.MoveVertical(true, true);
				break
			case "b":
				// bottom
				this.MoveVertical(false, true);
				break
			case "l":
				// left
				this.MoveHorizontal(true, true);
				break
			case "r":
				// right
				this.MoveHorizontal(false, true);
				break
		}
		
		window.clearInterval(this.oItemInterval);
		this.oItemInterval = null;
		
		callback = function(){ _this.ShowInfo(1, true); };
		this.oShowInfoInterval = window.setTimeout(callback, this.flip);
		
		this.RemoveNeedMoveChild();
	}else{
		switch(this.moveDirection)
		{
			case "t":
				// top
				this.MoveVertical(true);
				break
			case "b":
				// bottom
				this.MoveVertical(false);
				break
			case "l":
				// left
				this.MoveHorizontal(true);
				break
			case "r":
				// right
				this.MoveHorizontal(false);
				break
		}
	}
}


Rotator.prototype.MoveHorizontal = function(bIsLeft, bFinish){
	if (bFinish){
		this.aAllinfo[this.iCurrentIndex].style.left = "0px";
	}else{
		var movePerTime = this.ShowInfoPosition.width / (this.itemFlip / this.transitionUnitTime);
		var sLeft1 = this.aAllinfo[this.iCurrentIndex].style.left;
		if (sLeft1.length > 0){
			var left1 = s_GetIntValueByPx(sLeft1);
			var newLeft1 = left1 - movePerTime * (bIsLeft ? 1 : -1);
			if ((bIsLeft && newLeft1 <= 0) || (!bIsLeft && newLeft1 >= 0)){
				newLeft1 = 0;
			}
			this.aAllinfo[this.iCurrentIndex].style.left = newLeft1 + "px";
		}
		if (this.iNeedRemoveIndex != -1){
			var sLeft2 = this.aAllinfo[this.iNeedRemoveIndex].style.left;
			if (sLeft2.length > 0){
				var left2 = s_GetIntValueByPx(sLeft2);
				this.aAllinfo[this.iNeedRemoveIndex].style.left = (left2 - 
					movePerTime * (bIsLeft ? 1 : -1)) + "px";
			}
		}
	}
}
Rotator.prototype.MoveVertical = function(bIsTop, bFinish){
	if (bFinish){
		this.aAllinfo[this.iCurrentIndex].style.top = "0px";
	}else{
		var movePerTime = this.ShowInfoPosition.height / (this.itemFlip / this.transitionUnitTime);
		var sTop1 = this.aAllinfo[this.iCurrentIndex].style.top;
		if (sTop1.length > 0){
			var top1 = s_GetIntValueByPx(sTop1);
			var newTop1 = top1 - movePerTime * (bIsTop ? 1 : -1);
			if ((bIsTop && newTop1 <= 0) || (!bIsTop && newTop1 >= 0)){
				newTop1 = 0;
			}
			this.aAllinfo[this.iCurrentIndex].style.top = newTop1 + "px";
		}
		if (this.iNeedRemoveIndex != -1){
			var sTop2 = this.aAllinfo[this.iNeedRemoveIndex].style.top;
			if (sTop2.length > 0){
				var top2 = s_GetIntValueByPx(sTop2);
				this.aAllinfo[this.iNeedRemoveIndex].style.top = (top2 
					- movePerTime * (bIsTop ? 1 : -1)) + "px";
			}
		}
	}
}

// set the opacity for an Object
Rotator.prototype.SetObjectOpacity = function(oObject, iOpacity){
	if (!oObject){
		return false;
	}
	if (this.SupportActiveX){
		oObject.style.filter = "alpha(opacity=" + iOpacity + ")";
	}else{
		oObject.style.opacity = iOpacity / 100;
	}
	oObject = null;
}

Rotator.prototype.ItemOpacity = function(){
	if (this.itemOpacity >= 100){
		//this.aAllinfo[this.iCurrentIndex].style.zIndex += 10;
		window.clearInterval(this.oItemInterval);
		this.oItemInterval = null;
		
		var _this = this;
		callback = function(){ _this.ItemShow(); };
		this.oShowInfoInterval = window.setTimeout(callback, this.flip);
		callback = null;
	}else{
		this.itemOpacity += this.itemOpacityAdd;
		this.aAllinfo[this.iCurrentIndex].style.display = "block";
		this.SetObjectOpacity(this.aAllinfo[this.iCurrentIndex], this.itemOpacity);
	}
}
Rotator.prototype.ItemShow = function(){
	// start to fade out
	this.oldItemOpacity = 100;
	var _this = this;
	callback = function(){ _this.ItemOpacityFadeOut(); };
	this.oItemIntervalFadeOut = window.setInterval(callback, this.transitionUnitTime);
	callback = null;
	this.ShowInfo(1, true);
}

Rotator.prototype.ItemOpacityFadeOut = function(){
	if (this.oldItemOpacity <= this.MiniOpacity){
		this.aAllinfo[this.iNeedRemoveIndex].style.zIndex -= 1;
		this.aAllinfo[this.iNeedRemoveIndex].style.display = "none";
		//alert(this.iNeedRemoveIndex + ' move 10,' + this.aAllinfo[this.iNeedRemoveIndex].style.zIndex);
		this.aAllinfo[this.iNeedRemoveIndex].chdZIndex = true;
		
		this.aAllinfo[this.iNeedRemoveIndex].style.display = "none";
		window.clearInterval(this.oItemIntervalFadeOut);
		this.oItemIntervalFadeOut = null;
	}else{
		this.oldItemOpacity -= this.itemOpacityAdd;
		this.SetObjectOpacity(this.aAllinfo[this.iNeedRemoveIndex], this.oldItemOpacity);
	}
}


Rotator.prototype.InitInfoArray = function(){
	var iChildLength = 0;
	//debugger
	for (var i = 0;i < this.oDoc.childNodes.length;i++){
		if (this.oDoc.childNodes[i].nodeName != "#text"){
			this.aAllinfo[iChildLength] = this.oDoc.childNodes[i];
			if (this.switchStyle != 3 && iChildLength != 0){
				this.aAllinfo[iChildLength].style.display = "none";
			}
			iChildLength ++;
		}
	}
	this.iLength = iChildLength;
	//alert(this.iLength);
}

Rotator.prototype.SetContAndStop = function(){
	if (s_$(s_GetValueFromRel(this.sRelString, "StopID"))){
		s_$(s_GetValueFromRel(this.sRelString, "StopID")).style.display = 
			(this.bRuning == true ? "" : "none");
	}
	if (s_$(s_GetValueFromRel(this.sRelString, "ContID"))){
		s_$(s_GetValueFromRel(this.sRelString, "ContID")).style.display = 
			(this.bRuning == false ? "" : "none");
	}
}

Rotator.prototype.Stop = function(){
	if (this.bFinishShow){
		this.bRuning = false;
		this.ShowInfo(0, false);
		
		this.SetContAndStop();
	}
}
Rotator.prototype.Continue = function(){
	if (this.bFinishShow){
		this.bRuning = true;
		var _this = this;
		if (this.switchStyle == 1){
			//this.ItemShow();
			
			callback = function(){ _this.ItemShow(); };
			this.oShowInfoInterval = window.setTimeout(callback, this.flip);
			callback = null;
		}else{
			//this.ShowInfo(1, true);
			this.itemRestTime = this.itemFlip;
			if (this.bRuning){
				callback = function(){ _this.MoveOjbect(); };
				this.oItemInterval = window.setInterval(callback, this.transitionUnitTime);
			}
		}
		
		this.SetContAndStop();
	}
}
Rotator.prototype.Prev = function(){
	if (this.bFinishShow){
		if (this.switchStyle == 1){
			if (this.iNeedRemoveIndex != -1){
				this.SetObjectOpacity(this.aAllinfo[this.iNeedRemoveIndex], 0);
			}
			this.ShowInfo(-1, false);
		}else if (this.switchStyle == 2){
			if (this.oItemInterval){
				this.ShowInfo(-1, false);
			}else{
				this.ShowInfo(-1, false);
			}
		}
	}
}
Rotator.prototype.Next = function(){
	if (this.bFinishShow){//debugger
		if (this.switchStyle == 1){
			if (this.iNeedRemoveIndex != -1){
				this.SetObjectOpacity(this.aAllinfo[this.iNeedRemoveIndex], 0);
			}
			this.ShowInfo(1, false);
		}else if (this.switchStyle == 2){
			if (this.oItemInterval){
				this.ShowInfo(0, false);
			}else{
				this.ShowInfo(1, false);
			}
		}
	}
}

Rotator.prototype.SetCurrentInfoIndex = function(addValue){
	if (addValue != 0){
		this.iNeedRemoveIndex = this.iCurrentIndex;
		this.iCurrentIndex += addValue;
		if (this.iCurrentIndex >= this.iLength){
			this.iCurrentIndex -= this.iLength;
		}else if(this.iCurrentIndex < 0){
			this.iCurrentIndex += this.iLength;
		}
		//alert("this.iCurrentIndex:" + this.iCurrentIndex);
	}
}


/************** style 3# **************/
Rotator.prototype.startStyle3 = function(){
	// style 3#
	var _this = this;
    var callback;
	
	if (this.oShowInfo){
		this.oShowInfo.onmouseover = function(){
			_this.PauseStyle3();
		}
		this.oShowInfo.onmouseout = function(){
			_this.ContinueStyle3();
		}
		//debugger

		var iCurrentPosition = 0;//debugger
		this.ClearInfo();
		for (var i = 0;i < this.iLength;i++){
			//this.aAllinfo[i].style.display = "block";
			this.oShowInfo.appendChild(this.aAllinfo[i]);
			this.aAllinfo[i].style.position = "absolute";
			switch(this.moveDirection)
			{
				case "t":
					// top
					this.aAllinfo[i].style.top = iCurrentPosition + "px";
					iCurrentPosition += getPosition(this.aAllinfo[i]).height;
					break
				case "b":
					// bottom
					this.aAllinfo[i].style.bottom = iCurrentPosition + "px";
					iCurrentPosition += getPosition(this.aAllinfo[i]).height;
					break
				case "l":
					// left
					this.aAllinfo[i].style.left = iCurrentPosition + "px";
					iCurrentPosition += getPosition(this.aAllinfo[i]).width;
					break
				case "r":
					// right
					this.aAllinfo[i].style.left = iCurrentPosition + "px";
					iCurrentPosition -= getPosition(this.aAllinfo[i]).width;
					break
			}
		}
		this.iLastPosition = iCurrentPosition;
		
		// start to 
		this.ContinueStyle3();
	}
}

Rotator.prototype.RunStyle3 = function(){
	if (this.moveDirection == "t" || this.moveDirection == "l" || this.moveDirection == "b"){
		this.iLastPosition -= this.movePerTime;
	}else if (this.moveDirection == "r"){
		this.iLastPosition += this.movePerTime;
	}
	for (var i = 0;i < this.iLength;i++){
		switch(this.moveDirection)
		{
			case "t":
				// top
				var iNewPosition = s_GetIntValueByPx(this.aAllinfo[i].style.top) - this.movePerTime;
				this.aAllinfo[i].style.top = iNewPosition + "px";
				if (iNewPosition + getPosition(this.aAllinfo[i]).height < 0){
					this.aAllinfo[i].style.top = this.iLastPosition + "px";
					this.iLastPosition += getPosition(this.aAllinfo[i]).height;
				}
				break
			case "b":
				// bottom
				var iNewPosition = s_GetIntValueByPx(this.aAllinfo[i].style.bottom) - this.movePerTime;
				this.aAllinfo[i].style.bottom = iNewPosition + "px";
				if (iNewPosition + getPosition(this.aAllinfo[i]).height < 0){
					this.aAllinfo[i].style.bottom = this.iLastPosition + "px";
					this.iLastPosition += getPosition(this.aAllinfo[i]).height;
				}
				break
			case "l":
				// left
				var iNewPosition = s_GetIntValueByPx(this.aAllinfo[i].style.left) - this.movePerTime;
				this.aAllinfo[i].style.left = iNewPosition + "px";
				if (iNewPosition + getPosition(this.aAllinfo[i]).width < 0){
					this.aAllinfo[i].style.left = this.iLastPosition + "px";
					this.iLastPosition += getPosition(this.aAllinfo[i]).width;
				}
				break
			case "r":
				// right
				var iNewPosition = s_GetIntValueByPx(this.aAllinfo[i].style.left) + this.movePerTime;
				this.aAllinfo[i].style.left = iNewPosition + "px";
				if (iNewPosition - getPosition(this.aAllinfo[i]).width > getPosition(this.oShowInfo).width){
					this.aAllinfo[i].style.left = this.iLastPosition + "px";
					this.iLastPosition -= getPosition(this.aAllinfo[i]).width;
				}
				break
		}
	}
}

Rotator.prototype.ContinueStyle3 = function(){
	var _this = this;
    var callback;
	callback = function(){ _this.RunStyle3(); };
	this.oShowInfoInterval = window.setInterval(callback, this.moveIntervalTime);
}

Rotator.prototype.PauseStyle3 = function(){
	if (this.oShowInfoInterval){
		window.clearInterval(this.oShowInfoInterval);
	}
}

function s_GetValueFromRel(sRelValue, sParameterName){
	var oResult = "";
	var aRel = 	sRelValue.split(";");
	for (var i = 0;i < aRel.length;i++){
		var aItem = aRel[i].split(":");
		if (aItem.length == 2 && aItem[0] == sParameterName){
			oResult = aItem[1];
			break;
		}
	}
	return oResult;
}

function s_GetIntValueByPx(sPxValue){
	return parseInt(sPxValue.replace("px", ""));
}

function s_$(sID){
	return document.getElementById(sID);
}
