curDisplay = null ; 

 function initMenus(){

        $( 'a[name^=mnu_]' ).each(function(){
                var str=$.attr(this, 'name').substring( 4 ) ;
                this.onclick = function(event){
			return( poptart( str ) ) ; 
                };
        });
	winFixMenu( 'qmenu' ) ;
	winFixFlashy( 'flashy0' ) ;
	winFixFlashy( 'flashy1' ) ;
	winFixFlashy( 'flashy2' ) ;
	winFixFlashy( 'flashy3' ) ;
 }

 function q_loadAnimation( str ){
	$(str).cycle() ;
 }

 function q_loadPage( str ){
	$('#content').load( str ) ;
 }
 
 function onBefore() { 
    $('#caption') 
        .html(this.title); 
 }; 

function poptart ( id ) {

  if( !document.getElementById ){
        alert( "Your browser is a little dated.\nPlease upgrade for best results." ) ;
        return false ;
  }

  var x = document.getElementById( id ) ;

  if( !x ){
        return true ;
  }

  if( !curDisplay ){
        curDisplay = document.getElementById( 'slideShow' ) ;
  }

  if( curDisplay != x ) {
        curDisplay.style.zIndex = 10 ;
        curDisplay.style.display = 'none' ;
	curDisplay.visibility = 0 ;
  }

  curDisplay = x ;
  x.style.display = 'block' ;
  x.visibility = 1 ;
  x.style.zIndex = 1000 ;

  return true ;
}

function slave( addr ) {
	var W = window.open( addr, 
		"_xyzzy", "width=640,height=480,status=no,resizable=yes,menubar=no,toolbar=no,scrollbars=yes", 
		true ) ;
        W.left = 300 ;
        W.top = 400 ;
        W.screenX = 300 ;
        W.screenY = 400 ;
        return true ;
}

function winFixMenu( nav ) {

	// only MSIE supports document.all
	if(document.all && document.getElementById(nav).currentStyle){
		var navroot = document.getElementById(nav);
		var lis=navroot.getElementsByTagName("LI") ; 
		for(i=0;i<lis.length;i++){
			/* If the LI has another menu level */
			if(lis[i].lastChild.tagName=="UL"){
				/* assign the function to the LI */
				lis[i].onmouseover=function(){
					/* display the inner menu */
					this.lastChild.style.display="block";
				}
				lis[i].onmouseout=function(){
					this.lastChild.style.display="none";
				}
			}
            	}
        }
}

function winFixFlashy( nav ) {
	
	// this supports 'flashy' style menus, and does not require sublists
	if(document.all && document.getElementById(nav).currentStyle){
		var navroot = document.getElementById(nav);
		var lis=navroot.getElementsByTagName("LI") ; 

		for(i=0;i<lis.length;i++){
			lis[i].onmouseover=function(){
				this.lastChild.style.display="block";
				saveClass= this.className ;
				this.className += " flHover" ;
			}
			lis[i].onmouseout=function(){
				this.lastChild.style.display="none";
				this.className = saveClass ;
			}
		}
	}
}

 $(document).ready(function(){
	$('#pix').cycle({
		before: onBefore
	}) ;
	initMenus() ;
	poptart( 'slideShow' ) ; 
});
