﻿// JScript 文件

function $($id)
{
	return document.getElementById($id);
}

function getCurrentStyle (obj, prop)
{
    if (obj.currentStyle)
    {
        return obj.currentStyle[prop];
    }
    else if (window.getComputedStyle)
    {
        prop = prop.replace (/([A-Z])/g, "-$1");
        prop = prop.toLowerCase ();
        return window.getComputedStyle (obj, "").getPropertyValue(prop);
    }
    return null;
}



function initLocation()
{
	var loginNode=$('currcontent');
	var t=getCurrentStyle (loginNode, "top");
	var h=loginNode.offsetHeight;
	t=parseInt(t.substring(0,t.length-2));
	var y=parseInt(t+h+30);
	document.getElementById("linkhref").style.top=y+'px';
	document.getElementById("currlink").style.top=y+13+'px';
	loginNode=$('currlink');
	h=loginNode.offsetHeight;
	if(h<20) document.getElementById("linkhref").style.display="none";
	y=parseInt(h+y+20);
	document.getElementById("article_close").style.top=y+'px';
	document.getElementById("divall_page").style.height=y+55+'px';
	document.getElementById("divhj_mid").style.height=y+60+'px';
	document.getElementById("divhj_down").style.top=y+110+'px';
	document.getElementById("divall_bottom").style.top=y+200+'px';
	document.getElementById("divall").style.height=y+300+'px';
}

function bottomtext()
{
    document.write('CopyRight(C) 2005 福鼎市太姥山风景名胜区管委会.版权所有  闽ICP备08009877号<br />');
    document.write('技术支持: <a target="_blank" href="http://www.nanyuansoft.com">泉州市南元软件有限公司</a><br />');
    document.write('电话：0593-7856777 E-mail:web@taimushan.gov.cn');
	document.writeln('<script type="text\/javascript" src="http:\/\/s127.cnzz.com\/stat.php?id=1070361&amp;web_id=1070361&amp;show=pic" charset="gb2312"><\/scr'+'ipt>');
}

function bottomtexten()
{
    document.write('CopyRight(C) 2008 Mt.Taimu Scenic Area Management Committee<br />');
    document.write('<a target="_blank" href="http://www.nanyuansoft.com">all rights reseverd design by NanYuanSoft</a>');
	document.writeln('<script type="text\/javascript" src="http:\/\/s127.cnzz.com\/stat.php?id=1070361&amp;web_id=1070361&amp;show=pic" charset="gb2312"><\/scr'+'ipt>');
}

function LeftFls()
{
    document.write("<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='390px' height='730'>");
    document.write("<param name='movie' value='../img3/left.swf' />");
    document.write("<param name='wmode' value='transparent' />");
    document.write("<param name='quality' value='high' />");
    document.write("<embed src='../img3/left.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='390px' height='730'></embed>");
    document.write("</object>");
}

function LeftenFls()
{
    document.write("<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='390px' height='730'>");
    document.write("<param name='movie' value='../img3/enleft.swf' />");
    document.write("<param name='wmode' value='transparent' />");
    document.write("<param name='quality' value='high' />");
    document.write("<embed src='../img3/enleft.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='390px' height='730'></embed>");
    document.write("</object>");
}

function TopFls()
{
    document.write("<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='609' height='95'>");
    document.write("<param name='movie' value='img3/menu.swf' />");
    document.write("<param name='wmode' value='transparent' />");
    document.write("<param name='quality' value='high' />");
    document.write("<embed src='img3/menu.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='609' height='95'></embed>");
    document.write("</object>");
}

function TopFls1()
{
    document.write("<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='609' height='95'>");
    document.write("<param name='movie' value='../img3/menu1.swf' />");
    document.write("<param name='wmode' value='transparent' />");
    document.write("<param name='quality' value='high' />");
    document.write("<embed src='../img3/menu1.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='609' height='95'></embed>");
    document.write("</object>");
}

function TopenFls()
{
    document.write("<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='609' height='95'>");
    document.write("<param name='movie' value='../img3/enmenu.swf' />");
    document.write("<param name='wmode' value='transparent' />");
    document.write("<param name='quality' value='high' />");
    document.write("<embed src='../img3/enmenu.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='609' height='95'></embed>");
    document.write("</object>");
}

