﻿// JScript 文件
var flashID=new Array();
var flashIndex;
flashIndex=0;
var t_DiglogX,t_DiglogY,t_DiglogW,t_DiglogH;

function gid(id) {
return document.getElementById?document.getElementById(id):null;
}

function gname(name) {
return document.getElementsByTagName?document.getElementsByTagName(name):new Array()
}

function Browser() {
var ua, s, i;
this.isIE = false;
this.isNS = false;
this.isOP = false;
this.isSF = false;
ua = navigator.userAgent.toLowerCase();
s = "opera";
if ((i = ua.indexOf(s)) >= 0) {
  this.isOP = true;return;
}
s = "msie";
if ((i = ua.indexOf(s)) >= 0) {
  this.isIE = true;return;
}
s = "netscape6/";
if ((i = ua.indexOf(s)) >= 0) {
  this.isNS = true;return;
}
s = "gecko";
if ((i = ua.indexOf(s)) >= 0) {
  this.isNS = true;return;
}
s = "safari";
if ((i = ua.indexOf(s)) >= 0) {
  this.isSF = true;return;
}
}
var ww,wh,bgX,bgY
function setWindowsXY()
{
    var dde = document.documentElement;
    if (window.innerWidth) {
      ww = window.innerWidth;
      wh = window.innerHeight;
      bgX = window.pageXOffset;
      bgY = window.pageYOffset;
    } else {
      ww = dde.offsetWidth;
      wh = dde.offsetHeight;
      bgX = dde.scrollLeft;
      bgY = dde.scrollTop;
    }
}

function DialogLoc() {
//var dde = document.documentElement;
//if (window.innerWidth) {
//  var ww = window.innerWidth;
//  var wh = window.innerHeight;
//  var bgX = window.pageXOffset;
//  var bgY = window.pageYOffset;
//} else {
//  var ww = dde.offsetWidth;
//  var wh = dde.offsetHeight;
//  var bgX = dde.scrollLeft;
//  var bgY = dde.scrollTop;
//}
t_DiglogX = (bgX + ((ww - t_DiglogW)/2));
//t_DiglogY = (bgY + ((wh - t_DiglogH)/2));
t_DiglogY=bgY;
}

function DialogLoc1() {
//var dde = document.documentElement;
//if (window.innerWidth) {
//  var ww = window.innerWidth;
//  var wh = window.innerHeight;
//  var bgX = window.pageXOffset;
//  var bgY = window.pageYOffset;
//} else {
//  var ww = dde.offsetWidth;
//  var wh = dde.offsetHeight;
//  var bgX = dde.scrollLeft;
//  var bgY = dde.scrollTop;
//}
t_DiglogX = (bgX + ((ww - t_DiglogW)/2));
t_DiglogY = (bgY + ((wh - t_DiglogH)/2));
}

function DialogShow(showdata,ow,oh,w,h) {
if(document.getElementById('searchType')){
document.getElementById('searchType').style.display="none";
}
for(var i=0;i<flashID.length;i++)
{//申明一个值为0的变量 i ，循环到数组的最大项
    if(document.getElementById(flashID[i])){
        document.getElementById(flashID[i]).style.display='none';
    }
}
var objDialog = document.getElementById("DialogMove");
if (!objDialog) objDialog = document.createElement("div");
t_DiglogW = ow;
t_DiglogH = oh;
DialogLoc();
objDialog.id = "DialogMove";
var oS = objDialog.style;
oS.display = "block";
oS.top = t_DiglogY + "px";
oS.left = t_DiglogX + "px";
oS.margin = "0px";
oS.padding = "0px";
oS.width = w + "px";
oS.height = h + "px";
oS.position = "absolute";
oS.zIndex = "5";
oS.background = "#FFF";
oS.border = "solid #000 4px";
objDialog.innerHTML = showdata;
document.body.appendChild(objDialog);
}

