
/****************For AJAX****************/

function XecureAjaxGet(url)
{
	var qs ;
	var path = "/";
	var cipher;
	var xecure_url;

	// get path info & query string & hash from url
	qs_begin_index = url.indexOf('?');
	path = getPath(url)
	// get query string action url
	if ( qs_begin_index < 0 ) {
		qs = "";
	}
	else {
		qs = url.substring(qs_begin_index + 1, url.length );
	}

	if( gIsContinue == 0 ) {
		gIsContinue = 1;

		if( IsNetscape60() )		// Netscape 6.0
			cipher = document.XecureWeb.nsIXecurePluginInstance.BlockEnc(xgate_addr, "/off", XecureEscape(qs), "GET");
		else
			cipher = document.XecureWeb.BlockEnc(xgate_addr, "/off", XecureEscape(qs),"GET");

		gIsContinue = 0;
	}
	else {
		alert(busy_info);
		return false;
	}

	if( cipher == "" )	return XecureWebError();

	xecure_url = path + "?q=" + escape_url(cipher);
	return xecure_url;
}

function XecureAjaxPost(qs)
{
	var qs ;
	var p_value;
	
	if( gIsContinue == 0 ) {
		gIsContinue = 1;

		if( IsNetscape60() )		// Netscape 6.0
			cipher = document.XecureWeb.nsIXecurePluginInstance.BlockEnc ( xgate_addr, "/off", XecureEscape(qs), "POST" );
		else{
			cipher = document.XecureWeb.BlockEnc ( xgate_addr, "/off", XecureEscape(qs), "POST" );
		}
		gIsContinue = 0;
	}

	else {
		alert(busy_info);
		return false;
	}

	if( cipher == "" )	return XecureWebError() ;
	
	p_value = "p="+escape_url(cipher);
	return p_value;
}

