function validate() {
		document.onkeypress = onlyNumbers;
		event.returnValue=false;
}

function onlyNumbers(){	
	var keycode = event.keyCode;
	if ((keycode > 47 && keycode < 58) || (keycode == 46))
			event.returnValue=true;
}

function XClient(){
	return document.body.offsetWidth;
}

function YClient(){
	return document.body.offsetHeight;
}

function mContact(){
	//document.location.href="catalog_index.asp?contact=yes";
}

function goHome(){
	window.location.href="default.asp";
}

function goHome2(){
	window.top.location.href="../default.asp";
}

function goHotel(){
	//window.location.href="hotelcatalog/default.asp";
	window.location.href="hotel.asp";
}

function goHotel2(){
	window.top.location.href="../hotel.asp";
}

function goCasa(){
    window.location.href="catalog.asp?pageId=31";
}

function goCasa2(){
    window.top.location.href="../catalog.asp?pageId=31";
}

function goList(){
	//window.location.href="hotelcatalog/default.asp";
	window.top.location.href="list_login.asp";
}

// new functions
function openCategory(categoryId){
    //window.location.href="content_categor.asp?categ_id=" + categoryId;
    
    window.location.href="homecatalog/catalog_index.asp?categ_id=" + categoryId;
}

function openNews(newsId, categoryId){
    window.location.href="content_detail.asp?news_id=" + newsId + "&categ_id=" + categoryId;
}

function register(){
    
    var wndReg;
	wndReg = window.open("register.asp", "wndReg", "width=355, height=360, addressbar=0, resizable=0");
	wndReg.focus();
}

function openHotelCategory(categoryId){
    //window.location.href="content_categor.asp?categ_id=" + categoryId;
    
    window.location.href="hotelcatalog/catalog_index.asp?categ_id=" + categoryId;
}

function search(){
    var keycode = event.keyCode;
    
    if (keycode == 13){
        if(document.getElementById("txtPesquisar").value==""){
            alert("Tem de inserir um critério de pesquisa.");
            document.getElementById("txtPesquisar").focus();
        }else{
            window.location.href="search.asp?search="+document.getElementById("txtPesquisar").value;
        }
    }
}