﻿						window["picplaycache"]=new Object();
jQuery.iUtil = {
	getPosition : function(e)
	{
		var x = 0;
		var y = 0;
		var es = e.style;
		var restoreStyles = false;
		if (jQuery(e).css('display') == 'none') {
			var oldVisibility = es.visibility;
			var oldPosition = es.position;
			restoreStyles = true;
			es.visibility = 'hidden';
			es.display = 'block';
			es.position = 'absolute';
		}
		var el = e;
		while (el){
			x += el.offsetLeft + (el.currentStyle && !jQuery.browser.opera ?parseInt(el.currentStyle.borderLeftWidth)||0:0);
			y += el.offsetTop + (el.currentStyle && !jQuery.browser.opera ?parseInt(el.currentStyle.borderTopWidth)||0:0);
			el = el.offsetParent;
		}
		el = e;
		while (el && el.tagName  && el.tagName.toLowerCase() != 'body')
		{
			x -= el.scrollLeft||0;
			y -= el.scrollTop||0;
			el = el.parentNode;
		}
		if (restoreStyles == true) {
			es.display = 'none';
			es.position = oldPosition;
			es.visibility = oldVisibility;
		}
		return {x:x, y:y};
	},
	getPositionLite : function(el)
	{
		var x = 0, y = 0;
		while(el) {
			x += el.offsetLeft || 0;
			y += el.offsetTop || 0;
			el = el.offsetParent;
		}
		return {x:x, y:y};
	},
	getSize : function(e)
	{
		var w = jQuery.css(e,'width');
		var h = jQuery.css(e,'height');
		var wb = 0;
		var hb = 0;
		var es = e.style;
		if (jQuery(e).css('display') != 'none') {
			wb = e.offsetWidth;
			hb = e.offsetHeight;
		} else {
			var oldVisibility = es.visibility;
			var oldPosition = es.position;
			es.visibility = 'hidden';
			es.display = 'block';
			es.position = 'absolute';
			wb = e.offsetWidth;
			hb = e.offsetHeight;
			es.display = 'none';
			es.position = oldPosition;
			es.visibility = oldVisibility;
		}
		return {w:w, h:h, wb:wb, hb:hb};
	},
	getSizeLite : function(el)
	{
		return {
			wb:el.offsetWidth||0,
			hb:el.offsetHeight||0
		};
	},
	getClient : function(e)
	{
		var h, w, de;
		if (e) {
			w = e.clientWidth;
			h = e.clientHeight;
		} else {
			de = document.documentElement;
			w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
			h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
		}
		return {w:w,h:h};
	},
	getScroll : function (e)
	{
		var t=0, l=0, w=0, h=0, iw=0, ih=0;
		if (e && e.nodeName.toLowerCase() != 'body') {
			t = e.scrollTop;
			l = e.scrollLeft;
			w = e.scrollWidth;
			h = e.scrollHeight;
			iw = 0;
			ih = 0;
		} else  {
			if (document.documentElement) {
				t = document.documentElement.scrollTop;
				l = document.documentElement.scrollLeft;
				w = document.documentElement.scrollWidth;
				h = document.documentElement.scrollHeight;
			} else if (document.body) {
				t = document.body.scrollTop;
				l = document.body.scrollLeft;
				w = document.body.scrollWidth;
				h = document.body.scrollHeight;
			}
			iw = self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
			ih = self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
		}
		return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
	},
	getMargins : function(e, toInteger)
	{
		var el = jQuery(e);
		var t = el.css('marginTop') || '';
		var r = el.css('marginRight') || '';
		var b = el.css('marginBottom') || '';
		var l = el.css('marginLeft') || '';
		if (toInteger)
			return {
				t: parseInt(t)||0,
				r: parseInt(r)||0,
				b: parseInt(b)||0,
				l: parseInt(l)
			};
		else
			return {t: t, r: r,	b: b, l: l};
	},
	getPadding : function(e, toInteger)
	{
		var el = jQuery(e);
		var t = el.css('paddingTop') || '';
		var r = el.css('paddingRight') || '';
		var b = el.css('paddingBottom') || '';
		var l = el.css('paddingLeft') || '';
		if (toInteger)
			return {
				t: parseInt(t)||0,
				r: parseInt(r)||0,
				b: parseInt(b)||0,
				l: parseInt(l)
			};
		else
			return {t: t, r: r,	b: b, l: l};
	},
	getBorder : function(e, toInteger)
	{
		var el = jQuery(e);
		var t = el.css('borderTopWidth') || '';
		var r = el.css('borderRightWidth') || '';
		var b = el.css('borderBottomWidth') || '';
		var l = el.css('borderLeftWidth') || '';
		if (toInteger)
			return {
				t: parseInt(t)||0,
				r: parseInt(r)||0,
				b: parseInt(b)||0,
				l: parseInt(l)||0
			};
		else
			return {t: t, r: r,	b: b, l: l};
	},
	getPointer : function(event)
	{
		var x = event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)) || 0;
		var y = event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) || 0;
		return {x:x, y:y};
	},
	traverseDOM : function(nodeEl, func)
	{
		func(nodeEl);
		nodeEl = nodeEl.firstChild;
		while(nodeEl){
			jQuery.iUtil.traverseDOM(nodeEl, func);
			nodeEl = nodeEl.nextSibling;
		}
	},
	purgeEvents : function(nodeEl)
	{
		jQuery.iUtil.traverseDOM(
			nodeEl,
			function(el)
			{
				for(var attr in el){
					if(typeof el[attr] === 'function') {
						el[attr] = null;
					}
				}
			}
		);
	},
	centerEl : function(el, axis)
	{
		var clientScroll = jQuery.iUtil.getScroll();
		var windowSize = jQuery.iUtil.getSize(el);
		if (!axis || axis == 'vertically')
			jQuery(el).css(
				{
					top: clientScroll.t + ((Math.max(clientScroll.h,clientScroll.ih) - clientScroll.t - windowSize.hb)/2) + 'px'
				}
			);
		if (!axis || axis == 'horizontally')
			jQuery(el).css(
				{
					left:	clientScroll.l + ((Math.max(clientScroll.w,clientScroll.iw) - clientScroll.l - windowSize.wb)/2) + 'px'
				}
			);
	},
	fixPNG : function (el, emptyGIF) {
		var images = jQuery('img[@src*="png"]', el||document), png;
		images.each( function() {
			png = this.src;				
			this.src = emptyGIF;
			this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + png + "')";
		});
	}
};

// Helper function to support older browsers!
[].indexOf || (Array.prototype.indexOf = function(v, n){
	n = (n == null) ? 0 : n;
	var m = this.length;
	for (var i=n; i<m; i++)
		if (this[i] == v)
			return i;
	return -1;
});

