function postDojoStyle(formName, dialogID, refresh){
	
		var thisForm = dojo.byId(formName);

		dojo.xhrPost(
				{
					url: thisForm.action,
					handleAs: "text",
					form: thisForm,
					load: function(DATA, args){
							   	dijit.byId(dialogID).hide();
								
								if (refresh){
									if ("SUCCESS NO ERROR" == DATA){
										location.reload(true);
									} else {
										dijit.byId(dialogID).attr("content", DATA);
										dijit.byId(dialogID).show();
									}
								} else{

									if ("SUCCESS NO ERROR" == DATA){ // if success no error then just close the dialog
										
										dijit.byId(dialogID).hide();	
									} else {
										dijit.byId(dialogID).attr("content", DATA);
									}
										
									
								}
							}
				});
	}
	

function getDojoStyle(url, dialogID){
	dojo.xhrGet(
		{
			url: url,
			handleAs: "text",
			load: function(DATA, args){
					document.getElementById("dialogID").innerHTML=DATA;
					dijit.byId("dialogID").hide();
					dijit.byId("dialogID").show();
				}
		});
	}
function fnNumeric_only(e) {
    var unicode =e.charCode ? e.charCode : e.keyCode;
    if (unicode == 8 || unicode == 9 || (unicode >= 48 && unicode <= 57) || (unicode == 46 || unicode == 44)) {
        // we allow the key press
		return true;
    }
    else {
        // otherwise we don't
		return false;
				
    }
}
function formatPhone(F) {
    var PH = F.value;
	PH = PH.replace("(", "");
	PH = PH.replace(")", "");
	PH = PH.replace("-", "");
	//PH = PH.replace("/-/g", "");
    PH = PH.replace(" ", "");
	PH = PH.replace(new RegExp(" ", "g"), "");
	if(PH.length == 11 && PH.substring(0,1)=="1"){
    	PH = PH.substring(1,PH.length);
     }
	
    if(PH.length != 0 && PH.length != 10 || isNaN(parseInt(PH))){
    	return false;
    }
	if (PH.length == 10) {
		F.value = "(" + PH.substring(0, 3) + ") " + PH.substring(3, 6) + "-" + PH.substring(6, 10);
    	//F.value = "(" + PH.substring(0, 3) + ")-("+ PH.substring(3, 6) +")-(" + PH.substring(6, 10)+")";
	
	}
      	
	return true;
}

