function bookMark(title, url) {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if ( window.external ) { // IE Favorite
		window.external.AddFavorite(url, title); 
	}
}

function inputClick(id, defval) {
	val = document.getElementById(id).value;
	if (val == defval) {
		document.getElementById(id).value = '';
	}
}

function inputBlur(id, defval) {
	val = document.getElementById(id).value;
	if (val == '') {
		document.getElementById(id).value = defval;
	}
}

function changeService(s) {
	if (s.length > 0) {
		var url = "/inc/ajax/prices.php?s=" + s;
		new Ajax(url, {method: 'get', update: $('prices')}).request();
	}
}

function changeService2(s) {
	if (s.length > 0) {
		var url = "/inc/ajax/prices2.php?s=" + s;
		new Ajax(url, {method: 'get', update: $('prices2')}).request();
		
		new Ajax("/inc/ajax/furn.php?s=" + s, {method: 'get', update: $('furnished')}).request();
	}
}

function addPort(p,type) {
	var url = "/inc/ajax/addport.php?p=" + p + "&t=" + type;
	if (type == "list") {
		upd = 'addto'+p;
	} else {
		upd = 'addto';
	}
	new Ajax(url, {method: 'get', update: $(upd)}).request();
}

function propDetImg(imgnum,pid,fldnm) {
	$('propdetimg').style.background = 'url(/uploads/property/' + fldnm + '_' + pid + '_s.jpg) center no-repeat';
	var url = "/inc/ajax/backnext.php?p=" + pid + "&i=" + imgnum;
	new Ajax(url, {method: 'get', update: $('backnext')}).request();
}

function searchFilter() {	
	document.location = '/searchbounce.php?srt=' + $('sortby').value + '&npp=' + $('perpage').value;
}
