// Javascript

// ------------------------
// On load Event 
// (can use $(document).ready(); from jQuery now)
// Not removing as might be using in other areas
// ------------------------
function addLoadEvent(func) 
{
	var oldonload = window.onload;
  	if (typeof window.onload != 'function') 
  	{
    	window.onload = func;
  	}
  	else 
  	{
    	window.onload = function() 
    	{
      		if (oldonload) 
      		{
        		oldonload();
      		}
      		func();
    	}
  	}
}


function jumpMenu(targ,selObj,restore){ //v3.0
	  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	  if (restore) selObj.selectedIndex=0;
	}

function popupWindow(theURL,winName,features) { //v2.0
	  window.open(theURL,winName,features);
	}

jQuery.noConflict();

/**
 * jQuery to call in supersleight (png fix for IE6)
 * 
 * DOES NOT BREAK OTHER BROWSERS!!
 * 
 */
jQuery(document).ready(function()
{
	jQuery('body').supersleight({shim: '/images/blank.gif'});
});


/**
 * jQuery function to show and then hide the basket feedback
 * 
 */
jQuery(document).ready(function()
{
	jQuery('#feedback-container').delay(500).fadeIn(500).delay(5000).fadeOut(500);
});


/**
 * jQuery function to clear searchbox on click and focus
 * Will automatically add 'search' to the box if it's clear on focusout
 * 
 */
jQuery(document).ready(function()
{
	jQuery('#searchTerm').focusin(function()
	{
		var search = jQuery('#searchTerm').val();
		if(search == "search")
		{
			jQuery('#searchTerm').val("");
		}
	});
	
	jQuery('#searchTerm').focusout(function()
	{
		var search = jQuery('#searchTerm').val();
		
		if(search == "")
		{
			jQuery('#searchTerm').val("search");
		}
	});
	
	jQuery('#searchTerm').click(function()
	{
		var search = jQuery('#searchTerm').val();
		
		if(search == "search")
		{
			jQuery('#searchTerm').val("");
		}
	});
});
