
 function initMenus(){

        $( 'a[name^=mnu_]' ).each(function(){
                var str=$.attr(this, 'name').substring( 4 ) ;
                this.onclick = function(event){
                        $('#Home').load( str + '.html' ) ; 
			$('#xMenu').load( 'Home.menu', '', initxMenus ) ; 
                };
        });
	initxMenus() ;
	initphpMenus() ;
 }

 function initxMenus(){

	$( 'a[name^=mnx_]' ).each(function(){
		var str=$.attr(this, 'name').substring( 4 ) ;
		this.onclick = function(event){
                        $('#Home').load( str + '.html' ) ; 
			$('#xMenu').load( str + '.menu', '', initxMenus ) ;
		};
	});
 }

 function initphpMenus(){
	$( 'a[name^=php_]' ).each(function(){
		var str=$.attr(this, 'name').substring( 4 ) ;
		this.onclick = function(event){
			$('#Home').load( str + '.php' ) ;  
			$('#xMenu').load( str + '.menu', '', initphpMenus ) ; 
/*                        $('#Home').load( 'pfix_Commercial.html' ) ; */
		};
	});
 }

 function q_loadMenu( str ){
	$('#xMenu').load( str ) ;
 }

 function q_liveImages(){
        $('#thumbNails img').photomatic(
		{ photoElement: '#photo',
		  previousControl: '#previousButton',
		  nextControl: '#nextButton',
		  firstControl: '#firstButton',
		  lastControl: '#lastButton'
		}
        );
 }

 function q_loadBody( str ){
	$('#Home').load( str,'',q_liveImages ) ;
 }

 function q_defaultPortfolio( str ){
        $('#Home').load( str ) ;
 }

 $(document).ready(function(){
	initMenus() ;
});
