function goTo(page,params,newWindow,method) {
	var form = document.createElement("form");
	form.style.display = "none";
	form.action = page;
//	if(!method) form.method = "_POST";
//		else form.method = method;
	form.method = (method) ? method : "post";
	var hidden = null;
    if  (params!= null)
    for (var i = 0; i < params.length; i++) {    
    	hidden = document.createElement("input");
    	hidden.type = "hidden";
        hidden.name = params[i].key;
        hidden.value = params[i].val;         
        form.appendChild(hidden);         
	}  
    document.body.appendChild(form);
    form.submit();
    document.body.removeChild(form);  	
    return false;
}

function showSpiner(id) {
		var el = $(id);
		if (el != null) {
			el.update('');
			var div = document.createElement("div");
			div.innerHTML = '<img src="../img/loading.gif"/>';
			el.appendChild(div);
		}
}

function isEmail(sEmail){
	sEmail = sEmail.replace( new RegExp('/\(.*?\)/'), '' );
	oRegExp = /^[A-Za-z0-9][-\w]*(\.[A-Za-z0-9][-\w]*)*@[A-Za-z0-9][-\w]*(\.[A-Za-z0-9][-\w]*)*\.[a-zA-Z]{2,4}$/;
	return oRegExp.test(sEmail);
}

function isIP(ip){
	var regex =/^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$/;
	return regex.test(ip);
}
	

function isNumeric(sText, decimal)
{
    var validChars = "";
    if(decimal == true)
        validChars = "0123456789.,";
    else
        validChars = "0123456789";
    
	var isNumber = true;
	var c;

	for (i = 0; i < sText.length && isNumber == true; i++)
	{
		c = sText.charAt(i);
		if (validChars.indexOf(c) == -1)
		{
			isNumber = false;
		}
	}
    if(decimal == true)
    {
        if(sText.indexOf('.') != sText.lastIndexOf('.')) isNumber = false;
    }
	return isNumber;
}

function getWindowHeight()
{
    // Real browsers
    if(typeof( window.innerHeight ) == 'number')
    {
       //alert('firefox: '+window.innerHeight);
       return window.innerHeight;
    }
    // IE
    //alert('ie: '+document.body.clientHeight);
    return document.body.clientHeight;
}

  // how to use it in Javascript



Modalbox.close = function() {
	Modalbox.hide();
	return false;
}
