function displayadvert(root,advertimage,name){
	if (document.getElementById(name).style.display == "block" || document.getElementById(name).style.display == "") {
		document.getElementById(name).style.display="none";
		document.getElementById(advertimage).src=root+"/images/header_arrow_down.jpg";
	} else {
		document.getElementById(name).style.display = "block";
		document.getElementById(advertimage).src=root+"/images/header_arrow_up.jpg";
	}
}
function highlight(txt,sterm){if (txt.value==sterm){txt.value="";}else{txt.select();}}
function changesubmitmethod(newmethod,newaction){
    var frm;
    if (document.getElementById) if (!frm) frm = document.getElementById('aspnetForm');
    if (!frm){frm = document.aspnetForm;}
    if (document.getElementById('__VIEWSTATE')){(document.getElementById('__VIEWSTATE')).parentNode.innerHTML = "";}
    if (document.getElementById('__VSTATE')){(document.getElementById('__VSTATE')).parentNode.innerHTML = "";}
    if (document.getElementById('__EVENTTARGET')){(document.getElementById('__EVENTTARGET')).parentNode.innerHTML = "";}
    if (document.getElementById('__EVENTARGUMENT')){(document.getElementById('__EVENTARGUMENT')).parentNode.innerHTML = "";}
    if (document.getElementById('__EVENTVALIDATION')){(document.getElementById('__EVENTVALIDATION')).parentNode.innerHTML = "";}
    frm.method = newmethod;
    frm.action = newaction;
}
function hide(id){document.getElementById(id).style.visibility = "hidden";document.getElementById(id).style.display = "none";}
function display(id){document.getElementById(id).style.visibility = "visible";document.getElementById(id).style.display = "block";}
function listingcolorset(color,txtid){
    document.getElementById('listingnavigation').originalcolor = document.getElementById('listingnavigation').style.backgroundColor;
    document.getElementById('listingnav').originalcolor = document.getElementById('listingnav').style.backgroundColor;
    document.getElementById(txtid).originalcolor = document.getElementById(txtid).value;
    document.getElementById('listingnavigation').style.backgroundColor = color;
    document.getElementById('listingnav').style.backgroundColor = color;
    document.getElementById(txtid).value = color;
}
function listingcolorrevert(txtid){
    document.getElementById('listingnavigation').style.backgroundColor = document.getElementById('listingnavigation').originalcolor;
    document.getElementById('listingnav').style.backgroundColor = document.getElementById('listingnav').originalcolor;
    document.getElementById(txtid).value = document.getElementById(txtid).originalcolor;
}
function listingcolorsetforpost(txtid){
    //Keep color when clicked
    document.getElementById('listingnavigation').originalcolor = document.getElementById('listingnavigation').style.backgroundColor;
    document.getElementById('listingnav').originalcolor = document.getElementById('listingnav').style.backgroundColor;
    document.getElementById(txtid).originalcolor = document.getElementById(txtid).value;
}
function removecheck(idchk){var chk = document.getElementById(idchk);chk.checked = false;}
function f_scrollTop(){
	return f_filterResults (
		window.pageYOffset ? window.pageYOffset : 0,
		document.documentElement ? document.documentElement.scrollTop : 0,
		document.body ? document.body.scrollTop : 0
	);
}
function f_filterResults(n_win,n_docel,n_body){
	var n_result = n_win ? n_win : 0;
	if (n_docel && (!n_result || (n_result > n_docel))) n_result = n_docel;
	return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
}

                            if(typeof(Sys)!=='undefined') Array.add(Sys._ScriptLoader._getLoadedScripts(), 'http://www.engnet.us/scripts/base.js'); 
                            if( !window._combinedScripts ) { window._combinedScripts = []; } 
                            window._combinedScripts.push('http://www.engnet.us/scripts/base.js');

                if(typeof(Sys)!=='undefined')             
                {                
                    if(typeof(Sys._ScriptLoader) !== 'undefined')
                    {                                    
                        Sys._ScriptLoader.isScriptLoaded = function Sys$_ScriptLoader$isScriptLoaded(scriptSrc) 
                        {                                                    
                            var dummyScript = document.createElement('script');
                            dummyScript.src = scriptSrc;
                            var result = Array.contains(Sys._ScriptLoader._getLoadedScripts(), scriptSrc);
                            if( result === true ) return true;
                            result = Array.contains( window._combinedScripts, scriptSrc );
                            if( result === true ) return true;                            
                            var scriptTags = document.getElementsByTagName('script');
                            for(var i = 0; i < scriptTags.length; i ++ ) if( scriptTags[i].src == dummyScript.src ) return true;
                            return false;
                        }
                    }                    
                }