// JavaScript Document
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

var tc;
window.onload=function(){
	var o=document.getElementById('infozone');hscroll(o);
	window.setInterval(function(){window.clearTimeout(tc);o.firstChild.style.marginLeft='0px';scrollup(o,20,0);},2800);
}

function scrollup(o,d,c){
	if(d==c){
		var t=o.firstChild.cloneNode(true);
		o.removeChild(o.firstChild);o.appendChild(t);
		t.style.marginTop=o.firstChild.style.marginTop='0px';
		hscroll(o);
	}
	else{
		ch=false;var s=3,c=c+s,l=(c>=d?c-d:0);
		o.firstChild.style.marginTop=-c+l+'px';
		window.setTimeout(function(){scrollup(o,d,c-l)},50);
	}
}

function hscroll(o){
	var w1=o.firstChild.offsetWidth,w2=o.offsetWidth;
	if(w1<=w2)return;
	tc=window.setTimeout(function(){hs(o,w1-w2,0,w1-w2)},3500);
}

function hs(o,d,c,p){
	c++;var t=(c>0?-c:c);o.firstChild.style.marginLeft=t+'px';
	if(c==d){if(d==0){tc=window.setTimeout(function(){hs(o,p,0,p)},2500);}else tc=window.setTimeout(function(){hs(o,0,-p,p)},3500);}
	else tc=window.setTimeout(function(){hs(o,d,c,p)},5);
}

/*
参数介绍：
ctupdz:广告的地址，图片或flash
cwidth:广告的宽度
cheight:广告的高度
curl:图片广告的链接
功能介绍:
此函数主要用于广告处理，分析广告地址，如果是图片就以图片的方式显示，如果是flash就以flash的方式显示。
*/
var ggdz="";
var ggurl="";
var ggwd=0;
var gght=0;
var ctupdz="";
var cwidth=0;
var cheight=0;
var curl="";
function ReadGuanggao(ctupdz,cwidth,cheight,curl){
	var cfname=ctupdz;
	var cfExt = cfname.substring(cfname.length - 4, cfname.length) ;
	cfExt = cfExt.toLowerCase() ;
	if ((cfExt != ".jpg") && (cfExt != ".gif")){
		document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=7,0,19,0\" width=\""+cwidth+"\" height=\""+cheight+"\">");
		document.writeln("  <param name=\"movie\" value=\""+ctupdz+"\" \/>");
		document.writeln("  <param name=\"quality\" value=\"high\" \/>");
		document.writeln("  <embed src=\""+ctupdz+"\" quality=\"high\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" type=\"application\/x-shockwave-flash\" width=\""+cwidth+"\" height=\""+cheight+"\"><\/embed>");
		document.writeln("<\/object>");
	}else{
		document.writeln("<a href=\""+curl+"\" target=\"_blank\"><img src=\""+ctupdz+"\" width=\""+cwidth+"\" height=\""+cheight+"\" border=\"0\" \/><\/a>");
	}
} 
 
 
 
