// 玛丽亚设计师 蓝雨 QQ:921262

//判断IE6
//if(typeof document.body.style.maxHeight === "undefined") {
//	alert('IE6 Detected');
//}


//IE背景缓存
//document.execCommand("BackgroundImageCache",false,true);
  
//增加个判断，自动跳转
var ahost=document.domain			//当前域名
var bhost="3566666.cn"			//默认域名
if(ahost!=bhost){
	var aurl=window.location.href	//当前路径
	var burl=aurl.replace(ahost,bhost)	//默认路径
	window.location.href=burl		//跳转
}

//获取ID
function $(id){return document.getElementById(id);}

//flash显示
function flash(url,w,h){
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'"> ');
document.write('<param name="movie" value="' + url + '">');
document.write('<param name="quality" value="high"> ');
document.write('<param name="wmode" value="transparent"> ');
document.write('<param name="menu" value="false"> ');
document.write('<embed src="' + url + '" quality="high" wmode="transparent" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed> ');
document.write('</object> ');
}

//横幅
function setFocus(ID,t,numstr){//主函数...
function $$(tag,obj){return (typeof obj=='object'?obj:$(obj)).getElementsByTagName(tag);}
var n='';//标记
function showPics(num){
	if(n===num) return true;
	if(n==='') n=0;
	else n=num;
	var pics=$$('ul',ID)[0];
	var tit=$$('div',pics)[num];
	if (!pics.style.left){pics.style.left = 0+'px';}
    if (!tit.style.bottom||parseInt(tit.style.bottom)>-34){tit.style.bottom = -34+'px';}
	var endX=-num*$$('div',ID)[0].clientWidth;
	var goimg=function(){
		X=parseInt(pics.style.left);
		if (pics.movement){clearTimeout(pics.movement);}
		if(parseInt(pics.style.left)==endX) return true;
		if((endX-X)>0) X+=Math.ceil((endX-X) / 10);
		else X+=Math.floor((endX-X) / 10);
		pics.style.left=X+'px';
		pics.movement = setTimeout(goimg, 5);
	}
	var gotit=function(){
		var y=parseInt(tit.style.bottom);
		if (tit.movement){clearTimeout(tit.movement);}
		if(y==0) return true;
		y+=Math.ceil((0-y) / 10);
		if(parseInt(pics.style.left)==endX) tit.style.bottom=y+'px';
		if(y<0) tit.movement = setTimeout(gotit, 16);
	}
	goimg();
	gotit();
}
function classNormal() {//数字标签样式清除
    var focusBtnList = $$('li',$$('ul',ID)[1]);
    for (var i = 0; i < focusBtnList.length; i++) {
        focusBtnList[i].className = '';
    }
}
function focusChange() {//交互切换
    var focusBtnList = $$('li',$$('ul',ID)[1]);
    for (var i = 0; i < focusBtnList.length; i++) {
		focusBtnList[i].I=i;
		focusBtnList[i].onmouseover = function(){
        	showPics(this.I);
        	classNormal();
        	focusBtnList[this.I].className = 'current';
		}
	}
}
var autoFocusChange=function() {//自动运行
    if (atuokey) return;
    var focusBtnList = $$('li',$$('ul',ID)[1]);
    for (var i = 0; i < focusBtnList.length; i++) {
        if (focusBtnList[i].className == 'current') {
            var currentNum = i;
        }
    }
	if(currentNum<focusBtnList.length-1){
		showPics(currentNum+1);
       	classNormal();
       	focusBtnList[currentNum+1].className = 'current';
	}else if(currentNum==focusBtnList.length-1){
		showPics(0);
       	classNormal();
       	focusBtnList[0].className = 'current';
	}
}
var atuokey = '';
function init(){
	var auto
	var ul=$$('ul',ID)[0];
	var li=$$('li',ul);
	var NUM=li.length;
	var wid=$('myloading')?$$('div',ID)[1].clientWidth:$$('div',ID)[0].clientWidth;ul.style.width=wid*NUM+'px';
	for(var i=0;i<NUM;i++){
		var a=li[i].getElementsByTagName('a')[0];
		var img=li[i].getElementsByTagName('img')[0];
		li[i].innerHTML=li[i].innerHTML+'<div><span></span><a href="'+a+'">'+img.alt+'</a></div>';

		//增加FLASH效果,仅全栏时可用,屏蔽掉耗资源
		//if (numstr){
		//var flashstr
		//	flashstr='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="968" height="200"> '
		//	flashstr+='<param name="movie" value="'+imgurl+'/ad/bg/'+(i+1)+'.swf">'
		//	flashstr+='<param name="quality" value="high"> '
		//	flashstr+='<param name="wmode" value="transparent"> '
		//	flashstr+='<param name="menu" value="false"> '
		//	flashstr+='<embed src="'+imgurl+'/ad/bg/'+(i+1)+'.swf" quality="high" wmode="transparent" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="968" height="200"></embed> '
		//	flashstr+='</object>'
		//li[i].innerHTML=li[i].innerHTML+'<div class="flash">'+flashstr+'</div>';
		//}
	}
	var s='<div class="mybtn"><ul>';
	if(numstr==='') numstr=false;
	if (numstr){for(var i=0;i<NUM;i++){s+='<li>'+(i+1)+'</li>'}}else{for(var i=0;i<NUM;i++){s+='<li></li>'}}
	s+='</ul></div>';
	$(ID).innerHTML+=s;
	$(ID).removeChild($('myloading'));
	showPics(0);
    classNormal();
    $$('li',$$('ul',ID)[1])[0].className = 'current';
	$(ID).onmouseover = function() {
        atuokey = true;
		clearInterval(auto);
    }
    $(ID).onmouseout = function() {
        atuokey = false;
		auto=setInterval(autoFocusChange, T);
    }
}
var T=t*1000;//每帧图片停留的时间，1000=1秒
var auto='';
init();
focusChange();
auto=setInterval(autoFocusChange, T);
};

