function expandSearch()
{
	var advdiv = document.getElementById("advSearch")
	var advdivbut = document.getElementById("advSearchBut")
	advdiv.style.display = ( advdiv.style.display == "block" ) ? "none" : "block";
	//advdiv.style.display = "block";
	advdivbut.innerHTML = ( advdivbut.innerHTML == "+ close options" ) ? "+ expand your search" : "+ close options";
}

function UnsubscribeRecipe(action)
{
	var email = document.getElementById("em").value
	checkAJAX();
	var url = "/Scripts/Ajax/unsubscribe.ajax.asp";
	url += "?email="+email;
	url += "&action="+action;
	xmlHttp.onreadystatechange = Update;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function SubscribeWH()
{
	var email = document.getElementById("em").value
	checkAJAX();
	var url = "/Scripts/Ajax/subscribe_worldharbors.ajax.asp";
	url += "?email="+email;
	xmlHttp.onreadystatechange = Update;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function TransferWH(bool,id)
{
	if(bool == 1){
		checkAJAX();
		var url = "/Scripts/Ajax/transferWH.ajax.asp";
		url += "?bool="+bool;
		url += "&id="+id;
		xmlHttp.onreadystatechange = Update;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		
	}else{
		alert("You are being directed to our Splash Recipe Club sign up page. The information that we have for you is only partially complete. We would appreciate it if you would fill out the additional fields in the Splash Recipe Sign-Up.")
	}
}

//Send the new updated version of list to the page
function Update()
{
	newdisplay = xmlHttp.responseText
	display = document.getElementById('displayInfo')
	display.innerHTML = newdisplay
}

function movenextOver()
{
	corner = document.getElementById("mnCorner");
	tab = document.getElementById("movenext");
	corner.src = "/images/comparisonchart/movenextCornerOver.jpg";
	tab.style.backgroundColor = "#00ac4e";
}
function movenextOut()
{
	corner = document.getElementById("mnCorner");
	tab = document.getElementById("movenext");
	corner.src = "/images/comparisonchart/movenextCorner.jpg";
	tab.style.backgroundColor = "#f5821f";
}
function movepreviousOver()
{
	corner = document.getElementById("mpCorner")
	tab = document.getElementById("moveprevious");
	corner.src = "/images/comparisonchart/movepreviousCornerOver.jpg"
	tab.style.backgroundColor = "#00ac4e";
}
function movepreviousOut()
{
	corner = document.getElementById("mpCorner")
	tab = document.getElementById("moveprevious");
	corner.src = "/images/comparisonchart/movepreviousCorner.jpg"
	tab.style.backgroundColor = "#f5821f";
}

function movenext()
{
	var total = parseInt(document.getElementById("totalnum").value)
	var last = document.getElementById("lastnum")
	//alert("***"+last.value +" \ " + total)
	var newlast = parseInt(last.value) + 1
	first = parseInt(last.value)-4 
	if(last.value >= total)
	{
		return false;
	}
	else
	{
		var firstcol = document.getElementById("col"+first)
		firstcol.style.display = "none";
		
		var lastcol = document.getElementById("col"+newlast)
		lastcol.style.display = "block";
		
		last.value = newlast;
	}
	
}

function moveprevious()
{
	var total = parseInt(document.getElementById("totalnum").value)
	var last = document.getElementById("lastnum")
	var newlast = parseInt(last.value) - 1
	first = parseInt(last.value)-5 
	if(last.value <= 1)
	{
		return false;
	}
	else
	{
		var firstcol = document.getElementById("col"+first)
		firstcol.style.display = "block";
		
		var lastcol = document.getElementById("col"+last.value)
		lastcol.style.display = "none";
		
		last.value = newlast;
	}
	
}