jQuery.iCarousel = {
	build : function(options)
	{
		return this.each(
			function()
			{
			  var el = this;
	      var flag = 1;
				var increment = 2*Math.PI/360;
				var maxRotation = 2*Math.PI;
				if(jQuery(el).css('position') != 'relative' && jQuery(el).css('position') != 'absolute') {
					try{
						//jQuery(el).css('position', 'relative');
						el.style.position="relative";
					}catch(err){
						alert(err);
					}
				}
				el.carouselCfg = {
					items : jQuery(options.items, this),
					itemWidth : options.itemWidth,
					itemHeight : options.itemHeight,
					itemMinWidth : options.itemMinWidth,
					maxRotation : maxRotation,
					size : jQuery.iUtil.getSize(this),
					position : jQuery.iUtil.getPosition(this),
					start : Math.PI/2,
					rotationSpeed : options.rotationSpeed,
					reflectionSize : options.reflections,
					reflections : [],
          shadows : [],
					protectRotation : false,
					increment: 2*Math.PI/360,
          leftbutton: options.itemLeft,
          rightbutton: options.itemRight,
          autoplay:options.autoplay,
          _id:options._id,
          clearItems:options.clearItems
				};
				el.carouselCfg.radiusX = (el.carouselCfg.size.w - el.carouselCfg.itemWidth)/2;
				el.carouselCfg.radiusY =  (el.carouselCfg.size.h - el.carouselCfg.itemHeight - el.carouselCfg.itemHeight * el.carouselCfg.reflectionSize)/2;
				el.carouselCfg.step =  2*Math.PI/el.carouselCfg.items.size();
				el.carouselCfg.paddingX = el.carouselCfg.size.w/2;
				el.carouselCfg.paddingY = el.carouselCfg.size.h/2 - el.carouselCfg.itemHeight * el.carouselCfg.reflectionSize;
				var reflexions = document.createElement('div');
				reflexions.style.position='absolute';
				reflexions.style.zIndex=1;
				reflexions.style.top=0;
				reflexions.style.left=0;
				/*
				jQuery(reflexions)
					.css(
						{
							position: 'absolute',
							zIndex: 1,
							top: 0,
							left: 0
						}
					);
					*/
				jQuery(el).append(reflexions);

//阴影容器
        var shadows = document.createElement('div');
        shadows.style.position='absolute';
        shadows.style.top=0;
        shadows.style.left=0;
        /*
        jQuery(shadows)
          .css(
            {
              position: 'absolute',
              top: 0,
              left: 0
            }
          );
          */
          var canvas;
        jQuery(el).append(shadows);
//阴影容器结束
				el.carouselCfg.items
					.each(
						function(nr)
						{
							image = jQuery('img', this).get(0);
              if(jQuery(image).attr('class')=='roll'){
                height = parseInt(el.carouselCfg.itemHeight*el.carouselCfg.reflectionSize);
                if (jQuery.browser.msie) {
                  this.style.filter = 'progid:DXImageTransform.Microsoft.Shadow(enabled=true, color=#707070, direction=135, strength=4)';
                  canvas = document.createElement('img');
                  //jQuery(canvas).css('position', 'absolute');
                  //jQuery(canvas).css('border','1px solid #c3c3c3');
                  canvas.style.position='absolute';
                  canvas.style.border='1px solid #c3c3c3';
                  canvas.src = image.src;				
                  canvas.style.filter = 'flipv progid:DXImageTransform.Microsoft.Alpha(opacity=60, style=1, finishOpacity=0, startx=0, starty=0, finishx=0,finishy=90)';
                  //alert(el.carouselCfg._id);
                  if(el.carouselCfg._id)
                  	canvas.id=el.carouselCfg._id+"_canvas";
                } else {
  //阴影
                  shadow = document.createElement('canvas');
                  if(shadow.getContext){
                    thewidth = el.carouselCfg.itemWidth + 5;
                    theheight = el.carouselCfg.itemHeight + 5;
                    ct = shadow.getContext("2d");
                    shadow.style.position = 'absolute';
                    shadow.style.width = thewidth + 'px';
                    shadow.style.height = theheight + 'px';
                    shadow.width = thewidth;
                    shadow.height = theheight;
                    ct.save();
                    ct.beginPath();
                    ct.moveTo(thewidth,5);
                    ct.lineTo(thewidth,theheight);
                    ct.lineTo(thewidth-5,theheight-5);
                    ct.lineTo(thewidth-5,0);
                    ct.closePath();
                    var gradientH = ct.createLinearGradient(thewidth-5,0,thewidth,0);
                    gradientH.addColorStop(0,"rgba(112,112,112,1)");
                    gradientH.addColorStop(1,"rgba(112,112,112,0)");
                    ct.fillStyle = gradientH;
                    ct.fill();
                    ct.beginPath();
                    ct.moveTo(0,theheight-5);
                    ct.lineTo(thewidth-5,theheight-5);
                    ct.lineTo(thewidth,theheight);
                    ct.lineTo(5,theheight);
                    ct.closePath();
                    var gradientV = ct.createLinearGradient(0,theheight-5,0,theheight);
                    gradientV.addColorStop(0,"rgba(112,112,112,1)");
                    gradientV.addColorStop(1,"rgba(112,112,112,0)");
                    ct.fillStyle = gradientV;
                    ct.fill();
                  }
                  el.carouselCfg.shadows[nr] = shadow;
                  jQuery(shadows).append(shadow);
  //阴影结束
                  canvas = document.createElement('canvas');
                  if (canvas.getContext ) {
                    thewidth = el.carouselCfg.itemWidth + 4;
                    context = canvas.getContext("2d");
                    canvas.style.position = 'absolute';
                    canvas.style.height = height +'px';
                    canvas.style.width = thewidth +'px';
                    canvas.height = height;
                    canvas.width = thewidth;
                    context.save();
              
                    context.translate(0,height);
                    context.scale(1,-1);
                    context.drawImage(
                      image, 
                      0, 
                      0, 
                      thewidth, 
                      height
                    );
            
                    context.restore();
                    context.fillStyle = 'rgb(135, 135, 135)';
                    context.beginPath();
                    context.moveTo(1,0);
                    context.lineTo(1,height);
                    context.lineTo(2,height);
                    context.lineTo(2,0);
                    context.closePath();
                    context.fill();
                    context.beginPath();
                    context.moveTo(thewidth,0);
                    context.lineTo(thewidth,height);
                    context.lineTo(thewidth-1,height);
                    context.lineTo(thewidth-1,0);
                    context.closePath();
                    context.fill();
                    context.globalCompositeOperation = "destination-out";
                    var gradient = context.createLinearGradient(
                      0, 
                      0, 
                      0, 
                      height
                    );
                    
                    gradient.addColorStop(1, "rgba(255, 255, 255, 1)");
                    gradient.addColorStop(0, "rgba(255, 255, 255, 0.6)");
              
                    context.fillStyle = gradient;
                    if (navigator.appVersion.indexOf('WebKit') != -1) {
                      context.fill();
                    } else {
                      context.fillRect(
                        0, 
                        0, 
                        thewidth, 
                        height
                      );
                    }
                  }
                }
                el.carouselCfg.reflections[nr] = canvas;
                jQuery(reflexions).append(canvas);
							}
						}
					)
					.bind(
						'mouseover',
						function(e)
						{
              if(jQuery(this).css("z-index")>165){
                divtop = parseInt(jQuery(this).css("top"))+parseInt(jQuery(this).css("height"))/2-55;
                divleft = parseInt(jQuery(this).css("left"))+parseInt(jQuery(this).css("width"))/2-55;
                divid = "carousel_viewdiv"+this.parentNode.id.substring(8);
                //divid = "carousel_viewdiv";
                divimg = jQuery("#"+divid+" div.mall_hot_mo_pic");
                divtext = jQuery("#"+divid+" div.mall_hot_mo_text");
                divprice = jQuery("#"+divid+" div.mall_hot_mo_price");
                thehref = jQuery(this).attr("href");
                theimg = jQuery(this).children().attr("src");
                thestring = jQuery(this).attr("name");
                arr = thestring.split("`|`");
                productname = arr[0];
                productnames = arr[1];
                productprice = arr[2];
                divimg.html("<a href=\""+thehref+"\" target=\"_blank\" title=\""+productname+"\"><img src=\""+theimg+"\"/></a>");
                divtext.html(productnames);
                divprice.html("￥"+productprice);
                jQuery("#"+divid).get(0).style.cssText="position:absolute;top:"+divtop+"px;left:"+divleft+"px;z-index:999999";
                //alert(jQuery("#"+divid).get(0).outerHTML);
                /*
                jQuery("#"+divid).css({
                    "position":"absolute",
                    "top": divtop+"px",
                    "left": divleft+"px",
                    "z-index":"500"
                });*/
                jQuery("#"+divid).show();
                return false;
              }
						}
					);
        //增加方向导航按钮
        var dir = document.createElement('div');
        myheight = parseInt(jQuery(el).css("height"))-36;
        /*
        jQuery(dir).css(
          {
            'height':'20px',
            'font-size':'12px',
            'padding-top':myheight+'px',
            'padding-right':'10px',
            'float':'right'
          }
        );
        */
        //jQuery(dir).html('<span id="carouselLeft" title="按住顺时针旋转">'+el.carouselCfg.leftbutton+'</span>&nbsp;&nbsp;<span id="carouselRight" title="按住逆时针旋转">'+el.carouselCfg.rightbutton+'</span>');
        //jQuery(dir).css("cursor","pointer");
        jQuery(el).append(dir);
        //增加方向导航按钮完毕
        //方向加速
        jQuery('#carouselLeft').mousedown(function(){
          el.carouselCfg.speed = el.carouselCfg.rotationSpeed * el.carouselCfg.increment * (el.carouselCfg.size.w/2 - 200) / (el.carouselCfg.size.w/2);;
          el.carouselCfg.speed2=0;
        }).bind('mouseup',function(){
          el.carouselCfg.speed = el.carouselCfg.speed1;
        }).bind('mouseover',function(){
          $(".mall_hot_mo").hide();
        }).bind('mouseout',function(){
          el.carouselCfg.speed = el.carouselCfg.speed1;
        });
        jQuery('#carouselRight').mousedown(function(){
          el.carouselCfg.speed = el.carouselCfg.rotationSpeed * el.carouselCfg.increment * (el.carouselCfg.size.w/2 - 400) / (el.carouselCfg.size.w/2);;
          el.carouselCfg.speed2=0;
        }).bind('mouseup',function(){
          el.carouselCfg.speed = el.carouselCfg.speed1;
        }).bind('mouseover',function(){
          $(".mall_hot_mo").hide();
        }).bind('mouseout',function(){
          el.carouselCfg.speed = el.carouselCfg.speed1;
        });
        //方向加速完毕
				jQuery.iCarousel.positionItems(el);
				el.carouselCfg.speed = 0;
        el.carouselCfg.speed1 = el.carouselCfg.speed;
        jQuery.iCarousel.clearItems(el);
				window["carouseTimer11"]=el.carouselCfg.rotationTimer = window.setInterval(
					function()
					{
        		if(window["com.loonyee.productshow.circle.stoprolling"]&&window["com.loonyee.productshow.circle.stoprolling"]==true) return;						
						el.carouselCfg.start += el.carouselCfg.speed;
						if (el.carouselCfg.start > maxRotation)
							el.carouselCfg.start = 0;
						jQuery.iCarousel.positionItems(el);
					},
					20
				);
				
				//自动播放的定时器
				window["carouseTimer12"]=el.carouselCfg.rotationTimer2 = window.setInterval(
					function()
					{
						if(el.carouselCfg.autoplay!='1'||(window["com.loonyee.productshow.circle.stopauto"]&&window["com.loonyee.productshow.circle.stopauto"]==true)) return;
            el.carouselCfg.speed2 = 1 * el.carouselCfg.increment * (el.carouselCfg.size.w/2 - 400) / (el.carouselCfg.size.w/2);
						el.carouselCfg.start += el.carouselCfg.speed2;
						jQuery.iCarousel.positionItems(el);
					},
					20
				);
				window["com.loonyee.productshow.circle.inRect"]=function(x,y,obj){
					//Com.Loonyee.Page.logging("x="+x+" y="+y);
					//Com.Loonyee.Page.logging("x="+obj.offsetLeft+" y="+obj.offsetTop);
					return (x>obj.offsetLeft&&x<(obj.offsetLeft+obj.offsetWidth)&&y>obj.offsetTop&&(y<obj.offsetTop+obj.offsetHeight));
				}
					/*
				document.onmousemove=function(e){
									e=e||window.event;
									var x=e.clientX;
									var y=e.clientY;
									moveListener(x,y);
								if(mousemoveArray.length>=2)
													mousemoveArray.shift();						
								mousemoveArray.push({"x":x,"y":y});
							}*/
					/*
				document.onclick=function(e){
					alert('click');
										window["com.loonyee.productshow.circle.stoprolling"]=true;
										return;
				}
				*/
			}
		);
	},
	clearItems:function(el){
			clearInterval(window["carouseTimer11"]);
			clearInterval(window["carouseTimer12"]);
			jQuery(document).find('img[id=carousel_psd9787a09_9c2b_489f_b447_a5fcd55d1374_canvas]').each(
				function(nr){
					this.width=0;
					this.height=0;
					this.style.display="none";
				}
			);
	},
	positionItems : function(el)
	{
		el.carouselCfg.items.each(
			function (nr)
			{
        image = jQuery('img', this).get(0);
        if(jQuery(image).attr('class')=='roll'){
          angle = el.carouselCfg.start+nr*el.carouselCfg.step;
          x = el.carouselCfg.radiusX*Math.cos(angle);
          y = el.carouselCfg.radiusY*Math.sin(angle) ;
          itemZIndex = parseInt(100*(el.carouselCfg.radiusY+y)/(2*el.carouselCfg.radiusY))+100;
          parte = (el.carouselCfg.radiusY+y)/(2*el.carouselCfg.radiusY);
          
          width = parseInt((el.carouselCfg.itemWidth - el.carouselCfg.itemMinWidth) * parte + el.carouselCfg.itemMinWidth);
          //alert(el.carouselCfg.itemWidth+"-"+el.carouselCfg.itemMinWidth+"   width:"+width);
          height = parseInt(width * el.carouselCfg.itemHeight / el.carouselCfg.itemWidth);
          this.style.top = el.carouselCfg.paddingY + y - height/2 + "px";
          this.style.left = el.carouselCfg.paddingX + x - width/2 + "px";
          this.style.width = width + "px";
          this.style.height = height + "px";
          this.style.zIndex = itemZIndex;
          el.carouselCfg.reflections[nr].style.left = parseInt(el.carouselCfg.paddingX + x - width/2) + "px";
          if (jQuery.browser.msie){
            el.carouselCfg.reflections[nr].style.top = parseInt(el.carouselCfg.paddingY + y + height - 1 - height/2) + "px";
            el.carouselCfg.reflections[nr].style.width = width + "px";
          }else{
            el.carouselCfg.reflections[nr].style.top = parseInt(el.carouselCfg.paddingY + y + height - 1 - height/2+7) + "px";
            el.carouselCfg.reflections[nr].style.width = (width+4) + "px";
          }
          el.carouselCfg.reflections[nr].style.height = parseInt(height * el.carouselCfg.reflectionSize) + "px";

          if(!jQuery.browser.msie){
            el.carouselCfg.shadows[nr].style.width = (width + 5) + "px";
            el.carouselCfg.shadows[nr].style.height = (width + 5) + "px";
            el.carouselCfg.shadows[nr].style.top = el.carouselCfg.paddingY + y - height/2 + "px";
            el.carouselCfg.shadows[nr].style.left = el.carouselCfg.paddingX + x - width/2 + "px";
            el.carouselCfg.shadows[nr].style.zIndex = itemZIndex-1;
          }
        }
			}
		);
	}
};
jQuery.fn.Carousel = jQuery.iCarousel.build;
window["mousemoveArray"]=new Array();
function moveListener(x,y){
				//improve performance
				//if(!window["com.loonyee.productshow.circle.cach.carousel"])
						window["com.loonyee.productshow.circle.cach.carousel"]=jQuery(document).find("div[id^='carousel']");
				window["com.loonyee.productshow.circle.cach.carousel"].each(
										function (i){
											var _self=this;
											window["com.loonyee.productshow.circle.stoprolling"]=false;
											//ensure setInterval only once
											if(!window[this.id+"_holder"]){
											window["com.loonyee.productshow.circle."+_self.id+".times"]=1;
											window[this.id+"_holder"]=window.setInterval(
												function(){
															if(mousemoveArray.length>=2){
																var start=mousemoveArray[mousemoveArray.length-2];
																var end=mousemoveArray[mousemoveArray.length-1];
																if(end.x!=start.x||end.y!=start.y){
																		var offset = (end.x-start.x)/2;
																		/*
																		if(offset<1&&offset>-1){
																			offset=0;
																		}
																		*/
																		if(offset<0){
																			offset=-20;
																		}else if(offset>0){
																			offset=20
																		}
																		
																		try{												
																			var speed=offset/10 * _self.carouselCfg.increment * (_self.carouselCfg.size.w/2 - 200) / (_self.carouselCfg.size.w/2);
																			
																			
																			_self.carouselCfg.speed=-speed*window["com.loonyee.productshow.circle."+_self.id+".times"];
		
																			window["com.loonyee.productshow.circle.stopauto"]=true;													
																		}catch(err){
																		}
																}
															}
	
												},
												20
											);				
											}
											/*
											if(window["com.loonyee.productshow.circle.inRect"](x,y,_self)){
												window["com.loonyee.productshow.circle."+_self.id+".times"]=-5;
											}else{
												window["com.loonyee.productshow.circle."+_self.id+".times"]=1;
											}
											*/
								})
}

