$(document).ready(function() {		
	
	// jQuery Show Hide for Drop Down Menus - Triggered for all mobile devices that cannot use CSS Hover Menus
	if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/Android/i)) || (navigator.userAgent.match(/webOS/i)) || (navigator.userAgent.match(/blackberry/i)) || (navigator.userAgent.match(/windows/i)) || (navigator.userAgent.match(/opera/i))) {

	   	$('.show_hide').showHide({			 
			speed: 200,  // speed you want the toggle to happen	
			easing: '',  // the animation effect you want. Remove this line if you dont want an effect and if you haven't included jQuery UI				 
		}); 
	} else {
		$('.show_hide').click(function (e) {
			e.preventDefault();
		});
	};

	
	// jQuery dynamic two column split  V 1.0 
	//function altTwoColumns() {
	
		var left = 0; 
		var	right = 0;
		$('div.testimonial').each(function () {
			if (left <= right) {
				$(this).addClass('left');
				//this.style.float = "left";
				left += $(this).height();
			} else {
				$(this).addClass('right');
				//this.style.float = "right";
				right += $(this).height();				
			}
		
		});
	
	//};
	
		// jQuery Pop-up window
	//select all the a tag with name equal to modal
	$('a[name=modal]').click(function(e) {
		//Cancel the link behavior
		e.preventDefault();
		
		//Get the A tag
		var id = $(this).attr('href');
	
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set height and width to mask to fill up the whole screen
		$('#mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#mask').fadeIn(250);	
	//	$('#mask').fadeTo("fast",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		//transition effect
		$(id).fadeIn(250); 
	});
	
	//if close button is clicked
	$('.window .close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();
		
		$('#mask').hide();
		$('.window').hide();
	});		
	
	//if mask is clicked
	$('#mask').click(function () {
		$(this).hide();
		$('.window').hide();
	});
	
	
});