function RightMenu()
{
    document.write("<TABLE style='height:575px;' cellSpacing=0 cellPadding=0 border=0>");
    document.write("<tr><TD align='center'><A href='../en/tmsjj.html' target='_self'><IMG style='CURSOR: hand'  alt='' src='../enimg/s1_1.gif' width=150 border=0></A></TD></tr>");
    document.write("<tr><TD align=center><A href='../en/dzgyyl.html' target='_self'><IMG style='CURSOR: hand'   alt='' src='../enimg/s1_2.gif' width=150 border=0></A></TD></tr>");
    document.write("<tr><TD align=center><A href='../en/dzyhs.html' target='_self'><IMG style='CURSOR: hand' alt='' src='../enimg/s1_3.gif' width=150 border=0></A></TD></tr>");
    document.write("<tr><TD align=center><A href='../en/cjgmj.html' target='_self'><IMG style='CURSOR: hand' alt='' src='../enimg/s1_4.gif' width=150 border=0></A></TD></tr>");
    document.write("<tr><TD align=center><A href='../en/hadj.html' target='_self'><IMG style='CURSOR: hand'  alt='' src='../enimg/s1_5.gif' width=150 border=0></A></TD></tr>");

	document.write("<tr><TD align=center><A href='../en/hgyzgxjdsd.html' target='_self'><IMG style='CURSOR: hand' alt=''  src='../enimg/s1_6.gif' width=150  border=0></A></TD></tr>");
    document.write("<tr><TD align=center><A href='../en/qlpb.html'  target='_self'><IMG style='CURSOR: hand'  alt='' src='../enimg/s1_7.gif' width=150 border=0></A></TD></tr>");
    document.write("<tr><TD align=center><A href=''  target='_self'><IMG style='CURSOR: hand' alt=''  src='../enimg/s1_8.gif' width=150  border=0></A></TD></tr>");
    document.write("<tr><TD align=center><A href='' target='_self'><IMG style='CURSOR: hand' alt='' src='../enimg/s1_9.gif' width=150 border='0'></A></TD></tr>");
    
    document.write("<tr><TD align=center><A href='' target='_self'><IMG style='CURSOR: hand'  alt='' src='../enimg/s2_1.gif' width=150 border='0'></A></TD></tr>");
    document.write("<tr><TD align=center><A href='' target='_self'><IMG style='CURSOR: hand'  alt='' src='../enimg/s2_2.gif' width=150' border='0'></A></TD></tr>");
    document.write("<tr><TD align=center><A href='' target='_self'><IMG style='CURSOR: hand'  alt='' src='../enimg/s2_3.gif' width=150 border='0'></A></TD></tr>");
    document.write("<tr><TD align=center><A href='' target='_self'><IMG style='CURSOR: hand'  alt='' src='../enimg/s2_4.gif' width='150' border='0'></A></TD></tr>");
    document.write("<tr><TD align=center><A href='' target='_self'><IMG style='CURSOR: hand'  alt='' src='../enimg/s2_5.gif' width='150' border='0'></A></TD></tr>");
    document.write("<tr><TD align=center><A href='' target='_self'><IMG style='CURSOR: hand'  alt='' src='../enimg/s2_6.gif' width='150' border='0'></A></TD></tr>");
    document.write("</TABLE>");
}

