﻿// JavaScript Document
var menu=7;
var zmenu=15;
var smenu=15;
function dk(i)
{
	
   for(u=1;u<=menu;u++)
   {
       if(i==u)
	  {

	      if(document.getElementById("lmenu"+u).style.display=="")
		  {
		   document.getElementById("lmenu"+u).style.display="none";
		  }
		  else
		  {
	       document.getElementById("lmenu"+u).style.display="";
		  }
	  }
	  else
	  { 

		document.getElementById("lmenu"+u).style.display="none";
	  }
   }
}
function dks(i)
{
	

   for(h=1;h<=smenu;h++)
   {

      if(i==h)
	  {

	     if(document.getElementById("s"+h).style.display=="")
		  {

			document.getElementById("skg"+h).src="images/290.files/j.gif";
		   document.getElementById("s"+h).style.display="none";
		  }
		  else
		  {
			document.getElementById("skg"+h).src="images/290.files/j1.gif";
	       document.getElementById("s"+h).style.display="";
		  }
	  }
	  else
	 {  		

		document.getElementById("s"+h).style.display="none"
		document.getElementById("skg"+h).src="images/290.files/j.gif";
	 }
	 
   }
}



function dkz(i)
{

	
   for(p=1;p<=zmenu;p++)
   {
      if(i==p)
	  {
		
	     if(document.getElementById("z"+p).style.display=="")
		  {
			document.getElementById("kg"+p).src="images/290.files/j.gif";
		   document.getElementById("z"+p).style.display="none";
		  }
		  else
		  {
		
			document.getElementById("kg"+p).src="images/290.files/j1.gif";
	       document.getElementById("z"+p).style.display="";
		  }
	  }
	  else
	 {  
		
		document.getElementById("z"+p).style.display="none"
		document.getElementById("kg"+p).src="images/290.files/j.gif";
	 }
   }
}

function csub(d)
{

	document.getElementById(d).style.color="#FF0000";
}

