// JavaScript Document

// JavaScript Document

var map;

$('html').removeClass('no_script').addClass('script');


$(document).ready(function() {
		init();
		$('#anmeldung_checkbox').each(function(){anmeldung_checked = this.checked;});
		$('#abschicken').click(function(){
				//ist die checkbox angekreuzt
				$('#anmeldung_checkbox').each(function(){anm_check = this.checked;});
				//console.log(anm_check);
				if(!anm_check&& !anmeldung_checked){
					alert("Sie haben keine der Auswahlmöglichkeiten ausgewählt.\nFür eine Anmeldung sollten Sie zumindest 'ANMELDUNG' auswählen.");
					anmeldung_checked = true;
					$('#anmeldung_error').css('border', '3px solid red');
					return false;
				}
				else if(!anm_check && anmeldung_checked){
					return confirm("Sie melden sich hiermit von der Veranstaltung ab");
				}
	   });
});
		
		
function init() {
}


function getBilderWindow(obj) {
	window.open(obj, "data", "width=900,height=660,left=15,top=15,resizable=yes,scrollbars=yes");
	return false;
}


/*display the wide think*/
$(function(){
     if(screen.width > 1200) {
		 $('body').addClass('wide');
		 $('#canvas').wrap('<div id="wide_canvas" />');
		 $('#wide_canvas').prepend($('#sponsoren'));
	 }
});








function diaopenwin(obj) {
	window.open(obj, "diashow", "width=730,height=690,left=30,top=30,resizable=yes,scrollbars=no");
	return false;
}


function dataopenwin() {
	window.open("/__Datenschutz/index.php", "data", "width=500,height=500,left=100,top=100,resizable=yes,scrollbars=yes");
	return false;
}



function flash_01() {
	/*alert(navigator.userAgent);*/
	if(false){
	document.open();
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="440" height="100" title="Bilder-Schau"><param name="movie" value="/__Flash/gedankenflash_12072006.swf?clickURL=/Veranstaltungen/Museumsdorf%20Cloppenburg%2011_10_2006/index.php" /><param name="quality" value="high" /><embed src="/__Flash/gedankenflash_12072006.swf?clickURL=/Veranstaltungen/Museumsdorf%20Cloppenburg%2011_10_2006/index.php" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="440" height="100"></embed></object>');
	document.close();
}

}



// Flash Version Detector  v1.2.1
// documentation: http://www.dithered.com/javascript/flash_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
// with VBScript code from Alastair Hamilton (now somewhat modified)


function isDefined(property) {
  return (typeof property != 'undefined');
}

var flashVersion = 0;
function getFlashVersion() {
   var latestFlashVersion = 8;
   var agent = navigator.userAgent.toLowerCase(); 
   
   // NS3 needs flashVersion to be a local variable
   if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
      flashVersion = 0;
   }
   
   // NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Flash plugin in plugin array
   if (navigator.plugins != null && navigator.plugins.length > 0) {
      var flashPlugin = navigator.plugins['Shockwave Flash'];
      if (typeof flashPlugin == 'object') { 
         for (var i = latestFlashVersion; i >= 3; i--) {
            if (flashPlugin.description.indexOf(i + '.') != -1) {
               flashVersion = i;
               break;
            }
         }
      }
   }

   // IE4+ Win32:  attempt to create an ActiveX object using VBScript
   else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
      var doc = '<scr' + 'ipt language="VBScript"\> \n';
      doc += 'On Error Resume Next \n';
      doc += 'Dim obFlash \n';
      doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
      doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
      doc += '   If IsObject(obFlash) Then \n';
      doc += '      flashVersion = i \n';
      doc += '      Exit For \n';
      doc += '   End If \n';
      doc += 'Next \n';
      doc += '</scr' + 'ipt\> \n';
      document.write(doc);
   }
      
   // WebTV 2.5 supports flash 3
   else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

   // older WebTV supports flash 2
   else if (agent.indexOf("webtv") != -1) flashVersion = 2;

   // Can't detect in all other cases
   else {
      flashVersion = flashVersion_DONTKNOW;
   }

   return flashVersion;
}

flashVersion_DONTKNOW = -1;

