﻿//根据ID获取指定对象
function $(e) 
{
   return document.getElementById ? document.getElementById(e) : null;
}

var Items = new Array();
Items[0] = "Player";
Items[1] = "InfoMation";
Items[2] = "Card";
Items[3] = "Lostion";
Items[4] = "specialty";
Items[5] = "loadding";
//三维
var Simgsrc,SPlayName;
function Menu1(imgsrc,PlayName)
{  
  if($("subcont")!=null)
  {
    $("subcont").innerHTML = "<img src='images/3d.gif' alt='三维' />";
  }   
  if(typeof imgsrc!="undefined")
  {
    Simgsrc=imgsrc;
  }
  if(typeof PlayName!="undefined")
  {
     SPlayName=PlayName;
  }
  ShowItem(0);
  $("Postion").innerHTML = "三维实景展播 > "+SPlayName; 
//  if(Simgsrc.length <= 10)
//  {
//    $("PlayMovie").innerHTML = "<div style='height:358px;color:red;background:url(loading.gif) no-repeat;text-align:center;line-height:450px;text-indent:24px;'>三维实景正在制作中...</div>";
//  }
//  else
//  {
//  $("PlayMovie").innerHTML = OutApplert(Simgsrc,"605px","400px");    
//  }
OutApplert(Simgsrc,"605px","400px");
        
}
//在指定位置输出指定影片
function OutMovie(id,Url,Name,AutoCode)
{
 //   var outSD;
    if(Url.length <= 10)
     {
        outSD = "<div style='height:358px;color:red;background:url(loading.gif) no-repeat -80px -30px;text-align:center;line-height:450px;text-indent:24px;'>三维实景正在制作中...</div>";
         $("Palysd").innerHTML = outSD;
     }
     else
     {
     $("Palysd").innerHTML = OutApplert2(Url,"450px","306px");
     }
OutApplert(Url,"450px","306px");

          $("PalysdName").innerHTML = "<a target='_blank' href='info.aspx?id="+AutoCode+"'>"+Name+"</a>";

     
}
///输出影片
function OutApplert(ImgURL,Width,Height)
{
$("PalyFrame").src ="3dPlayer.aspx?TheUrl="+ImgURL+"&izdPlayWidth="+Width+"&izdPlayHeight="+Height+"&barx="+Math.ceil(parseInt(Width)/3.5)+"&bary="+Math.ceil(parseInt(Height)/3+parseInt(Height)/3);

var outstr = "<iframe src='3dPlayer.aspx?TheUrl="+ImgURL+"&izdPlayWidth="+Width+"&izdPlayHeight="+Height+"&barx="+Math.ceil(parseInt(Width)/3.5)+"&bary="+Math.ceil(parseInt(Height)/3+parseInt(Height)/3)+"' scrolling=\"no\" width="+Width+" height="+Height+" frameborder=\"0\"></iframe>";
               return outstr;
}
///输出影片2
function OutApplert2(ImgURL,Width,Height)
{
var outstr = "<iframe src='3dPlayer.aspx?TheUrl="+ImgURL+"' scrolling=\"no\" width="+Width+" height="+Height+" frameborder=\"0\"></iframe>";

//  var outstr ="<applet code=\"a3d.ImageRenderApplet.class\" archive=\"/pics/apvp.zip\" codebase=\".\" name=\"apv\" width=\""+Width+"\" height=\""+Height+"\" align=\"middle\">"
//              +"<param name=\"file\" value=\""+ImgURL+"\" />"
//              +"<param name=\"quality\" value=\"2\" />"
//     +"<param name=\"fov\" value=\"80\" />"
//     +"<param name=\"fovmin\" value=\"70\" />"
//     +"<param name=\"fovmax\" value=\"110\" />"
//     +"<param name=\"auto\" value=\"3\" />"
//     +"<param name=\"mousesen\" value=\"5\" />"
//     +"<param name=\"inits\" value=\"viewer:startAutoPan()\" />"
//     +"<param name=\"bar_width\" value=\""+Math.ceil(parseInt(Width)/3)+"\" />"
//     +"<param name=\"bar_height\" value=\"2\" />"
//     +"<param name=\"bar_x\" value=\""+Math.ceil(parseInt(Width)/3)+"\" />"
//     +"<param name=\"bar_y\" value=\""+Math.ceil(parseInt(Height)/3+parseInt(Height)/3)+"\" />"
//     +"<param name=\"barcolor\" value=\"ff6600\" />"
//     +"<param name=\"shotspot0\" value=\" x3 Y99 l0.5 q i\'/pics/panel1/left.gif\' u\'viewer:panLeft()\'\" />"
//             +"<param name=\"shotspot1\" value=\" x27 Y99 l0.5 q i\'/pics/panel1/start.gif\'  u\'viewer:reverseAutoPan()\'\" />"
//             +"<param name=\"shotspot2\" value=\" x51 Y99 l0.5 q i\'/pics/panel1/right.gif\' u\'viewer:panRight()\' \" />"
//             +"<param name=\"shotspot3\" value=\" x75 Y99 l0.5 q i\'/pics/panel1/stop.gif\' u\'viewer:stopAutoPan()\' \" />"
//             +"<param name=\"shotspot4\" value=\" x99 Y99 l0.5 q i\'/pics/panel1/plus.gif\' u\'viewer:startAutoPan(0,0,0.96)\' \" />"
//             +"<param name=\"shotspot5\" value=\" x123 Y99 l0.5 q i\'/pics/panel1/minus.gif\' u\'viewer:startAutoPan(0,0,1.04)\' \" />"
//             +"<param name=\"shotspot6\" value=\" x178 Y98 l0.8 q i\'/pics/panel1/zs.gif\' u\'http://www.5izd.com/\'\" />"
//             +"<param name=\"barcolor\" value=\"c6c6c6\" />"
//             +"<param name=\"regkey\" value=\"9701100121011101000000000\" />"
//             +"您的机子未安装JAVA虚拟机，为了便于您的观看，请点击"
//             +"<a href=\"/soft/java.exe\">"
//             +"<font color=\"red\">这里"
//             +"</font></a>下载"
//               +"</applet>";
               return outstr;
}
//简介
function Menu2()
{
  ShowItem(1);
  $("Postion").innerHTML = "简介";
  if($("subcont")!=null)
  {
    $("subcont").innerHTML = "<img src='images/sum.gif' alt='简介' />";
  }
}
//名片
function Menu3()
{
  ShowItem(2);
  $("Postion").innerHTML = "电子名片";
    if($("subcont")!=null)
  {
    $("subcont").innerHTML = "<img src='images/card1.gif' alt='电子名片' />";
  }

}
//位置
function Menu4()
{
    ShowItem(3);
    $("Postion").innerHTML = "地理位置";
        if($("subcont")!=null)
  {
    $("subcont").innerHTML = "<img src='images/pos1.gif' alt='地理位置' />";
  }

}
//专长
function Menu5()
{
  ShowItem(4);
  $("Postion").innerHTML = "特色专长";
}

