// JavaScript Document
<!--
function Func_Confirm(mess){

if(window.confirm(mess)){
	return true;
	}
else{
	return false;
	}
}

function ConfirmDel(){

if(window.confirm('确定要删除吗?')){
	return true;
	}
else{
	return false;
	}
}

function getAbsoluteLeft( ob ){
if(!ob){return null;}
    var mendingOb = ob;
    var mendingLeft = mendingOb .offsetLeft;
    while( mendingOb != null && mendingOb .offsetParent != null && mendingOb .offsetParent.tagName != "BODY" ){
      mendingLeft += mendingOb .offsetParent.offsetLeft;
      mendingOb = mendingOb .offsetParent;
    }
return mendingLeft ;
}

function getAbsoluteTop( ob ){
if(!ob){return null;}
var mendingOb = ob;
var mendingTop = mendingOb .offsetTop;
while( mendingOb != null && mendingOb .offsetParent != null && mendingOb .offsetParent.tagName != "BODY" ){
    mendingTop += mendingOb .offsetParent.offsetTop;
    mendingOb = mendingOb .offsetParent;
}
return mendingTop ;
}

//////////////////////////////////////上传图片验证/////////////////////////
function Func_Display(PicPath){	//预览图片
document.all.preview.src = PicPath;
}

function Func_Select(form_name, MaxWidth, MaxHeight){	//选择上传图片时，验证
var form_name,MaxWidth,MaxHeight;
if(document.all(form_name).value!=""){

document.all.preview.src=document.all(form_name).value;
Fanc_Formats(form_name);	//验证文件格式

	if((document.all.preview.width >MaxWidth)||(document.all.preview.height >MaxHeight)){
	alert("图片的尺寸太大，标准为" + MaxWidth +"*" + MaxHeight +"象素。");
	document.all.preview.src="Inc/white_pix.gif";
	document.all(form_name).select();
	document.execCommand("delete")
	return false;
	}
}
}

function Fanc_Formats(form_name){
	var field=document.all(form_name);
	if (field.value.toLowerCase().indexOf("http://") > -1){
	alert("请选择本地图片上传。");
	document.all.preview.src="Inc/white_pix.gif";
	document.all(form_name).select();
	document.execCommand("delete")
	return false;
	}

	var tmp = field.value.toLowerCase().substring(field.value.length-4);
	if ((tmp.lastIndexOf(".gif") <=-1) && (tmp.lastIndexOf(".jpg") <= -1)){
	alert("请正确选择图片格式：gif，jpg。");
	document.all.preview.src="Inc/white_pix.gif";
	document.all(form_name).select();
	document.execCommand("delete")
	return false;
	}
}

//setTimeout Location
function Func_setTimeoutLocation(varMess, varUrl, varTime)
{
window.setTimeout("alert('" + varMess + "'); window.location='" + varUrl + "';", varTime);
}

function SubMInitialize(){
document.all['SubM'].style.left=getAbsoluteLeft(Menu);
document.all['SubM'].style.top=getAbsoluteTop(Menu) + 30;
}

function SearKeysOn(Mess){
if (document.all.SearKeys.value==""){
	document.all.SearKeys.value = Mess;
}
else if(document.all.SearKeys.value==Mess){
	document.all.SearKeys.value = "";
}
}
-->
