/*<![CDATA[*/
/**
 * functions.js - Bibliothek mit uebergreifenden JavaScript Funktionen
 *
 * Copyright (c) 2010    die.interaktiven GmbH u. Co. KG
 *                       www.die-interaktiven.de
 *
 * Alle Rechte vorbehalten. Unberechtigte Kopie und Weiter-
 * verwendung nicht gestattet.
 *
 */
jQuery.noConflict();

var DOCUMENT_ROOT = '/';
var efacontainer = "body";

function doStart()
{
	setStatus('');
	
	if(jQuery.cookie("fontsize") != 'null')
	{
		setFontsize(jQuery.cookie("fontsize"));
	}

	jQuery(".iframe").fancybox({
		'width'			: '75%',
		'height'			: '75%',
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});
	
/*	jQuery("a").each(function() {
		
		if (typeof jQuery(this).attr("href") != 'undefined') {
			linkURL=jQuery(this).attr("href");
			if (linkURL.indexOf('vereinswelt.de')>0 || linkURL.indexOf("http://")==-1) {
				jQuery(this).click(function() {
					showPopup(true);
				});
			};

		}
	});	*/
	
}

function checkPowermail(oForm)
{
	try
	{
		if(trim(oForm.elements['text'].value) == '')
		{
			alert('Meldung');
			
			return false;
		}
		
		// oForm.elements['select'].options[oForm.elements['select'].selectedIndex].value
		
		//alert('Inaktiv');
	}
	catch(e)
	{
		void(0);
		
		return true;
	}
	
	return true;
}

function checkMGVO(oForm)
{
	try
	{
		if(trim(oForm.elements['vnr'].value) == '')
		{
			alert('Bitte tragen Sie Ihre Vereinsnummer ein!');
			
			return false;
		}

		if(trim(oForm.elements['user_id'].value) == '')
		{
			alert('Bitte tragen Sie Ihren Benutzernamen ein!');
			
			return false;
		}

		if(trim(oForm.elements['passwf'].value) == '')
		{
			alert('Bitte tragen Sie Ihr Passwort ein!');
			
			return false;
		}

		return true;		
		
	}
	catch(e)
	{
		void(0);
		
		return true;
	}
	
	return true;
}

function checkNlReg(oForm)
{
	try
	{
		if(!checkEmail(oForm.elements['email'].value))
		{
			oForm.elements['email'].focus();

			alert('Bitte tragen Sie eine korrekte E-Mail Adresse ein!');
			
			return false;
		}
	}
	catch(e)
	{
		void(0);
		
		return true;
	}
	
	return true;
}

function setFontsize(iWert)
{	
	switch (iWert) 
	{
		case '1':
			jQuery(efacontainer).css('font-size', '1em'); 
			jQuery.cookie("fontsize", "1");
			break;
			
		case '2':
			jQuery(efacontainer).css('font-size', '1.1em'); 
			jQuery.cookie("fontsize", "2");
			break;
			
		case '3':
			jQuery(efacontainer).css('font-size', '1.2em'); 
			jQuery.cookie("fontsize", "3");
			break;
	}
}

function showPopup(internalLink)
{
	jQuery(window).unbind("unload");
	if (internalLink==true) {
		return;
	} 
	loadpopunder();
} 

function loadpopunder(){
       var fenster=window.open("http://www.vereinswelt.de/index.php?id=74", "Nicht_verpassen", "width=394,height=401,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0");
       fenster.blur();
       window.focus();
} 

function closeLayerAd(element) {
	jQuery('#layerad').toggle();
} 

function closePopup() {
	window.close();
}

/*jQuery(document).ready(function() {
	//jQuery('body').wrapInner('<div id="shadow" style="background-color: rgb(102, 102, 102); opacity: 0.8; display: box;" />');
	jQuery(window).one("unload", function() {
		showPopup(false);
	});
});*/

jQuery(document).ready(function() {
                jQuery("a").filter(function() {
                     //return this.hostname && this.hostname !== location.hostname;
			return true;
                }).click(function() {
                               try
                               {
                                               var oPopunder = window.open("http://www.vereinswelt.de/index.php?id=74", "Nicht_verpassen", "width=394,height=401,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0");
                                               oPopunder.blur();
                               }
                               catch(e)
                               {
                                               void(0);
                               }
                });
});




 
	
window.onload = doStart;

/*]]>*/
