function noticeDialogHTML(num, width, height)
{
	window.showModalDialog("notice_view_html.php?idx="+num+"","","resizable:no; scroll:no; status:no; help:no; dialogHeight:"+height+"px; dialogWidth:"+width+"px;");
	//parent.location.href = "exit.htm";
}

function noticeDialogTEXT(num, width, height)
{
	window.showModalDialog("notice_view_text.php?idx="+num+"","","resizable:no; scroll:no; status:no; help:no; dialogHeight:"+height+"px; dialogWidth:"+width+"px;");
	//parent.location.href = "exit.htm";
}

function RollCmd(id, tblid, width, divWidth, divHeight, nSec, wdth_height){
	if(window.RollCmdWheel == null) window.RollCmdWheel = new Array(0);
	RollCmdWheel[id]  = {
		install : function(id, tblid, width, divWidth, divHeight, nSec){
			this.id = id;
			this.tblid = tblid;
			this.width = width;
			this.divWidth = divWidth;
			this.divHeight = divHeight;
			this.div = document.getElementById(this.id);
			this.table = document.getElementById(this.tblid);

			if(this.div == null) return;
			this.wdth_height = (wdth_height == null) ? "width:"+this.divWidth+";height:"+this.divHeight+";" : wdth_height;

			this.div.style.cssText = "float:left;position:relative;"+this.wdth_height+"overflow:hidden;clip:rect(0 auto "+this.width+" 0);left:0;top:0;";
			this.div.parentNode.style.position='relative'
			this.div.parentNode.onmouseover=function(){RollCmdWheel[id].nPause=true;}
			this.div.parentNode.onmouseout= function(){RollCmdWheel[id].nPause=false;}	

			this.index =0;
			this.width = width;
			this.items = new Array(0);
			this.tmID = null;
			this.nPause = false;
			this.nSec = nSec;
			var cols =this.table.tBodies[0].rows[0].cells;
			
			for(var i = 0; i < cols.length; i++){
				this.items[i] = document.createElement("DIV");
				this.items[i].innerHTML=cols[i].innerHTML;
				this.items[i].style.padding="0";
				this.items[i].style.width=cols[i].width ;
				this.items[i].style.position="absolute";
				this.items[i].style.left = 18 + cols[i].width * i;
				this.div.appendChild(this.items[i]);

				cols[i].onmouseover=function(){this.style.backgroundColor="#FDF1F0";}
				cols[i].onmouseout=function(){this.style.backgroundColor="";}
			}
		},
		doClick : function(n){
			if(!n)
			{
				var nSleep = 10;
				this.nPause=false;
				this.tmID = setTimeout("RollCmdWheel['" + this.id + "'].doWheel()", nSleep);
				return;
			}
			
			this.index = this.index+n;
			var nIndex = this.index+1 >=  this.items.length ? 0 :  this.index+1;
			if(this.index< 0 ) this.index	= this.items.length-1;
			if(this.index > this.items.length-1) this.index=0;
			var itmN = this.items[this.index];
	
			clearTimeout(this.tmID); this.tmID = null;
	
			if(parseInt(itmN.style.left) < (this.width/2)*-1){
					itmN.style.left = this.width*(this.items.length-1);
					this.index = this.index+1 >=  this.items.length ? 0 :  this.index+1;
			}
			for(var i = 0; i < this.items.length; i++){
				this.items[i].style.left =  this.width * (  (this.items.length -  this.index + i ) % this.items.length );
			}	
			
		},
		doWheel : function(){
			var itmN = this.items[this.index];
			var nSleep= 20;
			var nIndex= this.index+1 >=  this.items.length ? 0 :  this.index+1;
			clearTimeout(this.tmID); this.tmID = null;


			if(this.nPause != true){
				for(var i = 0; i < this.items.length; i++){
					this.items[i].style.left = parseInt(this.items[i].style.left)-1;
				}
				if(parseInt(itmN.style.left) <= this.width*-1){
					itmN.style.left = this.width*(this.items.length-1);
					this.index = this.index+1 >=  this.items.length ? 0 :  this.index+1;
					//nSleep= this.nSec;
				}
			}else{
				if(parseInt(itmN.style.left) < (this.width/2)*-1){
					itmN.style.left = this.width*(this.items.length-1);
					this.index = this.index+1 >=  this.items.length ? 0 :  this.index+1;
				}

				for(var i = 0; i < this.items.length; i++){
					//this.items[i].style.left =  this.width * (  (this.items.length -  this.index + i ) % this.items.length );
				}
				nSleep = 10;
			}
	
			this.tmID = setTimeout("RollCmdWheel['" + this.id + "'].doWheel()", nSleep);
		}
	}


	RollCmdWheel[id].install(id, tblid, width, divWidth, divHeight, nSec);
	RollCmdWheel[id].tmID = setTimeout("RollCmdWheel['" +id + "'].doWheel()", nSec);
}

