/*  common_js.js  -  This file contains common javascript used sitewide. cleaned up on 06-24-09 by Scott Eatmon.  */

/* Toggles and show/hide for divs  */

function toggleDivOn(divid){
  if(document.getElementById(divid).style.display == 'none'){
    document.getElementById(divid).style.display = 'block';
  }
}

function toggleDivOff(divid){
  if(document.getElementById(divid).style.display == 'block'){
    document.getElementById(divid).style.display = 'none';
  }
}
function timeOut(id){
    setTimeout('hideShow("'+id+'")',5000)
}
function hideShow(id){
    var s = document.getElementById(id).style;
    s.visibility=s.visibility=='hidden'?'visible':'hidden';
}

function toggle(obj) {
    var el = document.getElementById(obj);
    if ( el.style.display != 'none' ) {
        el.style.display = 'none';
    }
    else {
        el.style.display = '';
    }
}
/* end  */
/* Clear text in search box  */
function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}
/* end  */
/* Google Translate Snippet  */
function SetLanguage() {
    if ((document.getElementById("ddllanguage").value) != "") {
        document.getElementById("hltranslate").href = "http://translate.google.com/translate?prev=hp&hl=en&js=n&u=" + location.href + "&sl=en&tl=" + document.getElementById("ddllanguage").value;
        } else {
        document.getElementById("hltranslate").href = location.href;
        }
        document.getElementById("hltranslate").target = "_blank";
    }
/* end  */
/* Hide Email Addresses Code  */
if (document.layers)
    document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT | Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.MOUSEMOVE | Event.FOCUS)        
    document.onmouseover = hidemessage
    document.onmouseout = hidemessage
    document.onclick = hidemessage
    document.onmousedown = hidemessage
    document.onmouseup = hidemessage
    document.onmousemove = hidemessage
    document.onfocus = hidemessage
    
    var strempty = ""
    function hidemessage()
    {
        window.status = strempty
        return true 
    }     
    
    function  email(name,domain,suffix,text)
    {
        var address=name + "\u0040" + domain + "." + suffix;
        var url="mailto:" + address;
        if (!text)
        {
            text=address;
        }
        document.write("<a href=" + url + ">" + text + "</a>");
    }   
/* end  */
/* IE6 .png transparency fix  */
if( $.browser.msie() && $.browser.version.string() < 7.0 ) {
$(document).ready(function(){ 
    $(document).pngFix(); 
}); 
}
/* end  */

function navFix() {
    if( $.browser.msie() && $.browser.version.string() < 8.0 ) {
        document.write('<ul style=\"list-style-type: none; margin: 0px;\">');
    }else{
        document.write('<ul style=\"list-style-type: none; margin-left: -40px; margin-top: 20px;\">');
    }

/*    if( $.browser.firefox()) {
        document.write('<ul style=\"margin-left: -40px; margin-top: 20px;\">');
    }else if( $.browser.msie() && $.browser.version.string() == 8.0 ) {
        document.write('<ul style=\"list-style-type: none; margin-left: -40px; margin-top: 20px;\">');
    }else{
        document.write('<ul style=\"margin: 0px;\">');
    }
*/
}

function thirdnavFix() {
    if( $.browser.msie() && $.browser.version.string() < 8.0 ) {
        document.write('<ul class=\"thirdNav\" style=\"z-index: 5002; list-style-type: none;\">');
    }else{
        document.write('<ul class=\"thirdNav\" style=\"z-index: 5002; margin-left: -40px;\">');
    }

}




/* Debug code...  can be added to when new variables are needed - SWE  */
function debug() {
    alert("Listed below are a set of variables from your browsing environment:" + '\n \n' 
        + "    Page:  " + jQuery.url.attr("file") + '\n' + "    Domain:  " + jQuery.url.attr("host") + '\n' 
        + "    Protocol:  " + jQuery.url.attr("protocol") + '\n' + "    Browser:  " + $.browser.browser() + '\n' 
        + "    Version:  " + $.browser.version.string() + '\n'                                                                                                                                                                                             
        + "    OS:  " + $.browser.OS() + '\n'                                                                                                                                                                                                                                                                                                                                                 
        + "    Querystring:  " + jQuery.url.attr("query")
        );
}
//debug();  //-- uncomment this line when you need to view debug information.
/* end  */



/* animated collapse JS - SWE - KEEP AT VERY BOTTOM OF THIS FILE  */
//function acLogic() {
    //if (jQuery.url.attr("file") == ("index.aspx") || jQuery.url.attr("file") != ("index.aspx")){
        
        animatedcollapse.addDiv('spotFeat', 'fade=0,speed=100,group=spotlightsections')
        animatedcollapse.addDiv('spotVids', 'fade=0,speed=100,group=spotlightsections')
        animatedcollapse.addDiv('spotNews', 'fade=0,speed=100,group=spotlightsections')
        
        animatedcollapse.addDiv('storyMain1', 'fade=0,speed=100,group=spotlights')
        animatedcollapse.addDiv('storyMain2', 'fade=0,speed=100,group=spotlights')
        animatedcollapse.addDiv('storyMain3', 'fade=0,speed=100,group=spotlights')
        animatedcollapse.addDiv('vids1', 'fade=0,speed=100,group=spotlights')
        animatedcollapse.addDiv('news1', 'fade=0,speed=100,group=spotlights')
        animatedcollapse.addDiv('news2', 'fade=0,speed=100,group=spotlights')
        animatedcollapse.addDiv('news3', 'fade=0,speed=100,group=spotlights')
        
        animatedcollapse.addDiv('getajob', 'fade=1,group=howdoi')
        animatedcollapse.addDiv('applyfor', 'fade=1,group=howdoi')
        animatedcollapse.addDiv('getdocs', 'fade=1,group=howdoi')
        animatedcollapse.addDiv('signup', 'fade=1,group=howdoi')
        animatedcollapse.addDiv('find', 'fade=1,group=howdoi')
        animatedcollapse.addDiv('report', 'fade=1,group=howdoi')
        animatedcollapse.addDiv('payfor', 'fade=1,group=howdoi')
        animatedcollapse.addDiv('expunge', 'fade=1,group=howdoi')
        animatedcollapse.addDiv('learn', 'fade=1,group=howdoi')
        animatedcollapse.addDiv('gettraining', 'fade=1,group=howdoi')
        
        animatedcollapse.addDiv('menuservices', 'fade=0,speed=200,group=dropmenu')
        animatedcollapse.addDiv('menuresidents', 'fade=0,speed=200,group=dropmenu')
        animatedcollapse.addDiv('menubusinesses', 'fade=0,speed=200,group=dropmenu')
        animatedcollapse.addDiv('menuvisitors', 'fade=0,speed=200,group=dropmenu')
        animatedcollapse.addDiv('menuelected', 'fade=0,speed=200,group=dropmenu')
        animatedcollapse.addDiv('menudepts', 'fade=0,speed=200,group=dropmenu')
        animatedcollapse.addDiv('menumedia', 'fade=0,speed=200,group=dropmenu')
        
        animatedcollapse.addDiv('menuclear', 'fade=0,speed=100')
        
        
        
        
    //} else {
    //}
    
    
    animatedcollapse.addDiv('searchTop', 'fade=0,speed=50,group=topControls')
    
    animatedcollapse.ontoggle=function($, divobj, state){}
    animatedcollapse.init()    
//}
    
//acLogic();
/* end  */