/*
 * This script instantiates sitewide jQuery methods.
 * These methods could bind events to elements, for example.
 */

$(function(){
	/* PNG 24 fun */
	
	// Fixes transparent PNG bug just for IE6 or less.
	// Don't apply to all elements, as other non-transparent images may break.
	// Here we're appling the hack to all dynamic buttons and button elements.
	$('.btn, button, .item-compare').supersleight();

	// Here we're appling the hack to all "PNG24" images.
	$('.PNG24').supersleight({backgrounds: false});

	// Here we're appling the hack to all "tabs".
	$("ul.tabsNavMenu a span, ul.tabsNavMenu a em").supersleight();

	// Converts all support links to toggles
	$('.support-faq-question-link').click(function() { this.parentNode.onclick(); return false; });


	/* New "target" window for XHTML */
	
	//js alternative to target="_blank"
	$('a.new-win').click(function(){window.open(this.href); return false;});


	// Remove default value from input.
	$('.clear-this').focus(function(){
		$(this).val('');
	});

	
	// Let's not submit the search form if nothing's been entered
	var input_def_value = $('#search-for').val();
	$('#search-site').submit(function(){
		var input_value = $('#search-for').val();
		if (input_value == input_def_value || input_value == "") //return false;
			$('#search-for').val('');
		return true;
	});
	
});