function UserMenu()
{
    document.write("<table border='0'>");
    document.write("<tr><td class='tdtitle'>用户控制面板</td></tr>");
    document.write("<tr><td><a href='./User_Edit.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />修改个人信息</a></td></tr>");
    document.write("<tr><td><a href='./UserPWS_Edit.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />修改密码</a></td></tr>");
    document.write("<tr><td><a href='./Logout.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />退出登录</a></td></tr>");
    if(document.getElementById("hidMemType").value=="普通游客")
    {
        document.write("<tr><td class='tdtitle'>订单管理</td></tr>");
        document.write("<tr><td><a href='./Order_Query.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />订单查询</a></td></tr>");
        document.write("<tr><td class='tdtitle'>我要预订</td></tr>");
        document.write("<tr><td><a href='../netorder/comm_index.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />商品预订</a></td></tr>");
        document.write("<tr><td><a href='../netorder/hotel_index.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />酒店预订</a></td></tr>");
        document.write("<tr><td><a href='../netorder/line_index.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />线路预订</a></td></tr>");
        document.write("<tr><td><a href='../netorder/ticket_index.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />门票预订</a></td></tr>");
        document.write("<tr><td><a href='../netorder/repast_index.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />餐饮预订</a></td></tr>");
        document.write("<tr><td><a href='../netorder/travel_index.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />地接预订</a></td></tr>");
    }
    else if(document.getElementById("hidMemType").value=="酒店")
    {
        document.write("<tr><td class='tdtitle'>业务管理</td></tr>");
        document.write("<tr><td><a href='./SupplyInfo_List.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />商家信息发布</a></td></tr>");
        document.write("<tr><td><a href='./Hotel_List.aspx' target='_blank'><img src='../images/lipoint.gif' alt='' />产品信息发布</a></td></tr>");
        document.write("<tr><td><a href='./Order_Query1.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />订单查询</a></td></tr>");
    }
    else if(document.getElementById("hidMemType").value=="旅行社")
    {
        document.write("<tr><td class='tdtitle'>业务管理</td></tr>");
        document.write("<tr><td><a href='./SupplyInfo_List.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />商家信息发布</a></td></tr>");
        document.write("<tr><td><a href='./Line_List.aspx' target='_blank'><img src='../images/lipoint.gif' alt='' />产品信息发布</a></td></tr>");
        document.write("<tr><td><a href='./Order_Query1.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />订单查询</a></td></tr>");
    }
    else if(document.getElementById("hidMemType").value=="餐馆")
    {
        document.write("<tr><td class='tdtitle'>业务管理</td></tr>");
        document.write("<tr><td><a href='./SupplyInfo_List.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />商家信息发布</a></td></tr>");
        document.write("<tr><td><a href='./Repast_List.aspx' target='_blank'><img src='../images/lipoint.gif' alt='' />产品信息发布</a></td></tr>");
        document.write("<tr><td><a href='./Order_Query1.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />订单查询</a></td></tr>");
    }
    else if(document.getElementById("hidMemType").value=="旅游超市")
    {
        document.write("<tr><td class='tdtitle'>业务管理</td></tr>");
        document.write("<tr><td><a href='./SupplyInfo_List.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />商家信息发布</a></td></tr>");
        document.write("<tr><td><a href='./Goods_List.aspx' target='_blank'><img src='../images/lipoint.gif' alt='' />产品信息发布</a></td></tr>");
        document.write("<tr><td><a href='./Order_Query1.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />订单查询</a></td></tr>");
    }
    else if(document.getElementById("hidMemType").value=="景区")
    {
        document.write("<tr><td class='tdtitle'>业务管理</td></tr>");
        document.write("<tr><td><a href='./SupplyInfo_List.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />商家信息发布</a></td></tr>");
        document.write("<tr><td><a href='./Ticket_List.aspx' target='_blank'><img src='../images/lipoint.gif' alt='' />产品信息发布</a></td></tr>");
        document.write("<tr><td><a href='./Order_Query1.aspx' target='_self'><img src='../images/lipoint.gif' alt='' />订单查询</a></td></tr>");
    }
    document.write("</table>");
}

//title effect
var sPop = null;
document.write("<style type='text/css'>");
document.write(".PopText { font-family: Tahoma, 宋体; color: #3B676E; background-color: #ffffff; border: 1px #663300 solid; font-size: 12px; line-height: 20px; padding: 0px 10px 0px 10px; visibility: hidden; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='popLayer' style='position:absolute;z-index:1000;filter:revealtrans(duration=.5,transition=12) revealTrans(duration=.5,transition=12) alpha(opacity=90,enabled=100)' class='PopText'></div>");

