/* 
	Author: Tanin Srivaraphong 
*/

WebFontConfig = {
	google: { families: [ 'Quattrocento Sans' ] }
};

var bookmarkme = function() {
    if (window.sidebar) { // Mozilla Firefox Bookmark
        window.sidebar.addPanel(location.href,document.title,"");
    } else if(window.external) { // IE Favorite
        window.external.AddFavorite(location.href,document.title);
    } else if(window.opera && window.print) { // Opera Hotlist
        this.title=document.title;
        return true;
    }
}

$('.sharer').live('click', function(e) {
    e.preventDefault();
    
    var title = $(this).attr('title');
    var url = $(this).attr('href');    
    var fbSharerUrl = 'http://www.facebook.com/sharer.php?s=100&';
    var params = {
        "p[url]": url,
        "p[title]": title
    };
    var fbSharerConfig = 'toolbar=0,status=0,width=500,height=250';
    
    window.open(fbSharerUrl + $.param(params), 'sharer', fbSharerConfig);
});

$(function () {
	// Firefox, Safari, IE9+
	//console.log(555);
	//console.log("browser : " + $.browser.msie);
    if ( ! ($.browser.msie && (parseInt($.browser.version) < 9))) {
		$('#main-nav, #logo').animate({opacity: 1.0},500);
	}
    $('nav a').click(function () {
        $(this).addClass('active');
    }); 
    
    $('.eye-animation').sprite({fps: 24, no_of_frames: 39});    
});

(function() {
    // Google Web Font
    /*
	var wf = document.createElement('script');
	wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
		'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
	wf.type = 'text/javascript';
	wf.async = 'true';
	var s = document.getElementsByTagName('script')[0];
	s.parentNode.insertBefore(wf, s);
    */
    
})();