function getX(obj){   
        return obj.offsetLeft + (obj.offsetParent ? getX(obj.offsetParent) : obj.x ? obj.x : 0);   
}
function getY(obj){   
        return obj.offsetTop + (obj.offsetParent ? getY(obj.offsetParent) : obj.y ? obj.y : 0);   
}
function   showLayer(o){  
  document.getElementById(o).style.left=getX(hh)
  document.getElementById(o).style.top=getY(hh)+52
  document.getElementById(o).style.visibility='visible'   
}  
function   menuh(){  
  document.getElementById("menu").style.visibility='hidden'   
} 
function popmenu(i)
{ 
    
	 
	  if(i=="m1")
	  {
	     document.getElementById("menucontent").innerHTML="<table width='1004' height='28' border='0' cellpadding='0' cellspacing='0' ><tr><td width='85' height='30' valign='middle' ></td><td><table id='__01' width='362' height='28' border='0' cellpadding='0' cellspacing='0'><tr><td width='49'><img src='images/menubg1-1_01.png' width='49' height='28' alt=''></td><td height='28' nowrap background='images/menubg1-1_02.png'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='5'></td></tr><tr><td  nowrap><a href='zxzl.html' class='w'>最新展览</a> <a href='#' class='w'>常设展览</a> <a href='#' class='w'>多媒体展示</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a></td></tr></table></td><td width='59'><img src='images/menubg1-1_03.png' width='40' height='28' alt=''></td></tr></table></td></tr></table>";
         showLayer('menu')
	  }
	 
	  if(i=="m2")
	  {
	     document.getElementById("menucontent").innerHTML="<table width='1024' height='28' border='0' cellpadding='0' cellspacing='0' ><tr><td width='213' height='30' valign='middle' ></td><td width='738'><table id='__01' width='362' height='28' border='0' cellpadding='0' cellspacing='0'><tr><td width='49'><img src='images/menubg1-1_01.png' width='49' height='28' alt=''></td><td height='28' nowrap background='images/menubg1-1_02.png'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='5'></td></tr><tr><td  nowrap><a href='zxzl.html' class='w'>最新展览</a> <a href='#' class='w'>常设展览</a> <a href='#' class='w'>多媒体展示</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a></td></tr></table></td><td width='59'><img src='images/menubg1-1_03.png' width='40' height='28' alt=''></td></tr></table></td></tr></table>";
         showLayer('menu')
	  }
	  
	  if(i=="m3")
	  {
	     document.getElementById("menucontent").innerHTML="<table width='1024' height='28' border='0' cellpadding='0' cellspacing='0' ><tr><td width='352' height='30' valign='middle' ></td><td ><table id='__01' width='362' height='28' border='0' cellpadding='0' cellspacing='0'><tr><td width='49'><img src='images/menubg1-1_01.png' width='49' height='28' alt=''></td><td height='28' nowrap background='images/menubg1-1_02.png'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='5'></td></tr><tr><td  nowrap><a href='zxzl.html' class='w'>最新展览</a> <a href='#' class='w'>常设展览</a> <a href='#' class='w'>多媒体展示</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a></td></tr></table></td><td width='59'><img src='images/menubg1-1_03.png' width='40' height='28' alt=''></td></tr></table></td></tr></table>";
         showLayer('menu')
	  }
	  if(i=="m4")
	  {
	     document.getElementById("menucontent").innerHTML="<table width='1024' height='28' border='0' cellpadding='0' cellspacing='0' ><tr><td width='475' height='30' align='right' valign='middle' >&nbsp;</td><td ><table id='__01' width='362' height='28' border='0' cellpadding='0' cellspacing='0'><tr><td width='49'><img src='images/menubg1-1_01.png' width='49' height='28' alt=''></td><td height='28' nowrap background='images/menubg1-1_02.png'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='5'></td></tr><tr><td  nowrap><a href='zxzl.html' class='w'>最新展览</a> <a href='#' class='w'>常设展览</a> <a href='#' class='w'>多媒体展示</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a></td></tr></table></td><td width='59'><img src='images/menubg1-1_03.png' width='40' height='28' alt=''></td></tr></table></td></tr></table>";
         showLayer('menu')
	  }
	  if(i=="m5")
	  {
	     document.getElementById("menucontent").innerHTML="<table width='1024' height='28' border='0' cellpadding='0' cellspacing='0' ><tr><td width='598' height='30' valign='middle' ></td><td ><table id='__01' width='242' height='28' border='0' cellpadding='0' cellspacing='0'><tr><td width='49'><img src='images/menubg1-1_01.png' width='49' height='28' alt=''></td><td width='154' height='28' nowrap background='images/menubg1-1_02.png'><table width='87%' border='0' cellspacing='0' cellpadding='0'><tr><td height='5'></td></tr><tr><td  nowrap><a href='zxzl.html' class='w'>最新展览</a> <a href='#' class='w'>常设展览</a> <a href='#' class='w'>多媒体展示</a> <a href='#' class='w'>展览回放</a></td></tr></table></td><td width='39'><img src='images/menubg1-1_03.png' width='40' height='28' alt=''></td></tr></table></td></tr></table>";
         showLayer('menu')
	  }
	  if(i=="m6")
	  {
	     document.getElementById("menucontent").innerHTML="<table width='1024' height='28' border='0' cellpadding='0' cellspacing='0' ><tr><td width='803' height='30' align='right' valign='middle' ><table id='__01' width='89' height='28' border='0' cellpadding='0' cellspacing='0'><tr><td width='37'><img src='images/menubg2_01.png' width='37' height='28' alt=''></td><td width='268' height='28' background='images/menubg2_02.png'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='5' colspan='2'></td></tr><tr><td width='23'>&nbsp;</td><td align=center nowrap><a href='#' class='w'>最新展览</a> <a href='#' class='w'>常设展览</a> <a href='#' class='w'>多媒体展示</a> <a href='#' class='w'>展览回放</a></td></tr></table></td><td width='86'><img src='images/menubg2_03.png' width='52' height='28' alt=''></td></tr></table></td><td width='200' >&nbsp;</td></tr></table>";
         showLayer('menu')
	  }
	  if(i=="m7")
	  {
	     document.getElementById("menucontent").innerHTML="<table width='1024' height='28' border='0' cellpadding='0' cellspacing='0' ><tr><td  height='30' align='right' valign='middle' ><table id='__01' width='90' height='28' border='0' cellpadding='0' cellspacing='0'><tr><td width='37'><img src='images/menubg2_01.png' width='37' height='28' alt=''></td><td width='268' height='28' background='images/menubg2_02.png'><table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='5' colspan='2'></td></tr><tr><td width='23'>&nbsp;</td><td align=center nowrap><a href='#' class='w'>最新展览</a> <a href='#' class='w'>常设展览</a> <a href='#' class='w'>多媒体展示</a> <a href='#' class='w'>展览回放</a> <a href='#' class='w'>展览回放</a></td></tr></table></td><td width='86'><img src='images/menubg2_03.png' width='52' height='28' alt=''></td></tr></table></td><td width='100' >&nbsp;</td></tr></table>";
         showLayer('menu')
	  }
	  
	  
}

var speed=5;
var way="right";
var currentId=0;
var MyMar;
var handle;
var $$ = function (id) {
	return "string" == typeof id ? document.getElementById(id) : id;
};

function slideImgs(cobj,imgId,idTitle,idSummary){
	var tag = 0;
	var obj=$$(idTitle).getElementsByTagName("table");
	var total = obj.length;
	for(var i=0;i<total;i++){
		if(cobj==obj[i]){
			tag = i;
			break;
		}
	}
	$$(imgId).filters.revealTrans.Transition=Math.floor(Math.random()*23);
	setTimeout(function(){
	$$(imgId).filters.revealTrans.apply();
	$$(imgId).src= $$(imgId+"s").getElementsByTagName("img")[tag].src;
	$$(imgId).filters.revealTrans.play();
	}, 100);
	cb_over(tag,idTitle,idSummary);
}

