﻿// JScript 文件
function loadindex()
{
    //var lwidth=document.all.maindiv.clientWidth;
    var lheight=document.all.maindiv.clientHeight;
    //parent.document.all.Iframe.width=lwidth;
    parent.document.all.Iframe.height=lheight;
}
function loadlogin()
{
    var lheight=document.all.usermsg.clientHeight;
    var mheight=parent.document.all.LoginIframe.height;
    parent.document.all.LoginIframe.height=lheight;
}
function loaddefault()
{
    var lheight=document.all.list.clientHeight;
    var mheight=parent.document.all.mainiframe.height;
    if(lheight<100)
    {
        parent.document.all.mainiframe.height=lheight+200;  
    }
    else
    {
        parent.document.all.mainiframe.height=lheight+10;
    }
    top.window.scroll(0,0);

}
function loadlist()
{
    var lheight=document.all.list.clientHeight;
    var mheight=parent.document.all.mainiframe.height;
    if(lheight<100)
    {
        parent.document.all.mainiframe.height=lheight+200;  
    }
    else
    {
        parent.document.all.mainiframe.height=lheight+100;  
    }
    top.window.scroll(0,0);
}
function loadcontent()
{
    var lheight=document.all.content.clientHeight;
    var mheight=parent.document.all.mainiframe.height; 
    if(lheight<100)
    {
        parent.document.all.mainiframe.height=lheight+200;  
    }
    else
    {
        parent.document.all.mainiframe.height=lheight+100;
    }
    top.window.scroll(0,0);
}
//function replace_url(url)
//{
//    var obj=document.getElementById('divcontent');
//    var img=obj.all.tags('img');
//    var reg=//;
//    for(i=0;i<img.length;i++)
//    {
//        var value=img[i].src;
//        img[i].src=value.replace(reg,url);
//    }
//    
//    loadcontent();
//}
function go()
{
    top.mainiframe.location.replace('../Home/Default.aspx');
}

function adRotator() {};
adRotator.initialize=function(o)
{
 // script by blueDestiny
 this._t = new Array();
 this._l = new Array();
 this._p = new Array();
 this._i = new Image();
 this._c = 0;
 this._f = false;
 this._o = o;
 this._timeout = null;
 this._html = "";
 // configration.
 // @ image width
 // @ image height
 // @ rotator speed
 // @ filter type
 this._w = 220;
 this._h = 164;
 this._s = 4;
 this._x = 23;
 return this;
};
adRotator.add=function(p,t,l) { with (this)
{
 _p.push(p);
 _t.push(t);
 _l.push(l);
}};
adRotator.load=function() { with (adRotator)
{
 if( _i.readyState=='complete' )
 {
  if(_p.length-1==_c)
  {
   _f = true;
   _c = 0;
   window.clearTimeout(_timeout);
   //getRef("AdRotator").innerHTML="complete";
   adRotator.play();
  }
  else
  {
   _c++;
   //getRef(_o).innerHTML="共有图片" + _p.length + "张, 现导入" + _c + '张' + _i.readyState + "...";
   getRef(_o).innerHTML="共有图片" + _p.length + "张, 现导入" + _c + '张';
   _timeout=window.setTimeout(adRotator.load,10)
  }
 }
 else
 {
 
  //getRef(_o).innerHTML="共有图片" + _p.length + "张, 现导入" + _c + '张' + _i.readyState + "...";
  getRef(_o).innerHTML="共有图片" + _p.length + "张, 现导入" + _c + '张';
  _timeout=window.setTimeout(adRotator.load,10)
 }
}};
adRotator.play=function() { with (adRotator)
{
 if( _f )
 {
 _html = "";
 _html += '<table style="border:1px solid #2E7297;"><tr><td style="font-size:9pt;font-family:tahoma;font-weight:bold;">'
 _html += '<div id="rotatorPlayer"'
   + ' style="width:' + _w + ''
   + ';height:"' + _h + '"'
   + '>'
 _html += '<a href="' + ( _l[_c] ? _l[_c] : "javascript:void(0);" ) + '">';
 _html += '<img id="rotatorPic" src="' + _p[_c] + '"'
   + ' width="' + _w + '"'
   + ' height="' + _h + '"'
   + (_t[_c]?' title="' + _t[_c] + '"':'')
   + ' style="border:0px solid blue;FILTER:revealTrans(transition=' + _x + ',duration=1);"'
   + ' >';
 _html += (_t[_c]?('<div align="center">' + (_c+1) + '. ' + _t[_c] + '</div>'):'<div></div>');
 _html += '</a>';
 _html += "</div>";
 _html += '<div align="right">';
// for(var i=0; i<_p.length; i++)
//  _html += '<span'
//     + ' style="border:1px solid #333333;padding:1px 5px 1px 5px;height:20px;text-align:center;cursor:'
//     + (_c==i ? ('default;background-color:red;"') : 'hand;" onclick="adRotator.select(' + i + ')"')
//     + '>'
//     + (i>8?(i+1):('0'+(i+1)))+ '</span> ';
 _html += "</div></td></tr></table>";
 getRef(_o).innerHTML = _html;
 getRef("rotatorPic").filters[0].Apply();
 getRef("rotatorPic").filters[0].Play();
 next();
 }
 else
 {
  _i.src = _p[_c];
  adRotator.load();
 }
}};
adRotator.next=function() { with (this)
{
 (_p.length-1==_c) ? _c=0 : _c++;
 _timeout=window.setTimeout(adRotator.play,_s*1000);
}};
adRotator.select=function(i) { with (this)
{
 window.clearTimeout(_timeout);
 _c=i;
 adRotator.play();
}};
adRotator.set=function(second) { with (this)
{
 window.clearTimeout(_timeout);
 if((/\d+/).test(second)==true)
 {
  _s=second;
  adRotator.play();
 }
 else
 {
  alert("must be digit!")
  adRotator.play();
 }
}};
function getRef(id)
{
 return (document.all?document.all(id):document.getElementById(id));
}


