
(function(){
    
    var root_Path = function()
    {
	    var currentPath = "/";
  	    
        if( !(/http:\/\/.*?ncdot\.org|http:\/\/.*?ncdot\.gov|http:\/\/stage\/|http:\/\/.*?dot\.state\.nc\.us/i).test( document.location.href ) )
        {
            if( 'https:' == document.location.protocol )
            {
	            currentPath = "https://apps.dot.state.nc.us/";
	        }
	        else
	        {
	            currentPath = "http://www.ncdot.gov/";
	        }
        }
        return currentPath;
    };
    
    
    if( !(/http.*?:\/\/search|http.*?:\/\/apps|http.*?:\/\/fts|http.*?:\/\/intranet/i).test( document.location.href ) )
    {
        document.write('<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js" ></' + 'script>');
        document.write('<script src="'+root_Path()+'_js/jquerydotelementsmin.js"></' + 'script>');
    }
    
    //-- swfobject used not only on static side but on apps side too
    /* Apps:
    1. Prequal Application
    2. 
    3. 
    */
    document.write('<script src="'+root_Path()+'_js/swfobject.js"></' + 'script>');
    
})();
    
    
    //-- addEvent used on apps side
	/* Apps:
	1. SPOT List
	2. 
	3. 
	*/
	
function addEvent(elm, evType, fn, useCapture){
	if(!document.getElementById)return;
	if(elm.addEventListener){
   		elm.addEventListener(evType, fn, useCapture);
   		return true;
	}else if(elm.attachEvent){
		var r = elm.attachEvent("on"+evType, fn);
		return r;
	}else{
    	elm['on'+evType] = fn;
	}
}
