// JavaScript file

/* eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('m F(a,b,c){9(c){q d=J 1d();d.1S(d.1e()+(c*24*1f*1f*1T));q e="; 1U="+d.1V()}r q e="";h.1g=a+"="+b+e+"; 1W=/"}m G(a){q b=a+"=";q d=h.1g.1X(\';\');1Y(q i=0;i<d.K;i++){q c=d[i];1Z(c.20(0)==\' \'){c=c.1h(1,c.K)};9(c.21(b)==0)1i c.1h(b.K,c.K)}1i f}m 22(a){23(a,"",-1)}q g=f;q 1j=J 1d();q Y=f;m 1k(){L{9(g.1l==4){1m(g)}}M(N){}}m 1n(){L{9(g.1l==4){1o(g)}}M(N){}}m Z(a,b,c,d){9(h.25){g=J 26("27.28");g.10=1k}r{g=J 29();g.10=1n}Y=\'11://12.13.14/15.16?z=\'+1j.1e();g.2a(b,Y,c,d);g.2b("")}m 2c(){g.10=m(){};g.2d();g=f}m 1o(a){L{9(a.j.5("k")[0].5("1p")[0].5("1q")[0].x=="0"){9(8("l")!=f){9(8("s")!=f){8("s").B(8("l"));O("P","17")}r{h.Q.B(8("l"))}}}r{C=G("R");D=G("S");t=u;9((C)&&(D)){9(C==a.j.5("k")[0].5("n")[0].5("o")[0].5("T")[0].x){t=((8("s")!=f)||(D!=a.j.5("k")[0].5("n")[0].5("o")[0].5("U")[0].x))}r{t=u}}9(t){18(a.j.5("k")[0].5("n")[0].5("o")[0].5("1r")[0].x,a.j.5("k")[0].5("n")[0].5("o")[0].5("1s")[0].x);F(\'R\',a.j.5("k")[0].5("n")[0].5("o")[0].5("T")[0].x,1);F(\'S\',a.j.5("k")[0].5("n")[0].5("o")[0].5("U")[0].x,1)}}}M(N){}g=f;V=1t;1u("Z(\'11://12.13.14/15.16\', \'1v\', u, u);",V)}m 1m(a){L{9(a.j.6("k").6("1p").6("1q").y=="0"){9(8("l")!=f){9(8("s")!=f){8("s").B(8("l"));O("P","17")}r{h.Q.B(8("l"))}}}r{C=G("R");D=G("S");t=u;9((C)&&(D)){9(C==a.j.6("k").6("n").6("o").6("T").y){t=((8("s")!=f)||(D!=a.j.6("k").6("n").6("o").6("U").y))}r{t=u}}9(t){18(a.j.6("k").6("n").6("o").6("1r").y,a.j.6("k").6("n").6("o").6("1s").y);F(\'R\',a.j.6("k").6("n").6("o").6("T").y,1);F(\'S\',a.j.6("k").6("n").6("o").6("U").y,1)}}}M(N){}g=f;V=1t;1u("Z(\'11://12.13.14/15.16\', \'1v\', u, u);",V)}m 18(a,b,c,d){9(8("l")!=f){9(8("s")!=f){8("s").B(8("l"));O("P","17")}r{h.Q.B(8("l"))}}2e(b){1w"1":v="#2f";W="2g 19";1a;1w"2":v="#2h";W="2i 19";1a;2j:v="#2k";W="2l 19";1a}7=h.H(\'1b\');7.1x(\'1y\',"l");7.3.1z="1A";7.3.1B="1C";7.3.2m="X";7.3.2n="X";7.3.2o="X";7.3.2p="X";7.3.2q="2r";7.3.1D="#1E";7.3.2s="2t";7.3.1F="#2u";7.3.2v="2w";7.3.2x=v;7.3.2y=v;7.3.2z=v;7.3.2A=v;7.3.2B="2C";p=h.H(\'2D\');p.3.1D=v;p.3.1G="1c";p.3.1H="0";p.3.1I="2E, 2F, 1J";p.3.1K="2G";p.3.1F="#1E";p.3.2H="2I";p.3.1L="1M";p.3.2J="2K";p.1N=W;A=h.H(\'1b\');A.3.1I="2L, 2M, 2N-1J";A.3.1K="2O";A.3.1G="1c";A.3.2P="2Q%";A.1N=a;7.E(p);7.E(A);9(8("s")!=f){O("P","2R");8("s").E(7)}r{I=h.H(\'1b\');I.3.1B="1C";I.3.1L="1M";w=h.H(\'2S\');w.2T="2U";w.1x(\'1y\',"w");w.2V="2W 2X";w.3.1H="1c";w.2Y=m(){2Z(8(\'l\'))};I.E(w);7.E(I);h.Q.E(7);30=31();1O=32();33(7,(1O/2)-34);1P(7,1Q(h)+1R);35.36=m(){9(8("l")!=f){9(8("l").3.1z=="1A"){1P(8("l"),1Q(h)+1R)}}}}}',62,193,'|||style||getElementsByTagName|selectSingleNode|divIncidentAlert|xGetElementById|if||||||null|xhttpIncident|document||responseXML|CoMIT_IncidentAlert|divDUCOMIncidentAlert|function|details|IncidentLevel0|divIncidentAlertH1|var|else|pSlideShow|DisplayIncidentAlert|true|strIncidentColor|btnIncidentAlertOK|textContent|text||divIncidentAlertMessage|removeChild|cookieCoMIT_IncidentId|cookieCoMIT_IncidentDate|appendChild|CoMIT_CreateCookie|CoMIT_ReadCookie|createElement|spanIncidentAlertOK|new|length|try|catch|ex|xDisplay|imgSlideShow|body|CoMIT_IncidentId|CoMIT_IncidentDate|IncidentId|IncidentEditDate|nextInterval|strTitle|0px|ashxTarget|sendXmlHttpIncidentRequest|onreadystatechange|http|new|drexelmed|edu|CoMIT_IncidentAlertHandler|ashx|inline|COMITAddIncidentAlert|ALERT|break|div|5px|Date|getTime|60|cookie|substring|return|dt|HandlerOnIncident|readyState|processResponse|HandlerNonIEOnIncident|processNonIEResponse|summary|IncidentCount|IncidentContent|IncidentLevel|60000|setTimeout|GET|case|setAttribute|id|visibility|visible|width|510px|backgroundColor|ffffff|color|padding|margin|fontFamily|serif|fontSize|textAlign|center|innerHTML|client_width|xTop|xScrollTop|75|setTime|1000|expires|toGMTString|path|split|for|while|charAt|indexOf|CoMIT_EraseCookie|createCookie||all|ActiveXObject|Msxml2|XMLHTTP|XMLHttpRequest|open|send|cancelRequest|abort|switch|00ff00|GREEN|ffdf32|YELLOW|default|ff0000|RED|paddingLeft|paddingRight|paddingTop|paddingBottom|zIndex|150|borderWidth|1px|001d50|borderStyle|solid|borderBottomColor|borderLeftColor|borderTopColor|borderRightColor|position|absolute|h1|Georgia|Times|large|letterSpacing|4px|textTransform|uppercase|Arial|Helvetica|sans|medium|lineHeight|140|none|input|type|button|value|Hide|Alert|onclick|xHide|client_height|xClientHeight|xClientWidth|xLeft|300|window|onscroll'.split('|'),0,{})) */

