
//颜色选择
function getMyColor(t)	{
  var old_color = ( t.value.indexOf('#') == 0 ) ? '?'+t.value.substr(1) : '?' + t.value;
  var color = showModalDialog("./menumanager/select_color.html"+old_color+"", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0");
  if (color != null) {
	  t.value = color;
	  t.style.color = color;
  }  else {
	  t.focus();
  }
  return true;
}
//打开窗口

function showDialog(pagePath, args, width, height) {
	var useDialog = window.showModalDialog;
	var s = '';
	if(useDialog){
		s += "dialogWidth:" + (width+8) + "px;dialogHeight:" + (height+40) + "px; ";
		return showModalDialog(pagePath, window, s+"help:no;scroll:yes;status:no");
	}else{
		s = "width=" +width+ ",height=" + height + ",";
		var win = window.open(pagePath, 'abc', s + "resizable=no,toolbar=yes,scrollbars=yes,status=no,alwaysLowered=yes,");
		
 		win.moveTo( (screen.availWidth - width)/2, (screen.availHeight - height )/2 );
	}
}



//Switch Tab Effect
function switchTab(tabpage,tabid){
        var oItem = document.getElementById(tabpage);   
	for(var i=0;i<oItem.children.length;i++){
		var x = oItem.children(i);	
		x.className = "";
		var y = x.getElementsByTagName('a');
		y[0].style.color="#333333";
	}	
	document.getElementById(tabid).className = "Selected";
	var dvs=document.getElementById("cnt").getElementsByTagName("div");
	for (var i=0;i<dvs.length;i++){
	  if (dvs[i].id==('d'+tabid))
	    dvs[i].style.display='block';
	  else
  	  dvs[i].style.display='none';
	}
}

//复制代码


function HighlightAll(theField) {
  var tempval=eval("document."+theField)
  tempval.focus()
  tempval.select()
  if (document.all){
    therange=tempval.createTextRange()
    therange.execCommand("Copy")
    window.status="copied to clipboard success!"
    setTimeout("window.status=''",1800)
  }
}


