﻿<!--
//判断浏览器类型
	function getOs() 
	{  
		 var OsObject = ""; 
		if(navigator.userAgent.indexOf("MSIE")>0) { 
			 return "MSIE"; 
		} 
		if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){ 
			 return "Firefox"; 
		} 
		if(isSafari=navigator.userAgent.indexOf("Safari")>0) { 
			 return "Safari"; 
		} 
		if(isCamino=navigator.userAgent.indexOf("Camino")>0){ 
			 return "Camino"; 
		} 
		if(isMozilla=navigator.userAgent.indexOf("Gecko/")>0){ 
			 return "Gecko"; 
		} 
	   
	} 

	
	function adRotator() {};
	adRotator.initialize=function(o)
	{
	
	 this._t = new Array();
	 this._l = new Array();
	 this._p = new Array();
	 this._i = new Image();
	 this._c = 0;
	 this._f = false;
	 this._o = o;
	
	 this._timeout = null;
	 this._html = "";
	
	 // configration.
	 // @ image width 宽
	 // @ image height 高
	 // @ rotator speed 速度(秒)
	 // @ filter type 样式(IE支持)
	
	 this._w = 327;
	 this._h = 134;
	 this._s = 5;
	 this._x = 23;
	 return this;
	};
	adRotator.add=function(p,t,l) { with (this)
	{
	 _p.push(p);
	 _t.push(t);
	 _l.push(l);
	}};
	
	adRotator.load=function() { with (adRotator)
	{
	//alert(_i.readyState);
	//alert(_i.complete);
	 if( _i.complete )
	 {
		  if(_p.length-1==_c)
		  {
		   _f = true;
		   _c = 0;
		   window.clearTimeout(_timeout);
		   //getRef("AdRotator").innerHTML="complete";
		   adRotator.play();
		  }
		  else
		  {
		   _c++;
		  // getRef(_o).innerHTML="共有" + _p.length + "图片,加载中```" + _c + ' ' + _i.complete + "...";
		   _timeout=window.setTimeout(adRotator.load,10)
		  }
	 }
	 else
	 {
	 // getRef(_o).innerHTML="共有" + _p.length + "图片,加载中``` " + _c + ' ' + _i.complete + "...";
	  _timeout=window.setTimeout(adRotator.load,10)
	 }
	}};
	adRotator.play=function() 
	{ with (adRotator)
	{	
	 if( _f )
	 {
	 _html = "";
 _html += '<table style="border:0px solid #FFF;"><tr><td style="font-size:7pt;font-family:tahoma;font-weight:bold;">'
 _html += '<div id="rotatorPlayer"'
   + ' style="width:' + _w + ''
   + ';height:"' + _h + '"'
   + '>'
 _html += '<a href="' + ( _l[_c] ? _l[_c] : "javascript:void(0);" ) + '">';
 _html += '<img id="rotatorPic" src="' + _p[_c] + '"'
   + ' width="' + _w + '"'
   + ' height="' + _h + '"'
   + (_t[_c]?' title="' + _t[_c] + '"':'')
   + ' style="border:0px solid blue;FILTER:revealTrans(transition=' + _x + ',duration=1);"'
   + ' >';

 _html += '</a>';
 _html += "</div>";
 //_html += '<div align="right" style="margin-top:-20px;margin-right:8px;">';

// for(var i=0; i<_p.length; i++)
// _html += '<span'
//     + ' style="padding:2px 5px 1px 5px;margin:0px;height:10px;border:0px solid #fff;color:#555555;text-align:center;cursor:'
//     + (_c==i ? ('default;color:#0f41f6;"') : 'hand;" onclick="adRotator.select(' + i + ')"')+ '>'
//     + (i>8?(i+1):('0'+(i+1)))+ '</span> ';</div>

 _html += "</td></tr></table>";
 getRef(_o).innerHTML = _html;
	 
		if(getOs()=="MSIE")
		{
			getRef("rotatorPic").filters[0].Apply();
	 		getRef("rotatorPic").filters[0].Play();
		}

	 adRotator.next();
	 }
	 else
	 {
	  _i.src = _p[_c];
	  adRotator.load();
	 }
	}};
	adRotator.next=function() { with (this)
	{
	 (_p.length-1==_c) ? _c=0 : _c++;
	 _timeout=window.setTimeout(adRotator.play,_s*1000);
	}};
	adRotator.select=function(i) { with (this)
	{
	 window.clearTimeout(_timeout);
	 _c=i;
	 adRotator.play();
	}};
	adRotator.set=function(second) { with (this)
	{
	 window.clearTimeout(_timeout);
	 if((/\d+/).test(second)==true)
	 {
	  _s=second;
	  adRotator.play();
	 }
	 else
	 {
	  alert("必须为数字!")
	  adRotator.play();
	 }
	}};
	function getRef(id)
	{
	 return (document.all?document.all(id):document.getElementById(id));
	}
	adRotator.initialize("AdRotator");
	adRotator.add("1.jpg","","/pages/ProductList.aspx?catid=39|49|54")
	adRotator.add("2.jpg","","/pages/ProductList.aspx?catid=39|49|57")
	adRotator.add("3.jpg","","/pages/ProductList.aspx?catid=39|49|59")
	adRotator.play();
	//-->
