/* WINDOW FADE IN AND OUT FUNCTIONS */
/* The actual fade functions are commented out to create just a popup.  Uncomment them to add the fade effect. */

var browser=document.all?'Ie':'notIe'; 
var opac = 1;
var opacSpeed = 11;

function popup(id, width, height, bg, color) {
	var top = -(height/2);
	var left = -(width/2);
	opac = 1;
	var obj = document.getElementById(id);
	obj.style.visibility = 'visible';
	obj.style.width = width+'px';
	obj.style.height = height+'px';
	obj.style.marginLeft = left+'px';
	obj.style.marginTop = top+'px';
	obj.style.background = bg;
	obj.style.color = color;
	var objclosetop = document.getElementById(id+'closetop');
	objclosetop.innerHTML = '<a href="javascript:void(0)" onClick="hide(\''+id+'\')" style="color:#FFFF99 ">click here to close this box </a>';
	// objclosetop.width = (width-10)+'px';
	var objclosebottom = document.getElementById(id+'closebottom');
	objclosebottom.innerHTML = '<a href="javascript:void(0)" onClick="hide(\''+id+'\')" style="color:#FFFF99 ">click here to close this box </a>';
	// objclosebottom.width = (width-10)+'px';

	var obj2 = document.getElementById('screen');
	obj2.style.display = 'block';
	// fadeIn(id);
}
function hide(id) {
	fadeOut(id);
}
function fadeIn(id)
{ 
  opac += opacSpeed;

  if( opac <= 100 )
   { 
    opac2=opac*.8
	
	switch(browser){
	case 'Ie':
		document.getElementById(id).style.filter = 'alpha(opacity = ' + opac + ')';
		document.getElementById('screen').style.filter = 'alpha(opacity = ' + opac2 + ')';
	break;
	case 'notIe':
        document.getElementById(id).style.opacity = opac/100;
		document.getElementById('screen').style.opacity = opac2/100;
	break;
	} 
    //setTimeout("fadeIn("+id+")", 100);
	setTimeout(function(){ fadeIn(id) }, 100);
  }
}

function fadeOut(id)
{ 
  /*opac -= opacSpeed;
  if( opac >= 0 )
  {
    opac2=opac*.8
	switch(browser){
	case 'Ie':
		document.getElementById(id).style.filter = 'alpha(opacity = ' + opac + ')';
		document.getElementById('screen').style.filter = 'alpha(opacity = ' + opac2 + ')';
	break;
	case 'notIe':
        document.getElementById(id).style.opacity = opac/100;
		document.getElementById('screen').style.opacity = opac2/100;
	break;
	} 
   	setTimeout(function(){ fadeOut(id) }, 100);

	
  } else { */
 	var obj = document.getElementById(id);
	obj.style.visibility = 'hidden';
	var obj2 = document.getElementById('screen');
	obj2.style.display = 'none';
 /* } */
}