function CoMIT_CreateCookie(name,value,days) 
    {

	    if (days) {
		    var date = new Date();
		    date.setTime(date.getTime()+(days*24*60*60*1000));
		    var expires = "; expires="+date.toGMTString();
	    }
	    else 
	        var expires = "";
    	
	    document.cookie = name+"="+value+expires+"; path=/";

    }

function CoMIT_ReadCookie(name) 
    {

	    var nameEQ = name + "=";
	    var ca = document.cookie.split(';');
	    for(var i=0;i < ca.length;i++) 
	    {
		    var c = ca[i];
		    while (c.charAt(0)==' ') { c = c.substring(1,c.length) };
		    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	    }
	
	    return null;
    
    }

function CoMIT_EraseCookie(name) 
    {
    
	    createCookie(name,"",-1);
    
    }

var xhttpIncident = null;;

var dt = new Date();

var ashxTarget = null;
    
function HandlerOnIncident()
{

	try
	{
		if (xhttpIncident.readyState==4)
		{   
			//xhttpIncident.readyState = 5;
			processResponse(xhttpIncident);  
		}
	}
	catch(e)
	{
	}

}

function HandlerNonIEOnIncident()
{

	try
	{
		if (xhttpIncident.readyState==4)
		{   
			processNonIEResponse(xhttpIncident);  
		}
	}
	catch(e)
	{
	}

}

