var sh;var sh1;marqueesWidth=410;preLeft=0;currentLeft=0;stopscroll=false;getlimit=0;preTop=0;currentTop=0;preLeft1=0;currentLeft1=0;stopscroll1=false;getlimit1=0;preTop1=0;currentTop1=0;
function scrollLeft(){preLeft=marquees.scrollLeft;marquees.scrollLeft+=110;if(preLeft==marquees.scrollLeft){marquees.scrollLeft=templayer.offsetWidth-marqueesWidth+1;}}
function scrollLeft1(){preLeft1=marquees1.scrollLeft;marquees1.scrollLeft+=110;if(preLeft1==marquees1.scrollLeft){marquees1.scrollLeft=templayer.offsetWidth-marqueesWidth+1;}}
function scrollRight(){preLeft=marquees.scrollLeft;marquees.scrollLeft-=110;if(preLeft==marquees.scrollLeft){if(!getlimit){marquees.scrollLeft=templayer.offsetWidth*2;getlimit=marquees.scrollLeft;}marquees.scrollLeft-=1;}}
function scrollRight1(){preLeft1=marquees1.scrollLeft;marquees1.scrollLeft-=110;if(preLeft1==marquees1.scrollLeft){if(!getlimit1){marquees1.scrollLeft=templayer.offsetWidth*2;getlimit1=marquees1.scrollLeft;}marquees1.scrollLeft-=1;}}
function Left(){scrollLeft();}
function Right(){scrollRight();}
function Left1(){scrollLeft1();}
function Right1(){scrollRight1();}
function StopScroll(){stopscroll=true;clearInterval(sh);}
function StopScroll1(){stopscroll1=true;clearInterval(sh1);}
function SelectType(value){document.getElementById("sendForm").page.value=1;document.getElementById("sendForm").type.value=value;document.getElementById("sendForm").submit();}
function init(){with(document.getElementById(marquees)){style.height=130;style.width=marqueesWidth;style.overflowX="hidden";style.overflowY="visible";style.align="center";noWrap=true;}}
function getTotalHeight(){if($.browser.msie){return document.compatMode == "CSS1Compat"? document.documentElement.clientHeight :document.body.clientHeight;}else{return self.innerHeight;}}
function getTotalWidth (){if($.browser.msie){return document.compatMode == "CSS1Compat"? document.documentElement.clientWidth :document.body.clientWidth;}else{return self.innerWidth;}}        
$(document).ready(function(){
	    //$('#topBannerBao').css('top',(getTotalHeight()-$('#topBannerBao').height()) / 2);   //置于窗口正中间
	   // $('#topBannerBao').css('top',$('.main').eq(0).offset().top).slideDown(1000);        //拉窗帘效果展出
		//$('#closeSpan').click(function(){$('#topBannerBao').slideUp(1000);});});            //拉窗帘效果回退
		$('#topBannerBao').css({'top':$('.main').eq(0).offset().top}).animate({height:$('#topBannerBao').height(),opacity:'show'},1000);
		//$('#topBanner span').attr({'name':'map'}).html('<map name="Map"><area shape="rect" coords="0,0,474,1000" href="http://mag.cdiku.com/vip/index.html"><area shape="rect" coords="964,973,442,450" href="关闭事件"></map>').css({'position':'absolute','right':(getTotalWidth()-$('#topBannerBao a img').eq(0).width()) / 2 + 20}).click(function(){$('#topBannerBao').animate({height:0,opacity:'hide'},1000);});
		//$('#topBanner').attr({'name':'map'}).click(function(){$('#topBannerBao').animate({height:0,opacity:'hide'},1000);});
		$('#close').click(function(){$('#topBannerBao').animate({height:0,opacity:'hide'},1000);});
		//$('#topBanner span').css({'position':'relative','right':'20px','bottom':'20px'}).attr({'z-index':'10'}).click(function(){$('#topBannerBao').animate({height:0,opacity:'hide'},1000);});
		setTimeout("$('#close').click();",60000);
		//alert('整个页面区域的宽度为:'+getTotalWidth()+'px\r\n图片的宽度为:'+$('#topBannerBao a img').eq(0).width()+'px\r\n所以图片的right为：('+(getTotalWidth()+'-'+$('#topBannerBao a img').eq(0).width())+') / 2 = '+(getTotalWidth()-$('#topBannerBao a img').eq(0).width()) / 2+'px\r\n由此得出结论：关闭按钮的right应为:'+(getTotalWidth()-$('#topBannerBao a img').eq(0).width()) / 2+' + 20 = '+((getTotalWidth()-$('#topBannerBao a img').eq(0).width()) / 2 + 20)+'px');
//		$(document).resize(function(){alert(123);
//       $('#topBanner span').css({'right':(getTotalWidth()-$('#topBannerBao a img').eq(0).width()) / 2 + 20});
//     }); 
		});