/*===========================================================================*
	written by visuallizard.com
	
	insert and comment JS functions here 
*===========================================================================*/
	
	function checkRadio(){
		for (i=0, n=document.poll.answer.length; i<n; i++) {
			if (document.poll.answer[i].checked) {
				return true;
			}
		}
		alert("Please select an answer before submitting poll.");
		return false;
	}

/*============== set left column ====================*/
   function set_jump_display() {
       
		cookie_string = ''+getCookie('jumpcookie');
		cookie_array = new Array();
		
		if ( cookie_string.indexOf('|')!=-1 ) {
			cookie_array = cookie_string.split('|');
		}
		
		
		for ( var array_count=0; array_count<cookie_array.length; array_count++ ) {
			if ( cookie_array[array_count] != '' ) {
				document.getElementById(cookie_array[array_count]).className = "closed";
           		document.getElementById(cookie_array[array_count]+'detail').className = "closed";
			}
        }
		
		
    }

/*============== show hide function for the left column ====================*/
    function toggledisplay(divid) {
        var dividetail = divid+'detail';
        
		
		cookie_string = ''+getCookie('jumpcookie');
		cookie_array = new Array();
		
		if ( cookie_string.indexOf('|')!=-1 ) {
			cookie_array = cookie_string.split('|');
			
			//cookie_split_string = cookie_string.split('|');
			
			//for ( var array_count=0; array_count<cookie_split_string.length; array_count++ ) {
	    	//	var temp_cookie_array = cookie_split_string[array_count].split('!');
			//	cookie_array[temp_cookie_array[0]] = temp_cookie_array[0]+'!'+temp_cookie_array[1];
	        //}
			
		
		}
		
		
		if (document.getElementById(divid).className == "closed") {
            document.getElementById(divid).className = "open";
            document.getElementById(dividetail).className = "open";
		} else {
            document.getElementById(divid).className = "closed";
            document.getElementById(dividetail).className = "closed";
		}
    	
		cookie_string = '';
		
		//for ( var array_count=0; array_count<cookie_array.length; array_count++ ) {
		//	cookie_string = cookie_string+'|'+cookie_array[array_count];
        //}
    	
		found_in_cookie_array = '0';
		
		for ( var array_count=0; array_count<cookie_array.length; array_count++ ) {
			if ( cookie_array[array_count] != divid && cookie_array[array_count] != '' ) {
				cookie_string = cookie_string+'|'+cookie_array[array_count];
			} else if ( cookie_array[array_count] == divid ) {
				found_in_cookie_array = '1';
			}
        }
		
		if ( found_in_cookie_array == '0' ) {
			cookie_string = cookie_string+'|'+divid;
		}
		
		setCookie('jumpcookie',cookie_string);
		
		
    }

/*============== cookie functions to save sidebar settings =================*/	
function setCookie(name, value) {
	var curCookie = name + "=" + escape(value);
	document.cookie = curCookie;
}


/*
  name - name of the desired cookie
  return string containing value of specified cookie or null
  if cookie does not exist
*/

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}








/*============ hold open main nav link when in related sub-menu ===========*/
    function holdnavon(ulid) {
        var navdetail = 'nav_li_'+ulid;
         
            document.getElementById(navdetail).className = "on"
        
    }

/*============ close main nav link when leaving related sub-menu ==========*/
    function holdnavoff(ulid) {
        var navdetail = 'nav_li_'+ulid;
        
            document.getElementById(navdetail).className = "off"
    
    }
	
	
/*======================== open directory list ============================*/
    function diropen(divid) {
         
            if (document.getElementById(divid).className == "open") {
				document.getElementById(divid).className = "closed";
			} else {
				document.getElementById(divid).className = "open";
			}
        
    }


/* pop open a window of specified size */
	function openwindow(theURL,winName,features) { //v2.0
		
			window.open(theURL,winName,features);
	
	}


/*===========================================================================*
    &copy;2005 - visuallizard.com
*===========================================================================*/



