/////////////////////////////////////
//		Global Variables
/////////////////////////////////////
var domain_name = ['http://', location.host].join('');
var wp_root = '/';
var site_root = 'wp-content/themes/soupergirl/';
var page_path = location.href.replace(domain_name,'');

// Break out of any frames that may try to wrap this page.
if (top.location != location) {
	top.location.href = document.location.href;
}

/////////////////////////////////////
//		Initialize page functions
/////////////////////////////////////
$(document).ready(function() {
	// Preload all rollovers
	$.each($("a.imgrollover"), function() { $(['<img src="', $(this).children('img').attr('src').replace(/(\.[^.]+)$/, '_over$1'), '" />'].join('')); });
	// Set rollovers
	$("a.imgrollover").live('mouseover', function() { // the over state
		$(this).children('img').attr('src', $(this).children('img').attr('src').replace(/(\.[^.]+)$/, '_over$1'));
	});
	$("a.imgrollover").live('mouseout', function() { // the out state
		$(this).children('img').attr('src', $(this).children('img').attr('src').replace(/_over(\.[^.]+)$/, '$1'));
	});
	// Set form fields with erasecontent class to empty on focus and fill from alt if empty on losing focus
	$(".erasecontent").bind("focus", function () { $(this).val('') });

	$('#menu > ul > li > a').parent('li').hover(
		function () {
			$(this).addClass('menuover');
			$(this).children('ul').fadeIn(300);
		},
		function () {
			$(this).removeClass('menuover');
			$(this).children('ul').fadeOut(200);
		}
	);

	$('#tabs').tabs();

});
