﻿

// <![CDATA[ 

/**
* 重新设定图片大小
*
*@param picname 图片路径
*@param width_v  目标宽度
*@param height_v 目标高度
*/
function resizepic(picname,width_v,height_v){
if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
var backw=width_v;
var backh=height_v;
}else
{
var backw=width_v+8;
var backh=height_v+8;
}
var i = String(Math.floor(Math.random()*10000)+1);
document.writeln("<div style='width:"+backw+"px;height:"+backh+"px;padding:3px;border:0px solid #a1a1a1;backgournd:#fff;'>");
document.writeln("<div style='width:"+width_v+"px;height:"+height_v+"px;overflow:hidden;'>");
document.writeln("<img src='"+picname+"' id='img"+i+"'/></div></div>");
var pic=document.getElementById("img"+i);
if((width_v/height_v)>(pic.offsetWidth/pic.offsetHeight)){
pic.width=width_v;
}else
{
pic.height=height_v;
}
}



function externallinks()
{ 
 if(!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) 
 { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
   {
     anchor.target = "_blank"; 
   }
 } 
} 
window.onload = externallinks;


/*下拉菜单*/
function ShowFloatDiv(selfid,aa)
{
  
 if( selfid != null )
 { 
 	selfid.style.position = 'relative';
  document.getElementById(aa).style.top = CountPx(selfid.offsetTop,30);
  document.getElementById(aa).style.left = CountPx(selfid.offsetLeft/2,120);
  }
  
  
 document.getElementById(aa).style.display = 'block';

 
}
function HiddenFloatDiv(aa)
{
 	document.getElementById(aa).style.display = 'none';

}
function CountPx(PxA,PxB)
{
 	return (parseInt(PxA.toString().replace('px','')) + parseInt(PxB.toString().replace('px',''))).toString() + 'px';
}


/*下拉菜单*/
function ShowFloatDiv2(selfid,aa)
{
  
 if( selfid != null )
 { 
 	selfid.style.position = 'relative';
  document.getElementById(aa).style.top = CountPx(selfid.offsetTop,38);
  document.getElementById(aa).style.left = CountPx(selfid.offsetLeft,0);
  }
  
  
 document.getElementById(aa).style.display = 'block';

 
}
function HiddenFloatDiv2(aa)
{
 	document.getElementById(aa).style.display = 'none';

}
function CountPx(PxA,PxB)
{
 	return (parseInt(PxA.toString().replace('px','')) + parseInt(PxB.toString().replace('px',''))).toString() + 'px';
}




function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();

function ceowenajax(cid) {
    http.open('get','/user/message/updatestate?id='+cid);
    http.send(null);
}



//显示用时
function showdt()
{
	document.getElementById("show").innerHTML = document.getElementById("datetime").innerHTML;
}

// ]]>