function popUp(id,e) {
	mouseX = e.pageX+5; 
	mouseY = e.pageY+5;
	$("div#"+id).css({"left":mouseX+"px","top":mouseY+"px"});
}

function showPhoto(src){
		temp = $("#temp-image");
		obj = $("#popup-image");
		
		
		if (temp.attr("src") != src){
			obj.attr("src","/i/ajax-loader.gif");
			temp.attr("src",src);
			centerPhoto();
	
		} else {
			obj.fadeIn('slow');
		}

}

function centerPhoto(){
		obj = $("#popup-image");
		win_w = $(window).width();
		win_h = $(window).height();
		
		img_w = obj.width();
		img_h = obj.height();
		
			$("#popup-image, #print_link").css({
				"left":(win_w-img_w)/2+"px",
				"top":(win_h-img_h)/2+"px"
			});
		$("#print_link, #popup-image").fadeIn('slow'); 
		
	
}

function getLanguage(intro,lang1,lang2){
	language = $.cookie('language');
	document.write("<b>"+intro+"</b> ");
	switch(language){
	case (language = 'eng'):
		document.write("<span style='border-bottom: 1px #FFF solid; '>"+lang1+"</span> <a href='#' style='color: rgb(102, 187, 0); text-decoration: none; padding-bottom:2px; border-bottom: 1px dashed rgb(102, 187, 0)' onclick=\"setLanguage('rus'); return false;\">"+lang2+"</a>");
		break;
	case (language = 'rus'):
		document.write("<a href='#' style='color: rgb(102, 187, 0); padding-bottom:2px; text-decoration: none; border-bottom: 1px dashed rgb(102, 187, 0)' onclick=\"setLanguage('eng'); return false;\">"+lang1+"</a> <span style='border-bottom: 1px solid white'>"+lang2+"</span>");
		break; 
	default:
		document.write("<a href='#' style='color: rgb(102, 187, 0); padding-bottom:2px; text-decoration: none; border-bottom: 1px dashed rgb(102, 187, 0)' onclick=\"setLanguage('eng'); return false;\">"+lang1+"</a> <span style='border-bottom: 1px solid white'>"+lang2+"</span>");
		break;
	}
}

function setLanguage(language){
	
		var options = { path: '/', expires: 60 };
        $.cookie('language', language, options);
        window.location.reload();
    }
    


$(".popup-link").live("mouseout",function(){
	id = $(this).attr('id');
	$("div#"+id	).css("left","-500px");
})

