	jQuery.fn.blindToggle = function(speed, easing, callback) {
		  var h = this.height() + parseInt(this.css('paddingTop')) + parseInt(this.css('paddingBottom'));
		  return this.animate({marginTop: parseInt(this.css('marginTop')) < 0 ? 0 : -h}, speed, easing, callback);  
		  function callback()
		  {if($('#box').css('marginTop')!='0px') $('#box').hide();}
	};

	

$(document).ready(function() {

	//document.getElementById('nmtxt').focus();
	$('.kwicks').kwicks({
			max : 170,
			spacing : 1,
			easing: 'easeOutBounce'
	});
		

	$("#testimonials").uplift({
			timeout: 7000,			//after how much time the effect starts 
			speed: 2000,			//after starting how quickly effect finishies
			show: 3,				//how many elements to be visible all the time
			easing: 'easeOutBounce'	//the jQuery easing effect
		});
	//if($.browser.msie && $.browser.version<7) 
	//{
		//$(document).pngFix(); 
		$("#close,#reset,#menu,#subm,#nm,#eml,#selected-works").pngFix(); 
	//}
	
	$('#slideshow').cycle({
		fx: 'fade',
		timeout: 8000,
		speed: 2000
	});
	
	
	
	var $box = $('#box').wrap('<div id="box-outer"></div>');
			  
			$('#get-in-touch').click(function() {
				$('#box').show();
				$box.blindToggle('slow','easeInSine');  
			});
			  
			$('#get-in-touch').hover(function() {
				$('#box').show();
				$box.blindToggle('slow','easeInSine');
				//$box-outer.blindToggle('slow');	
			});
			  
			$('#ord1,#ord2,#ord3,#ord4,#ord5').click(function(){
				if($('#box').css('marginTop')!='0px')	
				{
						$('#box').show();
						$box.blindToggle('slow','easeInSine');  
				}
				var pval=$('#order').attr('value');
				document.getElementById('nmtxt').focus();
				$('#order').attr('value', pval+' '+$(this).attr('title'));
				$('#order-c').html('');
				$('#order-c-p').css('opacity','0');
				$('#order-c-p').show();
				
				$('#order-c-p').height(0);
				
				setTimeout(function(){
				
					$('#order-c-p').animate({opacity: '1',height: '16px'},1000);
					$('#order-c').html( $('#order').attr('value') );
					},500);
				
			});
			
			$('#cancel-order').click(function(){
				$('#order').attr('value','Order:')
				$('#order-c-p').animate({opacity: '0',height: '0'},1000,'',function(){$('#order-c-p').hide();});
				
			});
			
					$('#progress').hide(0);
		$('#return').hide(0);
		
	$('#register').click(function (e) {
		e.preventDefault();
		$("#basic-modal-content").html($loader);
		$('#basic-modal-content').modal();
		$('#basic-modal-content').load($siteurl+'/myarea');

		
	});
	
	
		$("#book").submit(function(){
			
			var act=document.getElementById("book").act.value;
			
			
			// 'this' refers to the current submitted form
			var str = $(this).serialize();
			$("#contact").hide(0);
			$("#progress").show(0);
			//$("#basic-modal-content").('<div style="margin: 80px 110px; width: auto"><img src="'+aj+'"  /></div>');
		   $.ajax({
		   type: "POST",
		   url: act,
		   data: str,
		   success: function(msg){

			$("#contact").ajaxComplete(function(event, request, settings){

			$("#progress").hide(0);
			$("#return").css({opacity: 0});
			$("#return").show(0);
			
			$("#return").html(msg);
			$("#return").animate({opacity: 1},1500);
			//$("#basic-modal-content").show(0);

			});

			}

					 });

			return false;

		});

				
});	


function set_val(num)
{
	document.getElementById("book").fid.value=num;
}