function startCarousel(id,w,h){
		function loadWait() {
			if (document.getElementById(id)) { // if loaded
				setTimeout(function(){
					var carousel=document.getElementById(id);
		  		carousel.style.backgroundColor="blue";
		  		carousel.style.width=w+"px";
		  		carousel.style.height=h+"px";
		  		alert(carousel.getAttribute("autoplay"));
			    jQuery(carousel).show();
			    jQuery(carousel).Carousel({
			      itemWidth: 100,
			      itemHeight: 100,
			      itemMinWidth: 53,
			      items: 'a',
			      reflections: .4,
			      rotationSpeed:10,
			      itemLeft: "<img src='images/last_img1.gif' border='0'/>",
			      itemRight: "<img src='images/last_img2.gif' border='0'/>",
			      autoplay:carousel.getAttribute("autoplay"),
			      _id:id
			    });
		  	},1000);
			} else {
				setTimeout(loadWait,10);
			}
		}
		loadWait();
	/*
  	jQuery(document).find("div[id^=carousel]").each(
  	function(){
  		this.style.backgroundColor="blue";
  		this.style.width="300px";
  		this.style.height="300px";
	    jQuery(this).show();
	    jQuery(this).Carousel({
	      itemWidth: 100,
	      itemHeight: 100,
	      itemMinWidth: 53,
	      items: 'a',
	      reflections: .4,
	      rotationSpeed:10,
	      itemLeft: "<img src='images/last_img1.gif' border='0'/>",
	      itemRight: "<img src='images/last_img2.gif' border='0'/>",
	      autoplay:jQuery(this).attr("autoplay")
	    });
  	});
  	*/
}
function CarouselResize(id,w,h){
			var carousel=document.getElementById("carousel_"+id);
			var canvas=document.getElementById("carousel_"+id+"_canvas");
			var html=canvas.parentNode.parentNode.parentNode.innerHTML;
			//alert(html);
			//canvas.parentNode.removeChild(canvas);
		  //carousel.style.backgroundColor="blue";
		  carousel.style.width=w+"px";
		  carousel.style.height=h+"px";
		  
			    jQuery(carousel).show();
			    jQuery(carousel).Carousel({
			      itemWidth: 100,
			      itemHeight: 100,
			      itemMinWidth: 53,
			      items: 'a',
			      reflections: .4,
			      rotationSpeed:10,
			      itemLeft: "<img src='images/last_img1.gif' border='0'/>",
			      itemRight: "<img src='images/last_img2.gif' border='0'/>",
			      autoplay:carousel.getAttribute("autoplay"),
			      _id:"carousel_"+id,
			      clearItems:1
			    });
		  /*
			    jQuery(carousel).show();
			    jQuery(carousel).Carousel({
			      itemWidth: 100,
			      itemHeight: 100,
			      itemMinWidth: 53,
			      items: 'a',
			      reflections: .4,
			      rotationSpeed:10,
			      itemLeft: "<img src='images/last_img1.gif' border='0'/>",
			      itemRight: "<img src='images/last_img2.gif' border='0'/>",
			      autoplay:carousel.getAttribute("autoplay"),
			      _id:"carousel_"+id
			    });		  
			    */
}


