$(document).ready(function () { $("#header_shiz").click(function () { $('#header_shiz').hide(); // $('#padder').show(); }); // generate links code $(".homenav").mouseenter(function () { $('.navigation').html('Home'); }); $(".homenav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".disclaimernav").mouseenter(function () { $('.navigation').html('Disclaimer'); }); $(".disclaimernav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".ircnav").mouseenter(function () { $('.navigation').html('IRC'); }); $(".ircnav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".aboutnav").mouseenter(function () { $('.navigation').html('About Us'); }); $(".aboutnav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".linksnav").mouseenter(function () { $('.navigation').html('Links'); }); $(".linksnav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".contactnav").mouseenter(function () { $('.navigation').html('Contact'); }); $(".contactnav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".downloadsnav").mouseenter(function () { $('.navigation').html('Downloads'); }); $(".downloadsnav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".vhostsnav").mouseenter(function () { $('.navigation').html('Vhosts'); }); $(".vhostsnav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".fontnav").mouseenter(function () { $('.navigation').html('Change Font Size'); }); $(".fontnav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".helpnav").mouseenter(function () { $('.navigation').html('Help & Support'); }); $(".helpnav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".themenav").mouseenter(function () { $('.navigation').html('Choose Theme'); }); $(".themenav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".searchnav").mouseenter(function () { $('.navigation').html('Search'); }); $(".searchnav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".backnav").mouseenter(function () { $('.navigation').html('Back One Page'); }); $(".backnav").mouseleave(function () { $('.navigation').html(document.location.hash); }); $(".forwardnav").mouseenter(function () { $('.navigation').html('Forward One Page'); }); $(".forwardnav").mouseleave(function () { $('.navigation').html(document.location.hash); }); // start history and load page $.history.init(pageload); $('a[href=' + window.location.hash + ']').addClass('selected'); $('a[rel=ajax]').click(function () { var hash = this.href; // hash = hash.replace(/^.*#/, '\/?url='); hash = hash.replace(/^.*#/, ''); $.history.load(hash); $('a[rel=ajax]').removeClass('selected'); $(this).addClass('selected'); $('.body').hide(); $('#wrapper').hide(); $('.loading').show(); getPage(); return false; }); }); function pageload(hash) { if (hash) getPage(); else getMainPage(); } function getMainPage() { $('.loading').show(); $('#wrapper').show(); $('.body').fadeIn('slow'); $('#content').load('pages/welcome.php'); $('#home').addClass('selected'); $('.loading').hide(); } function getPage() { var data = 'page=' + encodeURIComponent(document.location.hash); $.ajax({ url: "loader.php", type: "GET", data: data, cache: false, success: function (html) { $('.loading').show(); $('#wrapper').show(); $('.body').fadeIn('slow'); $('#content').html(html); $('.loading').hide(); $('.navigation').html(document.location.hash); } }); } // finished