
function af_check(_id) {
	_status = document.getElementById("checked-" + _id).checked;
	_i = 0;

	if(_status == true) {
		document.getElementById("active-" + _id).style.border = "1px solid #FF9900";
		document.getElementById("img-favorites").src = "/favorites/?s=t&Property_Id=" + _id;
		_i = 1;
	}
	if(_status == false) {
		document.getElementById("active-" + _id).style.border = "1px solid #FFFFFF";
		document.getElementById("img-favorites").src = "/favorites/?s=f&Property_Id=" + _id;
		_i = -1;
	}
	document.getElementById("booking-num").value = parseInt(document.getElementById("booking-num").value) + _i;
}
function scroll_pic(_id, _status) {

	_position = parseInt(document.getElementById("gpic-" + _id + "-cnt-s").value);	
	_position_total = parseInt(document.getElementById("gpic-" + _id + "-cnt-total").value);

	if(_status == "next") {		
		_position_new = _position + 1;
		if(!document.getElementById("gpic-" + _id + "-cnt-" +_position_new)) {
			_position_new = 1;
		}
		_next_img = document.getElementById("gpic-" + _id + "-cnt-" + _position_new).value;
	}
	if(_status == "prev") {		
		_position_new = _position - 1;
		if(!document.getElementById("gpic-" + _id + "-cnt-" +_position_new)) {
			_position_new = _position_total;
		}
		_next_img = document.getElementById("gpic-" + _id + "-cnt-" + _position_new).value;
	}
	if(_next_img) {
		document.getElementById("img-main-" + _id).style.background = "url(/img/pics/ico_loading_150x113.gif)";	
		document.getElementById("gpic-" + _id + "-cnt-s").value = _position_new;
	}	
	var image = new Image();
	image.onload = function() {
	    document.getElementById("img-main-" + _id).style.background = "url(" + _next_img + ") no-repeat";	
	};
	image.src = _next_img;	
}	
