// addjQuery.js  

// Script to add jQuery if it is not already loaded on the page.
// Used for pages or fragments that may not have control overy their parent directory config files.
// Written by Brendon Hicks (brendon@elegantthought.com) for PricewaterhouseCoopers.  

// Ver. 1: Jan 25, 2010
// ver. 2: May 30, 2010 - now loads jQuery v. 1.4.2


var jqaddscript = {loaded : false, conflict : false};

//detect jQuery


if (typeof jQuery == 'function'){

//check if it's 1.4 or higher
	var version = jQuery.fn.jquery;

	version = parseInt(version.split(".")[1]);
	if (version >= 4) jqaddscript.loaded = true;
}

// now check if some other script is using $
if (typeof $ == 'function' && !$.fn.jquery) jqaddscript.conflict = true;

if(!jqaddscript.loaded) document.write('<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>');

if(jqaddscript.conflict) jQuery.noConflict();