//第五种效果开始
		function setfoc(currid,moduleid){
			var focpic=document.getElementById("focpic_"+moduleid);
			if(!focpic) {stopit(moduleid);return;}
			document.getElementById("focpic_"+moduleid).src = window["fpic_data_"+moduleid].picarry[currid];
			if(document.getElementById("foclnk_"+moduleid))
				document.getElementById("foclnk_"+moduleid).href = window["fpic_data_"+moduleid].lnkarry[currid];
			//alert(window["fpic_data_"+moduleid].lnkarry[currid]);
			try{
			if(window["fpic_data_"+moduleid].lnkarry[currid].indexOf("#")>=0||window["fpic_data_"+moduleid].lnkarry[currid].indexOf("undefined")>=0)
				document.getElementById("fttltxt_"+moduleid).innerHTML = window["fpic_data_"+moduleid].ttlarry[currid];
			else
				document.getElementById("fttltxt_"+moduleid).innerHTML = '<a href="'+window["fpic_data_"+moduleid].lnkarry[currid]+'" >'+window["fpic_data_"+moduleid].ttlarry[currid]+'</a>';
			}catch(err){
				//alert(err);
			}
			currslid = currid;
			var len=document.getElementById("fpic_switcher_"+moduleid).childNodes.length;
			for(i=0;i<len;i++){
				document.getElementById("tmb"+i+"_"+moduleid).className = "thubpic";
				//document.getElementById("tmb"+i).style.cssText="Z-INDEX: 20; PADDING-BOTTOM: 0px; PADDING-LEFT: 4px; WIDTH: 63px; PADDING-RIGHT: 0px; HEIGHT: 49px; TOP: 10px; CURSOR: pointer; PADDING-TOP: 4px";
			};
			document.getElementById("tmb"+currid+"_"+moduleid).className ="thubpiccur";
			//document.getElementById("tmb"+id).style.cssText="PADDING-BOTTOM: 0px; PADDING-LEFT: 4px; WIDTH: 63px; PADDING-RIGHT: 0px; HEIGHT: 49px; TOP: 10px; CURSOR: pointer; PADDING-TOP: 4px;Z-INDEX: 30; BACKGROUND: url(../images/arrow3.gif) no-repeat left 50%;";
			focpic.style.visibility = "hidden";
			focpic.filters[0].Apply();
			if (focpic.style.visibility == "visible") {
				focpic.style.visibility = "hidden";
				focpic.filters.revealTrans.transition=23;
			}
			else {
				focpic.style.visibility = "visible";
				focpic.filters[0].transition=23;
			}
			focpic.filters[0].Play();
			stopit(moduleid);
			window["currslid_"+moduleid]=currid;
		}
		function stopit(moduleid){
			clearTimeout(window["slidint_"+moduleid]);
		}
		function playit(moduleid,currslid,autoplaytime){
			//alert(autoplaytime);
			if(window["picswitcher5.stopplay_"+moduleid]==1) return;
			if(autoplaytime)
			window["slidint_"+moduleid] = setTimeout(playnext(moduleid,currslid,autoplaytime),autoplaytime);
			else
			window["slidint_"+moduleid] = setTimeout(playnext(moduleid,currslid,4500),4500);
		}
		function playnext(moduleid,currslid,autoplaytime){
			if(!isNaN(currslid))
				window["currslid_"+moduleid]=currslid;
			return function(){
				if(!document.getElementById("fpic_switcher_"+moduleid)) return;
				if(window["currslid_"+moduleid]==document.getElementById("fpic_switcher_"+moduleid).childNodes.length-1){
					window["currslid_"+moduleid] = 0;
				}
				else{
					window["currslid_"+moduleid]=window["currslid_"+moduleid]+1;
				};
				setfoc(window["currslid_"+moduleid],moduleid);
				playit(moduleid,window["currslid_"+moduleid],document.getElementById("fpic_"+moduleid).getAttribute("autoplaytime"));
			}
		}		
