	function dropGuest(guestid,bookingid){
	    Check = confirm("Soll der Gast wirklich entfernt werden?");
	    if(Check == true){
			location.href="?do.guestDrop&guestid="+guestid+"&bookingid="+bookingid;
	    }
	}
	
	function addName(textbox) {
		
		var LastName = document.form2.form_lastname.value;
	
		textbox.value = LastName;
	}

	function getTemplate(selectBox,textareaBox) {
		
			$.ajax({
				type: "POST",
				url: "../asyn/templates.php",
				data: 	"id=" + selectBox.value,
				success: function(html){
					$('#'+textareaBox).tinymce().execCommand('mceInsertContent',false,html);
				}
			});		
	}
	
	function dropImage(name) {
		Check = confirm("Soll die Buchung wirklich entfernt werden?");
	    if(Check == true){
			location.href="?do.fileDrop&name="+name;
	    }		
	}

	function switchSize(size) {
	    if (size=='n') {
	        document.getElementById('content').style.fontSize = '0.750em';
	        document.getElementById('sidebar').style.fontSize = '1.000em';
	        document.getElementById('footer').style.fontSize = '0.750em';
	        document.getElementById('topRight').style.fontSize = '0.750em';
	        //document.getElementsByTagName('#content')[0].style.fontSize = '1.045em';
	    }
	    if (size=='x') {
	    	document.getElementById('content').style.fontSize = '1.000em';
	    	document.getElementById('sidebar').style.fontSize = '1.200em';
	    	document.getElementById('footer').style.fontSize = '0.900em';
	    	document.getElementById('topRight').style.fontSize = '0.850em';
	        //document.getElementsByTagName('#content')[0].style.fontSize = '2.50em';
	    }
	}

	function addBillItem(bookingid,text,amount,fee,type) {
		location.href="?do.addSum&bookingid="+bookingid+"&amount="+amount+"&fee="+fee+"&text="+text+"&type="+type;
	}	

	function dropSeason(id){
	    Check = confirm("Soll die Saison wirklich entfernt werden?");
	    if(Check == true){
			location.href="?do.seasonDrop&id="+id;
	    }
	}
	
	
	function dropBillItem(id,bookingid){
	    Check = confirm("Soll diese Summe aus dem Rechnungslauf entfernt werden?");
	    if(Check == true){
			location.href="?do.deleteSum&id="+id+"&bookingid="+bookingid;
	    }
	}

	function confirm1Send(id,text){
	    Check = confirm("Reservierungsbestaetigung jetzt schicken?");
	    if(Check == true){
			location.href="?do.bookingConfirm&id="+id;
	    }
	}

	function confirmChanges(id){
	    Check = confirm("Sollen die Buchungsaenderungen nicht mehr angezeigt werden?");
	    if(Check == true){
			location.href="?do.bookingUserChanges&id="+id;
	    }
	}

	function BookingConfirm2(id,ttype){
	    
	    
		if(ttype==1) {
			Check = confirm("Buchungsbestaetigung jetzt erstellen?");	
		} else {
			Check = confirm("Buchungsbestaetigung jetzt schicken?");
		}
			    
	    
	    if(Check == true){
			location.href="?do.bookingConfirm&id="+id+"&type=2&ttype="+ttype;
	    }
	}	

	function BookingConfirm(id,ttype){
		
		if(ttype==1) {
			Check = confirm("Reservierungsbestaetigung jetzt erstellen?");	
		} else {
			Check = confirm("Reservierungsbestaetigung jetzt schicken?");
		}
		
	    
	    if(Check == true){
			location.href="?do.bookingConfirm&id="+id+"ttype="+ttype;
	    }
	}

	function contentDrop(id){
	    Check = confirm("Soll der Inhalt wirklich entfernt werden?");
	    if(Check == true){
			location.href="?do.contentDrop&id="+id;
	    }
	}
	
	function bookingDrop(id){
	    Check = confirm("Soll die Buchung wirklich entfernt werden?");
	    if(Check == true){
			location.href="?do.bookingDrop&id="+id;
	    }
	}

	function tplDrop(id){
	    Check = confirm("Soll das Template wirklich entfernt werden?");
	    if(Check == true){
			location.href="?do.texttplDrop&id="+id;
	    }
	}
	
	function bookingCancel(id){
	    Check = confirm("Soll die Buchung wirklich storniert werden? (Die Daten bleiben erhalten, lediglich die genauen Buchungsdaten wie Bungalow, Zeitraum usw. werden entfernt!)");
	    if(Check == true){
			location.href="?do.bookingCancel&id="+id;
	    }
	}
	
	function userDrop(uid){
	    Check = confirm("Soll der Benutzer wirklich entfernt werden?");
	    if(Check == true){
			location.href="?do.userDrop&userid="+uid;
	    }
	}

	function loadGuests() {
		
		Zahl1 = parseFloat(document.form.form_adults.value);
	    Zahl2 = parseFloat(document.form.form_children.value);
	    
		Summe = ((Zahl1-1) + Zahl2);
	
		if(Summe < 1) {
			alert("Es sind 0 Erwachsene und 0 Kinder gewaehlt worden.");
		} else {
			
			for(i=1; i <= Summe; i++) {
					//addElement();
					$('#aha').append('<tr><td>'+i+'</td><td><input type="text" class="txtBooking" name="form_g_forename[]" /></td><td><input type="text" class="txtBooking" name="form_g_lastname[]" /></td><td><input type="text" class="txtBooking" name="form_g_birth[]" /></td></tr>');
				}  
			}
	}


	function checkDuplicates() {
		
		if(document.form.form_season[1].length > 0) {
			alert("Hello: "+document.form.form_season[1].value);
		}
		
	}
	
	
	function loadFeeRow() {
		$('#rows').append('<tr><td>#</td><td><select name="form_season[]" onchange="checkDuplicates()"><option value="Early">Fr&uuml;hsaison</option><option value="Peak">Hauptsaison</option><option value="Post">Nachsaison</option><option value="">-</option><option value="Between">Restliches Jahr</option></select></td><td><input type="text" name="form_fpd[]" /></td><td><select name="form_bungalowtype[]"><option value="A">A</option><option value="B">B</option></select></td></tr>');
	}
	
	
	function unique(arrayName) {
        var newArray=new Array();
        label:for(var i=0; i<arrayName.length;i++ )
        {  
            for(var j=0; j<newArray.length;j++ )
            {
                if(newArray[j]==arrayName[i]) 
                    continue label;
            }
            newArray[newArray.length] = arrayName[i];
        }
        return newArray;
    }	
	