//滚动
function Marquee()
{
	this.ID = document.getElementById(arguments[0]);
	if(!this.ID)
	{
		alert("您要设置的\"" + arguments[0] + "\"初始化错误\r\n请检查标签ID设置是否正确!");
		this.ID = -1;
		return;
	}
	this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
	this.Step = 1;
	this.Timer = 30;
	this.DirectionArray = {"top":0 , "up":0 , "bottom":1 , "down":1 , "left":2 , "right":3};
	if(typeof arguments[1] == "number" || typeof arguments[1] == "string")this.Direction = arguments[1];
	if(typeof arguments[2] == "number")this.Step = arguments[2];
	if(typeof arguments[3] == "number")this.Width = arguments[3];
	if(typeof arguments[4] == "number")this.Height = arguments[4];
	if(typeof arguments[5] == "number")this.Timer = arguments[5];
	if(typeof arguments[6] == "number")this.DelayTime = arguments[6];
	if(typeof arguments[7] == "number")this.WaitTime = arguments[7];
	if(typeof arguments[8] == "number")this.ScrollStep = arguments[8];
	this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
	this.ID.noWrap = true;
	this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1);
	if(arguments.length >= 7)this.Start();
}

Marquee.prototype.Start = function()
{
	if(this.ID == -1)return;
	if(this.WaitTime < 800)this.WaitTime = 800;
	if(this.Timer < 20)this.Timer = 20;
	if(this.Width == 0)this.Width = parseInt(this.ID.style.width);
	if(this.Height == 0)this.Height = parseInt(this.ID.style.height);
	if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()];
	this.HalfWidth = Math.round(this.Width / 2);
	this.HalfHeight = Math.round(this.Height / 2);
	this.BakStep = this.Step;
	this.ID.style.width = this.Width + "px";
	this.ID.style.height = this.Height + "px";
	if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height;
	var templateLeft = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;display:inline;'><tr><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td><td noWrap=true style='white-space: nowrap;word-break:keep-all;'>MSCLASS_TEMP_HTML</td></tr></table>";
	var templateTop = "<table cellspacing='0' cellpadding='0' style='border-collapse:collapse;'><tr><td>MSCLASS_TEMP_HTML</td></tr><tr><td>MSCLASS_TEMP_HTML</td></tr></table>";
	var msobj = this;
	msobj.tempHTML = msobj.ID.innerHTML;
	if(msobj.Direction <= 1)
	{
		msobj.ID.innerHTML = templateTop.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
	}
	else
	{
		if(msobj.ScrollStep == 0 && msobj.DelayTime == 0)
		{
			msobj.ID.innerHTML += msobj.ID.innerHTML;
		}
		else
		{
			msobj.ID.innerHTML = templateLeft.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML);
		}
	}
	var timer = this.Timer;
	var delaytime = this.DelayTime;
	var waittime = this.WaitTime;
	msobj.StartID = function(){msobj.Scroll()}
	msobj.Continue = function()
				{
					if(msobj.MouseOver == 1)
					{
						setTimeout(msobj.Continue,delaytime);
					}
					else
					{	clearInterval(msobj.TimerID);
						msobj.CTL = msobj.Stop = 0;
						msobj.TimerID = setInterval(msobj.StartID,timer);
					}
				}

	msobj.Pause = function()
			{
				msobj.Stop = 1;
				clearInterval(msobj.TimerID);
				setTimeout(msobj.Continue,delaytime);
			}

	msobj.Begin = function()
		{
			msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth / 2 : msobj.ID.scrollHeight / 2;
			if((msobj.Direction <= 1 && msobj.ClientScroll <= msobj.Height + msobj.Step) || (msobj.Direction > 1 && msobj.ClientScroll <= msobj.Width + msobj.Step))			{
				msobj.ID.innerHTML = msobj.tempHTML;
				delete(msobj.tempHTML);
				return;
			}
			delete(msobj.tempHTML);
			msobj.TimerID = setInterval(msobj.StartID,timer);
			if(msobj.ScrollStep < 0)return;
			msobj.ID.onmousemove = function(event)
						{
							if(msobj.ScrollStep == 0 && msobj.Direction > 1)
							{
								var event = event || window.event;
								if(window.event)
								{
									if(msobj.IsNotOpera)
									{
										msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX;
									}
									else
									{
										msobj.ScrollStep = null;
										return;
									}
								}
								else
								{
									msobj.EventLeft = event.layerX - msobj.ID.scrollLeft;
								}
								msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2;
								msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft);
								msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth);
							}
						}
			msobj.ID.onmouseover = function()
						{
							if(msobj.ScrollStep == 0)return;
							msobj.MouseOver = 1;
							clearInterval(msobj.TimerID);
						}
			msobj.ID.onmouseout = function()
						{
							if(msobj.ScrollStep == 0)
							{
								if(msobj.Step == 0)msobj.Step = 1;
								return;
							}
							msobj.MouseOver = 0;
							if(msobj.Stop == 0)
							{
								clearInterval(msobj.TimerID);
								msobj.TimerID = setInterval(msobj.StartID,timer);
							}
						}
		}
	setTimeout(msobj.Begin,waittime);
}

