function initLayout(){
	var el = document.getElementsByTagName('a');
	if(el.length){
		for(var i=0; i<el.length; i++){
			if (!document.addEventListener && document.attachEvent){
				el[i].attachEvent("focus", function(){ blur(); }, false)
			}else{
				el[i].addEventListener("focus", function(){ blur(); }, false)
			}
		}
	}
}

function MenuShowEl(id){
	var el = document.getElementById(id);
	if(!el) return;
	if(el.style.display=='none'){
		new Effect.BlindDown(id, {duration:0.5});
	}
}


function MenuAjaxLoad(posturl){
	var destid = 'body_main_content';
	jQuery('#'+destid).html('<div style="text-align:center;"><img src="/images/loading.gif" alt="" /></div>');
	jQuery.ajax({
		type: 'POST',
	   	url: posturl,
	   	data: '',
	   	success: function(data){
			jQuery('#'+destid).html(data);
		}
	});
	return false;
}



	var prev_id=false;
	function mop(id, pref_id){
	    if(prev_id&&prev_id!=id){
            setTimeout("mcl("+prev_id+", '"+pref_id+"')", 1000);
            prev_id=false;
		}
		if($(pref_id+id) && $(pref_id+id).style.display=='none'){
			new Effect.BlindDown(pref_id+id, {duration:0.3});
			$(pref_id+id+'_link').src='/images/layout/menuminus.jpg';
			prev_id = id;
		}else{
			new Effect.BlindUp(pref_id+id, {duration:0.3});
			$(pref_id+id+'_link').src='/images/layout/menuplus.jpg';
			prev_id = id;
		}
		return false;
	}
	
	function mop2(id, pref_id){
		if($(pref_id+id) && $(pref_id+id).style.display=='none'){
			new Effect.BlindDown(pref_id+id, {duration:0.3});
			$(pref_id+id+'_link').src='/images/layout/menuminus.jpg';
		}else{
			new Effect.BlindUp(pref_id+id, {duration:0.3});
			$(pref_id+id+'_link').src='/images/layout/menuplus.jpg';
		}
		return false;
	}
	
	function mcl(id, pref_id){
     	if(id!=prev_id){
			new Effect.BlindUp(pref_id+id, {duration:0.3});
			$(pref_id+id+'_link').src='/images/layout/menuplus.jpg';
  		}
	}



function MinimizeFrameHeight(){
	var i = 0; var j = 0; var founded = new Array();
	var elements = document.getElementsByTagName('iframe');
	if(elements.length){
	    for(i=0; i<elements.length; i++){
			founded[founded.length] = elements[i];
			var newElements = elements[i].contentWindow.document.getElementsByTagName('iframe');
			if(newElements.length){
            	for(j=0; j<newElements.length; j++){
	            	founded[founded.length] = newElements[j];
	            }
			}
		}
	}
	if(founded.length){
	    for(i=0; i<founded.length; i++){
			founded[i].height='1';
			founded[i].style.height='1px';
		}
	}
}
if(window.addEventListener) window.addEventListener('load', function() { MinimizeFrameHeight(); }, false);
else if(window.attachEvent) window.attachEvent('onload', function() { MinimizeFrameHeight(); });