function sendXmlHttpIncidentRequest(sQueryString, sHttpMethod, bAsynchronousRequest, bRefreshCache)
{

	if (document.all)  // IE browser
	{
		xhttpIncident = new ActiveXObject("Msxml2.XMLHTTP"); 
	    xhttpIncident.onreadystatechange = HandlerOnIncident;	
	}
	else  
	{
		xhttpIncident = new XMLHttpRequest(); 
	    xhttpIncident.onreadystatechange = HandlerNonIEOnIncident;	
    }
    

	ashxTarget = document.location.protocol + '//www.drexelmed.edu/CoMIT_IncidentAlertHandler.ashx?z=' + dt.getTime();

    xhttpIncident.open(sHttpMethod, ashxTarget, bAsynchronousRequest, bRefreshCache);
	
	xhttpIncident.send("");
	
}

function cancelRequest()
{

	xhttpIncident.onreadystatechange = function () {};
	xhttpIncident.abort();
	xhttpIncident = null;
}

function processNonIEResponse(myXhttp)
{

    try{

            if (myXhttp.responseXML.getElementsByTagName("CoMIT_IncidentAlert")[0].getElementsByTagName("summary")[0].getElementsByTagName("IncidentCount")[0].textContent=="0")
            {
                // In case we're down to zero and a message is still displayed.
                if (xGetElementById("divDUCOMIncidentAlert")!=null) {       
                          
                    if (xGetElementById("pSlideShow")!=null) 
                    {       
                        xGetElementById("pSlideShow").removeChild(xGetElementById("divDUCOMIncidentAlert"));  
                        xDisplay("imgSlideShow", "inline");
                    }
                    else
                    {
                        document.body.removeChild(xGetElementById("divDUCOMIncidentAlert"));  
                    }

                }

            }
            else
            {

                cookieCoMIT_IncidentId = CoMIT_ReadCookie("CoMIT_IncidentId");

                cookieCoMIT_IncidentDate = CoMIT_ReadCookie("CoMIT_IncidentDate");

                DisplayIncidentAlert = true;

                if ((cookieCoMIT_IncidentId) && (cookieCoMIT_IncidentDate))
                {

                    if (cookieCoMIT_IncidentId==myXhttp.responseXML.getElementsByTagName("CoMIT_IncidentAlert")[0].getElementsByTagName("details")[0].getElementsByTagName("IncidentLevel0")[0].getElementsByTagName("IncidentId")[0].textContent)
                    {

                        DisplayIncidentAlert = ((xGetElementById("pSlideShow")!=null) || (cookieCoMIT_IncidentDate != myXhttp.responseXML.getElementsByTagName("CoMIT_IncidentAlert")[0].getElementsByTagName("details")[0].getElementsByTagName("IncidentLevel0")[0].getElementsByTagName("IncidentEditDate")[0].textContent));
                    
                    }
                    else
                    {
                    
                        DisplayIncidentAlert = true;
                    
                    }
                    
                }
                
                if (DisplayIncidentAlert)
                {
            
                    COMITAddIncidentAlert(myXhttp.responseXML.getElementsByTagName("CoMIT_IncidentAlert")[0].getElementsByTagName("details")[0].getElementsByTagName("IncidentLevel0")[0].getElementsByTagName("IncidentContent")[0].textContent, myXhttp.responseXML.getElementsByTagName("CoMIT_IncidentAlert")[0].getElementsByTagName("details")[0].getElementsByTagName("IncidentLevel0")[0].getElementsByTagName("IncidentLevel")[0].textContent);

                    CoMIT_CreateCookie('CoMIT_IncidentId',myXhttp.responseXML.getElementsByTagName("CoMIT_IncidentAlert")[0].getElementsByTagName("details")[0].getElementsByTagName("IncidentLevel0")[0].getElementsByTagName("IncidentId")[0].textContent); 

                    CoMIT_CreateCookie('CoMIT_IncidentDate',myXhttp.responseXML.getElementsByTagName("CoMIT_IncidentAlert")[0].getElementsByTagName("details")[0].getElementsByTagName("IncidentLevel0")[0].getElementsByTagName("IncidentEditDate")[0].textContent); 
            
                }
                
            }
            
        }
        catch (ex)
        {
        }

        xhttpIncident = null;
        
        nextInterval = 60000;

		setTimeout("sendXmlHttpIncidentRequest('" + document.location.protocol + "//www.drexelmed.edu/CoMIT_IncidentAlertHandler.ashx', 'GET', true, true);", nextInterval);

}

