/*

	13twelve vs. jQuery

	This javascript is the main javascript for the sites actions.

*/

// --------------------------------------------------------------------------------------------------------------

var thirteentwelve = function(){
    function listingClick() {
        $(".work li").each(function(){
            var href = $(this).find("a:first").attr("href");
            if (href != "#" && href != "" && href != undefined) {
                $(this).addClass("linked").click(function(event){
                    event.preventDefault();
                    window.open(href);
                }).find("a:first").click(function(event){
                   event.stopPropagation(); 
                });
            }
        });
    }
    $(document).ready(function(){
        //
        //if ( Math.floor(Math.random()*2+1) == 2) {
            //$("html").addClass("alt");
        //}
        //
	    $("a[href^=http]").attr("target","_blank");
	    //
        listingClick();
        //
        var konami = new Konami();
    	konami.code = function() {
    	    alert("heh, coming soon")
    	}
    	konami.iphone.code = function() {
    	    alert("lols, coming soon")
    	}
    	konami.load();
    	var m1312 = new Konami();
    	m1312.pattern = "49514950";
    	m1312.code = function() {
    	    window.open("http://www.google.co.uk/images?um=1&hl=en&safe=off&biw=1297&bih=978&tbs=isch:1&sa=1&q=roces+majestic+13+twelve&aq=f&aqi=&aql=&oq=&gs_rfai=");
    	}
    	m1312.load();
    	//
    });
    return {
	   listingClick:listingClick
	}
}();