function showPopupText() {
	var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!="") { o.pop=o.alt;o.alt="" }
        if(o.title!=null && o.title!=""){ o.pop=o.title;o.title="" } 
		if(o.pop) { 
			o.pop=o.pop.replace("\n","<br>"); 
		    o.pop=o.pop.replace("\n","<br>");	
					}
	if(o.pop!=sPop) {
		sPop=o.pop;
		if(sPop==null || sPop=="") {
			popLayer.filters[0].apply();
			popLayer.style.visibility="hidden";	
			popLayer.filters[0].play();
			popLayer.style.width=""
		} else {
			if(o.dyclass!=null) popStyle=o.dyclass 
			else popStyle="PopText";
             
			popLayer.filters[1].apply();
			popLayer.style.visibility="visible";
			popLayer.filters[1].play();
			showIt();
			if (popLayer.offsetWidth>500)
			{
				popLayer.style.width=500
			}
		}
	}
}

function showIt() {
//	MouseX=event.x;
//	MouseY=event.y;
	popLayer.className=popStyle;
	popLayer.innerHTML=sPop;

	popWidth=popLayer.clientWidth;
	popHeight=popLayer.clientHeight;
	if(event.clientX+12+popWidth>document.body.clientWidth)
	    //popLeftAdjust=-(event.clientX+12+popWidth-document.body.clientWidth);
	    popLeftAdjust=-popWidth-24
	else 
	    popLeftAdjust=0;
	if(event.clientY+12+popHeight>document.body.clientHeight) 
	    //popTopAdjust=-(event.clientY+12+popHeight-document.body.clientHeight);
	    popTopAdjust=-popHeight-24
	else 
	    popTopAdjust=0;
	    
	var scrollPostop; 
	var scrollPosleft;
    if (typeof window.pageYOffset != 'undefined') { 
       scrollPostop = window.pageYOffset; 
       scrollPosleft= window.pageXOffset; 
    } 
    else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { 
       scrollPostop = document.documentElement.scrollTop;
       scrollPosleft = document.documentElement.scrollLeft; 
    } 
    else if (typeof document.body != 'undefined') { 
       scrollPostop = document.body.scrollTop;
       scrollPosleft = document.body.scrollLeft;
    }
	popLayer.style.left=event.clientX+12+scrollPosleft+popLeftAdjust;
	popLayer.style.top=event.clientY+12+scrollPostop+popTopAdjust;
}
//title effect

//link effect
var rate = 20;
var obj;
var act = 0;
var elmH = 0;
var elmS = 128;
var elmV = 255;
var clrOrg;
var TimerID;
if (navigator.appName.indexOf("Microsoft",0) != -1 && parseInt(navigator.appVersion) >= 4) {
	Browser = true;
} else {
	Browser = false;
}
function doRainbow(){
	if (Browser && act != 1) {
		act = 1;
		obj = event.srcElement;
		clrOrg = obj.style.color;
		TimerID = setInterval("ChangeColor()",100);
	}
}
function stopRainbow(){
	if (Browser && act != 0) {
		obj.style.color = clrOrg;
		clearInterval(TimerID);
		act = 0;
	}
}
function doRainbowAnchor(){
if (Browser && act != 1) {
	obj = event.srcElement;
	while (obj.tagName != 'A' && obj.tagName != 'BODY') {
		obj = obj.parentElement;
		if (obj.tagName == 'A' || obj.tagName == 'BODY')
			break;
		}
		if (obj.tagName == 'A' && obj.href != '') {
			act = 1;
			clrOrg = obj.style.color;
			TimerID = setInterval("ChangeColor()",100);
		}
	}
}
function stopRainbowAnchor(){
	if (Browser && act != 0) {
		if (obj.tagName == 'A') {
			obj.style.color = clrOrg;
			clearInterval(TimerID);
			act = 0;
		}
	}
}
function ChangeColor(){
	obj.style.color = makeColor();
}
function makeColor(){
	if (elmS == 0) {
		elmR = elmV; elmG = elmV; elmB = elmV;
	} else {
		t1 = elmV;
		t2 = (255 - elmS) * elmV / 255;
		t3 = elmH % 60;
		t3 = (t1 - t2) * t3 / 60;
		if (elmH < 60) {
			elmR = t1; elmB = t2; elmG = t2 + t3;
		} else if (elmH < 120) {
			elmG = t1; elmB = t2; elmR = t1 - t3;
		} else if (elmH < 180) {
			elmG = t1; elmR = t2; elmB = t2 + t3;
		} else if (elmH < 240) {
			elmB = t1; elmR = t2; elmG = t1 - t3;
		} else if (elmH < 300) {
			elmB = t1; elmG = t2; elmR = t2 + t3;
		} else if (elmH < 360) {
			elmR = t1; elmG = t2; elmB = t1 - t3;
		} else {
			elmR = 0; elmG = 0; elmB = 0;
		}
	}
	elmR = Math.floor(elmR);
	elmG = Math.floor(elmG);
	elmB = Math.floor(elmB);
	clrRGB = '#' + elmR.toString(16) + elmG.toString(16) + elmB.toString(16);
	elmH = elmH + rate;
	if (elmH >= 360)elmH = 0;
	return clrRGB;
}

