

var sent = false;
var popped = false;

var spamRegisterIframe = document.createElement('iframe'); // where we will submit the spam form... 

		

function getTheEmail() {
    //alert('se4tting popped');
    theEmail = $F('email-address');
    return theEmail;
}

function setPopped(status) {
//alert('se4tting popped');
    popped = status;
    return true;
}

function popitup(url) {
	// If the iframe isn't attached yet attache it.
	if(!spamRegisterIframe.parentNode){
		var body = document.getElementsByTagName('body');
		body[0].appendChild(spamRegisterIframe);	
	}
	spamRegisterIframe.style.display='none'; //hide it 
	spamRegisterIframe.src=url;
	return false;
}

function joinPopUp(){
//alert('inside submitEmail');
    if(popped == false){
	popitup('intellicontact/index.php');
	popped = true;
    }

}





function submitEmail(){
    //alert('inside submitEmail');
    
new Ajax.Request('http://app.intellicontact.com/icp/signup.php'


, {

method:'post',
parameters:'&fields_email=' + $F('email-address') 
+ "&listid=21873" 
+ "&specialid:21873=7MGL" 
+ "&clientid=37171"
+ "&reallistid=1"
+ "&doubleopt=0"
,

 onSuccess: function(transport){
  var response = transport.responseText || "no response text";
          alert("Success! [submitEmail]\n\n" + response);
},
 onFailure: function(){ alert('submitEmail failed') }

 });


}






