function moveGlobe(){
	// $("#home-globe").animate ({marginTop:"-50px",marginLeft:"20px" }, 350 ).animate ({marginTop:" ", marginLeft:" " }, 370 );
	 //$("#home-globe").animate ({opacity:"0", marginTop:" ", marginLeft:" "}, 250 );
	  //$("#home-globe").animate ({opacity:"1", marginTop:" ", marginLeft:" " }, 1500 );
}
$(document).ready(function(){
	$("X#sliderow a").click(function(){
		//alert('hi');
		$("#slides .slide").hide();
		return false;
	});
// 	$("#slide_btn1,#slide_btn2,#slide_btn3,#slide_btn4,#slide_btn5").hover(function(){
// 		$("#home-globe").animate({marginTop: '-=40px',marginLeft: '+=10px'}, 200); 
// 		
// 	}, function() {  
// 		$("#home-globe").animate({marginTop: '+=40px',marginLeft: '-=10px'}, 200); 
// 	});
	$("X#slide_btn1").click(function(){
		$("#slide1").show(400);
		moveGlobe();
	});
	$("X#slide_btn2").click(function(){
		$("#slide2").show(400);
		moveGlobe();
	});
	$("X#slide_btn3").click(function(){
		$("#slide3").show(400);
		moveGlobe();
	});
	$("X#slide_btn4").click(function(){
		$("#slide4").show(400);
		moveGlobe();
	});
	$("X#slide_btn5").click(function(){
		$("#slide5").show(400);
		moveGlobe();
	});
	$("#tab1A").click(function(){
		$("#tab1A_content").show();
		$("#tab1B_content").hide();
		$("#tab1A").addClass("selected");
		$("#tab1B").removeClass("selected");
		return false;
	});
	$("#tab1B").click(function(){
		$("#tab1B_content").show();
		$("#tab1A_content").hide();
		$("#tab1B").addClass("selected");
		$("#tab1A").removeClass("selected");
		return false;
	});
	$("#tab2A").click(function(){
		$("#tab2A_content").show();
		$("#tab2B_content").hide();
		$("#tab2A").addClass("selected");
		$("#tab2B").removeClass("selected");
		return false;
	});
	$("#tab2B").click(function(){
		$("#tab2B_content").show();
		$("#tab2A_content").hide();
		$("#tab2B").addClass("selected");
		$("#tab2A").removeClass("selected");
		return false;
	});

	$("#scroller").simplyScroll({
		autoMode: 'loop'
	});

	// VIDEOS
 	$("#video1").colorbox({speed:500, opacity:.5, inline:true, href:"#vid1"});
 	$("#video2").colorbox({speed:500, opacity:.5, inline:true, href:"#vid2"});
 	
	// Home Page FLIP
	
/*
	var nav_rollover = 0;
	$("#topnav a").hover(function () {
		nav_rollover = 1;
		$("#nav_rollover").slideDown(300);
		thisRollover = $(this).next().html();
		$("#nav_rollover").html(thisRollover);
	}, function () {
		nav_rollover = 0;
		setTimeout(function(){  
            if(!nav_rollover) $("#nav_rollover").fadeOut(200); 
        }, 200); 
		
	});
	$("#nav_rollover").hover(function () {
		nav_rollover = 1;
	}, function () {
		nav_rollover = 0;
		setTimeout(function(){  
           if(!nav_rollover) $("#nav_rollover").fadeOut(200); 
        }, 200); 
		
	});
*/

	var flip_rollover = 0;
	$("#pageflip").hover(function() { //On hover...
		flip_rollover = 1;
		$(".msg_block").stop()
			.animate({ //Animate and expand msg_block (Width + height)
				width: '147px',
				height: '147px'
			}, 1500,'easeOutBounce');
		$("#pageflip img").stop()
			.animate({ //Animate and expand the image (Width + height)
				width: '168px',
				height: '168px'
			}, 1500,'easeOutBounce');
	} , function() {
		$("#pageflip img").stop() //On hover out, go back to original size 50x52
			.animate({
				width: '61px',
				height: '61px'
			}, 800,'easeOutBounce');
		$(".msg_block").stop() //On hover out, go back to original size 50x50
			.animate({
				width: '52px',
				height: '52px'
			}, 800,'easeOutBounce'); //Note this one retracts a bit faster (to prevent glitching in IE)
	});
	// Automated OPEN:
		setTimeout(function(){  
            if(!flip_rollover) {
				$(".msg_block").stop()
					.animate({ //Animate and expand msg_block (Width + height)
						width: '147px',
						height: '147px'
					}, 1500,'easeOutBounce');
				$("#pageflip img").stop()
					.animate({ //Animate and expand the image (Width + height)
						width: '168px',
						height: '168px'
					}, 1500,'easeOutBounce');
			}
        }, 500);
        
	// Automated CLOSE:
// 		setTimeout(function(){  
//             if(!flip_rollover) {
// 				$("#pageflip img").stop() //On hover out, go back to original size 50x52
// 					.animate({
// 						width: '61px',
// 						height: '61px'
// 					}, 800,'easeOutBounce');
// 				$(".msg_block").stop() //On hover out, go back to original size 50x50
// 					.animate({
// 						width: '52px',
// 						height: '52px'
// 					}, 800,'easeOutBounce'); //Note this one retracts a bit faster (to prevent glitching in IE)
// 			}
//         }, 5000); 


});

