
function urlSubmit(url, parm, target, type) {
    var region = $("#regionList").val();
	if (type == undefined || type == "" || type == "get") {
		type = "get";
	} else {
		type = "post";
	}
	if(region != undefined && region != ""){
		var str = parm.substring(0,parm.length-1);
		parm = str+',"region"'+":"+'"'+region+'"}';
	}
	$("#j_g2p_form").remove();
	if (target == undefined || target == "") {
		$("body").append("<form id='j_g2p_form' method='" + type + "'></form>");
	} else {
		$("body").append("<form id='j_g2p_form' method='" + type + "' target='" + target + "'></form>");
	}
	$("#j_g2p_form").attr("action", url);
	if (parm != null && parm != "") {
		$.each($.parseJSON(parm), function (name, value) {
			$("#j_g2p_form").append("<input type='hidden' name='" + name + "' value='" + value + "' />");
		});
	}
	$("#j_g2p_form").submit();
}

function urlSubmit_1(url, parm, target, type,contiune_url) {
	if (type == undefined || type == "" || type == "get") {
		type = "post";
	} else {
		type = "post";
	}
	$("#j_g2p_form").remove();
	if (target == undefined || target == "") {
		$("body").append("<form id='j_g2p_form' method='" + type + "'></form>");
	} else {
		$("body").append("<form id='j_g2p_form' method='" + type + "' target='" + target + "'></form>");
	}
	$("#j_g2p_form").attr("action", url);
	if (parm != null && parm != "") {
		$.each($.parseJSON(parm), function (name, value) {
			$("#j_g2p_form").append("<input type='hidden' name='" + name + "' value='" + value + "' />");
		});
	}
	$("#j_g2p_form").append("<input type='hidden' name='continue_url'  value='" + contiune_url + "' />");
	
	$("#j_g2p_form").submit();
}

function urlSubmit_auth(url, parm, target, type,contiune_url,authlevel) {
	if (type == undefined || type == "" || type == "get") {
		type = "post";
	} else {
		type = "post";
	}
	$("#j_g2p_form").remove();
	if (target == undefined || target == "") {
		$("body").append("<form id='j_g2p_form' method='" + type + "'></form>");
	} else {
		$("body").append("<form id='j_g2p_form' method='" + type + "' target='" + target + "'></form>");
	}
	$("#j_g2p_form").attr("action", url);
	if (parm != null && parm != "") {
		$.each($.parseJSON(parm), function (name, value) {
			$("#j_g2p_form").append("<input type='hidden' name='" + name + "' value='" + value + "' />");
		});
	}
	$("#j_g2p_form").append("<input type='hidden' name='continue_url'  value='" + contiune_url + "' />");
	$("#j_g2p_form").append("<input type='hidden' name='authlevel'  value='" + authlevel + "' />");
	
	$("#j_g2p_form").submit();
}

function isLogin() {
	var isLoginVal = $("#utilIsLogin").val();
	if (isLoginVal == "0") {
		return false;
	} else {
		return true;
	}
}