var catGoodsNum = 0;
function catGoodsRolling(nDiv)
{
	var nNo = 0;

	for(i=0; i<5; i++) {

		nNo = i + 1;

		var objDiv   = document.getElementById("catGoods" + i);
		var objImage = document.getElementById("catGoodsImg" + nNo);

		if (nDiv == i) {

			var Browser = navigator.appName;
			if (Browser == "Microsoft Internet Explorer") {
				objDiv.filters[0].apply();
				objDiv.style.display = "block";
				objDiv.filters[0].Play();
				objImage.filters.blendTrans.stop();
				objImage.filters.blendTrans.apply();
				objImage.src = "/_comm/main/catGoods_icon_" + nNo + "_on.gif";
				objImage.filters.blendTrans.play();
			} else {
				objDiv.style.display = "block";
				objImage.src = "/_comm/main/catGoods_icon_" + nNo + "_on.gif";
			}		
			
		} else {
			if (Browser == "Microsoft Internet Explorer") {
				objDiv = objDiv.style.display = "none";
				objImage.filters.blendTrans.stop();
				objImage.filters.blendTrans.apply();
				objImage.src = "/_comm/main/catGoods_icon_" + nNo + ".gif";
				objImage.filters.blendTrans.play();
			} else {
				objDiv = objDiv.style.display = "none";
				objImage.src = "/_comm/main/catGoods_icon_" + nNo + ".gif";
			}
		}
	}
	catGoodsNum = nDiv + 1;
	if (catGoodsNum >= 5) catGoodsNum = 0;
}

function StartRolling(nMode)
{
	if (nMode == 0) {	catGoodsRolling(catGoodsNum)	}
	nSpecialTimer = setTimeout('StartRolling(0)', 4000);
}





