//mobile
$(function(){
      // bind change event to select
      $('#dynamic_select').bind('change', function () {
          var url = $(this).val(); // get selected value
          if (url) { // require a URL
              window.location = url; // redirect
          }
          return false;
      });
    });
	
var gMapNewAdress = "Kordon Caddesi, Marmaris, Turkiye"

//highlighting
/*$(document).ready(function(){
$('#menu a').not('.not-this').click(function(e) {
    e.preventDefault();
    
    $('#menu a').removeClass('selected');
    $(this).addClass('selected');
});
});*/

// tweeter
jQuery(function($)
	{
        $(".tweet").tweet({
          join_text: "auto",
          username: "geceolurken",
          count: 2,
          auto_join_text_default: "", //we said,
          auto_join_text_ed: "", //we
          auto_join_text_ing: "", //we were
          auto_join_text_reply: "", //we replied
          auto_join_text_url: "", //we were checking out
          loading_text: "loading tweets..."
        });
	});
	
	
//slides
		$(function(){
			$('#slides').slides({
				preload: true,
				preloadImage: '_images/loading.gif',
				play:false,
				/*pause: 2500,
				hoverPause: true,*/
				effect: 'fade'
			});
			
		});	

jQuery(document).ready(function(){
	
	$('#slides-story .slides_container').cycle({
				fx:      'fade', 
				timeout:  0,
				prev: '#slides-story .prev',
				next: '#slides-story .next'			
			});
});

//scroll
$(document).ready(function(){
	
	$(".scroller").click(function(event){
		
		//event.preventDefault();

		var full_url = this.href;		
		var parts = full_url.split("#");
		var trgt = parts[1];
		
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;


		$('html, body').animate({scrollTop:target_top}, 900);
	});
	
});

//pretty-image
$(document).ready(function(){
	$(".image-area a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'dark_square',slideshow:2000, autoplay_slideshow: false});
});

//pretty-video
$(document).ready(function(){
	$("#blog a[rel^='prettyVideo']").prettyPhoto({animationSpeed:'slow',theme:'dark_square',slideshow:2000, autoplay_slideshow: false});
});


// rsvp-form
$(document).ready(function()
	{
		$("#contactForm").submit(function(){
		var str = $(this).serialize();

		$.ajax({
		type: "POST",
		url: "send.php",
		data: str,
		success: function(msg){
			
		$("#note").ajaxComplete(function(event, request, settings){
			if(msg == 'OK')
			{
			result = 'Your RSVP has been sent!';
			}
			else
			{
			result = msg;
			}

			$(this).html(result).fadeIn("slow");
			$(this).html(result);

		});

		}

		 });
		return false;
		});
	});
	 
//map	*/
$(document).ready(function(){
	$("#map1").gMap({ address: gMapNewAdress, zoom:15 });
});

	 
jQuery('.prev').css('display','block');