function fpic_init(id,menuPicWidth,menuPicHeight,w,h,backgroundColor){			

	//var p=0;
	var switcher=document.getElementById("fpic_switcher_"+id);
	var nodes=switcher.childNodes;
	for(var i=0;i<nodes.length;i++){
			var img;
			if(nodes[i].firstChild.firstChild)
				img=nodes[i].firstChild.firstChild;
			else
				img=nodes[i].firstChild;
			img.style.height=menuPicHeight+"px";
			img.style.width=menuPicWidth+"px";
	}
	//alert(w);
	document.getElementById("fpic_"+id).style.height=h+"px";
	document.getElementById("fpic_"+id).style.width=w+"px";
	var autoplay=document.getElementById("fpic_"+id).getAttribute("autoplay");
	var autoplaytime=document.getElementById("fpic_"+id).getAttribute("autoplaytime");
	if(backgroundColor)
		document.getElementById("fpic_"+id).style.backgroundColor=backgroundColor;
	var maxHeight=parseInt(document.getElementById("fpic_"+id).style.height);
	//alert(document.getElementById("fpic_"+id).outerHTML);
	//alert(document.getElementById("fpic_"+id).style.width+"-"+menuPicWidth+"-15");
	var maxWidth=parseInt(document.getElementById("fpic_"+id).style.width)-menuPicWidth-15;
	document.getElementById("fpic_"+id).style.textAlign="right";
	
	var focpic=document.getElementById("focpic_"+id);
	var fttltxt=document.getElementById("fttltxt_"+id);
	fttltxt.style.marginTop="5px";
	focpic.width=maxWidth;
	if(fttltxt.offsetHeight>0)
		focpic.height=maxHeight-fttltxt.offsetHeight-10;
	else
		focpic.height=maxHeight;
	//fttltxt.style.marginTop=focpic.height+10+"px";
	//alert(autoplaytime);
	if(autoplay&&autoplay=='1'){
			playit(id,0,autoplaytime);
			window["picswitcher5.stopplay_"+id]=0;
	}else{
			window["picswitcher5.stopplay_"+id]=1;
		}
}
function fpic_resize(id,w,h){
	//alert(w+","+h);
	var menuPicWidth,menuPicHeight;
	var switcher=document.getElementById("fpic_switcher_"+id);
	var nodes=switcher.childNodes;
	for(var i=0;i<nodes.length;i++){
			var img;
			if(nodes[i].firstChild.firstChild)
				img=nodes[i].firstChild.firstChild;
			else
				img=nodes[i].firstChild;
			menuPicHeight=parseInt(img.style.height);
			menuPicWidth=parseInt(img.style.width);
			break;
	}
	document.getElementById("fpic_"+id).style.height=h+"px";
	document.getElementById("fpic_"+id).style.width=w+"px";
	var maxHeight=parseInt(document.getElementById("fpic_"+id).style.height);
	var maxWidth=parseInt(document.getElementById("fpic_"+id).style.width)-menuPicWidth-15;
	document.getElementById("fpic_"+id).style.textAlign="right";
	
	var focpic=document.getElementById("focpic_"+id);
	focpic.width=maxWidth;
	var fttltxt=document.getElementById("fttltxt_"+id);
	fttltxt.style.marginTop="5px";	
	if(fttltxt.offsetHeight>0)
		focpic.height=maxHeight-fttltxt.offsetHeight-10;
	else
		focpic.height=maxHeight
}
//第五种效果结束


