//这里是设置页面的背景颜色,写在这里是为了拿到 我们这个工程的根目录
//document.body.background=document.getElementById("host_link").value+"/images/mbg3.jpg" ;
//loading.....................

/*
AddProcessbar();//初始化Loading
var bwidth=0;
var swidth = document.all.waiting.clientWidth;
var time = 0.01;
var count = 0;
var obj;


// set onunload to do clear, avoid memory leak.
window.onunload = function(){
	document.onkeypress = null;
};


	
function ShowLoading()//显示Loading
{
	var divObj= document.getElementById("waiting");
	if(divObj.style.visibility == 'visible'){
		alert("Page loading.");
		return false;
	}
	//下面是设置Loading的位置
	divObj.style.top = (document.body.offsetHeight - divObj.clientHeight) / 2 + document.body.scrollTop;
	divObj.style.left = (document.body.offsetWidth - divObj.clientWidth) / 2 + document.body.scrollLeft;
	divObj.style.visibility = 'visible';
	//moveLoading();
	return true;
}

function moveLoading(){//移动Loading
	if (bwidth<swidth*0.95){//alert(bwidth+'AAA'+swidth*0.95);
		bwidth += (swidth - bwidth) * time;
		document.sbar.width = bwidth;
	}
	setTimeout("moveLoading();",150);
}

function AddProcessbar()//首先画出Loading
{
var Str="";
Str+= "<div id=waiting style=position:absolute;top:50px;left:100px;z-index:1;visibility:hidden >";
Str+= "<img src=\"" + document.getElementById("host_link").value+"/images/loading.gif" + "\"/>";
Str+= "<IFRAME  scrolling=\"no\"  style=\"position:absolute; left:0px; top:0px; width:100%; height:100%; z-index:1; border-style:none; display:block; filter: alpha(opacity=0);\"></IFRAME>";
Str+= "</div>";
document.write(Str)
}

function AddProcessbarOld()//首先画出Loading
{
//var host = document.getElementById("host_link").value;
var Str="";
Str+= "<div id=waiting style=position:absolute;top:50px;left:100px;z-index:1;visibility:hidden >";
Str+= "<table style='border-style: solid;border-width: 1pt;border-color: #63686B;border-bottom-style: solid;border-bottom-width: 1pt;border-bottom-color: #63686B;border-collapse: collapse;border-spacing: 0pt;'>"
Str+= " <tr>"
Str+= " <td bgcolor=#7BB0D0 height=30px width=300px align=center  style=color:#f4f4f4; id=abc>"
Str+= " Loading......"
Str+= " </td>"
Str+= " </tr>"
Str+= " <tr>"
Str+= " <td bgcolor=#F6F6F6>"
Str+= " <img width=1 height=10 name=sbar style=background-color:#6699cc>"
Str+= " </td>"
Str+= " </tr>"
Str+= "</table> "
Str+= "<IFRAME  scrolling=\"no\"  style=\"position:absolute; left:0px; top:0px; width:100%; height:100%; z-index:1; border-style:none; display:block; filter: alpha(opacity=0);\"></IFRAME>"
Str+= "</div>"
document.write(Str)
}




function ProcessBar(xtime){
    //if(xtime!=null){
	//	time = xtime;
	//}
	
	////document.all.abc.innerHTML="Loading......";	
	//flashs();
	return ShowLoading();
}

function ProcessBar2(){
	//mainFrame.document.all.abc.innerHTML="Loading......";	
	//这里是调用mainFrame框价里面的方法
	//mainFrame.flashs();//这里是让字符串"Loading......"不断的变颜色
	return mainFrame.ShowLoading();;
}

function flashs(){
if(abc.style.color=="#f7f7f7"){
	abc.style.color="#6699cc";
	setTimeout('flashs()',500);
	}
else{
	abc.style.color="#f7f7f7";
	setTimeout('flashs()',500);
	}
}

*/


var submitObj=null;

 /**
 *@author paul.lee
 *@date 2007/08/30
 * 将默认键盘enter事件移到提交按钮
 */
function pressEven(evt){
	evt = (evt) ? evt : ((window.event) ? event : null);
    if (evt) {
       var elem = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
       if (elem) {
           var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
           if(charCode==13){
           	 if(submitObj!=null && typeof submitObj!="undefined"){
           	 	submitObj.click();
           	 }
           	 return false;
           }
       }
    }

}
function enterEven(Obj){
	if(Obj!=null && typeof Obj!="undefined"){
		submitObj=Obj;
	}else{
		submitObj=null;
	}
	document.onkeypress = pressEven;
}

enterEven(null);
//enterEven(document.getElementById("form1:Save"));



 /**
 *@author paul.lee
 *@date 2007/08/30
 * 获取页面文件名
 */
function getPageID(){
	var url=document.getElementById("url_link").value;
	var page=url.substring(url.lastIndexOf("/")+1,url.lastIndexOf("."));
	return(page);
}

 /**
 *@author paul.lee
 *@date 2007/08/30
 * 改变位置拦信息
 */
function navigationPath(){
	if(parent.pageArray){
		parent.pageClick(getPageID());
	}
		
}

 /**
 *@author paul.lee
 *@date 2007/08/30
 * 弹出提示save信息
 */
function saveConfirm(){
	if(confirm('Are you sure you want to save?')){
		return true;
	}
	return false;
}

 /**
 *@author paul.lee
 *@date 2007/09/04
 * 弹出提示delete信息
 */
function delConfirm(){
	if(confirm('Are you sure you want to delete ?')){
		return true;
	}
	return false;
}

 /**
 *@author paul.lee
 *@date 2007/09/04
 * 弹出提示clear信息
 */
function clearConfirm(){
	if(confirm('Are you sure you want to clear ?')){
		return true;
	}
	return false;
}



 /**
 *@author paul.lee
 *@date 2007/09/04
 * 弹出提示msg信息
 */
function msgConfirm(msg){
	return(confirm(msg));
}


function PaymentClearanceConfirm(){
	return(confirm('Are you sure you want to Payment Clearance ?'));		
}


function test(){
	alert("test action");
}


//navigationPath();
