function send_recom(gid) {
	var url = 'global/ajax/recommend_send.php';
	var r_name=$('r_name').value;
	var r_receiver=$('r_receiver').value;
	var r_email=$('r_email').value;
	var pars = 'r_name='+r_name+'&r_receiver='+r_receiver+'&r_email='+r_email+'&loci='+document.location;
	var target = 'recom_content';

	var ok=true;
	if(r_name=='') ok=false;
	if(r_receiver=='') ok=false;
	if(r_email=='') ok=false;

	if(ok) {
		var myAjax = new Ajax.Updater(target, url, {method: 'get', parameters: pars});
		window.setTimeout(function() { Effect.Fade('recom_div', { duration: 1.5 }) },2000);
	}
	else alert('Bitte alle Felder bearbeiten!');
}


function open_recom(uri) {
	var url = 'global/ajax/recommend_form.php';
	var target = 'recom_content';
	Effect.Appear('recom_div', { duration: 1.0 });
	var myAjax = new Ajax.Updater(target, url, {method: 'get'});
}


function close_recom() {
	$('recom_div').style.display='none';
}



/*events*/
function open_event(el,eid) {
	if($('#event_details_'+eid).css('display')=='none') {
		el.style.color='#ff7000';
		$('#event_details_'+eid).show();
	}
	else {
		el.style.color='#7B7B7B';
		$('#event_details_'+eid).hide();
	}
}



function get_event_details(el,eid,langs) {
	var url = 'global/ajax/event_details.php';
	var pars = '?eid='+eid+'&lang='+langs;
	$('#event_details_'+eid).load(url+pars, function () {
	open_event(el,eid)});
}



function delete_newsletter_mail(email) {
	$('nl_abmeldung').style.display='none';
	var url = 'global/ajax/delete_user_newsletter.php';
	var target = 'nl_abmeldung';
	var pars = 'email='+$('del_mail').value;
	var myAjax = new Ajax.Updater(target, url, {method: 'get', parameters: pars, onComplete: delete_newsletter_status_back()});
}

function delete_newsletter_status_back() {
	Effect.BlindDown('nl_abmeldung', { duration: 0.6 });
}

function show_me_ticket_event(bak) {
		var einsunsein=bak.split('|');
		$('#ticket_zusammenfassung').html(einsunsein[0]);
		if($('#ticket_zusammenfassung').css('display')=='none') $('#ticket_zusammenfassung').slideDown('slow');
		if($('#senden').is(':checked')) {
			var gerechnet=parseFloat(einsunsein[1])+5;
			$('#daspreis').val(String(gerechnet).replace(/\./,","));
			var trenni=$('#daspreis').value.split(",");
			$('#daspreis').val($('#daspreis').val() += (trenni[1].length == 2) ? '' : '0');
		}
		else {
			var gerechnet=parseFloat(einsunsein[1]);
			$('#daspreis').val(String(gerechnet).replace(/\./,","));
			var trenni=$('#daspreis').value.split(",");
			$('#daspreis').val($('#daspreis').val() += (trenni[1].length == 2) ? '' : '0');
		}
	}



	function add_ticket_event() {
		/*$('ticket_infos').value+=$('anzahl').value+'|'+$('pg').value+';';*/
		var bestellsession=$('#bestellsession').val();
		var anzahl=$('#anzahl').val();
		var preiskat=$('#pg').val();
		var pk_konti=preiskat.split('|');
		if(pk_konti[1]>0 || pk_konti[1]=='')
			x_save_ticket_order(bestellsession,anzahl,pk_konti[0],show_me_ticket_event);
		else alert('Kategorie leider ausverkauft');

	}


	function delete_ticket(bestellsession) {
		x_delete_ticket_order(bestellsession,close_ticketevent);
	}
	function close_ticketevent(bak) {
		$('#daspreis').val('');
		$('#ticket_zusammenfassung').slideUp('slow');
	}

	function sendmetorightaddress() {
		var selectbox=document.getElementById('e_id').value;
		//alert(selectbox);
		if(selectbox) {
			var getsele=selectbox.split('|');
			if(getsele[0]=='NORMAL')
			{
				$('#event_form').submit();
			}

			else {

				if(window.location.host=='projekte')
						var ji=window.location.host+'/duesseldorfcongress/ph';
				else
					var ji=window.location.host;
				 document.location.href='http://'+ji+'/ticketshopgruppe.php?grp='+getsele[1];
			}
		}
	}

	function kaufm(x) {
	  var k = (Math.round(x * 100) / 100).toString();
	  k += (k.indexOf('.') == -1)? '.00' : '00';
	  var p = k.indexOf('.');
	  return k.substring(0, p) + ',' + k.substring(p+1, p+3);
	}

	function del_bearbeitung() {
		var preisfeld=$('#daspreis').value;
		if(preisfeld=='') {
			$('#daspreis').value='';
		}
		else {
			var gerechnet=parseFloat(preisfeld.replace(/,/, "."))-5;
			$('#daspreis').value=String(gerechnet).replace(/\./,",");
			var trenni=$('#daspreis').value.split(",");
			$('#daspreis').value += (trenni[1].length == 2) ? '' : '0';
		}
	}

	function zeig(dia)
	{
  		$('#tooltip_'+dia).style.display='block';
	}

	function MM_changeProp(objName,x,theProp,theValue) { //v6.0
	  var obj = MM_findObj(objName);
	  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
	    if (theValue == true || theValue == false)
	      eval("obj."+theProp+"="+theValue);
	    else eval("obj."+theProp+"='"+theValue+"'");
	  }
	}

	function MM_findObj(n, d) { //v4.01
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
	}

	function MM_showHideLayers() { //v6.0
	  var i,p,v,obj,args=MM_showHideLayers.arguments;
	  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	    obj.visibility=v; }
	}

	function change_bg(idd) {
		for(i=0;i<8;i++) {

			if(document.getElementById(idd+i)) {
				document.getElementById(idd+i).style.backgroundColor='#000000';
				document.getElementById(idd+i).style.color='#ffffff';
			}
		}

	}

	function change_bg_back(idd) {
		var color;
		for(i=0;i<8;i++) {
			if(i==0) color='#cfcfcf';
			else if(i==1) color='#efefef';
			else color='#efefef';
				if(document.getElementById(idd+i)) {
					document.getElementById(idd+i).style.backgroundColor=color;
					document.getElementById(idd+i).style.color='#656464';
			 }
		}

	}

	//
  // CSS Photo Shuffler v1.0 by
  //   Carl Camera
  //   http://iamacamera.org
  //
  // SetOpacity Function and inpiration from Photo Fade by
  //   Richard Rutter
  //   http://clagnut.com
  //
  // License: Creative Commons Attribution 2.5  License
  //   http://creativecommons.org/licenses/by/2.5/
  //

  // Customize your photo shuffle settings
  //
  // * Surround the target <img /> with a <div>. specify id= in both
  // * set background-repeat:no-repeat in CSS for the div
  // * The first and final photo displayed is in the html <img> tag
  // * The array contains paths to photos you want in the rotation.
  //   If you want the first photo in the rotation, then it's best to
  //   put it as the final array image.  All photos must be same dimension
  // * The rotations variable specifies how many times to repeat array.
  //   images. zero is a valid rotation value.



