/************************************************************
*genericdialogfuncs.js
*
点击选择图片并自动增加至FORM之文框。
本功能相关文件：
imgselect.asp
imglist.asp
genericdialogfuncs.js
popup.css
************************************************************/
function btnMouseover(el) {
  with (el.style) {
	borderLeft = "1px solid buttonhighlight";
	borderRight = "1px buttonface outset";
	borderTop = "1px solid buttonhighlight";
	borderBottom = "1px solid buttonshadow";
	background = "buttonface";
	padding = "1px";
  }
}

function btnMouseout(el) {
  with (el.style) {
    background = "buttonface";
	border = "1px solid buttonface";
	padding = "1px";
  }
}

function btnMousedown(el) {
  with (el.style) {
    borderLeft = "1 solid buttonshadow";
	borderRight = "1 solid buttonhighlight";
	borderTop = "1 solid buttonshadow";
	borderBottom = "1 solid buttonhighlight";
	paddingTop = "2px";
	paddingLeft = "2px";
	paddingBottom = "0px";
	paddingRight = "0px";
	backgroundColor = "buttonhighlight";
  }
}

function btnMouseup(el) {
  with (el.style) {
    borderLeft = "1px solid buttonhighlight";
	borderRight = "1px buttonface outset";
	borderTop = "1px solid buttonhighlight";
	borderBottom = "1px solid buttonshadow";
	background = "buttonface";
	padding = "1px";
  }
}

function autoDialogHeight() {
  var h = document.body.scrollHeight;
  window.dialogHeight = (h + 30) + "px";
}

function highlightcell(c) {
  var allcells = document.getElementsByTagName("TD");
  for (i=0;i<allcells.length;i++) {
    allcells[i].style.backgroundColor = "white"; allcells[i].style.color = "black";
  }
  c.style.backgroundColor = "highlight"; c.style.color = "highlighttext";
}

function websn_upfolder(path) {
 arrloc = curloc.split("/"); str = "";
 for (i=0;i<arrloc.length-2;i++) {
   str += arrloc[i] + "/";
 }
 location.href = path + ".asp?loc=" + str + "&u=y";
}

function dorefresh() {
 location.href = location.href;
}