/**
 * Common Javascript methods
 *
 * Self-calling method for common javascript methods. Called at the
 * end of DOM construction
 *
 * @author 		Paul Campbell
 * @copyright 	Copyright (c) 2009, PKR.com. All rights reserved.
 */
var FOCUS_CLASS 		= "focus";
var HOVER_CLASS 		= "hover";
var ACTIVE_CLASS		= "active";
var NO_JAVASCRIPT_CLASS = "no-js";
/**
 * Apply custom methods
 */
jQuery.easing.def = "easeOutQuad";
pkr.initialize();

/**
 * Enhanced style additions
 */
$("#information li:not(:last-child)").append("&#160;&#124;&#160;");

/**
 * IE CSS pseudo-class exceptions
 */
if($.browser.msie && $.browser.version < 8) {
	
	// Input focus 
	$("input[type=text]").focus(function() {
		$(this).addClass( FOCUS_CLASS );
	}).blur(function() {
		$(this).removeClass( FOCUS_CLASS );
	});
	
	// Hover
	$("#primary > li").hover(function () {
		$(this).addClass( HOVER_CLASS );
	}, function () {
		$(this).removeClass( HOVER_CLASS );	
	});
}

/**
 * Open external links in a new window
$("a[@rel*=external], a[@href*=http]").click(function() {
	window.open(this.href);
	return(false);
});
*/	

/**
 * Additional pseudo classes (W3C abiding)
 */
$("#primary li:first, #secondary li:first, table tr td:first-child, table tr th:first-child, #my-social-data li:first").addClass("first");
$("#secondary li:last, table tbody tr:last, .content-pane-half:nth-child(2n), .content-pane-quarter:nth-child(4n), table tr td:last-child, table tr th:last-child, .downloads-list > li:has(ol):nth-child(2n), .downloads-list > li:has(p):nth-child(2n), .forum-post:last-child, #breadcrumb li:last, #product .thumbs li:nth-child(3n)").addClass("last");
$("#content table tbody tr:nth-child(odd), .forum-post:even").addClass("stripe");

/**
 * Kill non-javascript elements
 */
$("." + NO_JAVASCRIPT_CLASS).remove();
