
var countryPrice = "$0.99";
var countryCode = "us";
var hilit = undefined;
var userAgent = navigator.userAgent.toLowerCase(); 
$.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase());

function goTo(elem,hi){
    if( $.browser.chrome || $.browser.opera || $.browser.msie ){ return true; }

    $.scrollTo($(elem).attr("href"), 1000);

    if( hi != undefined ){
	if( hilit != undefined ){
	    $("#" + hilit).css({"background-color":"transparent"});
	}
	hilit = hi;
	$("#" + hilit).css({"background-color":"#fffcdd"});
    }
    else {
	$("#" + hilit).css({"background-color":"transparent"});
	hilit = undefined;
    }
    return false;
}

$(window).load(function(){
    $.getJSON('http://api.wipmania.com/jsonp?callback=?', '', function(json) {
	if( json.address.country_code == "UK" ){
	    countryPrice = "£0.59";
	    countryCode = "uk";
	}
	else if(
		json.address.country_code == "ES" ||
		json.address.country_code == "SI" ||
		json.address.country_code == "SK" ||
		json.address.country_code == "PT" ||
		json.address.country_code == "NL" ||
		json.address.country_code == "MT" ||
		json.address.country_code == "LU" ||
		json.address.country_code == "IT" ||
		json.address.country_code == "IE" ||
		json.address.country_code == "GR" ||
		json.address.country_code == "DE" ||
		json.address.country_code == "FR" ||
		json.address.country_code == "FI" ||
		json.address.country_code == "CY" ||
		json.address.country_code == "BE" ||
		json.address.country_code == "AT"
		){
	    countryPrice = "€0.79";
	    countryCode = "eu";
	}

	$("#nocost").attr('class','nocost_' + countryCode);
	$("#price").text(countryPrice);
    });

    $("a.thumb").fancybox({ 'autoScale': true });
    $("div.post a").has("img").fancybox({ 'autoScale': true });
    $(window)._scrollable();
});

