/* 加入收藏 */
function addBookmark(title,url) {
    if (window.sidebar) {   
        window.sidebar.addPanel(title, url,"");   
    } else if( document.all ) {  
        window.external.AddFavorite( url, title);  
    } else if( window.opera && window.print ) {  
        return true;  
    }  
}

/* Tab */

function scrollDoor(){
}
scrollDoor.prototype = {
sd : function(menus,divs,openClass,closeClass){
 var _this = this;
 if(menus.length != divs.length)
 {
  alert("菜单层数量和内容层数量不一样!");
  return false;
 }    
 for(var i = 0 ; i < menus.length ; i++)
 { 
  _this.$(menus[i]).value = i;    
  _this.$(menus[i]).onclick = function(){
     
   for(var j = 0 ; j < menus.length ; j++)
   {      
    _this.$(menus[j]).className = closeClass;
    _this.$(divs[j]).style.display = "none";
   }
   _this.$(menus[this.value]).className = openClass; 
   _this.$(divs[this.value]).style.display = "block";    
  }
 }
 },
$ : function(oid){
 if(typeof(oid) == "string")
 return document.getElementById(oid);
 return oid;
}
}

/*首页的tab*/
function GetObj(objName){
if(document.getElementById){
return eval('document.getElementById("' + objName + '")');
}else if(document.layers){
return eval("document.layers['" + objName +"']");
}else{
return eval('document.all.' + objName);
}
}
function PARMenu(index,flag){
for(var i=0;i<4;i++){/* max-4 */
if(GetObj("content"+i)&&GetObj("PARm"+i)){
GetObj("content"+i).style.display = 'none';
GetObj("PARm"+i).className = "out";
}
}
if(GetObj("content"+index)&&GetObj("PARm"+index)){
GetObj("content"+index).style.display = 'block';
GetObj("PARm"+index).className = "on";
}
}

/* input特效 add by Gaojingliang */

function $( id ){return document.getElementById( id );}

function inputEvent(){
var obj = document.getElementsByTagName('input');
	for(var i=0;i<obj.length;i++){
		
		if(obj[i].type == 'text' ){
		
		obj[i].onFocus=function(){
	                                                                                                                                                                                             
			fEvent('focus',this);
		};
		obj[i].onBlur=function(){
			fEvent('blur',this);
		};
		obj[i].onMouseOver=function(){
			fEvent('mouseover',this);
		};
		obj[i].onMouseOut=function(){
			fEvent('mouseout',this);
		}
		//alert(obj[i].onMouseOver)
		}
	}
}

	function fEvent(sType,oInput){
	
		switch (sType){
			case "focus" :
				oInput.isfocus = true;
			case "mouseover" :
				oInput.style.borderColor = '#9ecc00';
				oInput.style.backgroundColor = '#FFF7D7';
				break;
			case "blur" :
				oInput.isfocus = false;
			case "mouseout" :
				if(!oInput.isfocus){
					oInput.style.borderColor='#484848';
				oInput.style.backgroundColor = '#FFFFFF';
				}
				break;
		}
	} 

/* 全选 add by Gaojingliang */

/* checkbox显示隐藏div add by Gaojingliang */
function show_checkbox_div(id){
	if(document.getElementById('checkbox'+id).checked==true){
		document.getElementById('checkbox_div'+id).style.display="";
	}
	else if(document.getElementById('checkbox'+id).checked!=true){
		document.getElementById('checkbox_div'+id).style.display="none";
	}
}

/* 显示简单信息 add by Gaojingliang */
var Hide=null; 
function ShowHideThing(HideThing){ 
  var obj = document.getElementById(HideThing); 
  if (Hide!=null&&Hide!=obj) 
    Hide.style.display='none'; 
  Hide=obj; 
  if (obj.style.display=='none'){ 
    obj.style.display=''; 
  }else{ 
    obj.style.display='none'; 
  } 
} 

/* Graybox add by Gaojingliang */
function closebox(){
	parent.parent.GB_CURRENT.hide();
	parent.parent.location.reload();
}


/* PNG图象透明 add by Gaojingliang */
function correctPNG() 
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText 
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle 
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
img.outerHTML = strNewHTML
i = i-1
}
}
}
if (document.all){
 window.attachEvent('onload',correctPNG)//IE中
}
else{
 window.addEventListener('load',correctPNG,false);//firefox
}