function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function $(str){
	return document.getElementById(str);
}
function _(str){
	return document.getElementsByTagName(str);
}
function msg(boxtitle,boxtype,boxwidth,msg,url){
	$("msg_div_main").style.width = boxwidth;
	$("msg_div_main").style.left = (_("body")[0].clientWidth - boxwidth) / 2;
	$("msg_div_main").style.top  = (_("body")[0].clientHeight - 220) / 2;
	var msg_div_main_but_tmp = "<br /><br /></div><div style='text-align:center;line-height:14px;'>"
				+ "<button class='msg_div_main_but' id='msg_div_main_but' "
				+ "onclick=\"msg_close_tmp_biyuan();" + url + "\">确 定</button>";
	switch(boxtype * 1){
		case 1:
			$("msg_div_main_content").innerHTML = msg + msg_div_main_but_tmp;
			//$("msg_div_main_but").focus();
		break;
		case 2:
			$("msg_div_main_content").innerHTML =  msg + msg_div_main_but_tmp
							 + "&nbsp;&nbsp;<button class='msg_div_main_but' "
							 + "onclick='msg_close_tmp_biyuan();'>取 消</button>";
			//$("msg_div_main_but").focus();
		break;
		case 3:
			$("msg_div_main_content").innerHTML =  msg;
		break;
		defualt:
			$("msg_div_main_content").innerHTML =  msg;
		break;
	}
	$("msg_div_main_title").innerHTML =  boxtitle;
	$("msg_div_all").style.zIndex  = 100;
	$("msg_div_main").style.zIndex = 200;
	$("msg_div_all").style.display = "";
	$("msg_div_main").style.display = "";
	$("msg_div_all").oncontextmenu = function(){
		return false;
	}
	$("msg_div_main").oncontextmenu = function(){
		return false;
	}
}
function msg_close_tmp_biyuan(){
	$('msg_div_all').style.display='none';
	$('msg_div_main').style.display='none';
}

//加入对话框移动代码
var msg_md = false,msg_mobj,msg_ox,msg_oy;
document.onmousedown = function(){
	if(typeof(event.srcElement.msg_canmove) == "undefined"){
		return;
	}
	if(event.srcElement.msg_canmove){
		msg_md = true;
		msg_mobj = $(event.srcElement.msg_forid);
		msg_ox = msg_mobj.offsetLeft - event.x;
		msg_oy = msg_mobj.offsetTop - event.y;
	}
}
document.onmouseup = function(){
	msg_md = false;
}
document.onmousemove = function(){
	if(msg_md){
		msg_mobj.style.left = event.x + msg_ox;
		msg_mobj.style.top  = event.y + msg_oy;
	}
}

document.writeln("<style type='text/css'>"
	+ "#msg_div_all {width:500%;height:500%;left:0px; top:0px;position:absolute;filter:Alpha(opacity=70);background:#222222;}"
	+ "#msg_div_main {position:absolute;}"
	+ "#msg_div_main_title {font-size:12px;color:#2C71AF;font-family:verdana;cursor:default;cursor:move;}"
	+ "#msg_div_main_content {font-size:12px;color:#2C71AF;padding-left:8px;}"
	+ ".msg_div_main_but {background:url(/agphoto/rina/Images/buttonbg.gif);width:65px;heigt:20px;border:none;padding-top:3px;font-size:12px;}"
	+ "</style>"
	+ "<div id='msg_div_all' style='display:none;'></div>"
	+ "<div id='msg_div_main' style='display:none;'>"
	+ "<table width='100%' height='29' border='0' cellspacing='0' cellpadding='0'>"
	+ "<tr>"
	+ "<td width='25'><img src='/agphoto/rina/Images/bg_01.gif' width='25' height='29' alt='' /></td><td background='/agphoto/rina/Images/bg_02.gif' width='3'></td>"
	+ "<td background='/agphoto/rina/Images/bg_02.gif' msg_canmove='true' msg_forid='msg_div_main' id='msg_div_main_title'></td>"
	+ "<td background='/agphoto/rina/Images/bg_02.gif' align='right' style='padding-top:4px'>"
	+ "<img src='/agphoto/rina/Images/bg_05.gif' width='21' height='21' style='cursor:pointer;' alt='关闭' "
	+ "onMouseover=\"this.src='/agphoto/rina/Images/bg_13.gif'\" "
	+ "onMouseout=\"this.src='/agphoto/rina/Images/bg_05.gif'\" onMouseup='msg_close_tmp_biyuan();' "
	+ "onMousedown=\"this.src='/agphoto/rina/Images/bg_18.gif'\"></td>"
	+ "<td width='6'><img src='/agphoto/rina/Images/bg_06.gif' width='6' height='29' alt='' /></td>"
	+ "</tr>"
	+ "</table>"
	+ "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
	+ "<tr>"
	+ "<td width='3' background='/agphoto/rina/Images/bg_07.gif'></td>"
	+ "<td bgcolor='#F7F7F7'><br /><div id='msg_div_main_content' style='text-align:justify;line-height:18px;'></div><br /><br /></td>"
	+ "<td width='3' background='/agphoto/rina/Images/bg_08.gif'></td>"
	+ "</tr>"
	+ "<tr>"
	+ "<td width='3' height='3'><img src='/agphoto/rina/Images/bg_09.gif' width='3' height='3' alt='' /></td>"
	+ "<td background='/agphoto/rina/Images/bg_11.gif'></td>"
	+ "<td width='3' height='3'><img src='/agphoto/rina/Images/bg_10.gif' width='3' height='3' /></td>"
	+ "</tr>"
	+ "</table>"
	+ "</div>");