$(document).ready(function() {
	
			var BGImageArray = ["bg_img1.jpg","bg_img2.jpg","bg_img3.jpg","bg_img4.jpg","bg_img5.jpg","bg_img6.jpg","bg_img7.jpg","bg_img8.jpg","bg_img9.jpg","bg_img10.jpg","bg_img11.jpg","bg_img12.jpg","bg_img13.jpg","bg_img14.jpg","bg_img15.jpg","bg_img16.jpg","bg_img17.jpg","bg_img18.jpg","bg_img19.jpg","bg_img20.jpg"];
			var BGImage = BGImageArray[Math.floor(Math.random()*BGImageArray.length)]

			$("body").ezBgResize({
				img     : "img/" + BGImage, // Relative path example.  You could also use an absolute url (http://...).
				opacity : 1, // Opacity. 1 = 100%.  This is optional.
				center  : true // Boolean (true or false). This is optional. Default is true.

			});
			
	$('#menu  li > span').css({opacity:'0'})
	
	$('#menu li').hover(function(){
		$(this).find('> span').stop().animate({opacity:'1'},400);						   
	}, function(){
		if (!$(this).hasClass('active'))
		$(this).find('> span').stop().animate({opacity:'0'},400);						   
	})
	
	$('#menu').superfish({
      delay:       600,
      animation:   {opacity:'show', height:'show'},
      speed:       600,
      autoArrows:  false,
      dropShadows: false
    });

	
	

			
$("#AYR").validate({
		rules: {
			ad: "required",
			sehir:"required",
			ulke:"required",
			mesaj: {
				required: false
			},
			adres: {
				required: false
			},
		email: {
				required: true,
				email: true
			},
			
		tel: {
				required: true,
				number: true,
				minlength:7
			},
		fax: {
				required: true,
				number: true,
				minlength:7
			},
		},
		messages: {
			ad: "",
			tel: "",
			email: "",
			fax:"",
			sehir:"",
			ulke:"",
			mesaj:"",
			adres:""
		}
		
	});
	
	$("#AYI").validate({
		rules: {
			ad: "required",
			
		email: {
				required: true,
				email: true
			},
			
		tel: {
				required: false
			},
		mesaj: {
				required: true
			},
		},
		messages: {
			ad: "",
			tel: "",
			email: "",
			mesaj:""
		}
		
	});
	
	if( jQuery.browser.mozilla ) {
	// do when DOM is ready
	$( function() {
		// search form, hide it, search labels to modify, filter classes nocmx and error
		$( 'form.cmxform' ).hide().find( 'p>label:not(.nocmx):not(.error)' ).each( function() {
			var $this = $(this);
			var labelContent = $this.html();
			var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );
			// create block element with width of label
			var labelSpan = $("<span>")
				.css("display", "block")
				.width(labelWidth)
				.html(labelContent);
			// change display to mozilla specific inline-box
			$this.css("display", "-moz-inline-box")
				// remove children
				.empty()
				// add span element
				.append(labelSpan);
		// show form again
		}).end().show();
	});
};

	
		
	
 });
