function klick(obj){
	var func = obj.parentNode.parentNode.firstChild.firstChild.onclick+"";
	pos1 = func.search('{');
	pos2 = func.search('}');
	if(navigator.appName == "Microsoft Internet Explorer")
		func = func.slice(pos1+1,pos2-15);
	else
		func = func.slice(pos1+6,pos2-19);
	eval(func);
}

function ImagePopup(img){	
  Img1 = new Image()
  Img1.src=img;
  var s1 = "<TITLE>Image</TITLE>"+"<BODY  topmargin='0' leftmargin='0'>"+"<img onClick='self.close()' src='" +img +"'>"+"</BODY>";
  
  popup = window.open("","Bild","status=no,toolbar=no,scrollbars=no,width="+Img1.width+",height="+Img1.height)
  popup.document.write(s1)
  popup.document.close()
}

function checkUncheckAll(theElement) {
	var theForm = theElement.form, z = 0;
	for(z=0; z<theForm.length;z++){
		if(theForm[z].type == 'checkbox' && theForm[z].name != 'checkall'){
			theForm[z].checked = theElement.checked;
		}
	}
}

function chkForm(){

	var flag = true;
	var errors = new Array();
	errors[0] = "firstname";
	errors[1] = "lastname";
	errors[2] = "street";
	errors[3] = "streetno";
	errors[4] = "postcode";
	errors[5] = "town";
	errors[6] = "banknumber";
	errors[7] = "bank";
	errors[8] = "accountnumber";
	
	var numErrors = new Array();
	numErrors[0] = "banknumber";
	numErrors[1] = "accountnumber";
	numErrors[2] = "contribution_text";
	
	for(i=0;i<errors.length;i++){	
		if(document.getElementById(errors[i]).value == ""){
			document.getElementById(errors[i]+"E").style.display = "block";
			flag = false;
		}
		else{
			document.getElementById(errors[i]+"E").style.display = "none";
		}
	}
	for(i=0;i<numErrors.length;i++){
		if(isInt(document.getElementById(numErrors[i]).value) || document.getElementById(numErrors[i]).value == ""){
			document.getElementById(numErrors[i]+"NE").style.display = "none";
		}
		else{
			document.getElementById(numErrors[i]+"NE").style.display = "block";
			flag = false;			
		}
	}
	return flag;
}
function chkForm2(){
var flag = true;
	var errors = new Array();
	errors[0] = "firstname";
	errors[1] = "lastname";	
	errors[2] = "street";
	errors[3] = "streetno";
	errors[4] = "postcode";
	errors[5] = "town";
	
	var numErrors = new Array();
	numErrors[0] = "contribution_text";
	
	for(i=0;i<errors.length;i++){	
		if(document.getElementById(errors[i]).value == ""){
			document.getElementById(errors[i]+"E").style.display = "block";
			flag = false;
		}
		else{
			document.getElementById(errors[i]+"E").style.display = "none";
		}
	}
	for(i=0;i<numErrors.length;i++){
		if(isInt(document.getElementById(numErrors[i]).value) || document.getElementById(numErrors[i]).value == ""){
			document.getElementById(numErrors[i]+"NE").style.display = "none";
		}
		else{
			document.getElementById(numErrors[i]+"NE").style.display = "block";
			flag = false;			
		}
	}
	return flag;
}

function chkForm3(){
var flag = true;
	var errors = new Array();
	errors[0] = "firstname";
	errors[1] = "lastname";	
	errors[2] = "street";
	errors[3] = "streetno";
	errors[4] = "postcode";
	errors[5] = "town";
    	errors[6] ="invitation";
    	errors[7] = "email"
	
	var numErrors = new Array();
	numErrors[0] = "contribution_text";
	
	for(i=0;i<errors.length;i++){	
		if(document.getElementById(errors[i]).value == ""){
			document.getElementById(errors[i]+"E").style.display = "block";
			flag = false;
		}
		else{
			document.getElementById(errors[i]+"E").style.display = "none";
		}
	}
	for(i=0;i<numErrors.length;i++){
		if(isInt(document.getElementById(numErrors[i]).value) || document.getElementById(numErrors[i]).value == ""){
			document.getElementById(numErrors[i]+"NE").style.display = "none";
		}
		else{
			document.getElementById(numErrors[i]+"NE").style.display = "block";
			flag = false;			
		}
	}
	return flag;
}


function isInt(x) {
	var y=parseInt(x);
	if (isNaN(y)) return false;
	return x==y && x.toString()==y.toString();
}

function currencyChange(box){
	cur = box.options[box.selectedIndex].innerHTML;
	objs = document.getElementsByClassName('cur');
	for(i=0; i < objs.length; i++)
		objs[i].innerHTML = cur;
}


// Flash-Detection
function getFlashVer() {
	var flashVer = -1;

	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash"]) {
			var flashDescription = navigator.plugins["Shockwave Flash"].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var flashVer = versionMajor;
		}
	}
	else if (navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.toLowerCase().indexOf("win") != -1) {
		try {
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			flashVer = axo.GetVariable("$version");
			flashVer = flashVer.substr(4,2).replace(/,/, "");
		} catch (e) {}
	}	
	return flashVer;
}

var plugin = (getFlashVer() >= 8)?1:0;
var plugin6 = (getFlashVer() >= 6)?1:0;

function showFlash(src, width, height, quality, menu, bgcolor, flashvars, wmode) {
	closeTags = "</" + "embed></" + "object>";
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="' + width + '" height="' + height + '" id="flashfilm" title="flash"><param name="movie" value="' + src + '"><param name="quality" value="' + quality + '"><param name="wmode" value="' + wmode + '"><param name="flashVars" value="' + flashvars + '"<embed src="' + src + '" quality="' + quality + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" name="flashfilm" flashVars="' + flashvars + '" wmode="' + wmode + '" >'+closeTags);
}
// Google Link Tracking

function recordOutboundLink(link, category, action) {
	try {
		var pageTracker=_gat._getTracker("UA-4475968-1");
		pageTracker._trackEvent(category, action);
		setTimeout('document.location = "' + link.href + '"', 100)
	}catch(err){}
}