function cb_over(thisId,idTitle,summaryId)
{
	var obj=$$(idTitle).getElementsByTagName("table");
	var total = obj.length;
	for(var i=0;i<total;i++){
		if(thisId!=i){
			obj[i].style.backgroundImage="";
			if(summaryId!=null)
				$$(summaryId).getElementsByTagName("span")[i].style.display="none";
		}
	}
	obj[thisId].style.backgroundImage="url("+$$("bgImage").src+")";
	if(summaryId!=null)
		$$(summaryId).getElementsByTagName("span")[thisId].style.display="block";
}

function getTop(e){
	var offset=e.offsetTop;
	if(e.offsetParent!=null) offset+=getTop(e.offsetParent);
	return offset;
}

function getLeft(e){
	var offset=e.offsetLeft;
	if(e.offsetParent!=null) offset+=getLeft(e.offsetParent);
	return offset; 
}

function thumbnail(obj,url){
	$$("wimg").filters.revealTrans.Transition=Math.floor(Math.random()*23);
	$$("zpdc_imgurl").href=url;
	setTimeout(function(){
			$$("wimg").filters.revealTrans.apply();
			$$("wimg").src=obj.src;
			$$("wimg").filters.revealTrans.play();
			}, 100);
			
}
function slideImgs_zlxx(cobj,maintitle,imgid,imghref,url,color,subhead){
	var tag = 0;
	var obj=$$(maintitle).getElementsByTagName("table");
	if(cobj!=''&&color!='') cobj.style.backgroundColor=color;
	//if(url!='') $$(imghref).href=url;
	var total = obj.length;
	for(var i=0;i<total;i++){
		if(cobj==obj[i]){
			tag = i;
		}
		else{
			$$(subhead).getElementsByTagName("table")[i].style.display="none";
		}
	}
	$$(imghref).href=$$(imgid+"s").getElementsByTagName("a")[tag].href;
	$$(subhead).getElementsByTagName("table")[tag].style.display="block";
	$$(imgid).filters.revealTrans.Transition=Math.floor(Math.random()*23);
	setTimeout(function(){
	$$(imgid).filters.revealTrans.apply();
	$$(imgid).src= $$(imgid+"s").getElementsByTagName("img")[tag].src;
	$$(imgid).filters.revealTrans.play();
	}, 100);
			
}
function MarqueeL(){
	if(demo2.offsetWidth-demo.scrollLeft<=0){
		demo.scrollLeft-=demo1.offsetWidth;
	}else{
		demo.scrollLeft++;
	}
}

function MarqueeR(){
	if(demo2.offsetWidth-demo.scrollLeft>=255){
		demo.scrollLeft+=demo1.offsetWidth;
	}else{
		demo.scrollLeft--;
	}
}

function moveout(){
	if(MyMar){
		clearInterval(MyMar);
	}
}

function changeDirection(direction){
	way = direction;
	moveThis();
}

function moveThis(){
	if(currentId>=$$("jpdc_imgs").getElementsByTagName("img").length) {currentId=0};
	if(currentId<0){currentId=$$("jpdc_imgs").getElementsByTagName("img").length-1};
	if(way=='left'){
		if(MyMar)
		{
			clearInterval(MyMar);
		}
		MyMar=setInterval(MarqueeL,speed);
		currentId++;
	}
	else{ 
		if(MyMar)
		{
			clearInterval(MyMar);
		}
		MyMar=setInterval(MarqueeR,speed);
		currentId--;
	}
}
function convertLayer(cobj,idTitle){
	var obj=$$(idTitle).getElementsByTagName("td");
	var total = obj.length;
	for(var i=0;i<total;i++){
		if(cobj==obj[i]){
			obj[i].style.backgroundImage="url("+$$("bgImage").src+")";
			$$(idTitle+i).style.display="block";
		}else{
			obj[i].style.backgroundImage="";
			$$(idTitle+i).style.display="none";
		}
	}
	if(cobj==''){
		obj[0].style.backgroundImage="url("+$$("bgImage").src+")";
		$$(idTitle+0).style.display="block";
	}
}	
function request_old(getvar){
	var strRequest,offset,endpoint,returnvar;
	strRequest=window.location.search;
	strRequest="&"+strRequest.substring(1,strRequest.length);
	//if (getvar.search("=|&")!=-1)return "";
	getvar="&"+getvar;
	offset=getoffset(strRequest,getvar,0);
	if (offset==-1) return "";
	endpoint=strRequest.indexOf("&",offset);
	if (endpoint==-1) endpoint=strRequest.length;
	returnvar=strRequest.substring(offset,endpoint);
	return returnvar;
}
function request(getvar){

    var query=location.search.substring(1);//获取查询串

    var pairs=query.split("&");//在逗号处断开

	var idChild="";
	


    for(var i=0;i<pairs.length;i++)  
    {  

        var pos=pairs[i].indexOf('=');//查找name=value

        if(pos==-1)
   			continue;//如果没有找到就跳过  
        if(pairs[i].substring(0,pos)==getvar){//提取id  

        	idChild=pairs[i].substring(pos+1);//提取路径idurl
  		}
		

	}

	return idChild;
}
