var editOpen		= false;

function latenZienFlat(id,handleDiv,show) {
   if (show==true) {
   	
      $j('#'+handleDiv).css({'opacity':'0.70'});
      $j('#'+handleDiv).css({'filter':'alpha(opacity=70)'});
      $j('#'+id).css({'display':'inline','visibility':'visible'});
   }
   else {
       $j('#'+handleDiv).css({'opacity':'1.0'});
       $j('#'+handleDiv).css({'filter':'alpha(opacity=100)'});
       $j('#'+id).css({'display':'none','visibility':'hidden'});
   }
}

function latenzien(id,handleDiv,show) {
 if (show) {
      $j('#'+handleDiv).addClass("showFilter");
      $j('#'+id).addClass("mouse");
   }
   else {
     $j('#'+handleDiv).addClass("hideFilter");
     $j('#'+id).removeClass("mouse");
   }
}


function latenzienIMG(id,handleDiv,show) {

 $j('.sectionText').removeClass("highlight");
   if (show==true) {
      $j('#'+handleDiv).addClass("showFilter");
      $j('#'+id).addClass("mouse");
   }
   else {
       $j('#'+handleDiv).addClass("hideFilter");
       $j('#'+id).removeClass("mouse");
   }
}



/**
 * Code below taken from - http://www.evolt.org/article/document_body_doctype_switching_and_more/17/30655/
 *
 * Modified 4/22/04 to work with Opera/Moz (by webmaster at subimage dot com)
 *
 * Gets the full width/height because it's different for most browsers.
 */
function getViewportHeight() {
	if (window.innerHeight!=window.undefined) return window.innerHeight;
	if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight;
	if (document.body) return document.body.clientHeight;

	return window.undefined;
}
function getViewportWidth() {
	var offset = 17;
	var width = null;
	if (window.innerWidth!=window.undefined) return window.innerWidth;
	if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth;
	if (document.body) return document.body.clientWidth;
}

/**
 * Gets the real scroll top
 */
function getScrollTop() {
	if (self.pageYOffset) // all except Explorer
	{
		return self.pageYOffset;
	}
	else if (document.documentElement && document.documentElement.scrollTop)
		// Explorer 6 Strict
	{
		return document.documentElement.scrollTop;
	}
	else if (document.body) // all other Explorers
	{
		return document.body.scrollTop;
	}
}
function getScrollLeft() {
	if (self.pageXOffset) // all except Explorer
	{
		return self.pageXOffset;
	}
	else if (document.documentElement && document.documentElement.scrollLeft)
		// Explorer 6 Strict
	{
		return document.documentElement.scrollLeft;
	}
	else if (document.body) // all other Explorers
	{
		return document.body.scrollLeft;
	}
}

function fillthescreen(){
   var theBody = document.getElementsByTagName("BODY")[0];
   //theBody.style.overflow = "hidden";
   var scTop = parseInt(getScrollTop(),10);
   var scLeft = parseInt(theBody.scrollLeft,10);
   var fullHeight = getViewportHeight();
   var fullWidth = getViewportWidth();
  /*
  if( typeof( window.innerWidth ) != 'number' ) { //Explorer doesn't recognize minHeight
    $j("#maindiv").css({'height':fullHeight+'px'});
  }
  $j("#maindiv").css({'minHeight':fullHeight+'px'});  //For every other browser, we use minHeight
  */
  if( typeof( window.innerWidth ) != 'number' ) { //Explorer doesn't recognize minHeight
    $j("#mainCenterContent").css({'height':fullHeight+'px'});
  }
  $j("#mainCenterContent").css({'minHeight':fullHeight+'px'});  //For every other browser, we use minHeight

}

function showDialog(width,height,data) {
	if(editOpen != true){
		editOpen = true;
	
		$j('input').attr("disabled", true);
		$j('a').attr("disabled", true);
		$j('select').attr("disabled", true);
		$j('button').attr("disabled", true);
		
		var  marginleft = -1*Math.round(parseInt(width)/2);
		var  margintop = -1*Math.round(parseInt(height)/2);
		$j.modal.defaults.afterClose   = function() {
		  jQuery("#modalContainer").html("");
		  $j('input').attr("disabled", false);
		  $j('a').attr("disabled", false);
		  $j('select').attr("disabled", false);
		  $j('button').attr("disabled", false);
		};
		newContent = "<div id='topframe' style='background-color:transparent;'> "+ data +" </div>";
		$j.modal(newContent);
		$j('#modalContainer').css({'height':height,
		                         'width':width,
		                         'top':'50%',
		                         'background-color': '#EEF2EA',
		                         'left':'50%',
		                         'margin-left':marginleft+'px',
		                         'margin-top':margintop+'px','display':'none'});
		$j('#topframe').attr("disabled", false);
		$j('#modalContainer').show("slow");
	

	} 
}

function resetEditorBg(msg) {
  $j.modal.close();
  location.reload(true);

}
       


//window.onresize = fillthescreen;