//第九种效果开始
function startSwitch4(id,w,h,imgtu,tulink){
	//alert(window["imgtu_"+pid]);
	if(window["picswitcher9.lastIntervalHolder_"+id]) clearInterval(window["picswitcher9.lastIntervalHolder_"+id]);
	var box=document.getElementById("box_"+id);
	var autoplay=box.getAttribute("autoplay");
	box.style.width=w+"px";
	box.style.height=h+"px";
	var box2=document.getElementById("box2_"+id);
	if(box.firstChild.firstChild){
		//alert(h+"-"+box2.offsetHeight);
		box.firstChild.firstChild.height=h;
		box.firstChild.firstChild.width=w-4;
	}else{		
		box.firstChild.height=h;
		box.firstChild.width=w-4;
	}
	for(var i=0;i<4;i++){
		if(!document.getElementById("item"+(i+1)+"_"+id)) break;
		document.getElementById("item"+(i+1)+"_"+id).style.width=box.offsetWidth/2-12+"px";
		//document.getElementById("item"+(i+1)+"_"+id).style.backgroundColor="blue";
	}
	/*	
	var imgdaohang={};
	imgdaohang[0]="img/01.jpg";
	imgdaohang[1]="img/02.jpg";
	imgdaohang[2]="img/05.jpg";
	imgdaohang[3]="img/06.jpg";
	*/
	var currIndex=0;

	window["swapImg41"]=function(pid,i)
	{
		if(!document.getElementById("item"+(i+1)+"_"+pid)) return;
		if(document.getElementById("item"+(i+1)+"_"+pid).firstChild.firstChild){
			document.getElementById("item"+(i+1)+"_"+pid).firstChild.firstChild.style.width="35px";
			document.getElementById("item"+(i+1)+"_"+pid).firstChild.firstChild.style.height="26px";
		  document.getElementById("item"+(i+1)+"_"+pid).firstChild.firstChild.src=window["imgtu_"+pid][i];
		}else{
			document.getElementById("item"+(i+1)+"_"+pid).firstChild.style.width="35px";
			document.getElementById("item"+(i+1)+"_"+pid).firstChild.style.height="26px";
		  document.getElementById("item"+(i+1)+"_"+pid).firstChild.src=window["imgtu_"+pid][i];
		}
	  document.getElementById("item"+(i+1)+"_"+pid).style.backgroundImage="url(/images/picplay/picplay9_bg1.gif)";
	}
	window["swapImg42"]=function(pid,i,auto)
	{
	  if(!document.getElementById("box_"+pid)) return;
		if(window["picswitcher9.stopplay_"+pid]==1&&auto==1) return;
		//if(!document.getElementById("item"+(i+1)+"_"+pid) return;
		currIndex=i;
		if(!document.getElementById("item"+(i+1)+"_"+pid)) {
			currIndex==0;i=0;
		}
		if(!document.getElementById("item"+(i+1)+"_"+pid)) return;
		if(document.getElementById("item"+(i+1)+"_"+pid).firstChild.firstChild){
			document.getElementById("item"+(i+1)+"_"+pid).firstChild.firstChild.style.width="35px";
			document.getElementById("item"+(i+1)+"_"+pid).firstChild.firstChild.style.height="26px";
		  document.getElementById("item"+(i+1)+"_"+pid).firstChild.firstChild.src=window["imgtu_"+pid][i];
		}else{			
			document.getElementById("item"+(i+1)+"_"+pid).firstChild.style.width="35px";
			document.getElementById("item"+(i+1)+"_"+pid).firstChild.style.height="26px";
			//alert(window["imgtu_"+pid]);
		  document.getElementById("item"+(i+1)+"_"+pid).firstChild.src=window["imgtu_"+pid][i];
		}
	  document.getElementById("item"+(i+1)+"_"+pid).style.backgroundImage="url(/images/picplay/picplay9_bg2.gif)";
	  if(document.getElementById("box_"+pid).firstChild.firstChild){
	  	document.getElementById("box_"+pid).firstChild.firstChild.src = window["imgtu_"+pid][i];
	  	document.getElementById("box_"+pid).firstChild.href=window["tulink_"+pid][i];
	  	//document.getElementById("box_"+pid).firstChild.target="_blank";
	  }
	  else
	  	document.getElementById("box_"+pid).firstChild.src = window["imgtu_"+pid][i];
		for(var j=0;j<4;j++){
			if(i!=j)
				swapImg41(pid,j);
		}  
	}
	swapImg42(id,0);
	function startPlay(pid){
		return function(){
				currIndex++;
				if(currIndex>=4) currIndex=0;
				swapImg42(pid,currIndex,1);
		}
	}
	if(autoplay&&autoplay=="1"){
		window["picswitcher9.lastIntervalHolder_"+id]=setInterval(startPlay(id),box.getAttribute("autoplaytime"));
		window["picswitcher9.stopplay_"+id]=0;
	}else{
		window["picswitcher9.stopplay_"+id]=1;
	}
}
function resizePicSwitcher4(id,w,h){
	var box=document.getElementById("box_"+id);
	box.style.width=w+"px";
	box.style.height=h+"px";
	var box2=document.getElementById("box2_"+id);
	if(box.firstChild.firstChild){
		box.firstChild.firstChild.height=h;
		box.firstChild.firstChild.width=w-4;
	}else{		
		box.firstChild.height=h;
		box.firstChild.width=w-4;
	}
	for(var i=0;i<4;i++){
		document.getElementById("item"+(i+1)+"_"+id).style.width=box.offsetWidth/2-12+"px";
		//document.getElementById("item"+(i+1)+"_"+id).style.backgroundColor="blue";
	}	
}
//第九种效果结束

