function openWin(theURL,winName,features) {
 Fenster = window.open(theURL,winName,'width=400,height=280');
 Fenster.focus();
}

		jQuery(function( $ ){




    $(".hsGalleryLink a").click( function(e){
	 
	
	 
      $.ajax({
        url: 'include/galerie/gallery_uebersicht.php?datum='+this.title+'&name='+this.firstChild.nodeValue,
        type: 'GET',
        dataType: 'html',
        beforeSend: function() {
          $('#hsGalleryPics').html('<div class="hs_ajaxWait"></div>');
		  
		  },
        success: function(html){
          $('#hsGalleryPics').html(html);
		  	  GalleryHoehe = window.document.getElementById('hsGall').offsetHeight;
		  GalleryHoehe = GalleryHoehe+1200;
          	var GalleryneueHoehe = GalleryHoehe+'px'; 
       $(".section ul li .inner").css({ height: GalleryneueHoehe });
        $("#hs_contH").animate({ height: GalleryneueHoehe}, 600 );
	
        }
		
      }); 
    });




        $("a.hs_naviLink").click(function(){
$(".section ul li .inner").css({ height: 'auto' });
            var title = $(this).attr('title');
            Hoehe = window.document.getElementById(title).offsetHeight;
		var neueHoehe = Hoehe+'px'; 
       $(".section ul li .inner").css({ height: neueHoehe });
        $("#hs_contH").animate({ height: neueHoehe}, 600 );
// alert(neueHoehe);
        });

		

			/**
			 * Most jQuery.localScroll's settings, actually belong to jQuery.ScrollTo, check it's demo for an example of each option.
			 * @see http://flesler.webs.com/jQuery.ScrollTo/
			 * You can use EVERY single setting of jQuery.ScrollTo, in the settings hash you send to jQuery.LocalScroll.
			 */
			
			target = $('#content').get(0);//the scrolled div
			
			/**
			 * restart the scroll position to ( 0, 0 ) (Firefox doesn't reset it)
			 * could use $(target).scrollTo( 0, {axis:'xy'));
			 * but this needs to be quick(synchronous), to reset before $.localScroll.hash() begins
			 */
			target.scrollLeft = target.scrollTop = 0;
			
			//scroll initially if there's a hash (#something) in the url 
			$.localScroll.hash({
				target: target, //could be a selector or a jQuery object too.
				axis:'xy',//the default is 'y'
				queue:true,
				duration:2500
			});
			
			var $last = $([]);//save the last link
			
			/**
			 * NOTE: In the former version of the demo, I called $('#navigation').localScroll()
			 * Now I want to also affect the >> and << links, so I'll use $.localScroll() instead
			 */
			$.localScroll({
				target: target, //could be a selector or a jQuery object too.
				axis:'xy',//the default is 'y'
				queue:true,
				duration:1000,
				hash:true,
				onBefore:function( e, anchor, $target ){//'this' is the clicked link
					$last.removeClass('scrolling');
					$last = $(this).addClass('scrolling');
					this.blur();//remove the awful outline
				},
				onAfter:function( anchor ){
					$last.removeClass('scrolling');
				}
			});
			
	});
		



/** MAIL FORMULAR 		 */

$(document).ready(function(){
  // initial things
  var name;
var mail;
var message;
var EMail;
var Name;
var FirstName;
var City;
  });

function sendMailAjaxRequest() {
// local events
$.ajax({
type:        'POST',
dataType:    'html',
url:         'include/kontakt/contact_send.php',
data:        {mail: mail,
name: name,
message : message },
cache:       false,
global:      true,
/* */
beforeSend:  function (XMLHttpRequest) {

},
complete :   function (XMLHttpRequest, textStatus) {
alert (mail);
},
/* */
error:       function (XMLHttpRequest, textStatus, errorThrown) {

},
success:     function(data,textStatus){
//$("#ajax35").html(data);
//if(1) {

$("#hs_formMail").hide();
$("#hs_formBest").show();
alert('bla');

}
});

}



function sendcheck1() {

name = $("input[@name=name]").val();
mail = $("input[@name=mail]").val();
message = $("textarea[@name=message]").val();

 sendMailAjaxRequest();

return false;
}






/** NEWSLETTER FORMULAR 		 */


function sendNewsAjaxRequest() {
// local events
$.ajax({
type:        'POST',
dataType:    'html',
url:         'http://www.wachtelborn.net',
data:        {Name: Name },
cache:       false,
global:      true,
/* */
beforeSend:  function (XMLHttpRequest) {

},
complete :   function (XMLHttpRequest, textStatus) {
alert (mail);
},
/* */
error:       function (XMLHttpRequest, textStatus, errorThrown) {

},
success:     function(data,textStatus){
//$("#ajax35").html(data);
//if(1) {

$("#hs_formMail").hide();
$("#hs_formBest").show();
alert('bla');

}
});

}



function sendcheck2() {

Name = $("input[@name=Name]").val();
 FirstName = $("input[@name=FirstName]").val();
City = $("input[@name=City]").val();
EMail = $("input[@name=Mail]").val();
 sendNewsAjaxRequest();
alert(Name);
return false;
}