Marquee.prototype.Scroll = function()
{
	switch(this.Direction)
	{
		case 0:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop >= this.ClientScroll)
				{
					this.ID.scrollTop -= this.ClientScroll;
				}
				this.ID.scrollTop += this.Step;
			}
		break;

		case 1:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollTop <= 0)
				{
					this.ID.scrollTop += this.ClientScroll;
				}
				this.ID.scrollTop -= this.Step;
			}
		break;

		case 2:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft >= this.ClientScroll)
				{
					this.ID.scrollLeft -= this.ClientScroll;
				}
				this.ID.scrollLeft += this.Step;
			}
		break;

		case 3:
			this.CTL += this.Step;
			if(this.CTL >= this.ScrollStep && this.DelayTime > 0)
			{
				this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL;
				this.Pause();
				return;
			}
			else
			{
				if(this.ID.scrollLeft <= 0)
				{
					this.ID.scrollLeft += this.ClientScroll;
				}
				this.ID.scrollLeft -= this.Step;
			}
		break;
	}
}

function show_div(obj){$(obj).style.display='block';}

//AJAX
function createxmlhttp()
{
	var xmlhttp;
	try
	{
		xmlhttp = new ActiveXObject('Msxml2.XMLHTTP');//IE5.5+
	}
	catch (e)
	{
		xmlhttp = new XMLHttpRequest();//FF等其它浏览器
	}
	return xmlhttp;
} 

