﻿//控制二级菜单显示或者隐藏
function showxiaolei(i,a){
if (i.style.display == "none") {
		i.style.display = "";
	}else{
		i.style.display = "none";
	}
if (i.style.display == "none") {
		 document.images[a].src="../images/1+.gif";
	 }else{
		 document.images[a].src="../images/1-.gif";
	 }
}


///////图片自动缩略限制
var flag=false; 
function DrawImage(ImgD){ 
 var image=new Image(); 
 image.src=ImgD.src; 
 if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= 150/135){ 
   if(image.width>150){
    ImgD.width=150; 
    ImgD.height=(image.height*150)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
  else{ 
   if(image.height>135){
    ImgD.height=135; 
    ImgD.width=(image.width*135)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   ImgD.alt="点击查看详细信息..."; 
  } 
 }
}
///////图片自动缩略限制完




//Author:客服提示框
			function sAlert(str){
			var msgw,msgh,bordercolor;
			msgw=450;//提示窗口的宽度
			msgh=150;//提示窗口的高度
			titleheight=50 //提示窗口标题高度
			bordercolor="#ff9600";//提示窗口的边框颜色
			titlecolor="#ff9600";//提示窗口的标题颜色
			
			var sWidth,sHeight;
			sWidth=document.body.offsetWidth;
			sHeight=screen.height;
			var bgObj=document.createElement("div");
			bgObj.setAttribute('id','bgDiv');
			bgObj.style.position="absolute";
			bgObj.style.top="0";
			bgObj.style.background="#4a4a4a";
			bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75";
			bgObj.style.opacity="0.6";
			bgObj.style.left="0";
			bgObj.style.width=sWidth + "px";
			bgObj.style.height=sHeight + "px";
			bgObj.style.zIndex = "10000";
			document.body.appendChild(bgObj);
			
			var msgObj=document.createElement("div")
			msgObj.setAttribute("id","msgDiv");
			msgObj.setAttribute("align","center");
			msgObj.style.background="white";
			msgObj.style.border="1px solid " + bordercolor;
	    	msgObj.style.position = "absolute";
            msgObj.style.left = "50%";
            msgObj.style.top = "50%";
            msgObj.style.font="12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif";
            msgObj.style.marginLeft = "-225px" ;
            msgObj.style.marginTop = -75+document.documentElement.scrollTop+"px";
            msgObj.style.width = msgw + "px";
            msgObj.style.height =msgh + "px";
            msgObj.style.textAlign = "center";
            msgObj.style.lineHeight ="25px";
            msgObj.style.zIndex = "10001";
   
		   var title=document.createElement("h4");
		   title.setAttribute("id","msgTitle");
		   title.setAttribute("align","right");
		   title.style.margin="0";
		   title.style.padding="3px";
		   title.style.background=bordercolor;
		   title.style.filter="progid:DXImageTransform.Microsoft.Alpha(startX=20, startY=20, finishX=100, finishY=100,style=1,opacity=75,finishOpacity=100);";
		   title.style.opacity="0.75";
		   title.style.border="1px solid " + bordercolor;
		   title.style.height="18px";
		   title.style.font="12px Verdana, Geneva, Arial, Helvetica, sans-serif";
		   title.style.color="white";
		   title.style.cursor="pointer";
		   title.innerHTML="关闭";
		   title.onclick=function(){
		        document.body.removeChild(bgObj);
                document.getElementById("msgDiv").removeChild(title);
                document.body.removeChild(msgObj);
                }
		   document.body.appendChild(msgObj);
		   document.getElementById("msgDiv").appendChild(title);
		   var txt=document.createElement("p");
		   txt.style.margin="1em 0"
		   txt.setAttribute("id","msgTxt");
		   txt.innerHTML=str;
           document.getElementById("msgDiv").appendChild(txt);
            }



function S(i) { return document.getElementById(i); }
function download( evt, fid){
var _event = evt ? evt : event;
 var _target = evt ? evt.target : event.srcElement;
 var _p = S( "downloadPanel" );
 _p.style.top = _event.clientY + document.body.scrollTop;
 _p.style.left = ( _event.clientX + document.body.scrollLeft < 500 ? _event.clientX + document.body.scrollLeft + 10  : _event.clientX  + document.body.scrollLeft - 400 );
 Show( "downloadPanel" , true ); 
 _p.focus();
}
function Show(obj, bShow) {
 obj = (typeof(obj) == "string" ? S(obj) : obj);
 if (obj) obj.style.display= (bShow ? "" : "none");
}
function hideDownloadPanel( evt ){
 Show( "downloadPanel" ,false); 
}
function checkClick(evt){
 var _target = evt ? evt.target : event.srcElement ;
 var _id = _target.id;
 if( _id == "" ){
  _id = _target.parentNode.id;
 }
 if( _id !="downloadDirect"  &&  _id != "downloadAgent"  &&  _id != "downloadPanel"  &&  _id.indexOf( "downloadFile_" ) < 0  &&  _id.indexOf( "downloadLink_" ) < 0 ){
  Show( "downloadPanel" , false );
 }
}
window.onload = function(){
 document.body.onclick1=checkClick;
}







//客服隐藏
function hidead() 
{ 
showad = false; 
document.getElementById("topbar").style.display="none"; 
} 



function showCards(name,num,total,tname,tclass){
	for(i=1;i<=total;i++){
		document.getElementById(name+i).className="off";
		document.getElementById(tname+i).className="";
	}
	document.getElementById(name+num).className="on";
	document.getElementById(tname+num).className=tclass;
}

function cardTitle(obj,classname){
	//if(obj.className!=classname)
	obj.className=classname;
}

function showHidden(id){
	if(document.getElementById(id).className=="on")
		document.getElementById(id).className="off";
	else
		document.getElementById(id).className="on";
}



//两列同高
function autoHeight() {
 if (arguments.length > 1) {
  var x = arguments.length;
  var elements=[];
  for (i=0; i<x; i++) {
   elements.push(document.getElementById(arguments[i]).scrollHeight);
  }
  var max = elements[0];
  for(i=0; i<x; i++) {
   if(max < elements[i]) {
    max = elements[i];
   }
  }
  for (i=0; i<x; i++) {
   document.getElementById(arguments[i]).style.height = max+"px";
  }
 }
}


//FLASH调用
function showflash(flashsrc,widthpx,heightpx){ var fStr = ''; fStr += ('<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="'+ widthpx +'" height="'+ heightpx +'">'); fStr += ('<param name="movie" value="'+ flashsrc +'">'); fStr += ('<param name="quality" value="high">'); fStr += ('<param name="menu" value="false">'); fStr += ('<param name="wmode" value="transparent">'); fStr += ('<embed src="'+ flashsrc +'" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ widthpx +'" height="'+ heightpx +'">'); fStr += ('</embed>'); fStr += ('</object>'); document.write(fStr);};



//初始化
var def="1";
function mover(object){
  //主菜单
  var mm=document.getElementById("m_"+object);
  mm.className="m_li_a";
  //初始主菜单先隐藏效果
  if(def!=0){
    var mdef=document.getElementById("m_"+def);
    mdef.className="m_li";
  }
  //子菜单
  var ss=document.getElementById("s_"+object);
  ss.style.display="block";
  //初始子菜单先隐藏效果
  if(def!=0){
    var sdef=document.getElementById("s_"+def);
    sdef.style.display="none";
  }
}
function mout(object){
  //主菜单
  var mm=document.getElementById("m_"+object);
  mm.className="m_li";
  //初始主菜单还原效果
  if(def!=0){
    var mdef=document.getElementById("m_"+def);
    mdef.className="m_li_a";
  }
  //子菜单
  var ss=document.getElementById("s_"+object);
  ss.style.display="none";
  //初始子菜单还原效果
  if(def!=0){
    var sdef=document.getElementById("s_"+def);
    sdef.style.display="block";
  }
}



function ShowDivCity()
{
    document.getElementById("DivCity").style.display= "block";
}

function HiddenDivCity()
{
    document.getElementById("DivCity").style.display = "none";
}
function ShowDivCity2()
{
    document.getElementById("DivCity2").style.display= "block";
}

function HiddenDivCity2()
{
    document.getElementById("DivCity2").style.display = "none";
}

function ShowDivCity3()
{
    document.getElementById("DivCity3").style.display= "block";
}

function HiddenDivCity3()
{
    document.getElementById("DivCity3").style.display = "none";
}function ShowDivCity4()
{
    document.getElementById("DivCity4").style.display= "block";
}

function HiddenDivCity4()
{
    document.getElementById("DivCity4").style.display = "none";
}function ShowDivCity5()
{
    document.getElementById("DivCity5").style.display= "block";
}

function HiddenDivCity5()
{
    document.getElementById("DivCity5").style.display = "none";
}function ShowDivCity6()
{
    document.getElementById("DivCity6").style.display= "block";
}

function HiddenDivCity6()
{
    document.getElementById("DivCity6").style.display = "none";
}function ShowDivCity7()
{
    document.getElementById("DivCity7").style.display= "block";
}

function HiddenDivCity7()
{
    document.getElementById("DivCity7").style.display = "none";
}function ShowDivCity8()
{
    document.getElementById("DivCity8").style.display= "block";
}

function HiddenDivCity8()
{
    document.getElementById("DivCity8").style.display = "none";
}