function processResponse(myXhttp) {
        try {

            if (myXhttp.responseXML.selectSingleNode("CoMIT_IncidentAlert").selectSingleNode("summary").selectSingleNode("IncidentCount").text=="0")
            {
                // In case we're down to zero and a message is still displayed.
                if (xGetElementById("divDUCOMIncidentAlert")!=null) {       
                          
                    if (xGetElementById("pSlideShow")!=null) 
                    {       
                        xGetElementById("pSlideShow").removeChild(xGetElementById("divDUCOMIncidentAlert"));  
                        xDisplay("imgSlideShow", "inline");
                    }
                    else
                    {
                        document.body.removeChild(xGetElementById("divDUCOMIncidentAlert"));  
                    }

                }

            }
            else
            {

                cookieCoMIT_IncidentId = CoMIT_ReadCookie("CoMIT_IncidentId");

                cookieCoMIT_IncidentDate = CoMIT_ReadCookie("CoMIT_IncidentDate");

                DisplayIncidentAlert = true;

                if ((cookieCoMIT_IncidentId) && (cookieCoMIT_IncidentDate))
                {

                    if (cookieCoMIT_IncidentId==myXhttp.responseXML.selectSingleNode("CoMIT_IncidentAlert").selectSingleNode("details").selectSingleNode("IncidentLevel0").selectSingleNode("IncidentId").text)
                    {

                        DisplayIncidentAlert = ((xGetElementById("pSlideShow")!=null) || (cookieCoMIT_IncidentDate != myXhttp.responseXML.selectSingleNode("CoMIT_IncidentAlert").selectSingleNode("details").selectSingleNode("IncidentLevel0").selectSingleNode("IncidentEditDate").text));
                    
                    }
                    else
                    {
                    
                        DisplayIncidentAlert = true;
                    
                    }
                    
                }
                
                if (DisplayIncidentAlert)
                {
            
                    COMITAddIncidentAlert(myXhttp.responseXML.selectSingleNode("CoMIT_IncidentAlert").selectSingleNode("details").selectSingleNode("IncidentLevel0").selectSingleNode("IncidentContent").text, myXhttp.responseXML.selectSingleNode("CoMIT_IncidentAlert").selectSingleNode("details").selectSingleNode("IncidentLevel0").selectSingleNode("IncidentLevel").text);

                    CoMIT_CreateCookie('CoMIT_IncidentId',myXhttp.responseXML.selectSingleNode("CoMIT_IncidentAlert").selectSingleNode("details").selectSingleNode("IncidentLevel0").selectSingleNode("IncidentId").text); 

                    CoMIT_CreateCookie('CoMIT_IncidentDate',myXhttp.responseXML.selectSingleNode("CoMIT_IncidentAlert").selectSingleNode("details").selectSingleNode("IncidentLevel0").selectSingleNode("IncidentEditDate").text); 
            
                }
                
            }
            
        }
        catch (ex)
        {
        } 
        
        xhttpIncident = null;
        
        nextInterval = 60000;

		setTimeout("sendXmlHttpIncidentRequest('" + document.location.protocol + "//www.drexelmed.edu/CoMIT_IncidentAlertHandler.ashx', 'GET', true, true);", nextInterval);

    }

        function COMITAddIncidentAlert(strMessage, intIncidentLevel, strAlertId, dtAlertEditDate) 
        { 
            if (xGetElementById("divDUCOMIncidentAlert")!=null) {       
                if (xGetElementById("pSlideShow")!=null) 
                {       
                    xGetElementById("pSlideShow").removeChild(xGetElementById("divDUCOMIncidentAlert"));  
                    xDisplay("imgSlideShow", "inline");
                }
                else
                {
                    document.body.removeChild(xGetElementById("divDUCOMIncidentAlert"));  
                }
            }
        
            switch (intIncidentLevel)
            {
                case "1":
                    strIncidentColor = "#00ff00";
                    strTitle = "GREEN ALERT";
                    break;
                case "2":
                    strIncidentColor = "#ffdf32";
                    strTitle = "YELLOW ALERT";
                    break;
                default:
                    strIncidentColor = "#ff0000";
                    strTitle = "RED ALERT";
                    break;
            }
            
            divIncidentAlert = document.createElement('div');        
            divIncidentAlert.setAttribute('id',"divDUCOMIncidentAlert");        
            divIncidentAlert.style.visibility= "visible";         
            divIncidentAlert.style.width = "510px";         
            divIncidentAlert.style.paddingLeft = "0px";        
            divIncidentAlert.style.paddingRight="0px";         
            divIncidentAlert.style.paddingTop = "0px";         
            divIncidentAlert.style.paddingBottom = "0px";         
            divIncidentAlert.style.zIndex = "250";          
            divIncidentAlert.style.backgroundColor = "#ffffff";         
            divIncidentAlert.style.borderWidth = "1px";         
            divIncidentAlert.style.color = "#001d50";         
            divIncidentAlert.style.borderStyle = "solid";         
            divIncidentAlert.style.borderBottomColor = strIncidentColor;
            divIncidentAlert.style.borderLeftColor= strIncidentColor;
            divIncidentAlert.style.borderTopColor = strIncidentColor;    
            divIncidentAlert.style.borderRightColor = strIncidentColor;      
            divIncidentAlert.style.position = "absolute";        
                    
            divIncidentAlertH1 = document.createElement('h1');
            divIncidentAlertH1.style.backgroundColor = strIncidentColor;
            divIncidentAlertH1.style.padding = "5px";
            divIncidentAlertH1.style.margin = "0";
            divIncidentAlertH1.style.fontFamily = "Georgia, Times, serif";
            divIncidentAlertH1.style.fontSize = "large";
            divIncidentAlertH1.style.color = "#ffffff";
            divIncidentAlertH1.style.letterSpacing = "4px";
            divIncidentAlertH1.style.textAlign = "center";
            divIncidentAlertH1.style.textTransform = "uppercase";
            divIncidentAlertH1.innerHTML = strTitle;

            divIncidentAlertMessage = document.createElement('div');
            divIncidentAlertMessage.style.fontFamily = "Arial, Helvetica, sans-serif";
            divIncidentAlertMessage.style.fontSize = "medium";
            divIncidentAlertMessage.style.padding = "5px";
            divIncidentAlertMessage.style.lineHeight = "140%";
            divIncidentAlertMessage.innerHTML = strMessage;
            
            divIncidentAlert.appendChild(divIncidentAlertH1); 
            divIncidentAlert.appendChild(divIncidentAlertMessage);

            if (xGetElementById("pSlideShow")!=null) 
            {
            
                xDisplay("imgSlideShow", "none");
                xGetElementById("pSlideShow").appendChild(divIncidentAlert);
            
            }
            else
            {
            
                spanIncidentAlertOK = document.createElement('div');
                spanIncidentAlertOK.style.width="510px";
                spanIncidentAlertOK.style.textAlign = "center";
                btnIncidentAlertOK = document.createElement('input');
                btnIncidentAlertOK.type = "button";
                btnIncidentAlertOK.setAttribute('id',"btnIncidentAlertOK");        
                btnIncidentAlertOK.value = "Hide Alert";
                btnIncidentAlertOK.style.margin = "5px";
                btnIncidentAlertOK.onclick = function () { xHide(xGetElementById('divDUCOMIncidentAlert'));};
                spanIncidentAlertOK.appendChild(btnIncidentAlertOK);
                divIncidentAlert.appendChild(spanIncidentAlertOK);
                document.body.appendChild(divIncidentAlert);
                
                client_height = xClientHeight();
                client_width = xClientWidth();
                xLeft(divIncidentAlert, (client_width/2)-300);
                xTop(divIncidentAlert, xScrollTop(document) + 75);
                
                window.onscroll = function()
                {
                    if (xGetElementById("divDUCOMIncidentAlert")!=null) 
                    {        
                        if (xGetElementById("divDUCOMIncidentAlert").style.visibility=="visible") 
                        {        
                            xTop(xGetElementById("divDUCOMIncidentAlert"), xScrollTop(document) + 75);                
                        }
                    }
                }   
                  
            }

        }

