// JavaScript Document
function toggleField(field,$button,title){
var button = $button
	if($(field).visible()){
		Effect.BlindUp(field);
		new Effect.Morph(title,{style:"color:#ffffff",duration:.5});
		Effect.BlindLeft(button+"B",{duration:.05});
		setTimeout("Effect.BlindRight('"+button+"A')",51)
	}else {
		Effect.BlindDown(field);
		Effect.BlindLeft(button+"A",{duration:.05});
		new Effect.Morph(title,{style:"color:#81AB12",duration:.5});
		setTimeout("Effect.BlindRight('"+button+"B')",51)
	}
	resize();
}
function calcHeight()
{
//find the height of the internal page
var the_height=document.getElementById('content').contentWindow.document.body.scrollHeight;

//change the height of the iframe
document.getElementById('content').height=the_height;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

Effect.BlindLeft = function(element) {
  element = $(element);
  element.makeClipping();
  return new Effect.Scale(element, 0,
    Object.extend({ scaleContent: false,
      scaleY: false,
      scaleMode: 'box',
      scaleContent: false,
      restoreAfterFinish: true,
      afterSetup: function(effect) {
        effect.element.makeClipping().setStyle({
          height: effect.dims[0] + 'px'
        }).show();
      },
      afterFinishInternal: function(effect) {
        effect.element.hide().undoClipping();
      }
    }, arguments[1] || { })
  );
};

Effect.BlindRight = function(element) {
  element = $(element);
  var elementDimensions = element.getDimensions();
  return new Effect.Scale(element, 100, Object.extend({
    scaleContent: false,
    scaleY: false,
    scaleFrom: 0,
    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
    restoreAfterFinish: true,
    afterSetup: function(effect) {
      effect.element.makeClipping().setStyle({
        width: '0px',
        height: effect.dims[0] + 'px'
      }).show();
    },
    afterFinishInternal: function(effect) {
      effect.element.undoClipping();
    }
  }, arguments[1] || { }));
};

function switchTo($menu,$arr,$cont){
//*
//new Effect.Morph('error_message', {style: 'background:#f00; color: #fff;',duration: 0.8});
if($menu != "menuA"){
new Effect.Morph('menuA',{style: {color:'#ffffff'},duration: 0.6});
$("menuA").setStyle({fontWeight:"normal"})
//$temp = document.getElementById("menuA");
//$temp.className = "menu"
				 }
if($menu != "menuB"){
new Effect.Morph('menuB',{style: {color:'#ffffff'},duration: 0.6});
$("menuB").setStyle({fontWeight:"normal"})
//$temp = document.getElementById("menuB");
//$temp.className = "menu";
				 }
if($menu != "menuC"){
new Effect.Morph('menuC',{style: {color:'#ffffff'},duration: 0.6});
$("menuC").setStyle({fontWeight:"normal"})
//$temp = document.getElementById("menuC");
//$temp.className = "menu";
				 }
new Effect.Morph($menu,{style: {color:'#81AB12'},duration: 0.6});
$($menu).setStyle({fontWeight:"bold"})
//$temp = document.getElementById($menu);
//$temp.className = "menu_select";
//*/
if($("arrA").visible()&&"arrA"!=$arr) Effect.BlindLeft("arrA",{duration:0.6});
//$temp = document.getElementById("arrA");
//if($temp.style.display != "none") $temp.style.display = "none";
if($("arrB").visible()&&"arrB"!=$arr) Effect.BlindLeft("arrB",{duration:0.6});
//$temp = document.getElementById("arrB");
//if($temp.style.display != "none") $temp.style.display = "none";
if($("arrC").visible()&&"arrC"!=$arr) Effect.BlindLeft("arrC",{duration:0.6});
//$temp = document.getElementById("arrC");
//if($temp.style.display != "none") $temp.style.display = "none";
Effect.BlindRight($arr,{duration:0.6});
//$temp = document.getElementById($arr);
//$temp.style.display = "block";


if($("contA").visible()&&"contA"!=$cont) Effect.Fade("contA",{duration:0.3});
//$temp = document.getElementById("contA");
//if($temp.style.display != "none") $temp.style.display = "none";
if($("contB").visible()&&"contB"!=$cont) Effect.Fade("contB",{duration:0.3});
//$temp = document.getElementById("contB");
//if($temp.style.display != "none") $temp.style.display = "none";
if($("contC").visible()&&"contC"!=$cont) Effect.Fade("contC",{duration:0.3});
//$temp = document.getElementById("contC");
//if($temp.style.display != "none") $temp.style.display = "none";
Effect.Appear($cont,{duration:0.3,delay:0.31});
//$temp = document.getElementById($cont);
//$temp.style.display = "block";
//find the height of the internal page;
resize();
//change the height of the iframe
}
function switchToLaw($menu,$arr,$cont){
	

if($menu != "menuA"){
	new Effect.Morph('menuA',{style: {color:'#ffffff'},duration: 0.6});
	$("menuA").setStyle({fontWeight:"normal"})
}
if($menu != "menuB"){
	new Effect.Morph('menuB',{style: {color:'#ffffff'},duration: 0.6});
	$("menuB").setStyle({fontWeight:"normal"})
}
if($menu != "menuC"){
	new Effect.Morph('menuC',{style: {color:'#ffffff'},duration: 0.6});
	$("menuC").setStyle({fontWeight:"normal"})
}
if($menu!= "menuD"){
	new Effect.Morph('menuD',{style: {color:'#ffffff'},duration: 0.6});
	$("menuD").setStyle({fontWeight:"normal"})
}
new Effect.Morph($menu,{style: {color:'#81AB12'},duration: 0.6});
$($menu).setStyle({fontWeight:"bold"})

if($("arrA").visible()&&"arrA"!=$arr) Effect.BlindLeft("arrA",{duration:0.6});
if($("arrB").visible()&&"arrB"!=$arr) Effect.BlindLeft("arrB",{duration:0.6});
if($("arrC").visible()&&"arrC"!=$arr) Effect.BlindLeft("arrC",{duration:0.6});
if($("arrD").visible()&&"arrC"!=$arr) Effect.BlindLeft("arrD",{duration:0.6});
Effect.BlindRight($arr,{duration:0.6});

if($("contA").visible()&&"contA"!=$cont) Effect.Fade("contA",{duration:0.3});
if($("contB").visible()&&"contB"!=$cont) Effect.Fade("contB",{duration:0.3});
if($("contC").visible()&&"contC"!=$cont) Effect.Fade("contC",{duration:0.3});
if($("contD").visible()&&"contC"!=$cont) Effect.Fade("contD",{duration:0.3});
Effect.Appear($cont,{duration:0.3,delay:0.31});
resize();
//change the height of the iframe
}

function resize(){
var the_height = 0;
if (navigator.userAgent.toLowerCase().indexOf('safari')!=-1){
setTimeout("the_height=(document.documentElement.scrollHeight ? document.documentElement.scrollHeight : document.body.scrollHeight ? document.body.scrollHeight : document.body.offsetHeight);window.parent.document.getElementById('content').height=the_height;",1000);
}else{
setTimeout("the_height=document.body.scrollHeight;window.parent.document.getElementById('content').height=the_height;",1000);

}	
}