function CntRollCmd(id, tblid, width, divWidth, divHeight, nSec, wdth_height){
	if(window.CntRollCmdWheel == null) window.CntRollCmdWheel = new Array(0);
	CntRollCmdWheel[id]  = {
		install : function(id, tblid, width, divWidth, divHeight, nSec){
			this.id = id;
			this.tblid = tblid;
			this.divWidth = divWidth;
			this.divHeight = divHeight;
			this.div = document.getElementById(this.id);
			this.table = document.getElementById(this.tblid);

			if(this.div == null) return;
			this.wdth_height = (wdth_height == null) ? "width:"+this.divWidth+";height:"+this.divHeight+";" : wdth_height;

			this.div.style.cssText = "position:relative;"+this.wdth_height+"overflow:hidden;clip:rect(0 auto "+this.width+" 0);left:0;top:0;";
			this.div.parentNode.style.position='relative'
			this.div.parentNode.onmouseover=function(){CntRollCmdWheel[id].nPause=true;}
			this.div.parentNode.onmouseout= function(){CntRollCmdWheel[id].nPause=false;}	

			this.index =0;
			this.width = width;
			this.items = new Array(0);
			this.tmID = null;
			this.nPause = false;
			this.nSec = nSec;
			var cols =this.table.tBodies[0].rows[0].cells;
			
			for(var i = 0; i < cols.length; i++){
				this.items[i] = document.createElement("DIV");
				this.items[i].innerHTML=cols[i].innerHTML;
				this.items[i].style.padding="0";
				this.items[i].style.width=cols[i].width ;
				this.items[i].style.position="absolute";
				this.items[i].style.left = 18 + cols[i].width * i;
				this.div.appendChild(this.items[i]);

				cols[i].onmouseover=function(){this.style.backgroundColor="#FDF1F0";}
				cols[i].onmouseout=function(){this.style.backgroundColor="";}
			}
		},
		doClick : function(n){
			if(!n)
			{
				var nSleep = 10;
				this.nPause=false;
				this.tmID = setTimeout("CntRollCmdWheel['" + this.id + "'].doWheel()", nSleep);
				return;
			}
			
			this.index = this.index+n;
			var nIndex = this.index+1 >=  this.items.length ? 0 :  this.index+1;
			if(this.index< 0 ) this.index	= this.items.length-1;
			if(this.index > this.items.length-1) this.index=0;
			var itmN = this.items[this.index];
	
			clearTimeout(this.tmID); this.tmID = null;
	
			if(parseInt(itmN.style.left) < (this.width/2)*-1){
					itmN.style.left = this.width*(this.items.length-1);
					this.index = this.index+1 >=  this.items.length ? 0 :  this.index+1;
			}
			for(var i = 0; i < this.items.length; i++){
				this.items[i].style.left =  this.width * (  (this.items.length -  this.index + i ) % this.items.length );
			}	
			
		},
		doWheel : function(){
			var itmN = this.items[this.index];
			var nSleep= 20;
			var nIndex= this.index+1 >=  this.items.length ? 0 :  this.index+1;
			clearTimeout(this.tmID); this.tmID = null;


			if(this.nPause != true){
				for(var i = 0; i < this.items.length; i++){
					this.items[i].style.left = parseInt(this.items[i].style.left)-1;
				}
				if(parseInt(itmN.style.left) <= this.width*-1){
					itmN.style.left = this.width*(this.items.length-1);
					this.index = this.index+1 >=  this.items.length ? 0 :  this.index+1;
					//nSleep= this.nSec;
				}
			}else{
				if(parseInt(itmN.style.left) < (this.width/2)*-1){
					itmN.style.left = this.width*(this.items.length-1);
					this.index = this.index+1 >=  this.items.length ? 0 :  this.index+1;
				}

				for(var i = 0; i < this.items.length; i++){
					//this.items[i].style.left =  this.width * (  (this.items.length -  this.index + i ) % this.items.length );
				}
				nSleep = 10;
			}
	
			this.tmID = setTimeout("CntRollCmdWheel['" + this.id + "'].doWheel()", nSleep);
		}
	}


	CntRollCmdWheel[id].install(id, tblid, width, divWidth, divHeight, nSec);
	CntRollCmdWheel[id].tmID = setTimeout("CntRollCmdWheel['" +id + "'].doWheel()", nSec);
}

var CntRollNum = 0;
function CntRolling(nDiv)
{
	var nNo = 0;

	for(i=0; i<9; i++) {

		nNo = i + 1;

		var objDiv   = document.getElementById("CntRoll" + i);
		var objImage = document.getElementById("CntRollImg" + nNo);

		if (nDiv == i) {

			var Browser = navigator.appName;
			if (Browser == "Microsoft Internet Explorer") {
				objDiv.filters[0].apply();
				objDiv.style.display = "block";
				objDiv.filters[0].Play();
				objImage.filters.blendTrans.stop();
				objImage.filters.blendTrans.apply();
				objImage.src = "/_comm/main/CntRoll_icon_" + nNo + "_on.gif";
				objImage.filters.blendTrans.play();
			} else {
				objDiv.style.display = "block";
				objImage.src = "/_comm/main/CntRoll_icon_" + nNo + "_on.gif";
			}		

		} else {
			if (Browser == "Microsoft Internet Explorer") {
				objDiv = objDiv.style.display = "none";
				objImage.filters.blendTrans.stop();
				objImage.filters.blendTrans.apply();
				objImage.src = "/_comm/main/CntRoll_icon_" + nNo + ".gif";
				objImage.filters.blendTrans.play();
			} else {
				objDiv = objDiv.style.display = "none";
				objImage.src = "/_comm/main/CntRoll_icon_" + nNo + ".gif";
			}
		}
	}
	CntRollNum = nDiv + 1;
	if (CntRollNum >= 9) CntRollNum = 0;
}

function StartCntRolling(nMode)
{
	if (nMode == 0) {	CntRolling(CntRollNum)	}
	CntRollTimer = setTimeout('StartCntRolling(0)', 4000);
}