var oPopup = window.createPopup();
var popTop=50;
function popmsg(msgstr){
var winstr="<table style=\"border: 1 solid  #6D93C8\"  width=\"241\" height=\"172\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"   >";
winstr+="<tr><td height=\"30\"> </td></tr><tr><td align=\"center\"><table width=\"90%\" height=\"110\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
winstr+="<tr><td valign=\"top\" style=\"font-size:12px; color: #6D93C8; face: Tahoma\">"+msgstr+"</td></tr></table></td></tr></table>";
oPopup.document.body.innerHTML = winstr;
popshow();
}
function popshow(){
    //window.status=popTop;
    if(popTop>1720){
    clearTimeout(mytime);
    popTop=50;
    oPopup.hide();
    return;
    }else if(popTop>1520&&popTop<1720){
    oPopup.show(screen.width-250,screen.height,241,1720-popTop);
    }else if(popTop>1500&&popTop<1520){
    oPopup.show(screen.width-250,screen.height+(popTop-1720),241,172);
    }else if(popTop<180){
    oPopup.show(screen.width-250,screen.height,241,popTop);
    }else if(popTop<220){
    oPopup.show(screen.width-250,screen.height-popTop,241,172);

    }
    popTop+=10;
    var mytime=setTimeout("popshow();",50);
}

function GetCookie(sName)
{
    // cookies are separated by semicolons
    var aCookie = document.cookie.split("; ");
    for (var i=0; i < aCookie.length; i++)
    {
    // a name/value pair (a crumb) is separated by an equal sign
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0])
    return unescape(aCrumb[1]);
    }
    // a cookie with the requested name does not exist
    return null;
}

function CreateObject(panel,src,width,heiht){	var EMBED = document.createElement('EMBED');	var _panel = document.getElementById(panel);	_panel.appendChild(EMBED);	EMBED.src = src;	EMBED.quality = "high";	EMBED.wmode ="transparent";	EMBED.width= width; 	EMBED.height = heiht;	EMBED.TYPE = "application/x-shockwave-flash" ;} 