function DialogShow1(showdata,ow,oh,w,h) {
if(document.getElementById('searchType')){
document.getElementById('searchType').style.display="none";
}
for(var i=0;i<flashID.length;i++)
{//申明一个值为0的变量 i ，循环到数组的最大项
    if(document.getElementById(flashID[i])){
        document.getElementById(flashID[i]).style.display='none';
    }
}
var objDialog = document.getElementById("DialogMove");
if (!objDialog) objDialog = document.createElement("div");
t_DiglogW = ow;
t_DiglogH = oh;
DialogLoc1();
objDialog.id = "DialogMove";
var oS = objDialog.style;
oS.display = "block";
oS.top = t_DiglogY + "px";
oS.left = t_DiglogX + "px";
oS.margin = "0px";
oS.padding = "0px";
oS.width = w + "px";
oS.height = h + "px";
oS.position = "absolute";
oS.zIndex = "5";
oS.background = "#FFF";
oS.border = "solid #000 4px";
objDialog.innerHTML = showdata;
document.body.appendChild(objDialog);
}

function DialogHide() {
ScreenClean();
var objDialog = document.getElementById("DialogMove");
if (objDialog) objDialog.style.display = "none";
if(document.getElementById('searchType')){
document.getElementById('searchType').style.display="";
}
for(var i=0;i<flashID.length;i++)
{//申明一个值为0的变量 i ，循环到数组的最大项
    if(document.getElementById(flashID[i])){
        document.getElementById(flashID[i]).style.display='';
    }
}
}

function ScreenConvert() {
var browser = new Browser();
var objScreen = gid("ScreenOver");
if (!objScreen) var objScreen = document.createElement("div");
var oS = objScreen.style;
objScreen.id = "ScreenOver";
oS.display = "block";
oS.top = oS.left = oS.margin = oS.padding = "0px";
if (document.body.clientHeight)    {
  var wh = document.body.clientHeight + "px";
} else if (window.innerHeight) {
  var wh = window.innerHeight + "px";
} else {
  var wh = "100%";
}
oS.width = "100%";
oS.height = wh;
oS.position = "absolute";
oS.zIndex = "3";
if ((!browser.isSF) && (!browser.isOP)) {
  oS.background = "#000000";
} else {
  oS.background = "#000000";
}
oS.filter = "alpha(opacity=80)";
oS.opacity = 70/100;
oS.MozOpacity = 70/100;
document.body.appendChild(objScreen);
var allselect = gname("select");
//for (var i=0; i<allselect.length; i++) allselect.style.visibility = "hidden";
}

function ScreenConvert1() {
var browser = new Browser();
var objScreen = gid("ScreenOver");
if (!objScreen) var objScreen = document.createElement("div");
var oS = objScreen.style;
objScreen.id = "ScreenOver";
oS.display = "block";
oS.top = oS.left = oS.margin = oS.padding = "0px";
if (document.body.clientHeight)    {
  var wh = document.body.clientHeight + "px";
} else if (window.innerHeight) {
  var wh = window.innerHeight + "px";
} else {
  var wh = "100%";
}
oS.width = "100%";
oS.height = wh;
oS.position = "absolute";
oS.zIndex = "3";
if ((!browser.isSF) && (!browser.isOP)) {
  oS.background = "#000000";
} else {
  oS.background = "#000000";
}
oS.filter = "alpha(opacity=80)";
oS.opacity = 70/100;
oS.MozOpacity = 70/100;
document.body.appendChild(objScreen);
var allselect = gname("select");
//for (var i=0; i<allselect.length; i++) allselect.style.visibility = "hidden";
}

function ScreenClean() {
var objScreen = document.getElementById("ScreenOver");
if (objScreen) objScreen.style.display = "none";
var allselect = gname("select");
//for (var i=0; i<allselect.length; i++) allselect.style.visibility = "visible";
}

//举报
function Report(Type,ID)
{
   //var PostData = "do=" + Type + "&reportid=" + ID;
   //PostRequest(window.location.protocol + "//" + window.location.host + "/AJAX_Comm.aspx", PostData);
   var showData = document.getElementById('sample').innerHTML;
   //ScreenConvert();DialogShow("<div id=\"DialogLoading\">正在读取,请稍候...</div>",110,10,124,20);
   ScreenConvert();
   DialogShow(showData,710,460,0,0);

}
function Report1(Type,ID)
{
   //var PostData = "do=" + Type + "&reportid=" + ID;
   //PostRequest(window.location.protocol + "//" + window.location.host + "/AJAX_Comm.aspx", PostData);
   var showData = document.getElementById('sample').innerHTML;
   //ScreenConvert();DialogShow("<div id=\"DialogLoading\">正在读取,请稍候...</div>",110,10,124,20);
   ScreenConvert1();
   DialogShow1(showData,600,400,0,0);

}
var iw,ih,w,h,imgObj;
//imgObj = new Image();

