/**

 * JavaScript functions for XSL objects module.

 * @author Joel Mükker

 */





/**

 * Go to object detail view.

 * @param id Object id

 */

function showDetails(id) {

	//f = eval("document" + formId);

	var f = document.hidden;

	f.id.value = id;

	f.showLong.value = '1';

	f.submit();

}



/**

 * Navigate back to objects list page from object detail view.

 */

function goBack() {

	var f = document.hidden;

	f.id.value = '';

	f.showLong.value = '0';

	f.submit();

}



/**

 * Navigate through pages.

 * @param start First object to show

 * @param limit Number of objects to show

 */

function navPage(start, limit) {

	var f = document.hidden;

	f.start.value = start;

	f.limit.value = limit;

	f.showLong.value = '0';

	f.submit();

}



/**

 * Pop up new window and show all object pictures.

 * @param id Object id

 */

function showPictures(id) {

	var lang = document.hidden.lang.value;

	var popUpWin = window.open('http://www.city24.ee/client/city24client?pageId=290&stateId=Picture&reo_id='+id+'&lang='+lang, 'popUpWin', 'toolbar=yes,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=680,height=400');

	popUpWin.focus();

}



/**

 * Get jump form textbox value.

 * @return jump form textbox value

 */

function getJumpId() {

	var f = document.jumpForm;

	return f.id.value;

}



/**

 * Show or hide detail search form.

 * @param show Specifies whether to show detail search form (true) or not (false)

 */

function setShowDetailSearch(show) {

	var f = document.searchForm;

	f.detailsearch.value = (show) ? "1" : "0";

	f.submit();

}

