﻿function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function show(obj,id,name,pic,abst){
	document.getElementById("cpl").innerHTML="<a href=\"showmsg.php?id="+id+"\" target=\"_blank\"><img src=\"uploadfiles/"+pic+"\" /></a><div><a href=\"showmsg.php?id="+id+"\" target=\"_blank\">"+name+"</a></div>";
	document.getElementById("cpr").innerHTML=abst;
	tag=obj.parentNode.parentNode.getElementsByTagName('li');
	for (i=0;i<tag.length;i++){
		if (tag[i].id!=""){
			tag[i].id="";
		}
	}
	obj.parentNode.id="cp1";
}

function change0(obj,key){
	lock=0;
	var tag=obj.parentNode.parentNode.getElementsByTagName('li');
	for (var i=0;i<tag.length;i++){
		if (tag[i].className!="vam left title0"){	
			tag[i].className="vam left title0";
		}
	}
	obj.parentNode.className="vam left title1 fwb";
	var tag1=obj.parentNode.parentNode.parentNode.parentNode.getElementsByTagName('ul');
	for (i=1;i<tag1.length;i++){
		if (tag1[i].className!="dpn"){
			tag1[i].className="dpn";
		}
	}
	tag1[key].className="";
	lock=1;
}

function turn(){
	if (ii<tlength[j]){
		change0(tag[ii].firstChild,ii+1);
		ii++;
		MyTime=setTimeout("turn()",1000);
	}else{
		change0(tag[0].firstChild,1);
		j++;
		MyTime=setTimeout("myturn()",2000);
	}
}

function myturn(){
	if (j<tags.length){
		tag=document.getElementById(tags[j]).getElementsByTagName("li");
		ii=1;
		MyTime=setTimeout("turn()",1000);
	}else{
		ifshut=1;
		start();
	}
}

function shut(){
		clearTimeout(MyTime);
		ifshut=1;
}

function start(){
	if (ifshut==1){
		ii=1;
		j=0;
		MyTime=setTimeout("myturn()",10000);
	}
}

function check(){
	if (form1.gsmc.value=="" || form1.gsdz.value=="" || form1.yb.value=="" || form1.lxr.value=="" || form1.lxdh.value=="" || form1.lxqq.value=="" || form1.lxyx.value==""　|| form1.ly.value==""){
		alert("请完善联系方式及留言内容：\n带＊必填！");
		return false;
	}
}

function flashshow(url,source,w,h){
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\""+w+"\" height=\""+h+"\">\n	<param name=\"movie\" value=\""+source+"\" />\n	<param name=\"quality\" value=\"high\" />\n	<param name=\"wmode\" value=\"transparent\" />\n	<embed src=\""+source+"\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\""+w+"\" height=\""+h+"\" wmode=\"transparent\"></embed>\n</object>\n");
}

function showmouse(msg,heig) {
	document.getElementById("msg0").style.top=document.documentElement.scrollTop+window.event.y;		
	document.getElementById("msg0").style.left=window.event.x+5;
	document.getElementById("msg0").style.background="#FFC";
	document.getElementById("msg0").className="tal";
	document.getElementById("msg0").innerHTML=msg;
}

function dismouse() {
	document.getElementById("msg0").style.background="";
	document.getElementById("msg0").className="";
	document.getElementById("msg0").innerHTML="";
}