/*  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  */
/* 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  */

        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')
        
        animatedcollapse.addDiv('toolbox', 'fade=1')
        animatedcollapse.addDiv('pagename', 'fade=1')

    
        animatedcollapse.addDiv('searchTop', 'fade=0,speed=50,group=topControls')
    
        animatedcollapse.addDiv('autismMap', 'fade=0,speed=50')

    
    animatedcollapse.ontoggle=function($, divobj, state){}
    animatedcollapse.init()    
/* end  */
