   $(document).ready(function(){

/*
	var trans0 = "";
	var trans1 = "";
	var linkz0 = "";
	var linkz1 = "";

	 $("#openSlide0").click(function(){
		if(trans0=="") {
			jQuery.each(translated01, function(i, val) {
				trans0 = trans0 + "<div class='wr'><a href='javascript:void(0)' rel='modal'><div class='padme'>" + translated00[i]  + "</div><span class='invb'></span></a></div>\n";
			});
			trans0 = trans0 + "<div style='clear:both'></div><br/><a class='synclink' href='/adm_locale/sync' onclick='return confirm(\"Really?\");'>" +
								"<span class='xicon refresh'>Sync</span></a>";
			$("#contentSlide0").html(trans0);
			getLinkz("linkz0");
		}
		$("#contentSlide1").hide();
		$("#contentSlide0").toggle();
		
		return false;
	});

	$("#openSlide1").click(function(){
		if(trans1=="") {
			jQuery.each(translated11, function(i, val) {
				trans1 = trans1 + "<div class='wr'><a href='javascript:void(0)' rel='modal'><div class='padme'>" + val + "</div><span class='invb'>" + translated10[i] + "</span></a></div>\n";
			});
			trans1 = trans1 + "<div style='clear:both'></div><br/><a class='synclink' href='/adm_locale/sync' onclick='return confirm(\"Really?\");'>" +
								"<span class='xicon refresh'>Sync</span></a>";
			$("#contentSlide1").html(trans1);
			getLinkz("linkz1");
		}
		$("#contentSlide0").hide();
		$("#contentSlide1").toggle();
		return false;
	});


	function getLinkz(arrname) {
		if(arrname=="linkz0") {
			arrname = $('a[rel="modal"]');
			arrname.each(function(i,n){
					current = arrname[i];
					$(current).qtip({
						content: {
							title: {
								text: "<span class='lng"+LANG+"'></span> &nbsp; Translation",
								button: '[X]'
							},
							url: '/adm_translate',
							data: { 
								content: $(current).children("div").text(),
								key: $(current).children("div").text()
							},
							method: 'post'
						},
						position: {
							target: $(document.body),
							corner: 'center'
						},
						show: {
							when: 'click', // Show it on click
							solo: true // And hide all other
						},
						hide: false,
						overlay: 0, //da ne se skriva kato cykna navyn
						style: {
							width: { max: 700 },
							padding: '14px',
							border: {
								width: 9,
								radius: 9,
								color: '#666666'
							},
							name: 'light'
						}
					});
			});
		}
		else {
			arrname = $('a[rel="modal"]');
			arrname.each(function(i,n){
					current = arrname[i];
					$(current).qtip({
						content: {
							title: {
								text: "<span class='lng"+LANG+"'></span> &nbsp; Translation",
								button: '[X]'
							},
							url: '/adm_translate',
							data: { 
								content: $(current).children("div").text(),
								key: $(current).children("span").text()
							},
							method: 'post'
						},
						position: {
							target: $(document.body),
							corner: 'center'
						},
						show: {
							when: 'click', // Show it on click
							solo: true // And hide all other
						},
						hide: false,
						overlay: 0, //da ne se skriva kato cykna navyn
						style: {
							width: { max: 700 },
							padding: '14px',
							border: {
								width: 9,
								radius: 9,
								color: '#666666'
							},
							name: 'light'
						}
					});
			});
		}
	}
*/
	$(".marketWr a").click(function(e){
		$('.marketWr a').removeClass("selected");
		var cname = "#" + $(this).attr("class");
		$('#marketTable').html($(cname).html());
		$(cname).show();
		$(this).addClass("selected");
	});


 });

//GOOGLE TRANSLATION
function translateText(text, to_lang, callback, obj)
{
	if(text.length > 0 && to_lang.length > 0) 
	{
		google.language.detect(text, function(result)
		{
			if(!result.error) 
			{
				lang = result.language;
				google.language.translate(text, lang, to_lang, function(result) {
					if(result.translation) {
						if(typeof(callback) == "function")
						{
							callback.call(null, result.translation, lang, to_lang, obj);
						}
					}
				});
			}
		});
	}
}

function showPromoHint(hintText)
{
	if(hintText.length > 0)
	{
		$('div#hint-container').append("<div class='promo-hint-container'><div id='promo-hint' class='promo-hint'>" + hintText + "</div></div>");
		$('#promo-hint').slideToggle('slow', function(){
			//setTimeout(function(){ $('#promo-hint').slideToggle('slow'); }, 3000);
		});
	}
}