function checkemail(str)
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)){return (true);}
	else {return (false);}
}

function formaction()
{
	var name = document.getElementById("swanotify_name").value;
	var email = document.getElementById("swanotify_email").value;
	var sms = document.getElementById("swanotify_sms").value;
	var accept = document.getElementById("swanotify_accept");
	//var btn = document.getElementById("swanotify_submit");
	
	//btn.disabled = true;
	var regImg = '<input name="swanotify_submit" type="image" id="swanotify_submit" src="i/rc/sign-up.gif" title="Fill in form and click here to sign up" />';
	var btnImg = '<img name="swanotify_submit" id="swanotify_submit" src="i/rc/sign-up-disabled.gif" width="148" height="26" title="Fill in the form to enable this button." />';
	
	if((name.length)>0 && (checkemail(email) || (sms.length)>0) && accept.checked)
	{
		document.getElementById("btnTD").innerHTML = regImg;
	}
	else {document.getElementById("btnTD").innerHTML = btnImg;}
}

function check()
{
	var accept = document.getElementById("swanotify_accept");
	if(accept.checked)alert("BOX IS CHECKED");
	else alert("BOX IS UNCHECKED");
}

function swanotify_terms()
{
	var width = 400;
	var height = 300;
	if(window.innerWidth)
	{
		LeftPosition =(window.innerWidth-width)/2;
		TopPosition =((window.innerHeight-height)/4)-50;
	}
	else
	{
		LeftPosition =(parseInt(window.screen.width)-	width)/2;
		TopPosition=((parseInt(window.screen.height)-height)/2)-50;
	}
	attr = 'resizable=no,scrollbars=yes,width=' + width + ',height=' +
	height + ',screenX=300,screenY=200,left=' + LeftPosition + ',top=' +
	TopPosition + '';
	popWin=open('https://www.eeminder.com/marketing/swanotify_agreement.php', 'new_window', attr);
}
