//加入收藏夹
function bookmarkit(sUrl,sTitle){
	window.external.addFavorite(sUrl,sTitle);
}
//下拉菜单跳转
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//当前日期
function writeCurDate(){
	today=new Date();
	var d=new Array(
	"星期日",
	"星期一",
	"星期二",
	"星期三",
	"星期四",
	"星期五",
	"星期六");
	document.writeln("<font color=#666666 style='font-size:9pt;font-family: 宋体'>",today.getYear(),"年",today.getMonth()+1,"月",today.getDate(),"日&nbsp;&nbsp;" ,d[today.getDay()],"</font>" ); 
}
function bbimg(o){
	var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}

function openScript(url, width, height){
	var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}
function chkdiv(divid){
	var chkid=document.getElementById(divid);
	if(chkid != null){return true; }
	else {return false; }
}

function getpara(){
	var str,pos,parastr
	str = window.location.href;
	pos = str.indexOf("?");
	parastr = str.substring(pos+1);
	return parastr;
}

function oblog_ViewCode(rnum)
{
	var bodyTag="<html><head><style type=text/css>.quote{margin:5px 20px;border:1px solid #CCCCCC;padding:5px; background:#F3F3F3 }\nbody{boder:0px}.HtmlCode{margin:5px 20px;border:1px solid #CCCCCC;padding:5px;background:#FDFDDF;font-size:14px;font-family:Tahoma;font-style : oblique;line-height : normal ;font-weight:bold;}\nbody{boder:0px}</style></head><BODY bgcolor=\"#FFFFFF\" >";
	bodyTag+=document.getElementById('scode'+rnum).value
	bodyTag+="</body></html>"
	preWin=window.open('preview','','left=0,top=0,width=550,height=400,resizable=1,scrollbars=1, status=1, toolbar=1, menubar=0');
	preWin.document.open();
	preWin.document.write(bodyTag);
	preWin.document.close();
	preWin.document.title="查看代码内容";
	preWin.document.charset="UTF-8";
}

function checkAll(all)//用于判断全选记录的函数
{
	var objID = document.getElementsByName("selectID");
	for (var i=0; i<objID.length; i++){
		objID[i].checked = all.checked;
	}
}
function doPostBack(formObj,actionFile) //用于提醒操作的函数
{
	if(confirm('您确定执行的操作吗?')){
		formObj.action=actionFile;
		formObj.submit();
		return true;
	}
	return false;
}
//省市选择，注意市的文本框名必须为slt_City
function chkSel(formOjb,formField){
	with (formOjb){
		if(formField.value) {
			slt_City.options.length=0;
			for(var i=0;i<selects[formField.value].length;i++){
				slt_City.add(selects[formField.value][i]);
			}
		}
	}
}
//省市选择，注意市的文本框名必须为slt_City
function magSel(formOjb,formField){
	with (formOjb){
		if(formField.value) {
			slt_CatalogID.options.length=0;
			for(var i=0;i<selects[formField.value].length;i++){
				slt_CatalogID.add(selects[formField.value][i]);
			}
		}
	}
}
function getImg(){
	if (document.uploadfrm.ico.value==""){
		document.uploadfrm.imgIcon.src="images/ico_default.gif";
	}
	else{
		document.uploadfrm.imgIcon.src=document.uploadfrm.ico.value;
	}
}
	
function chkdiv(divid){
	var chkid=document.getElementById(divid);
	if(chkid != null){return true; }
	else {return false; }
}


function SelectColor(what){
	var dEL = document.all("d_"+what);
	var sEL = document.all("s_"+what);
	var arr = showModalDialog("../editor/selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0; help:0");
	if (arr) {
		dEL.value=arr;
		sEL.style.backgroundColor=arr;
	}
}
// 修改文本框高度
function chgSize(num,objname)
{
	var obj=document.getElementById(objname)
	if (parseInt(obj.rows)+num>=6) {
		obj.rows = parseInt(obj.rows) + num;	
	}
	if (num>0)
	{
		obj.width="90%";
	}
}
//表格背景色切换

//showmenu vmenu:内容，允许为空,vmenuobj DIV数据ID，MOD 0=关闭浏览器自适应，用于版面导航菜单
function showmenu(e,vmenu,vmenuobj,mod){
	if (!document.all&&!document.getElementById&&!document.layers)
		return
	var which=vmenu;
	if (vmenuobj)
	{
		var MenuObj = fetch_object(vmenuobj);
		if (MenuObj)
		{
			which = MenuObj.innerHTML;
		}
	}
	if (!which)
	{
		return
	}
	clearhidemenu();
	ie_clearshadow();
	menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
	menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj
	if (ie4||ns6)
		menuobj.innerHTML=which
	else{
		menuobj.document.write('<layer name=gui bgcolor="#E6E6E6" width="165" onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
		menuobj.document.close()
	}
	menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
	menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
	eventX=ie4? event.clientX : ns6? e.clientX : e.x
	eventY=ie4? event.clientY : ns6? e.clientY : e.y
	var rightedge=ie4? document.body.clientWidth-eventX : window.innerWidth-eventX
	var bottomedge=ie4? document.body.clientHeight-eventY : window.innerHeight-eventY
	var getlength
		if (rightedge<menuobj.contentwidth){
			getlength=ie4? document.body.scrollLeft+eventX-menuobj.contentwidth+menuOffX : ns6? window.pageXOffset+eventX-menuobj.contentwidth : eventX-menuobj.contentwidth
		}else{
			getlength=ie4? ie_x(event.srcElement)+menuOffX : ns6? window.pageXOffset+eventX : eventX
		}
		menuobj.thestyle.left=getlength+'px'
		if (bottomedge<menuobj.contentheight&&mod!=0){
			getlength=ie4? document.body.scrollTop+eventY-menuobj.contentheight-event.offsetY+menuOffY-23 : ns6? window.pageYOffset+eventY-menuobj.contentheight-10 : eventY-menuobj.contentheight
		}	else{
			getlength=ie4? ie_y(event.srcElement)+menuOffY : ns6? window.pageYOffset+eventY+10 : eventY
		}
	menuobj.thestyle.top=getlength+'px'
	menuobj.thestyle.visibility="visible"
	ie_dropshadow(menuobj,"#999999",3)
	return false
}

