function showDiv(id) {
	document.getElementById(id).style.display="block";
}

function hideDiv(id) {
	document.getElementById(id).style.display="none";
}

function closeDiv(id) {
	this.setTimeout('hideDiv(\'submenu\')', 1200);
}

function spryLoader() {
	var spryName = new Spry.Widget.ValidationTextField("spryName", "custom");
	var spryLastname = new Spry.Widget.ValidationTextField("spryLastname", "custom");
	var spryPhone = new Spry.Widget.ValidationTextField("spryPhone", "phone_number", {format:"phone_custom", pattern:"01234567890"});
	var spryEmail = new Spry.Widget.ValidationTextField("spryEmail", "email");
	var spryZip = new Spry.Widget.ValidationTextField("spryZip", "zip_code", {format:"zip_custom", pattern:"24220030"});
}

function onlyNumber(event) {
	if(document.all) key = event.keyCode; 
	else key = event.which;
	if ( key>=48 && key<=57 ) return 1;
	else if ( key==8 || key==0) return 2;
	else return false;
}

function autoChange(frm,source,target) {
    if (source.maxLength>0) {
        if ( source.value.length >= source.maxLength) {
			if (document.getElementById("postal_code") == source) {
				var formObj = document.getElementById( frm );
				formObj[target].focus();
				xajax_execModule("jpf_address","","check_postal_code","","postal_code="+document.getElementById("postal_code").value);
			} else {
				var formObj = document.getElementById( frm );
				formObj[target].focus();
			}
        }
    }
}
/* DEPRECATTED!!!
function autoSubmit(frmfind,event) {
    if(document.all) key = event.keyCode; 
    else key = event.which;
    if (key=="13")
    xajax_processForm(xajax.getFormValues(frmfind))
}
*/