//预约
function yuyue()
{
	//定义
	var xm	= $( "yuyue_xm" ).value;
	var xb	= $( "yuyue_xb" ).value;
	var nl	= $( "yuyue_nl").value;
	var dz1	= $( "yuyue_dz1").value;
	var dz2	= $( "yuyue_dz2").value;
	var st	= $( "yuyue_st").value;
	var gh	= $( "yuyue_gh").value;
	var ks	= $( "yuyue_ks").value;
	var sj	= $( "yuyue_sj").value;
	var bz	= $( "yuyue_bz").value;
	var msg	= $( "yuyue_msg" );
		
		//锁定提交按钮
		$('yuyue_submit').disabled=true;
		//显示提示框
		show_div("yuyue_msg");
		//显示内容
		msg.innerHTML="<img src='http://dll.3566666.cn/images/loadingx.gif'>请等待，数据提交中...";

	//提交
	var url="/plus/yuyue/save.asp",post="xm="+escape(xm)+"&xb="+xb+"&nl="+nl+"&dz1="+escape(dz1)+"&dz2="+escape(dz2)+"&st="+st+"&gh="+gh+"&ks="+escape(ks)+"&sj="+sj+"&bz="+escape(bz)

	//AJAX处理
	var xmlhttp=new createxmlhttp();
		xmlhttp.open("POST",url,true);
		xmlhttp.setRequestHeader("Cache-Control","no-cache");
		xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
		xmlhttp.onreadystatechange=function (){
		if(xmlhttp.readyState==4&&xmlhttp.status==200){
			var vback=xmlhttp.responseText.split('|');
			if(vback[1]=='False')
			{
				//光标移动错误的输入框并解锁提交按钮
				if(vback[0]!='ok'){$(vback[0]).focus();$('yuyue_submit').disabled=false;}
				msg.innerHTML=vback[2];	
					
			}else{
				msg.innerHTML=vback[2];
			}
			//注销
			xmlhttp=null;
		}
	}
	xmlhttp.send(post);
}

//底部不动咨询
//document.writeln("<style>");
//document.writeln("#fdc{z-index:100;width:127px; height:151px; position:fixed; right:0; bottom:0;}");
//document.writeln("<\/style>");
//document.writeln("<!--[if lte IE 6]>");
//document.writeln("<script type=\"text\/javascript\">");
//document.writeln("if(typeof document.compatMode!=\'undefined\'&&document.compatMode!=\'BackCompat\'){");
//document.writeln("    cot_t1_DOCtp=\"top:expression(document.documentElement.scrollTop+document.documentElement.clientHeight-this.clientHeight+0.00001);left:expression(document.documentElement.scrollLeft + document.documentElement.clientWidth - offsetWidth);}\";");
//document.writeln("}else{");
//document.writeln("    cot_t1_DOCtp=\"top:expression(document.body.scrollTop+document.body.clientHeight-this.clientHeight-150);left:expression(document.body.scrollLeft + document.body.clientWidth - offsetWidth);}\";");
//document.writeln("}");
//document.writeln("var fdc_bodyCSS=\'* html {background:url(\"http:\/\/images.3566666.cn\/images\/none.gif\") fixed;}\';");
//document.writeln("var fdcCSS=\'#fdc {position:fixed;\';");
//document.writeln("var fdcCSS=fdcCSS+\'_position:absolute;\';");
//document.writeln("var fdcCSS=fdcCSS+cot_t1_DOCtp;");
//document.writeln("document.write(\'<style type=\"text\/css\">\'+fdc_bodyCSS+fdcCSS+\'<\/style>\');");
//document.writeln("<\/script>");
//document.writeln("<![endif]-->");
//document.writeln("<div id=\"fdc\"> ");
//document.writeln("<a href=\"http:/\/\qiao.baidu.com/\?module=default&controller=webim&action=index&siteid=206015&style=common5&groupid=0&groupname=%E7%8E%9B%E4%B8%BD%E4%BA%9A%E5%AE%A2%E6%9C%8D\" target=\"_blank\"><img src=\"http:\/\/images.3566666.cn\/images\/kf.jpg\" \/><\/a>");
//document.writeln("<\/div>")

//统计显示
function online(){
	var url='/?online&n='+Math.random();	
	var xmlhttp =new createxmlhttp();
	xmlhttp.open("GET",url,true)
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState==4&&xmlhttp.status==200){
			try{
				$("lanyu_online").innerHTML=xmlhttp.responseText;
				}
			catch(e){};
			xmlhttp=null;
			window.setTimeout("online()",1000);
		}
	};
	xmlhttp.send(null); 	
}

function preview() { 
	var bdhtml=window.document.body.innerHTML; 
	var sprnstr="<!--startprint-->"; 
	var eprnstr="<!--endprint-->"; 
	var prnhtml
		prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); 
		prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); 
		//修饰下，重复添加是怕重复点击错误
		prnhtml=prnhtml+"<style>.print{margin:5px 0 20px 0;font-size:14px;width:633px;line-height:150%;text-indent:2em;padding:6px;}h5{width:633px;margin-top:20px;}img{padding:2px;border:1px solid #ddd;margin:0 10px 10px 0;}.printa{display:none;}</style>"; 
	window.document.body.innerHTML=prnhtml+"\r\n原文地址："+location.href; 
	window.print(); 
}


window.setTimeout("online()",1000);