window.onload = function () {
	createJSFCommunicatorObject(thisMovie("mymovie"));
}

//this function return to Flash ActiveX Object or Plugin depending upon browser
//it takes care for browser type and returns the proper reference.
//Accepts the id or name of <OBJECT> or <EMBED> tag respectively
//Taken from Colin Moock (http://www.moock.org) code base.
function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
 
  	if (navigator.appName.indexOf ("Microsoft") !=-1) {
   		return window[movieName]
	} else {
		return window.document[movieName]
	}
}

function createJSFCommunicatorObject(playerObj){
	//create an instance of JSFCommunicator, pass the flashMovie's reference
	//make sure flash object is loaded when you create this object with parameter otherwise
	//you can JSFCommunicator.setMovie(flashMovie) once flash object is loaded
	fc = new JSFCommunicator(playerObj);
}

var homeSubscribe = false;
function toggleSubscribe(){
	// toggle subscribe height
	
	if(homeSubscribe){
		homeSubscribe = false;
		new Fx.Style('signup','height').start(0);
	}else{
		homeSubscribe = true;
		new Fx.Style('signup','height').start(200);
	}
}

function submitSubscription(theForm){
	myConn = new XHConn();

	if(!myConn) return false;

	myConn.connect('/sendToCampaignManager.php', 'POST', 'name='+theForm.name.value+'&email='+theForm.email.value, fnWhenDone); 
}

function fnWhenDone(oXML){
	//alert(oXML.responseText);
     
    document.getElementById("subscribeThankYou").innerHTML = oXML.responseText; 
	hide("signup");
	show("subscribeThankYou");
}

function show(el){
	document.getElementById(el).className = 'visibleBlock'; 
}

function hide(el){ 
	document.getElementById(el).className = 'hiddenBlock'; 
}