//显示和隐藏
function ShowItem(item)
{
   $(Items[0]).style.display = "none";
   $(Items[1]).style.display = "none";
   $(Items[2]).style.display = "none";
   $(Items[3]).style.display = "none";
   $(Items[4]).style.display = "none";
   $(Items[5]).style.display = "none";
   $(Items[item]).style.display = "block";
}
//多点翻页
var jz_cur_screen = 1;
function show_jz(x) {

var jz_container = $("PlayList") ;
var lis = jz_container.getElementsByTagName('li');
if(lis.length < 1)
{
return false;
}
var max_screen = Math.ceil(lis.length / 5) ;
if (x < 1) {
x = max_screen;
}
if (x > max_screen) {
x = 1;
}
for (i=0;i<5;i++) {
var hidden_cnt = (jz_cur_screen-1)*5+i ;
 var display_cnt = (x-1)*5+i ;
if (hidden_cnt < lis.length) {
 lis[hidden_cnt].style.display = "none" ; //隐藏前面显示的
 }
 if (display_cnt < lis.length) {
 lis[display_cnt].style.display = "block" ; //显示当前
 }
 }
 jz_cur_screen = x ;
 return false ;
}
var xmlHttp;
function CreateXmlHttp()
{
    try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
    catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
    catch(e){try{xmlHttp=new XMLHttpRequest();}
    catch(e){xmlHttp=false;}}}
}
///xmlHttp处理
function AjaxProcess(url,id)
{
    CreateXmlHttp();    
    xmlHttp.open("POST",url);
    xmlHttp.onreadystatechange=function()
    {
        if(xmlHttp.readyState==4)
            id.innerHTML=xmlHttp.responseText;            
    }
    xmlHttp.send(null);
}







// function ResumeError(){
//    return true;
//    }
//window.onerror = ResumeError;





























































