function openNewPopup(url, w, h) {
    var _left = 100;
    var _top = 100;
    var _location = 'no';
    var _directories = 'no';
    var _menubar = 'no';
    var _resizable = 'no';
    var _scrollbars = 'no';
    var _status = 'no';
    var _titlebar = 'no';
    var _toolbar = 'no';
        
    window.popupWindow = window.open(url, '_blank', 'width='+w
        +', height='+h+',left='+_left+', top='+_top+', location='+_location
        +', directories='+_directories+', menubar='+_menubar
        +', resizable='+_resizable+', scrollbars='+_scrollbars
        +', status='+_status+', titlebar='+_titlebar+', toolbar='+_toolbar);
        
    return false;
}

function makeSearch() {
	if($('search')) {
		if($('search').value) {
			window.location='cautare-'+$('search').value+'-0.html';
		}
	}
}
function quickSearchByKey(e) {
    var keyCode = (window.event) ? event.keyCode : e.keyCode;
    var enterCode = 13;
    if(keyCode==enterCode) {
        makeSearch();
    }
}
function $(id) {
	if(document.getElementById(id)) {
		return document.getElementById(id);
	}
}
function isIE() {
	var agent = navigator.userAgent;
	agent = agent.toLowerCase();
	if(agent.indexOf('msie') != -1) {
		return true;
	}
	return false;
}
//old
//Author: M. Catalin, dublutz@yahoo.com
//Date: 08.03.2006
window.maxqty = 90;
window.minqty = 0;

function incrementVal(id) {
	var elem = $(id);
	if(!elem) {
		return false;
	}
	if(elem.value != maxqty) {
		elem.value = parseInt(elem.value) + 1;
	}
	return false;
}
function decrementVal(id) {
	var elem = $(id);
	if(!elem) {
		return false;
	}
	if(elem.value != minqty) {
		elem.value = parseInt(elem.value) - 1;
	}
	return false;
}
function mergiLaCasa() {
	window.location = "casa.php";
	return true;
}
function submitLogin() {
	var frm = $('login');
	if(!frm) {
		return false;
	}
	frm.submit();
	return true;
}
function $(id) {
	if(document.getElementById(id)) {
		return document.getElementById(id);
	} 
	return false;
}
function cumparaProdus(id) {
	if(!id) {
		return false;
	}
	$('b').value = id;
	$('buy').submit();
	return false;	
}