function addReview(user)
{
if (!user || user==undefined)
	{
	//win = new Window({className: "alphacube", title: "Zaloguj się", width:400, height:150, destroyOnClose: true, recenterAuto:false}); 
	//win.getContent().update(message); 
	//win.showCenter();	
	var modal = modalWindow(dirHost+'account/pleaseLogIn',380,170,'Zaloguj się');
	}
	else
	{
	showHideBox('addReviewBox');
	}
}

function addPhoto(user)
{
if (!user || user==undefined)
	{
	//win = new Window({className: "alphacube", title: "Zaloguj się", width:400, height:150, destroyOnClose: true, recenterAuto:false}); 
	//win.getContent().update(message); 
	//win.showCenter();	
	var modal = modalWindow(dirHost+'account/pleaseLogIn',380,170,'Zaloguj się');
	}
	else
	{
	document.location='';
	}
}

function validateQuickSearchReviewForm(thisform)
{
	with (thisform)
	{
	
	/*if ($('otherCityCheck').checked==true)
		{
		if (emptyvalidation(searchCity)==false) {searchCity.focus(); return false;};
		}
	*/		
		
	if (selectBoxValidation(categories_id)==false) {categories_id.focus(); return false;};
		
		
	//var city = ($('otherCityCheck').checked==true) ? searchCity.value : citiesCombo.value;	
	
	var city = citiesCombo.value;
		
	var link = new String(dirHost+'near,search,n,'+categories_id.value+'-'+city);	
	var url = link.gsub(' ', '-');
	
		
	$('quickSearchReviewForm').action=url;	
	$('quickSearchReviewForm').submit();			
	}	
}




function validateReviewFinishForm(thisform)
{
	with (thisform)
	{
	
	if (selectBoxValidation(rating)==false) {rating.focus(); return false;};
	if (emptyvalidation(title)==false) {title.focus(); return false;};
	
	
	tinyMCE.triggerSave();
	if (emptyvalidation(description)==false) {alert('Wprowadź treść recenzji'); return false;};
	if (description.value.length<200) {alert('Treść recenzji jest za krótka (min. 200 znaków)'); return false;};
	
	if (!$('#objects_id').val())
	 	{
		if (emptyvalidation(objectsTitle)==false) {objectsTitle.focus(); return false;};
		if (selectBoxValidation(citiesCombo)==false) {citiesCombo.focus(); return false;};
		if (selectBoxValidation(categories_id)==false) {categories_id.focus(); return false;};
			
		if ($('#google_x').val()==$('#old_google_x').val() && $('#google_y').val()==$('#old_google_y').val())
			{
			alert('Wskaż miejsce na mapie...');
			return false;
			}
		}
	
	}
}

function validateEditReviewForm(thisform)
{
	with (thisform)
	{	
	if (selectBoxValidation(rating)==false) {rating.focus(); return false;};	
	if (emptyvalidation(title)==false) {title.focus(); return false;};	
	
	
	tinyMCE.triggerSave();
	if (emptyvalidation(description)==false) {alert('Wprowadź treść recenzji'); return false;};
	if (description.value.length<200) {alert('Treść recenzji jest za krótka (min. 200 znaków)'); return false;};	
	}
}


function validateAddPhotoForm(thisform,user)
{

	if (!user || user==undefined)
		{
		var modal = modalWindow(dirHost+'account/pleaseLogIn',380,170,'Zaloguj się');
		return false;
		}

	with (thisform)
	{	
	if (emptyvalidation(photoTitle)==false) {photoTitle.focus(); return false;};
	if (emptyvalidation(photo)==false) {photo.focus(); return false;};		
	}
}