function Classesinfo(imgsrc,name,info,infoL){
//  this.id = id;
  this.imgsrc = imgsrc;
  this.name = name;
  this.info = info;
  this.infoL = infoL;
  this.showView = showView;
 }
 function showView(mm){
  var div_1 = document.createElement("div");
  var span_1 = document.getElementById("txt");
  span_1.appendChild(div_1);
  var div_top = document.createElement("div");
  var div_cent = document.createElement("div"); 
  var div_boot = document.createElement("div");
  var div_img = document.createElement("div");
  var div_txt = document.createElement("div");       
  div_1.appendChild(div_top);
  div_1.appendChild(div_cent);
  div_1.appendChild(div_boot);
  div_cent.style.overflow = 'hidden';
  div_1.style.width = 300;
  div_1.style.styleFloat = 'left';
  div_cent.appendChild(div_img);
  div_img.style.width =114;
  div_img.style.height = 142;
  div_img.style.styleFloat = 'left';
  div_cent.appendChild(div_txt);
  div_txt.style.width =140;
  div_txt.style.height = 142;
  div_txt.style.styleFloat = 'left';
  div_txt.style.marginLeft = 10;
  div_txt.innerHTML = "<p><span id='h3'>"+this.name+"</span><span id='htt'>"+this.info.link("javascript:void showInfoBox("+mm+")")+"</span></p>";  
  div_img.style.backgroundImage  = "url("+this.imgsrc+")";
  div_img.style.marginLeft = 20;
  div_top.style.backgroundImage  = "url(imgstl/level0_top.png)";
  div_top.style.height = 24;
  div_cent.style.backgroundImage  = "url(imgstl/level0_cent.png)";
  div_boot.style.backgroundImage  = "url(imgstl/level0_boot.png)";
  div_boot.style.height = 24;    
 }
 function showInfoBox(mm){
  box.innerHTML = "<div id='mask'class='bg'; align='center'><div id='perbox'><div id='level0L_top'><a href='javascript:void(0)' onClick = 'hideInfoBox()'>[关闭]</a></div><div id='level0L_cent'><div id='perimg' style='background-image:url("+perinfos[eval(mm)].imgsrc+")'></div><div id='perinfo'><p><span id='h3'>"+perinfos[eval(mm)].name+"</span><p id='htt'>"+perinfos[eval(mm)].info+"</p></p></div><div id='perinfoL'><p><span id='htt'>"+perinfos[eval(mm)].infoL+"</span></p></div></div><div id='level0L_boot'></div></div></div>";
  mask.style.top = document.documentElement.scrollTop;
  document.body.style.overflow  = 'hidden';
 }
 function hideInfoBox(){
  box.innerHTML = "";
  document.body.style.overflow  = 'visible';
 }
//////////////////////////////////////////////////////ajax
var perinfos = new Array();
function loadXMLDoc(url,classid)
{
 var xmlhttp;
 var xxnode,xxpername,xxperimg,xxperjob,xxperresume,xdom,i;
 if (window.XMLHttpRequest)
   {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
   }
 else
   {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
 xmlhttp.onreadystatechange=function(){
   if (xmlhttp.readyState==4 && xmlhttp.status==200){
  xdom=xmlhttp.responseXML.documentElement.getElementsByTagName("perinfo");
  for (i=0;i<xdom.length;i++)
    { 
     if(xdom[i].getElementsByTagName("perclass")[0].firstChild.nodeValue != classid){continue;}//extern classid
    xxnode = xdom[i].getElementsByTagName("pername");
     {
    try
    {
     xxpername=xxnode[0].firstChild.nodeValue;
     }
     catch(er)
     {
     xxpername = "";
     }
      }
    xxnode = xdom[i].getElementsByTagName("perimg");
      {
    try
    {
     xxperimg=xxnode[0].firstChild.nodeValue;
    }
    catch(er)
    {
     xxperimg="";
    }
      }
    xxnode = xdom[i].getElementsByTagName("perjob");
     {
    try
    {
     xxperjob=xxnode[0].firstChild.nodeValue;
    }
    catch(er)
    {
     xxperjob="";
    }
      }
    xxnode = xdom[i].getElementsByTagName("perresume");
     {
    try
    {
     xxperresume=xxnode[0].firstChild.nodeValue;
    }
    catch(er)
    {
     xxperresume="";
    }
   }   
     perinfos[i]=new Classesinfo( xxperimg,xxpername,xxperjob,xxperresume);
     if(perinfos.length > 0){perinfos[i].showView(i);}
    }
  }
 }
 xmlhttp.open("GET",url,true);
 xmlhttp.send();
}

創作者介紹
創作者 shadow 的頭像
shadow

資訊園

shadow 發表在 痞客邦 留言(0) 人氣()