/*  
Addison Steele
Author: Aaron Layton (EventureInternet)

Copyright © Addison Steele
Date: 14/07/2011
    
*/

(function ($) {

    // Common scripts that run as soon as the page loads
    SetupMenu();
    SetupGlobal();

    // Page specific code for each class
    $.each(document.body.className.split(/\s+/), function (i, classnm) {
        runPageCode(classnm);
    });

})(this.jQuery);

function runPageCode(pageClass) {
    switch (pageClass) {
        case "homepage":
			// Blank
			if ($('ul.slides').length) {
				$('ul.slides').cycle({
					speed: 1000,
					timeout: 5000
				});
			}
			
		break;
    }
}


window.log = function () {
    log.history = log.history || [];
    log.history.push(arguments);
    if (this.console) {
        console.log(Array.prototype.slice.call(arguments));
    }
};
(function (doc) {
    var write = doc.write;
    doc.write = function (q) {
        log('document.write(): ', arguments);
        if (/docwriteregexwhitelist/.test(q)) write.apply(doc, arguments);
    };
})(document);

function SetupGlobal() {
	
}

function SetupMenu() {
	$("#july11Menu li").prepend("<span></span>"); //Throws an empty span tag right before the a tag
	

	$("#july11Menu li").each(function() { //For each list item...
		var tmp = $(this).find("a");
		tmp.css({color:'#bf4ecb'});
		var linkText = tmp.html(); //Find the text inside of the <a> tag
		$(this).find("span").show().html(linkText); //Add the text in the <span> tag
	}); 

	$("#july11Menu li").hover(function() {	//On hover...
		$(this).find("span").stop().animate({
			marginTop: "-16" //Find the <span> tag and move it up 40 pixels
		}, 250);
	} , function() { //On hover out...
		$(this).find("span").stop().animate({
			marginTop: "0"  //Move the <span> back to its original state (0px)
		}, 250);
	});
	
}















