
/**
 *
 * Include a javascript file at runtime
 *
 **/
function include_js(js_file_name){

	if($("script[src='"+GBL_BASE_URL+js_file_name+"']").size() == 0) {

        $('head').append(
            "<script type='text/javascript' src='"+GBL_BASE_URL+js_file_name+"'></script>"
        );
    }		 
}
		

function is_browser_ie6(){
	//Can't just run one test, as they will not necessarily return accurate version number
	//Start with the navigator useragent 
	if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ 
		var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		if (ieversion<7){
			//Double check it
			if($.browser.msie&&($.browser.version == "6.0")){		
				return true;					
			}
		}
	}		 
	return false;
}
		

/**
 * Create a console function so that firebug console logging will not fail when a non console browser is used
 **/
if (! ("console" in window) || !("firebug" in console)) {
    var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", "group"
                 , "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
    window.console = {};
    for (var i = 0; i <names.length; ++i) window.console[names[i]] = function() {};
}
