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 get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

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('survey') == null) {
	if (get_cookie("survey1")!=""){
		//nothing
	}
	else{

	  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()+(100000*24*60*60));
			var expires = "; expires="+date.toGMTString();
			document.cookie = "survey1=true"+expires+"; path=/";
		}

	  document.catfish_session = function(){
			document.cookie = "survey1=true; 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 x,y;
	if (self.innerHeight) // all except Explorer
	{
		topX = self.innerWidth;
		topY = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) // Explorer 6 Strict Mode
	{
		topX = document.documentElement.clientWidth;
		topY = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		topX = document.body.clientWidth;
		topY = document.body.clientHeight;
	}

	topX = topX/2 - 300;

	var iframe = '<p align="center"><IFRAME align="center" ID="catfish" NAME="catfish" scrolling="no" frameborder="0" SRC="'
	  + url + '" ALLOWTRANSPARENCY="true" width="600" height="' + height + 'px" STYLE="bottom: -'
	  + height + 'px;left:'+ topX  +'px;display:none;width:600;position:' + pos + '"></IFRAME></p>';
	  
	body[0].innerHTML = body[0].innerHTML + iframe;
		
	setTimeout("slide_open('" + url + "', " + height + ", " 
		+ speed + ", " + increment + ")", start_delay);
}

function changeCheck() {
// alert("beep");
// alert(document.survey.business_change[0].checked);
/*
 if (document.business_change[0].checked) {
  alert("beep");
 }
*/
/*
 if (document.getElementById("changeNo").style.display == "block") {
  document.getElementById("changeNo").style.display = "none";
 } 
 else { 
  document.getElementById("changeNo").style.display = "block";
 } 
*/
}
