$(document).ready(function () { if(window.location.hash==false) { window.location.hash ='page=main&id=1'; } $.history.init(pageload); $('a[href=' + window.location.hash + ']').addClass('selected'); $('.back_h').click(function () { alert('ass'); }); $('a').click(function () { var toLoad = $(this).attr('href'); window.location.hash = $(this).attr('href'); toLoad = toLoad.replace(/^.*#/, ''); $.history.load(toLoad); var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } media(vars[hash[0]]); $('.loader').show(); $('#content').hide(); getPage(toLoad); return false; }); $(".refreshMe").everyTime(1000,function(i){ $.ajax({ url: "refresh-me.php", cache: false, success: function(html){ $('.refreshMe').html(html); apply(html) } }); }); $('.refreshMe').css({color:"red"}); }); function apply(html) { } function pageload(toLoad) { if (toLoad) getPage(toLoad); } function media(id) { if (id == 3) { $( "#media" ).animate({ height: 1 }, 1000 ); $( "#playerControl").remove() $( "#media" ).html(''); } else { //$("#media:empty").text("Was empty!") $("#media:empty").animate({ height: 310 }, 1000,getPlayer); $( "#pMenu" ).html('
HIDE PLAYER
'); } } function getPlayer() { $( "#media" ).html('
'); $("#musicplayer").hide(); $('#musicplayer').flash( { swf : 'swf/musicplayer.swf', width: '950', height:'300', wmode : 'transparent', menu : false, flashvars : { pathToFiles : 'media/', xmlPath:'xml/settings.xml', contentPath:'xml/mp3gallery.xml' } }); $("#musicplayer").fadeIn('slow'); } function getPage(toLoad) { var data = toLoad; $.ajax({ url: "loader.php", type: "GET", data: data, cache: false, success: function (html) { $('.loader').hide(); $('#content').html(html); $('#content').show(); document.title = '.:DJ MORGAN:.'; } }); }