// JavaScript Document
function getscript(version) {
var now = new Date();
var AttenoIndex = now.getTime();
var mytablestr = '' +
					'<table id=\"signuptable\" cellpadding=\"0\" cellspacing=\"5\" border=\"0\">'+
						'<tr>'+
							'<td colspan=\"2\">'+
								'<input style=\"width:220px\" type=\"text\" id=\"txtemail\" class=\"TextBoxSingle\" value=\"Indtast email\" onFocus=\"this.value=\'\';\" onBlur=\"if(this.value==\'\')this.value=\'Indtast email\';\" name=\"txtemail\" /><br />'+
								'</td></tr><tr><td>'+
								'<input type=\"button\" onclick=\'popup(\"http://acceptcard.w11.dk/subscribe.aspx\",\"mitvindue\",\"675\",\"780\");\' value=\"Tilmeld\" id=\"btnTilmeld\" class=\"Button Green\" name=\"Tilmeld\" />'+
								'</td><td>'+
								'<input type=\"button\" onclick=\'popup(\"http://acceptcard.w11.dk/SendEditDelete.aspx\",\"mitvindue\",\"300\",\"780\");\' value=\"Ret eller afmeld\" id=\"btnRetafmeld\" class=\"Button\" name=\"btnRetafmeld\" />'+
							'</td>'+
						'</tr>'+
					'</table>';
var ministr = '' +
					'<table id=\"signuptable\" cellpadding=\"0\" cellspacing=\"4\" border=\"0\">'+
						'<tr>'+
							'<td>'+
								'<input style=\"width:140px\" type=\"text\" id=\"txtemail\" class=\"TextBoxSingle\" value=\"Indtast email\" onFocus=\"this.value=\'\';\" onBlur=\"if(this.value==\'\')this.value=\'Indtast email\';\" name=\"txtemail\" /><br />'+
								'</td></tr><tr><td>'+
								'<input type=\"button\" onclick=\'popup(\"http://acceptcard.w11.dk/subscribe.aspx\",\"mitvindue\",\"675\",\"780\");\' value=\"Tilmeld\" id=\"btnTilmeld\" class=\"Button Green\" name=\"Tilmeld\" />'+
								'</td>'+
						'</tr>'+
					'</table>';
if (version) { mytablestr=ministr; }
return document.write(mytablestr);
}
        function popup(url,name,win_height,win_width) 
        {
            if(validering(document.getElementById("txtemail").value))
            {    
                if(Count(document.getElementById("txtemail")))
                {
	                pos_horizon = ((screen.width/2)-(win_width/2));
	                pos_vertical = ((screen.height/2)-((win_height/2)+70));
	                window.open(url+="?email="+document.getElementById("txtemail").value,name,"width="+win_width+",height="+win_height+",top="+pos_vertical+",left="+pos_horizon);
                }
                else
                {
                    alert("Max 50 tegn i din email!");
                }
            }
        }
	
        function Count(tBox) 
        {
            var max = 50;
            if (tBox.value.length > max) 
            {
                return false;
            }
            return true;
        }

        function validering(email)
        {
            var t = "\\wáaaââaaçéeeëiíîinoóôoöouúuüýy";
            var regexp = new RegExp("^["+t+"]["+t+"\\.\\-\\+]*@["+t+"]["+t+"\\.\\-]*\\.["+t+"]{2}["+t+"\\.\\-\\/]*$","i");
            tekst=email.toLowerCase();
            if (!regexp.test(tekst))
            {
                alert ("Den indtastede email er ugyldig!!");
                return false;
            }
            return true;
        }
