function DialogLocation()
{
	if (window.innerWidth)
	{
		var ww = window.innerWidth;
		var wh = window.innerHeight;
		var bgX = window.pageXOffset;
		var bgY = window.pageYOffset;
	}
	else
	{
		var ww = document.documentElement.offsetWidth;
		var wh = document.documentElement.offsetHeight;
		var bgX = document.documentElement.scrollLeft;
		var bgY = document.documentElement.scrollTop;
	}
	t_DiglogX = (bgX + ((ww - t_DiglogW)/2));
	t_DiglogY = (bgY + ((wh - t_DiglogH)/2));
}

function openPage(url,pageName,afterFunction){
	fillPage(pageName,"<div style=\"text-align:center;background:#FF9900;width:124px;height:24px;border:solid #000 1px;line-height:25px;margin:50px 0 0 0;font-size: 12px;\">正在读取,请稍候...</div>");
	//setInnerHTML(document.getElementById(pageName),fillData);
	GetFillAjax(url,pageName,afterFunction);
}

function showPage(url,width,height,afterFunction)
{
	ScreenConvert();
	DialogShow("<div id=\"DialogLoading\" style=\"line-height:25px;font-size: 12px;\">正在读取,请稍候...</div>",110,24,124,24,"#FF9900");
	GetAjax(url,width,height,afterFunction);
}

function Ajax_submit(theForm,url,pageName,afterFunction){
	var poststr = "";
	var host = window.location.host;
	var url = "http://" + host + "/" + url;
	for(i=0;i<theForm.length;i++){
		if(i==0){
			connect = "";
		}else{
			connect = "&";
		}
		element_type = theForm.elements[i].type;
		element_name = theForm.elements[i].name;
		element_value = theForm.elements[i].value;
		if((element_type=="checkbox" || element_type=="radio") && theForm.elements[i].checked){
			poststr += connect + element_name + "=" + element_value;
		}else if(element_type!="checkbox" && element_type!="radio"){
			poststr += connect + element_name + "=" + element_value;
		}
	}
	//ScreenConvert();
	fillPage(pageName,"<div align='center' style=\"background:#FF9900;width:124px;height:24px;border:'solid #000 1px';line-height:25px;margin:50px 0 0 0;font-size: 12px;\">正在发送,请稍候...</div>");
	PostFillAjax(url,poststr,pageName,afterFunction);
}

function Ajax_submitDialog(theForm,url,width,height,afterFunction){
	var poststr = "";
	var host = window.location.host;
	var url = "http://" + host + "/" + url;
	for(i=0;i<theForm.length;i++){
		if(i==0){
			connect = "";
		}else{
			connect = "&";
		}
		element_type = theForm.elements[i].type;
		element_name = theForm.elements[i].name;
		element_value = theForm.elements[i].value;
		if((element_type=="checkbox" || element_type=="radio") && theForm.elements[i].checked){
			poststr += connect + element_name + "=" + element_value;
		}else if(element_type!="checkbox" && element_type!="radio"){
			poststr += connect + element_name + "=" + element_value;
		}
	}
	//alert(poststr);
	ScreenConvert();
	DialogShow("<div align='center' style=\"background:#FF9900;width:124px;height:24px;line-height:25px;font-size: 12px;\">正在发送,请稍候...",110,24,124,24,"#FF9900");
	PostAjax(url,poststr,afterFunction,width,height);
}

function Ajax_submitPost(theForm,CFKname,url,width,height,afterFunction){
	var poststr = "";
	var host = window.location.host;
	var url = "http://" + host + "/" + url;
	for(i=0;i<theForm.length;i++){
		if(i==0){
			connect = "";
		}else{
			connect = "&";
		}
		element_type = theForm.elements[i].type;
		element_name = theForm.elements[i].name;
		element_value = theForm.elements[i].value;
		//alert( FCKeditorAPI.GetInstance('Article_Content').GetXHTML( true ));
		if((element_type=="checkbox" || element_type=="radio") && theForm.elements[i].checked){
			poststr += connect + element_name + "=" + element_value;
		}else if(element_type!="checkbox" && element_type!="radio"){
			//if(CFKname==element_name) poststr +=connect + element_name + "=" + escape(FCKeditorAPI.GetInstance(CFKname).GetXHTML( true ));
			if(CFKname==element_name) poststr +=connect + element_name + "=" + encodeURIComponent(FCKeditorAPI.GetInstance(CFKname).GetXHTML( true ));
			else poststr += connect + element_name + "=" + element_value;
		}
		
	}
	
	ScreenConvert();
	DialogShow("<div align='center' style=\"background:#FF9900;width:124px;height:24px;line-height:25px;font-size: 12px;\">正在发送,请稍候...",110,24,124,24,"#FF9900");
	PostAjax(url,poststr,afterFunction,width,height);
	//showPage(url,450,150);
}

function closePage()
{
	DialogHide();
	ScreenClean();
}

function gname(name)
{
	return document.getElementsByTagName?document.getElementsByTagName(name):new Array()
}

function Browser()
{
	var ua, s, i;
	this.isIE = false;
	this.isNS = false;
	this.isOP = false;
	this.isSF = false;
	ua = navigator.userAgent.toLowerCase();
	s = "opera";
	if ((i = ua.indexOf(s)) >= 0){this.isOP = true;return;}
	s = "msie";
	if ((i = ua.indexOf(s)) >= 0) {this.isIE = true;return;}

	s = "netscape6/";
	if ((i = ua.indexOf(s)) >= 0) {this.isNS = true;return;}

	s = "gecko";
	if ((i = ua.indexOf(s)) >= 0) {this.isNS = true;return;}
	
	s = "safari";
	if ((i = ua.indexOf(s)) >= 0) {this.isSF = true;return;}
}

function hiddenSelect(name){
	var select = document.getElementById(name);
	select.style.visibility = "hidden";
}

function GetFillAjaxAndHiddenS(url,pageName){
	GetFillAjax(url,pageName,"hiddenSelect('jumpMenu"+pageName+"');");
}