/**
 * Common execution js
 * 
 * should be loaded at end of body (for quicker IE execution (IR))
 * 
 * dependancies: jQuery 1.2.x
 * 
 * @author AK
 * 
 */

$.ppprd = {
	debug: {
		enabled: true,
		logAlerts: false	// alerts for clients that don't have the firebug console (otherwise silent)
	}
};


$('body').removeClass('nojs').addClass('jsfx');

/**
 * cross browser stuff
 */		
// correct boxmodel input[type="text"] FF<3
if ($.browser.mozilla && parseFloat($.browser.version) < 1.9)
	$("body").addClass("FF2");		

// ie6 workarounds for unsupported css
if ($.browser.msie && parseFloat($.browser.version) < 7) {
	$("body").addClass("IE6");
	$("acronym[title]").addClass('hasTitle'); /* ie6 doesn't support abbr element */
}

/**
 * submitHovers
 */
$('ul.showsList li a').hover(function(){
	$(this).parents('li:eq(0)').addClass('hover');
},function(){
	$(this).parents('li:eq(0)').removeClass('hover');
});


// anchor hover images
$('a.more')
	.addClass('more-fx')
	.wrapInner('<span class="hoverHelper" />');
$('a.more-container')
	.addClass('more-container-fx')
	.find('span.a-more')
	.wrapInner('<span class="hoverHelper" />');
$('a.action')
	.addClass('action-fx')
	.wrapInner('<span class="hoverHelper" />');
$('a.next')
	.addClass('next-fx')
	.wrapInner('<span class="hoverHelper" />');
$('a.prev')
	.addClass('prev-fx')
	.wrapInner('<span class="hoverHelper" />');


/**
 * anchors (external/popup)
 * 
 */
var oPopWin = null;

$("a[rel='external']").click(function(){window.open(this.href); return false});
$("a[rel='popup']").click(function(){
	popWin = new PopupWindow();
	popWin.anchor = $(this);
	popWin.width = 500;
	popWin.height = 500;
	if (popWin.spawn())
		return false;
});

// Image Replace
if ($.fn.ImageReplace) {
	/* main menu */
	$('#menu>ul').addClass('ir-enabled');
	$('#menu>ul>li a.menuItem').ImageReplace();
}