//第十种效果的开始
function startSwicher9(id,w,h,tu,tulink,len){	
	if(h<=78) h=78;
	//alert(document.getElementById("shu_"+id));
	//alert(document.getElementById("shu_"+id).innerHTML);
	var _offset=parseInt(document.getElementById("shu_"+id).offsetHeight);
	if(len<=6&&len>3) _offset=44;
	if(len<=3) _offset=22;
	if(len>6) _offset=66;
	//alert(_offset);
	if(window["picswitcher10.lastIntervalHolder_"+id]) clearInterval(window["picswitcher10.lastIntervalHolder_"+id]);	
	window["currentIndex_"+id]=0;
	var container=document.getElementById("tbg_"+id);
	container.style.width=w+"px";
	container.style.height=h+"px";
	container.setAttribute("len",len);
	var autoplay=container.getAttribute("autoplay");
	var autoplaytime=container.getAttribute("autoplaytime");
	var p=document.getElementById("tu_"+id);
	if(p.firstChild.firstChild){
		p.firstChild.firstChild.style.width=(w-2)+"px"
		p.firstChild.firstChild.style.height=(h-_offset)+"px"
		p.firstChild.firstChild.src=tu[window["currentIndex_"+id]];
	}else{
		p.firstChild.style.width=(w-2)+"px"
		p.firstChild.style.height=(h-_offset)+"px"
		p.firstChild.src=tu[window["currentIndex_"+id]];
	}
	for(var i=0;i<len;i++){
		if(!document.getElementById("item"+(i+1)+"_"+id)) break;
		var item=document.getElementById("item"+(i+1)+"_"+id);
		item.style.width=(w/3-1)+"px";
	}
	window["swapImg101"]=function(pid,i)
	{
		//if(!document.getElementById("item"+(i+1)+"_"+pid)) return;
		try{
			document.getElementById("item"+(i+1)+"_"+pid).className="shusbg1";		
		}catch(err){
		}
	}
	window["swapImg102"]=function(pid,i)
	{
		window["currentIndex_"+pid]=i;
		var p=document.getElementById("tu_"+pid);
		if(!p) {
			for(var j=0;j<9;j++){
				if(i!=j)
					swapImg101(pid,j);
			}  			
			return;
		}
		if(p.firstChild.firstChild){
			p.firstChild.firstChild.src=window["tu_"+pid][window["currentIndex_"+pid]];
			p.firstChild.href=window["tulink_"+pid][window["currentIndex_"+pid]];
		}else{
			p.firstChild.src=window["tu_"+pid][window["currentIndex_"+pid]];
		}
		if(!document.getElementById("item"+(i+1)+"_"+pid)) {
			for(var j=0;j<9;j++){
				if(i!=j)
					swapImg101(pid,j);
			}  			
			return;
		}
		document.getElementById("item"+(i+1)+"_"+pid).className="shusbg2";
		//alert(tu.length);
		for(var j=0;j<9;j++){
			if(i!=j)
				swapImg101(pid,j);
		}  
	}
	swapImg102(id,0);
	function startPlay(pid){
		return function(){
				window["currentIndex_"+pid]++;
				if(window["currentIndex_"+pid]>=len) window["currentIndex_"+pid]=0;
				swapImg102(pid,window["currentIndex_"+pid]);
		}
	}
	if(autoplay&&autoplay=="1"){
		var startPlayId=startPlay(id);
		window["picswitcher10.lastIntervalHolder_"+id]=setInterval(startPlayId,container.getAttribute("autoplaytime"));
		window["picswitcher10.stopplay_"+id]=0;
	}else{
		window["picswitcher10.stopplay_"+id]=1;
	}	
}
function resizePicSwitcher9(id,w,h){
	if(h<=78) h=78;
	var _offset=document.getElementById("shu_"+id).offsetHeight;
	var container=document.getElementById("tbg_"+id);
	container.style.width=w+"px";
	container.style.height=h+"px";
	var len=container.getAttribute("len");
	var p=document.getElementById("tu_"+id);
	if(p.firstChild.firstChild){
		p.firstChild.firstChild.style.width=(w-2)+"px"
		p.firstChild.firstChild.style.height=(h-_offset)+"px"
	}else{
		p.firstChild.style.width=(w-2)+"px"
		p.firstChild.style.height=(h-_offset)+"px"
	}
	for(var i=0;i<len;i++){
		var item=document.getElementById("item"+(i+1)+"_"+id);
		if(!item) break;
		item.style.width=(w/3-1)+"px";
	}
}
//第十种效果的结束

//第十五种
function slidePicNews() {
   var ref = this;

   this.imgWidth=320;  //图片宽度
   this.imgHeight=240; //图片高度
   this.fontSize=14;   //图片文字字号
   this.fontWeight="bold"; //图片文字加粗
   this.lineHeight=24;
   this.numHeight=16; //切换数字位于图片的垂直位置
   this.timer=1000; //切换速度
   this.autoplay=1;
   this.className="";

   this.targetID = ''; //控制栏目的编号

   this.srcs=new Array();
   this.hrefs=new Array();
   this.texts=new Array();

   var adNum=-1;
   var _timer7 = null;

   var gE = function() {
      return document.getElementById(arguments[0]);
   };

   function PreloadImages() {
   	var preloadedimages=new Array();

   	for (i=1;i<ref.srcs.length;i++) {
   		preloadedimages[i]=new Image();
   		preloadedimages[i].src=ref.srcs[i];
   	}
   };

   var nextAd = function(){
   	if(!gE("slide_news_"+ref.targetID+"_title")) return;
   	if (adNum<ref.srcs.length-1)
   		adNum++ ;
   	else
   		adNum=0;
   //setTransition();
   	if (ref.texts.length>adNum) {
   		if(ref.hrefs[adNum]=="")
   			gE("slide_news_"+ref.targetID+"_title").innerHTML='<span class='+ref.className+'>'+ref.texts[adNum]+'</span>';
   		else
   			gE("slide_news_"+ref.targetID+"_title").innerHTML='<span class='+ref.className+'><a href="'+ref.hrefs[adNum]+'">'+ref.texts[adNum]+'</a></span>';
   	}
   	document.images["slide_news_"+ref.targetID+"_pic"].src=ref.srcs[adNum];
   	var obj=gE("slide_news_"+ref.targetID);
   	if (obj) {
   		if(ref.hrefs[adNum]!="")
   			obj.href=ref.hrefs[adNum];
   	}
   //playTransition();
   	for (i=0;i<ref.srcs.length;i++)
   	   gE('s_'+ref.targetID+'_led_'+i).className='s7_num1';
   	gE('s_'+ref.targetID+'_led_'+adNum).className='s7_num2';
   	if (typeof(ref.timer)=="undefined") ref.timer=5000;
   	if (ref.timer>0) _timer7=setTimeout(nextAd, ref.timer);
   }

   this.slideTo = function(evt) {
     evt = evt || window.event;
     var t = evt.target || evt.srcElement;

   	adNum=(parseInt(t.id.split("_").pop()) || 0) - 1;
   	try{
   		clearTimeout(_timer7);
  	}catch(err){
  	}
   	nextAd();
   }

   this.init = function() {
   	var cid = ref.targetID;
   	var d = gE("slide_"+cid);
   	if (ref.srcs.length==0) return;
   	PreloadImages();
   	//ref.lineHeight+=5;
   	//alert(ref.imgHeight);
		//if(ref.texts[0]=="")
		if(true)
		str='<div id="'+ref.targetID+'_area" style="width:'+ref.imgWidth+'px;height:'+ref.imgHeight+'px;overflow:hidden">';
		else
   	str='<div id="'+ref.targetID+'_area" style="width:'+ref.imgWidth+'px;height:'+(ref.imgHeight+((ref.lineHeight==5)?0:ref.lineHeight))+'px;overflow:hidden">';
   	if(ref.hrefs[0]=="")
   		str+='<div><a id="slide_news_'+cid+'">';
   	else
			str+='<div><a id="slide_news_'+cid+'" href="'+ref.hrefs[0]+'">';
   	str+='<img id="'+ref.targetID+'_img" style="filter:revealTrans(duration=2,transition=20)" width="'+ref.imgWidth+'" height="1" src="'+ref.srcs[0]+'" border="0" name="';
   	str+="slide_news_"+cid+"_pic";
   	str+='" /></a></div>';
   	
   	if(ref.texts[0]=="")
	str+='<div id="slide_news_'+cid+'_title" style="display:none;height:0px;">';
   	else
	str+='<div id="slide_news_'+cid+'_title" style="height:'+(ref.lineHeight)+'px;line-height:'+(ref.lineHeight)+'px;text-align:center;overflow:hidden;font-size:'+ref.fontSize+'px;font-weight:'+ref.fontWeight+'">';
   	if (ref.texts.length>0) {
   		if(ref.hrefs[0]=="")
				str+='<span class='+ref.className+'>'+ref.texts[0]+'</span>';   		
   		else
   			str+='<span class='+ref.className+'>'+'<a href="'+ref.hrefs[0]+'">'+ref.texts[0]+'</a></span>';
   	}
   	str+='</div>';
	
		if(ref.texts[0]=="")
			str+='<div class="slide7nums" style="height:'+ref.numHeight+'px;top:-'+(ref.numHeight+1)+'px;padding-right:1px;left:0px;overflow:hidden;position:relative">';
		else
   		str+='<div class="slide7nums" style="height:'+ref.numHeight+'px;top:-'+(ref.numHeight+ref.lineHeight+1)+'px;padding-right:1px;left:0px;overflow:hidden;position:relative">';
   	for (var i=ref.srcs.length-1;i>=0;i--) {
   		str+='<div id="s_'+cid+'_led_'+i+'" class="s7_num';
   		if (i==0)
   			str+="2";
   		else
   			str+="1";
   		str+='">'+(i+1)+'</div>';
   	}
   	str+='</div>';
	
   	str+='</div>';
   	d.innerHTML=str;
    
   	var titleheight=0;
   	//alert("slide_news_"+ref.targetID+"_title")
		var _title=document.getElementById("slide_news_"+ref.targetID+"_title");
		//alert(_title.outerHTML);
		if(_title) {
			//alert(_title.outerHTML);
			titleheight=_title.offsetHeight;
		}
		//alert(titleheight);
		document.getElementById(ref.targetID+"_img").height=ref.imgHeight-titleheight;
	//alert(str);
   	for (i = 0; i < ref.srcs.length; i++) {
   	   gE("s_" + cid + "_led_" + i).onclick = ref.slideTo;
   	}

   	d.style.display = "";
   	try{
	  	clearTimeout(_timer7);
		}catch(err){
		}
		if(ref.autoplay==1)
   		nextAd();
   }
}
function resizeSlide15(id,w,h){
	//alert(w+","+h);
	var slidearea=document.getElementById(id+'_area');
	slidearea.style.width=w+"px";
	slidearea.style.height=h+"px";	
	var slideimg=document.getElementById(id+'_img');
	slideimg.width=w;
	var slidenewstitle=document.getElementById("slide_news_"+id+"_title");
	slideimg.height=h-slidenewstitle.offsetHeight;
}
//第十五种

