function resizeresortmap() {
	jQuery.each(jQuery("#contentholderrealestatemap a"), function(key, value) {
		//ids += "," + value.replace("rowal","");
		//var fscale = jQuery('#contentholderrealestatemap').width() / 1800;
		var fscale = (jQuery(window).width() - 367) / 1200;
		//console.log(fscale);
		//console.log(jQuery('#contentholderrealestatemap').css("left"));
		if (jQuery.browser.msie) {
			jQuery("#contentholderrealestatemap").css("transform", "scale(" + fscale + ")");
			jQuery("#contentholderrealestatemap").css("msTransform", "scale(" + fscale + ")");
		} else if (jQuery.browser.mozilla) {
			jQuery("#contentholderrealestatemap").css("-moz-transform", "scale(" + fscale + ")");
		} else {
			jQuery("#contentholderrealestatemap").css("-webkit-transform", "scale(" + fscale + ")");
		}
		jQuery("#contentholderrealestatemap").css("left", (367 + (80 * fscale)) + "px");
		//alert(1);
		/*
		console.log(jQuery("#contentholderrealestatemap").css("width"));
		var delta = 1000/ jQuery('#imgmap2').width();
		jQuery(value).css("left", jQuery(value).attr("x") / delta + "px");
		jQuery(value).css("top", jQuery(value).attr("y") / delta + "px");
		*/
	});
}
jQuery( document ).ready( function()
{

	jQuery(window).resize(function(){
		resizeresortmap();
	});
	resizeresortmap();
/* Removed from design. Thanks for ruining my vacation!
	switch (_lang) {
		case "bg" :
			jQuery("#quoteholder").css("margin-left", "125px");
			break;
		case "en" :
			jQuery("#quoteholder").css("margin-left", "117px");
			break;
		case "ru" :
		default:
			jQuery("#quoteholder").css("margin-left", "80px");
	}
	if (jQuery("#weathercont").length) {
		jQuery(window).resize(function(){
			setBodyScale();
			weatherPositioning();
		});
	}
*/
	//Fire it when the page first loads:
	//setBodyScale();
//	weatherPositioning();
/* Removed from design. Thanks for ruining my vacation!
	if (jQuery("#weathercont").length) {
		setBodyScale();
		weatherPositioning();
	}
	*/
	if (jQuery("#ftrrightcol").length) {
		jQuery("#ftrrightcol img").mouseover(function() {
            jQuery(this).attr("src", jQuery(this).attr("hover").replace("color-", ""));
		});
		jQuery("#ftrrightcol img").mouseout(function() {
            jQuery(this).attr("src", jQuery(this).attr("hover").replace("logo-", "logo-color-"));
		});
	}
	
});

/**
 * Positions the weather box
 */
 /*
function weatherPositioning() {
	if (jQuery("#weathercont").position().left < 679) {
		jQuery("#sunrisebottom").css("right", "10px");
		jQuery("#weatherright").css("right", "139px");
	} else {
		jQuery("#sunrisebottom").css("right", "60px");
		jQuery("#weatherright").css("right", "189px");
		if (jQuery("#weathercont").position().left < 638) {
			jQuery("#sunrisebottom").css("right", "10px");
		} else {
			jQuery("#sunrisebottom").css("right", "60px");
		}
	}
	if (jQuery("#weathercont").position().top > 500) {
		jQuery("#weathercont").css("height", "350px");
	} else {
		jQuery("#weathercont").css("height", "550px");
	}
}
*/
/**
 * This code resizes the Gary Player text to try and keep it visible at different screen sizes
 */
 /*
function setBodyScale() {
	var $body = jQuery('body'); //Cache this for performance
	var scaleSource = $body.width(),
		scaleFactor = 0.015,                     
		maxScale = 20,
		minScale = 8; //Tweak these values to taste

	var fontSize = (scaleSource) * scaleFactor; //Multiply the width of the body by the scaling factor:

	if (fontSize > maxScale) fontSize = maxScale;
	if (fontSize < minScale) fontSize = minScale; //Enforce the minimum and maximums
	
	
	jQuery('.quotetext').css('font-size', Math.floor(fontSize) + 'px');
	
	if (scaleSource < 1200) {
		jQuery("#quoteholder").css("width", "300px");
	} else {
		jQuery("#quoteholder").css("width", "380px");
	}
	if (scaleSource < 1112) {
		jQuery("#quoteholder").css("right", "10px");
		if (scaleSource < 1000) {
			jQuery('.quotetext').css("font-size", "20px");
		}
	} else {
		jQuery("#quoteholder").css("right", "60px");
	}
	//console.clear();
	if (jQuery("#quoteholder").position().left < 672) {
		if (jQuery.browser.msie) {
			jQuery("#quoteholder").css("width", "360px");
		} else {
			jQuery("#quoteholder").css("width", "280px");
		}
	}
	//console.log(jQuery("#quoteholder").position().left); //695 100px margin-left 'en', 125px 'bg'
	if (jQuery("#quoteholder").position().top > 645) {
		jQuery("#quoteholder").css("top", "0px");
	} else {
		jQuery("#quoteholder").css("top", "115px");
	}
}
*/

// function callback on hiding image
function superbgimage_hide(img) {
	jQuery('#showtitle').hide();
}

// function callback on showing image
// get title and display it
function superbgimage_show(img) {
	jQuery('#superbgimage').css('background', 'none');
	jQuery('#superbgimage').append(jQuery('#showtitle'));
	jQuery('#showtitle p.imagecount').html('image ' + img + ' of ' + $.superbg_imgIndex);
	if (jQuery('#thumbs1').css('display') == 'block') {
		jQuery('#showtitle p.title').html(jQuery('#thumbs1 a' + "[rel='" + img + "']").attr('title'));
	} else {
		jQuery('#showtitle p.title').html(jQuery('#thumbs2 a' + "[rel='" + img + "']").attr('title'));
	}
	jQuery('#showtitle').fadeIn('fast');
}

// function callback on clicking image, show next slide
function superbgimage_click(img) {
	jQuery('#thumbs').nextSlide();
}

my_slideshowActive = false;

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
		
jQuery(document).ready(function(){ 
	try {
		if (jQuery("#dvgalcont").length) {
			jQuery("#dvgalcont a").fancybox({
				'transitionIn'	:	'elastic',
				'transitionOut'	:	'elastic',
				'speedIn'		:	600, 
				'speedOut'		:	200, 
				'overlayShow'	:	true,
				'overlayOpacity' : 0
				,'cyclic' : true
				,'hideOnContentClick' : true
				
			});
		} else if (jQuery("#_Image-Maps_4201108200922555").length) {
			jQuery("#_Image-Maps_4201108200922555 area").fancybox({
				'transitionIn'	:	'fade',
				'transitionOut'	:	'fade',
				'speedIn'		:	600, 
				'speedOut'		:	200, 
				'overlayShow'	:	true,
				'overlayOpacity' : 0
				,'cyclic' : true
				,'titlePosition' : 'float'
				,'hideOnContentClick' : true
				
			});
		}
	} catch (err) {}
});
function sprintf(format, etc) {
    if (void(0) == format) return;
	var arg = arguments;
	var i = 1;
	return format.replace(/%((%)|s)/g, function (m) { return m[2] || arg[i++] })
}
function __(a,b,c,d) {
	if (void(0) != lt[a]) {
		a = lt[a];
	}
	return sprintf(a,b,c,d);
}

