﻿//显示/隐藏
function $(_sId){
	return document.getElementById(_sId);
}
function hideright(_sId,_imgid,imgdown,imgup){
	if($(_sId).style.display == "none")
	{
	    $(_sId).style.display ="";
	    $(_imgid).src=imgup;
	}
	else
	{
	    $(_sId).style.display = "none";
	   $(_imgid).src=imgdown ;
	}
}
function hiderightNoimg(_sId){
	//$(_sId).style.display = $(_sId).style.display == "none" ? "" : "none";
	if($(_sId).style.display == "none")
	{
	    $(_sId).style.display ="";
	}
	else
	{
	    $(_sId).style.display = "none";
	}
}

function ShowDialog(url,width,height)
{
    alert('aa');
    window.showModalDialog(url,window,'dialogWidth:'+width+';dialogHeight:'+height+';help:0;status:0;scroll:0;center:1;');
}	

var row_marked = Array();
var row_over_color;
var row_marked_color;

function onRowOver(row, rowNo){
  if(row_marked[rowNo]==null||!row_marked[rowNo]){
    // use row.bgColor save ori color since it has no effect if has style backgroundColor
    row.bgColor=row.style.backgroundColor;
    row.style.backgroundColor=row_over_color!=null?row_over_color:'#cccccc';
    row.style.border='1px dashed red';
  }
}
function onRowOut(row, rowNo){
  if(row_marked[rowNo]==null||!row_marked[rowNo]){
    row.style.backgroundColor=row.bgColor;
    row.bgColor='';
    row.style.border='';
  }
}
function onRowClicked(row, rowNo){
  // FIXME: following several lines only works on IE
  whichIt = event.srcElement;
	while (whichIt.tagName != "A") {
		whichIt = whichIt.parentElement;
		if (whichIt == null){
			// no link clicked, passed
			break;
		}
	}
	if (whichIt != null){
	  return;
	}
	if(row_marked[rowNo]==null||!row_marked[rowNo]){
	  row_marked[rowNo]=true;
	  row.style.backgroundColor = row_marked_color!=null?row_marked_color:'orange';
	}
	else{
	  row_marked[rowNo]=false;
	  row.style.backgroundColor = row_over_color!=null?row_over_color:'#cccccc';
	}
}

//加入收藏夹
function bookmark(){
var title=document.title
var url=document.location.href
if (window.sidebar) window.sidebar.addPanel(title, url,"");
else if( window.opera && window.print ){
var mbm = document.createElement('a');
mbm.setAttribute('rel','sidebar');
mbm.setAttribute('href',url);
mbm.setAttribute('title',title);
mbm.click();}
else if( document.all ) window.external.AddFavorite( url, title);
}



