


/**************************************************/
/** Events Section *********************************/
/**************************************************/

function event_legend_boxClick(btn) {

	visStatus='none';
	if (btn.checked) visStatus='';

	var e=document.getElementsByTagName('tr');
	for(var i=0;i<e.length;i++){
	   if (e[i].getAttribute('name')==btn.name) {
	     e[i].style.display=visStatus;

	     }
	   }	   
	fjs_cookie_create(btn.name,visStatus,30);	   
	//alert('writing cookie:' + btn.name + "=" + visStatus);	   
}

function popLegend(btn) {
	e = document.getElementById('legend');
	if( e.style.display=='none') {
	   e.style.display='';
	   document.images['tree-legend'].src='/zig/include/images/bullets/tree-minus.png';
	   document.getElementById('legend-table').style.background = 'url(/zig/images/legend-bg-big.png)';
	} else {
	   e.style.display='none';
	   document.images['tree-legend'].src='/zig/include/images/bullets/tree-plus.png';
	   document.getElementById('legend-table').style.background = 'url(/zig/images/legend-bg-small.png)';
	}   
}


function hideEventsBasedOnCookies() {
	valFest = fjs_cookie_read('event1');
	valConv = fjs_cookie_read('event2');
	valFilm = fjs_cookie_read('event3');
	valHoli = fjs_cookie_read('event4');
	valRun = fjs_cookie_read('event5');
	
	//alert("read cookie2:" + valConv );
	var e=document.getElementsByTagName('tr');
	for(var i=0;i<e.length;i++){
	   hide=false;
	   if (e[i].getAttribute('name')=='event1' && valFest=='none') {
	     hide=true;
	   } else if (e[i].getAttribute('name')=='event2' && valConv=='none') {  
	     hide=true;	   
	   } else if (e[i].getAttribute('name')=='event3' && valFilm=='none') {  
	     hide=true;
	   } else if (e[i].getAttribute('name')=='event4' && valHoli=='none') {  
	     hide=true;	     
	   } else if (e[i].getAttribute('name')=='event4' && valRun=='none') {  
	     hide=true;	  	     
	   }
	   if (hide==true) {
	     e[i].style.display='none';
	   }  
	}

	if (valFest=='none') { document.getElementById('chk-event1').checked = false ;}
	if (valConv=='none') { document.getElementById('chk-event2').checked = false ;}
	if (valFilm=='none') { document.getElementById('chk-event3').checked = false ;}
	if (valHoli=='none') { document.getElementById('chk-event4').checked = false ;}
	if (valRun=='none') { document.getElementById('chk-event5').checked = false ;}
	
}



/**************************************************/
/** Links Section *********************************/
/**************************************************/

function fjs_links_onLinkCatClick(id) {
	e = document.getElementById('link-body-'+id);
	if( e.style.display=='none') {
	   document.getElementById('link-body-'+id).style.display='';
	   document.getElementById('link-head-'+id).className='sty-linkCat-on';
	   document.images['link-pic-'+id].src='/zig/images/tree-minus.png';
	   fjs_cookie_create('link-'+id,'show',30);
	} else {
	   document.getElementById('link-body-'+id).style.display='none';
	   document.getElementById('link-head-'+id).className='sty-linkCat-off';
	   document.images['link-pic-'+id].src='/zig/images/tree-plus.png';
	   fjs_cookie_create('link-'+id,'none',30);
	}   
}


function fjs_links_onLoad() {

	var e=document.getElementsByTagName('tr');
	for(var i=0;i<e.length;i++){
	   trname=e[i].getAttribute('name');
	   if (isEmpty(trname)==false) {	   
	      if (trname.substring(0,10)=='link-body-') {
	        trnamearray=trname.split("-");
	        id=trnamearray[2];
	        if (fjs_cookie_read('link-'+id)=='show') {
	          document.getElementById('link-body-'+id).style.display='';
	   	  document.getElementById('link-head-'+id).className='sty-linkCat-on';
	          document.images['link-pic-'+id].src='/zig/images/tree-minus.png';
	          }
	        }
	     }
	   }
	
}



/**************************************************/
/**************************************************/


function openHelpWindow(page,item) {
	
	OpenWin = this.open('/DM/help/info-'+page+'.asp#'+item, "HelpWindow", "toolbar=no,status=no,width=580,height=520,menubar=no,location=no,scrollbars=yes,status=no,resizable=yes");
	OpenWin.focus();
}


function openVenueWindow(venueID) {

	OpenWin = this.open('/opera/pop-venue.asp?id='+venueID, 'VenueWindow', 'toolbar=no,menubar=no,width=685,height=470,location=no,scrollbars=yes,resizable=yes,status=no');
	OpenWin.focus();
}



/***************************************************************/
/***************************************************************/
var whitespace = " \t\n\r";
function isEmpty (s) {
	var i;
	if ((s == null) || (s.length == 0)) return true;
	for (i = 0; i < s.length; i++) {
		var c = s.charAt(i);
	        if (whitespace.indexOf(c) == -1) return false;
	}
	return true;
	}
	
	
function openFormHelpWindow(content,id,title,fileid) {
	theWidth=380;
	theHeight=420;
	if (content==''){
		theWidth=620;
		theHeight=450;
	}	
	if (fileid==''){
		fileid='/DM/schools/form_help.asp';
	}
	else{
		fileid='/DM/help/'+fileid;
	}
	OpenWin = this.open(fileid+'?hid='+id+'&title='+title+'&txt=' + content, 'HelpWindow', 'location=no,directories=no,menubar=no,toolbar=no,status=no,width='+theWidth+',height='+theHeight+',scrollbars=yes,resizable=yes');
	OpenWin.focus();
}


// Hide/show div's table/rows
function funcjs_showstuff(boxid){ 
   document.getElementById(boxid).style.visibility="visible"; 
} 

function funcjs_hidestuff(boxid){ 
   document.getElementById(boxid).style.visibility="hidden"; 
}


function funcjs_removesection(boxid){ 
   document.getElementById(boxid).style.display="none";
} 

function funcjs_showsection(boxid){ 
   document.getElementById(boxid).style.display="block";
}


// Confirmation for deletion
function validateDelete(theType) { 
  var returnVal = confirm("Are you sure you want to delete this " + theType + "?");
  if (returnVal){ 
     return true;
   }
  return false;
}


	/** for bullets mouse overs, see inc_aspAppBullets.asp **/
	function showT(imgID,imgFile){ 
		document.getElementById(imgID).setAttribute('src','/opera/include/images/bullets/bullet-'+imgFile+'.gif');
	} 
	function funcjs_DealWithMousoverImageButton(imgID,imgFile){ 
		document.getElementById(imgID).setAttribute('src',imgFile);
	} 	
	