function isAllAnswered(fm){
var chked
var allChked=true
	for (i=1;i<=28;i++){
		chked=false
		for (j=0;j<eval(fm.name+'.ques'+i+'.length');j++){
			if (eval(fm.name+'.ques'+i+'[j].checked==true')){
				chked=true
				break;
			}
		}
		if (chked==false){
			allChked=false
			return false
		}
	}
	return true
}

function goanstr(){
var v=0;
var r = new Array();

for(j=0;j<4;j++)
{
    for(i=1;i<8;i++)
    {
        if(eval('test.ques'+(j*7+i)+'[0].checked'))
        v++;
    }
    if (v>=4)
        r[j] = true;
    else
        r[j] = false;
    v=0;
}

var max = r[0]*1+r[1]*2+r[2]*4+r[3]*8;
var sURL=''
var sMaxAnswer='';
	switch (max){
         case 0: sMaxAnswer='26';break;
	case 1: sMaxAnswer='28';break;
	case 2: sMaxAnswer='15';break;
	case 3: sMaxAnswer='17';break;
	case 4: sMaxAnswer='25';break;
	case 5: sMaxAnswer='27';break;
	case 6: sMaxAnswer='09';break;
	case 7: sMaxAnswer='11';break;
	case 8: sMaxAnswer='22';break;
	case 9: sMaxAnswer='24';break;
	case 10: sMaxAnswer='16';break;
	case 11: sMaxAnswer='19';break;
	case 12: sMaxAnswer='20';break;
	case 13: sMaxAnswer='23';break;
	case 14: sMaxAnswer='10';break;
	case 15: sMaxAnswer='13';break;

	}
	teskOK='LoveTestOk.asp?testc='+sMaxAnswer;

	window.location='LoveTestOk.asp?testc='+sMaxAnswer;
	

}

function mark(fm){
	if (isAllAnswered(fm)){
		
		goanstr()
	}else{
		alert('提示：请检查是否有题目还没有填完。')
	}
}
function viewntwo(e,f){
e.style.display='none';
f.style.display='';
}


//link effect
document.onmouseover = effect;
function effect(){
	//doRainbowAnchor();
	showPopupText();
}
//document.onmouseout = stopRainbowAnchor;

//播放视频
//地址,宽度,高度,是否自动播放,是否可人为控制,是否启用上下文菜单,窗口模式
//0为否，-1为是
//窗口模式(Full显示全部;mini最简化;None不显示播放控制,只显示视频窗口;invisible全部不显示)

function getPlayer1(url,w,h,s,e,m,mode){
return '<object id="player" width="'+w+'" height="'+h+'" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"><param NAME="AutoStart" VALUE="-1"><param NAME="Balance" VALUE="-1"><param name="enabled" value="'+e+'"><param NAME="EnableContextMenu" VALUE="'+m+'"><param NAME="url" VALUE="'+url+'"><param NAME="PlayCount" VALUE="1"><param name="rate" value="1"><param name="currentPosition" value="0"><param name="currentMarker" value="0"><param name="defaultFrame" value=""><param name="invokeURLs" value="0"><param name="baseURL" value=""><param name="stretchToFit" value="-1"><param name="volume" value="50"><param name="mute" value="0"><param name="uiMode" value="'+mode+'"><param name="windowlessVideo" value="0"><param name="fullScreen" value="0"><param name="enableErrorDialogs" value="-1"></object>';	
}

function getPlayer(url,w,h,s,e,m,mode)
{
    return "<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='400' height='340'><param name='movie' value='"+url+"' /><param name='wmode' value='transparent' /><param name='quality' value='high' /><embed src='"+url+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='400' height='340'></embed></object>";
}