
function placesShowBigImage (sImgUrl) {
    var e = $('#k_photo img');
    e.get(0).style.display = 'none';
    var i = new Image();    
    i.onload = function () {
        e.get(0).src = sImgUrl;   
        e.get(0).style.display = 'inline';    
    }
    i.src = sImgUrl;
}

function placesShowRealImage (e) { 
    var sImgUrl = $(e).children().filter("img").get(0).src;
    sImgUrl = sImgUrl.replace (/\/big\//, '/real/');
    e.href = sImgUrl;
    return true;
}

function placesShowBigVideo (sEmbed) { 
    var e = $('#k_video').get(0);
    e.innerHTML = decodeURIComponent(sEmbed);
    return true;
}


/**
 * Get all region's cities
 * 
 * @param sCountryCode string
 * @param sWrapper string - will rewrite with server answer
 * @return void
 */
function getCities(sCountryCode, sRegionName, sWrapper) {
	var $oWrapper = $('#' + sWrapper);

	if( !$oWrapper.html() ) {
		$oWrapper.html('Loading...'); 
		$.get("places/getCities/" + sCountryCode + '/' + sRegionName, function(sData){
			 $oWrapper.html(sData);
		 });
	}

	if( $oWrapper.css('display') == 'none' ) {
		 $oWrapper.css('display', 'block');
	}	
	else {
		$oWrapper.css('display', 'none');
	}
}	

/**
 * Get all countries regions
 * 
 * @param sCountryCode string
 * @param sWrapper string - will rewrite with server answer
 * @return void
 */
function getRegions(sCountryCode, sWrapper) {
	var $oWrapper = $('#' + sWrapper);

	if( !$oWrapper.html() ) {
		 $oWrapper.html('Loading...');
		 $.get("places/getRegions/" + sCountryCode, function(sData){
			 $oWrapper.html(sData);
		 });
	}

	if( $oWrapper.css('display') == 'none' ) {
		 $oWrapper.css('display', 'block');
	}	
	else {
		$oWrapper.css('display', 'none');
	}
}	
