function createAutoIframe(Turl,frame_name,frame_width,frame_hight,frame_object)
{
    if (frame_object.name)
	{
		destroyIFrameObj = document.body.removeChild(frame_object);
		eval(frame_name+'frm=document.createElement(\'iframe\')');
	    tempIFrame = eval(frame_name+'frm');
	    tempIFrame.setAttribute('name',frame_name);
	    tempIFrame.style.border='0px';
	    tempIFrame.style.width=frame_width;
	    tempIFrame.style.height=frame_hight;
	    tempIFrame.src=Turl;
	    IFrameObj = document.body.appendChild(tempIFrame);
	}
	else
	{
		eval(frame_name+'frm=document.createElement(\'iframe\')');
	    tempIFrame = eval(frame_name+'frm');
	    tempIFrame.setAttribute('name',frame_name);
	    tempIFrame.style.border='0px';
	    tempIFrame.style.width=frame_width;
	    tempIFrame.style.height=frame_hight;
	    tempIFrame.src=Turl;
	    IFrameObj = document.body.appendChild(tempIFrame);
	}
	return IFrameObj;
}
function removeAutoIFrame(frame_object)
{
	document.body.removeChild(frame_object);
	iframe = 0;
}			
 
var iframe = '';			
function subscribe()
{
	if (document.forms[0].email.value == '')
	{
		alert('You must fill in your Email');
		return false;
	}
	if (document.forms[0].first_name.value == '')
	{
		alert('You must fill in your first name');
		return false;
	}
	iframe = createAutoIframe('/includes/add_subscribe.php?email='+document.forms[0].email.value+'&first_name='+document.forms[0].first_name.value,'subscribe',0,0,iframe);
}
