// Popup Function
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height){
	if(popUpWin){
		if(!popUpWin.closed) popUpWin.close();
	}
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


function popUpWindow2(URLStr, left, top, width, height){
	if(popUpWin){
		if(!popUpWin.closed) popUpWin.close();
	}
	popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}



// Background Flicker Function
(function(){

	/*Use Object Detection to detect IE6*/
	var  m = document.uniqueID /*IE*/
	&& document.compatMode  /*>=IE6*/
	&& !window.XMLHttpRequest /*<=IE6*/
	&& document.execCommand ;
	
	try{
		if(!!m){
			m("BackgroundImageCache", false, true) /* = IE6 only */ 
		}
		
	}catch(oh){};
})();

// Marquee Function
var Scroller = function(frameId,contentId,direction,tempo,w,h)
{
	// default parameters
	var thisObj 		= this;
	this.nXlocation 	= 0;
	this.nYlocation 	= 0;
	this.nFrameHeight 	= h;
	this.nFrameWidth	= w;
	this.nTempo			= tempo;
	this.strDirection	= direction;
	this.scrollerStat	= true;
	this.objFrame		= document.getElementById(contentId);
	this.ScrollCycle;
	
	// frame parameter
	frm = document.getElementById(frameId);
	frm.style.height 	= h+'px';
	frm.style.width 	= w+'px';

	this.MoveScroller = function()
	{
		switch(this.strDirection)
		{
			case 'u':	// moving up
				this.nXlocation--;
				this.objFrame.style.top=this.nXlocation+"px";
				break;
			case 'd':	// moving sown
				this.nXlocation++;
				this.objFrame.style.top=this.nXlocation+"px";
				break;
			case 'r':	// moving right
				this.nYlocation++;
				this.objFrame.style.left=this.nYlocation+"px";
				break;
			case 'l':	// moving left
				this.nYlocation--;
				this.objFrame.style.left=this.nYlocation+"px";
				break;
		}
	}

	this.CheckScroller = function()
	{
		switch(this.strDirection)
		{
			case 'u':
				if ((0-this.nXlocation) > this.objFrame.offsetHeight)
				this.nXlocation = this.nFrameHeight;
				break;
			case 'd':
				if (this.nXlocation > this.nFrameHeight)
				this.nXlocation = -this.objFrame.offsetHeight;
				break;
			case 'r':
				if (this.nYlocation > this.nFrameWidth)
				this.nYlocation = -this.objFrame.offsetWidth;
				break;
			case 'l':
				if ((0-this.nYlocation) > this.objFrame.offsetWidth)
				this.nYlocation = this.nFrameWidth;
				break;
		}	
	}
	
	this.RunScroll = function()
	{
		if (this.scrollerStat)
		{
			this.MoveScroller();
			this.CheckScroller();
		}
	}
	
	this.StartScroll = function()
	{
		this.ScrollCycle=setInterval(function() { thisObj.RunScroll(); },thisObj.nTempo);
	}
	this.StopScroll = function()
	{
	  clearInterval(this.ScrollCycle);
	}	
}