function changImg(url)
{
if(document.getElementById('imgShowBig'))
{
    var img=document.getElementById('imgShowBig');
    document.getElementById('imgShow').removeChild(img);
}
imgObj = new Image();
document.getElementById('imgShow').innerHTML="";
//document.getElementById('imgShow').innerHTML="<img id=\"imgShowBig\" src=\"\" alt=\"\" />";
//imgObj = document.getElementById('imgShowBig');
imgObj.src=url;
imgObj.id='imgShowBig';
imgObj.onerror='this.src="/images2/imgerr2.gif";this.height=\"183\";this.width=\"355\";';
document.getElementById('imgShow').appendChild(imgObj);
}

function setImga()
{
//    imgObj = new Image();
    imgObj = document.getElementById('imgShowBig');
    
    imgObj1 = new Image();
    // 设置图像源
    imgObj1.src = imgObj.src;
    //alert(imgObj1.src+imgObj1.height);
    h=imgObj1.height;
    w=imgObj1.width;
    //alert(imgObj1.height);
    if(w>0 && h>0){ 
//        if(w/h>= 600/480){ 
//           if(w>600){ 
//               imgObj.width=600; 
//               imgObj.height=(h*600)/w;
//           }else{ 
//                  imgObj.width=w; 
//                  imgObj.height=h; 
//                } 
//        } 
//        else{ 
//                if(h>480){ 
//                       imgObj.height=480; 
//                       imgObj.width=(600*480)/h; 
//                }else{ 
//                        imgObj.width=w; 
//                        imgObj.height=h; 
//                     } 
//            } 

    if(w>700)
    {
        imgObj.width=700;
        imgObj.height=h * 700 / w;
    }
    }
    iw=imgObj.width;
    ih=imgObj.height;
    imgObj=null;
    
    
    //this.blur();
    Report('reportvote',1175222);
}

function setImgb()
{
//    imgObj = new Image();
if(h!=0&&w!=0)
{
    imgObj = document.getElementById('imgShowBig');
    
    imgObj.height=h;
    imgObj.width=w;
    iw=imgObj.width;
    ih=imgObj.height;
    //this.blur();
    Report('reportvote',1175222);
    }
}

function setImgc()
{
if(h!=0&&w!=0)
{
//    imgObj = new Image();
    imgObj = document.getElementById('imgShowBig');
    imgObj.height=ih+100*h/w;
    imgObj.width=iw+100;
    iw=imgObj.width;
    ih=imgObj.height;
    //alert(imgObj.width+"|"+imgObj.height);
    //this.blur();
    Report('reportvote',1175222);
}
}

function setImgd()
{
if(h!=0&&w!=0)
{
//    imgObj = new Image();
    imgObj = document.getElementById('imgShowBig');
    imgObj.height=ih-100*h/w;
    imgObj.width=iw-100;
    iw=imgObj.width;
    ih=imgObj.height;
    //this.blur();
    Report('reportvote',1175222);
}
}

function resetxy(img)
{
    imgObj1 = new Image();
    // 设置图像源
    imgObj1.src = img.src;
    h=imgObj1.height;
    w=imgObj1.width;
    if(w>=550)
    {
        img.width=550;
        img.height=h * 550 / w;
    }
    else
    {
        img.width=w;
        img.height=h;
    }
    //img.style.display='block';
//    if(w>0 && h>0){ 
//        if(w/h>= 200/150){ 
//           if(w>600){ 
//               img.width=200; 
//               img.height=(h*200)/w;
//           }else{ 
//                  img.width=w; 
//                  img.height=h; 
//                } 
//        } 
//        else{ 
//                if(h>150){ 
//                       img.height=150; 
//                       img.width=(200*150)/h; 
//                }else{ 
//                        img.width=w; 
//                        img.height=h; 
//                     } 
//            } 
//    }
}