//第三种
	function PicPlay003(id,w,h,shownum,bg,pp,l){
		var _self=this;
		this._id=id;
		this._pp=new Array();
		this._bgcolor=bg;
		var m=shownum/pp.length;
		if(m>1) m=Math.ceil(m);
		for(var n=0;n<m;n++){
			for(var i=0;i<pp.length;i++){
				this._pp.push(pp[i]);
			}
		}
		this._w=w;
		this._h=h;
		this._shownum=shownum;
		this._l=l;
		this.container=document.getElementById("picplay003_"+_self._id);
		this.autoplay=this.container.getAttribute("autoplay");
		this.autoplaytime=this.container.getAttribute("autoplaytime");
		this.init=function(){
				if(!document.getElementById("picplay003_"+_self._id)) return;//is deleted
				_self.container.style.width=_self._w+"px";
				_self.container.style.height=_self._h+"px";
				_self.container.style.backgroundColor=_self._bgcolor;
				var imgwidth=(_self._w-150)/_self._shownum-3;
				for(var i=1;i<=_self._shownum;i++){
					if(_self._l&&_self._l[i-1]&&document.getElementById("picplay003_tu"+i+"_"+_self._id).parentNode.tagName=="DIV"){
						var a = document.createElement("A");
						a.href=_self._l[i-1];
						document.getElementById("picplay003_tu"+i+"_"+_self._id).parentNode.appendChild(a);
						a.appendChild(document.getElementById("picplay003_tu"+i+"_"+_self._id));
					}
					document.getElementById("picplay003_tu"+i+"_"+_self._id).src=_self._pp[i-1];
					document.getElementById("picplay003_daoying"+i+"_"+_self._id).src=_self._pp[i-1];
					document.getElementById("box003_"+i+"_"+_self._id).style.height=_self._h;
					document.getElementById("box003_"+i+"_"+_self._id).style.width=imgwidth;
					document.getElementById("tu003_"+i+"_"+_self._id).style.height=_self._h/2;
					document.getElementById("tu003_"+i+"_"+_self._id).style.width=imgwidth-2;
					document.getElementById("daoying003_"+i+"_"+_self._id).style.height=_self._h/2;
					document.getElementById("daoying003_"+i+"_"+_self._id).style.width=imgwidth-2;
					document.getElementById("picplay003_tu"+i+"_"+_self._id).style.height=_self._h/2;
					document.getElementById("picplay003_tu"+i+"_"+_self._id).style.width=imgwidth-2;
					document.getElementById("picplay003_daoying"+i+"_"+_self._id).style.height=_self._h/2;
					document.getElementById("picplay003_daoying"+i+"_"+_self._id).style.width=imgwidth-2;
					document.getElementById("picplay003_next_"+_self._id).style.marginTop=(_self._h/2-16)+"px";
					document.getElementById("picplay003_prev_"+_self._id).style.marginTop=(_self._h/2-16)+"px";
				}
				this.focusimg(shownum);
		}
		this.focusimg=function(shownum){
				var i=(shownum+1)/2;
				document.getElementById("tu003_"+i+"_"+_self._id).className="tu003focus";
				document.getElementById("picplay003_daoying"+i+"_"+_self._id).className="daoying003_1focus";
		}
		this.nextImg=function(){
			var first=_self._pp.shift();
			_self._pp.push(first);
			_self.init();
		}
		this.nextScreen=function(){
			for(var i=0;i<_self._shownum;i++){
				setTimeout(function(){
					var first=_self._pp.shift();
					_self._pp.push(first);
					_self.init();
				},100*(i+1));
			}
		}
		this.prevImg=function(){
			var last=_self._pp.pop();
			_self._pp.unshift(last);
			_self.init();
		}
		this.prevScreen=function(){
			for(var i=0;i<_self._shownum;i++){
				setTimeout(function(){
					var last=_self._pp.pop();
					_self._pp.unshift(last);
					_self.init();
				},100*(i+1));
			}
		}
		this.resize=function(w,h){
			_self._w=w;
			_self._h=h;
			_self.init();
		}
		try{
			clearInterval(window["picplay003_timer_"+this._id]);
		}catch(err){
			alert(err);
		}
		if(this.autoplay==1){
			window["picplay003_timer_"+this._id]=this.timer=setInterval(_self.nextImg,_self.autoplaytime);
		}
		this.init();
		//document.getElementById("picplay003_next_"+_self._id).onclick=this.nextImg;
		document.getElementById("picplay003_"+_self._id+"_right2").onclick=this.nextImg;
		//document.getElementById("picplay003_prev_"+_self._id).onclick=this.prevImg;
		document.getElementById("picplay003_"+_self._id+"_left2").onclick=this.prevImg;
		document.getElementById("picplay003_"+_self._id+"_right1").onclick=this.nextScreen;
		document.getElementById("picplay003_"+_self._id+"_left1").onclick=this.prevScreen;
	}
	function resizeSlide3(id,w,h){
		window["picplaycache"][id].resize(w,h);
	}
//第三种
