	function resizeRightDiv(autox){
		$(".rightcol").height('auto');

		var rightcolH = $(".rightcol").height();
		var leftcolH = $(".leftcol").height();
		if( leftcolH > rightcolH){
			$(".rightcol").height( leftcolH );
		} else {
			$(".leftcol").height( rightcolH );
		}
		// else {
			// $(".rightcol").height('auto');
		// }			

		// alert(leftcolH + " : " + rightcolH);
	}
	
	
	$(".mainmenudiv").hover(		
	  function () {
		$("#headerblock").css({'background-image':'url(/images/topbk.hover.jpg)'});
		$(".submenudiv").stop(true, true).hide();
		$(this).find(".submenudiv").show();
	  }, 
	  function () {
		$("#headerblock").css({'background-image':'url(/images/topbk.jpg)'});
		$(this).find(".submenudiv").delay(1000).fadeOut(3000);
	  }
	);
	
	$(".submenudiv").hover(
	  function () {
		$(this).stop(true, true).show();
	  }, 
	  function () {		
		$(this).hide();
	  }	
	);

	// $("button").hover(
	  // function () {
		// $(this).removeClass("bktrans20");
	  // }, 
	  // function () {		
		// $(this).addClass("bktrans20");
	  // }	
	// );	
	


	// $.fn.equalizeHeights = function(){
	  // return this.height( Math.max.apply(this, $(this).map(function(i,e){ return $(e).height() }).get() ) )
	// }
	function init_jqpop(){
		$('a.jqpop').unbind('click');
		$("a.jqpop").click(function(){
			var linky = $(this).attr('href');	
				// alert(linky);
			var titley = //"<img src='/images/logo.jpg' style='height:40px; background:white; padding:2px;'/>" +
							//"&nbsp; First Canvas: " +
							$(this).attr('title');
			// newWindu(linky);
			linky = "/popups/pop.index.php?f=" + linky
			var winH = (screen.availHeight * .65);
			 showHTML(linky, titley, '550', winH, 'true', 'true', 'htmlno')
			return false;
		});	
	}

	function init_jqpopinpage(){
		$('a.jqpopinpage').unbind('click');
		$("a.jqpopinpage").click(function(){
			var linky = $(this).attr('href');	
			var titley = $(this).attr('title');
			// newWindu(linky);
			linky = linky
			var winW = (screen.availWidth * .90);
			var winH = (screen.availHeight * .90);
			 showHTML(linky, titley, winW, winH, 'true', 'true', 'html')
			return false;
		});	
	}
	
	function showHTML(linky, titley, wX, hX, resz, modal_T, linkORhtml){
		if(!resz){resz=true;}
		$("#msgpop").html('');
		if(linkORhtml == "html"){
			$("#msgpop").html(linky);
		} else {
			if(linky){	$("#msgpop").load(linky); }
		}

		$("#msgpop").delay(1000).dialog({	
			autoOpen	: false,
			width		: wX,
			height		: hX,
			resizable	: resz,
			modal		: modal_T,
			position	: ['center','center'],
			title		: titley,
			show		: 'scale',
			speed		: 500,
			hide		: 'scale'	//,
			// buttons: {
						// Close: function() {
						// $( this ).dialog( "close" );
						// }
					// }			
		});	
		$("#msgpop").dialog("open"); //.parents(".ui-dialog").find(".ui-dialog-titlebar").hide();
		// $(".ui-dialog-titlebar").hide();
		return false;
	}
	
	$(document).ready(function() {
		var pathnamex = escape(window.location.pathname);
		var hrefx = ""; aThis="";
		$("a.menutop").each(function(){
			hrefx = $.trim($(this).attr("href"));
			alink = $(this).html();
			colorx = "black";
			searchx = pathnamex.search(hrefx);
			if( hrefx && searchx >= 0  ){
				colorx = "blue";
				aThis = $(this);
				// return false;  // instead of break;
			}
			// $("#msgpop").append("<br/>searchx: "+searchx+" .... <span style='color:"+ colorx +"'>menutop: " + pathnamex + " --- # href: " + alink + " > |" + hrefx + "|</span>");
		});
		if(!aThis){
			// $("#msgpop").append("<br/><hr/>");
			hrefx = ""; aThis="";
			$("a.submenu01").each(function(){
				hrefx = $.trim($(this).attr("href"));
				alink = $(this).html();
				colorx = "black";	
				searchx = pathnamex.search(hrefx);
				if( hrefx && searchx >=0 ){
					colorx = "blue";
					aThis = $(this).parent().siblings("a.menutop");
					$(this).addClass('submenu01sele');
					// return false;  // instead of break;
				}
				// $("#msgpop").append("<br/>searchx: "+searchx+" .... <span style='color:"+ colorx +"'>submenu01: " + pathnamex + " --- # href: " + alink + " > |" + hrefx + "|</span>");
			});
		}
			
		if(aThis){	$(aThis).addClass('menutopsele'); }
		
		$(".img01LB").show(1200);
	
	});	
$(window).bind("load", function() {
	resizeRightDiv();
	init_jqpop();
	init_jqpopinpage();	
});

function init_on_HiddenDivs(){
	init_jqpop();
	init_jqpopinpage();
}
