﻿// JScript 文件
//首页轮番切换广告

//imgUrl1 = "adimg/2011/zwmc/305.jpg";
//imgtext1 = "第十二届中国·慈溪 中外名车展览会"
//imgLink1 = escape("http://www.mcixi.com/adimg/2011/zwmc/index.html");

//imgUrl2 = "images/index/bbbb.jpg";
//imgtext2 = "百年经典杰出人像摄影作品网络评选大赛"
//imgLink2 = escape("http://cx001.yingshow.com.cn/");

//imgUrl3 = "images/index/gd3.jpg";
//imgtext3 = "心怡会所，(足浴、按摩、保健)"
//imgLink3 = escape("#");

//imgUrl4 = "adv-img/cct.jpg";
//imgtext4 = "广告招租"
//imgLink4 = escape("#");

//imgUrl5 = "adv-img/phone5.jpg";
//imgtext5 = "广告招租"
//imgLink5 = escape("#");

// var focus_width = 366
// var focus_height = 200
// var text_height = 0
// var swf_height = focus_height+text_height
// 
// var pics = imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
// var links = imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
// var texts = imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
// 
// document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
// document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="adv-js/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">');
// document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
// document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
// document.write('</object>');



$(function(){
	var picX = 0;
	var interval;
	len  = $(".num > li").length;
	$(".num li").mouseover(function(){
		picX  =   $(".num li").index(this);
		showpic(picX);
	}).eq(0).mouseover();
	$('.slider').hover(function(){
		clearInterval(interval);
	}
	,function(){
		interval = setInterval(function(){
			picX++;
			if(picX==len){
				picX=0;
			}
			showpic(picX);
		}
		,4000);
	}).trigger("mouseleave");
});

function showpic(sipicX){
	$(".slider li").css("display","none");
	$("#slpic"+sipicX).css("display","block");
	$(".num li").removeClass("on");
	$("#mu"+sipicX).addClass("on");
}
