﻿
function checkegg()
{
new Ajax.Request("/egginfo.aspx", {
  method: 'get',
  onSuccess: function(transport) {
    if (transport.responseText==thispos)
    {
	$("easteregg" + thispos).style.display = "block";
    }
  }
});

}

function formappear() {    
document.location = "#top";
$('easterform').appear();
}     

function formdisappear(){
$('easterform').fade();
}    

function formsend(){
formdisappear();

new Ajax.Request("/egginfo.aspx?status=1&egg=" + thispos, {
  method: 'get',
  onSuccess: function(transport) {
  }
});

//document.easterform1.submit();
$('easteregg' + thispos).fade(); 

}    

function output()
{
document.write('<a href="#top" onclick="formappear();"><img id="easteregg' + thispos + '" src="/Layout/33/osterei.gif" style="display:none; cursor:pointer;" ></a>');

document.write('<div id=easterform style="PADDING-RIGHT: 0px; DISPLAY: none; PADDING-LEFT: 0px; LEFT: 350px; PADDING-BOTTOM: 0px; WIDTH: 500px; PADDING-TOP: 0px; POSITION: absolute; TOP: 200px;  overflow:hidden; z-index:20000;">  <div id=handle style="TEXT-ALIGN: right; background:#2b2c65;"><a href="javascript:formdisappear();" style="color:#ffffff;">schließen</a></div>  <div style="BORDER: #eeeeee 2px groove; PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; BACKGROUND: #f8bd21; PADDING-TOP: 10px; overflowy-y:scroll;" id="easterformtext">');
document.write('<img src=/Media/33/werbung/karstadt.jpg>');
document.write('<br>');
document.write('Herzlichen Glückwunsch. Sie haben das Osterei als Erster gefunden. Jetzt schnell Ihre Daten ausfüllen und teilnehmen!<br>');
document.write('<form action="default.aspx" method="POST" id="easterform1" name="easterform1" onsubmit="formsend();"><input type="hidden" name="FormID" value="204">');
document.write('<fieldset>');
document.write('<legend>Teilnahmeformular</legend>');
document.write('<table style="margin:10px;">');
document.write('<colgroup>');
document.write('<col width="100" />');
document.write('<col width="*" />');
document.write('</colgroup>');
document.write('<tr><td>Vorname:</td><td><input type="text" name="Vorname"></td></tr>');
document.write('<tr><td>Name:</td><td><input type="text" name="Name"></td></tr>');
document.write('<tr><td>Ort:</td><td><input type="text" name="Ort"></td></tr>');
document.write('<tr><td>Telefon:</td><td><input type="text" name="Telefon"></td></tr>');
document.write('<tr><td>E-Mail-Adresse:</td><td><input type="text" name="email"></td></tr>');
document.write('<tr><td>Kommentar:</td><td><textarea name="Bemerkungen" width=200 height=100></textarea></td></tr>');
document.write('<tr><td></td><td></td></tr></table>');
document.write('</fieldset><br>');
document.write('<input type="submit" value="Teilnehmen"> <input type="reset" value="Abbrechen" onclick="formdisappear()">');
document.write('</form>');
document.write('</div></div>');
}

function egg(pos)
{
	thispos = pos;
	output();
	checkegg();

	var mydrag = new Draggable('easterform', { handle: 'handle' });
}