function slide_open(url, height, speed, increment) {
	
  var ifr =
    document.all ? document.all['catfish'] :
      document.getElementById('catfish');
      
  ifr.style.bottom = (parseInt(ifr.style.bottom) + increment) + 'px';
  ifr.style.display = 'block';

  if(parseInt(ifr.style.bottom) < 0)
		setTimeout("slide_open('" + url + "', " + height + ", " 
	  	+ speed + ", " + increment + ")", speed);
	else
		ifr.style.bottom = "0px";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function isIE6()
{
	var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);
	if(browser=="Microsoft Internet Explorer" && version==4)
		return true;
	return false;
}

function catfish(url, height, start_delay, speed, increment)
{
	if(! start_delay)
		start_delay = 2000;
	if(! speed)
		speed = 25;
	if(! increment)
		increment = 5;
	
	if(readCookie('subscribed') == null) {

	  document.catfish_close = function() {
	  	var ifr =
	  		document.all ? document.all['catfish'] :
	  		document.getElementById('catfish');
	  		ifr.style.bottom = (parseInt(ifr.style.bottom) - increment) + 'px';
  
	  	if(parseInt(ifr.style.bottom) > (0 - height))
	  		setTimeout("document.catfish_close()", speed);
	  	else
	  	{
	  		ifr.parentNode.removeChild(ifr);
	  	}
	  }
	  
	  document.catfish_lock = function(){
	  	var date = new Date();
			date.setTime(date.getTime()+(60*24*60*60*1000));
			var expires = "; expires="+date.toGMTString();
			document.cookie = "subscribed=true"+expires+"; path=/";
		}
		
		attachFrame(url, height, speed, increment, start_delay);
	}
}

function attachFrame(url, height, speed, increment, start_delay)
{
	var body = document.getElementsByTagName('body');
	if(body.length == 0)
	{
		// Wait until the dom is formed
	  setTimeout("attachFrame('" + url + "', " + height + ", " 
	  	+ speed + ", " + increment + ", " + start_delay + ")", 100);
	  return;
	}
	
	var pos = 'fixed';
	if(isIE6())
		pos = 'absolute';
		
	var iframe = '<IFRAME ID="catfish" NAME="catfish" scrolling="no" frameborder="0" SRC="'
	  + url + '" ALLOWTRANSPARENCY="true" width="100%" height="' + height + 'px" STYLE="bottom: -'
	  + height + 'px; left: 0px;display:none;width:100%;position:' + pos + '"></IFRAME>';
	  
	body[0].innerHTML = body[0].innerHTML + iframe;
		
	setTimeout("slide_open('" + url + "', " + height + ", " 
		+ speed + ", " + increment + ")", start_delay);
}
	