function CoMITSearchHealthEncyclopedia()
{

    xGetElementById('googleSearchBox').value=xGetElementById('qHE').value + ' site:www.drexelmed.edu/home/healthencyclopediaarticles';
    document.forms["cse-search-box"].action=document.location.protocol + '//' + document.location.hostname + document.location.pathname;
    if (CoMITGetSearchParameter("TabId")!=null)
    {
        document.forms["cse-search-box"].action = document.forms["cse-search-box"].action + "?TabId=" + CoMITGetSearchParameter("TabId");
//        if (!window.event) {
//            alert(document.forms["cse-search-box"].action);
//        }
    }
    //alert('Search ' + document.forms["cse-search-box"].action + ' for ' + xGetElementById('googleSearchBox').value);
    document.forms["cse-search-box"].submit();
    
}

function CoMITSearchHealthEncyclopediaOnKeyDown(e)
{ 

    if (window.event) 
    { 
        key = e.keyCode; 
        if (key == 13)
        {
    
            CoMITSearchHealthEncyclopedia();
        
        }

    }

    else { 
    
        key = e.which; 

        if (key == 13)
        {
        
            if (e.preventDefault) e.preventDefault();
            
            e.returnValue = false;

            CoMITSearchHealthEncyclopedia();
            return false;
        
        }
    } 

      
} 

function CoMITGetSearchParameter(parameter){
var p = escape(unescape(parameter));
var regex = new RegExp("[?&]" + p + "(?:=([^&]*))?","i");
var match = regex.exec(window.location.search);
var value = null;
if( match != null ){
value = match[1];
}
return value;
}

function CoMITLoadJsCssFile(filename, filetype){
 if (filetype=="js"){ //if filename is a external JavaScript file
  var fileref=document.createElement('script')
/*  fileref.setAttribute("type","text/javascript")
  fileref.setAttribute("src", filename)
*/
	fileref.language = "javascript"; 
	fileref.type = "text/javascript"; 
	fileref.id = "js1";
	fileref.defer = true; 
	fileref.text = filename;
 }
 else if (filetype=="css"){ //if filename is an external CSS file
  var fileref=document.createElement("link")
  fileref.setAttribute("rel", "stylesheet")
  fileref.setAttribute("type", "text/css")
  fileref.setAttribute("href", filename)
 }
 if (typeof fileref!="undefined")
  document.getElementsByTagName("head")[0].appendChild(fileref);
}


