	
// keep track opf gallery
var limit = 0;
var width;
var height;
var quadWidth;
var quadHeight;
	// preloading
	

	$(function(){
		$.viewportHeight = function() {
     		return self.innerHeight ||
        		jQuery.boxModel && document.documentElement.clientHeight ||
        		document.body.clientHeight;
   		};
   		$.viewportWidth = function(){
     		return self.innerWidth ||
        		jQuery.boxModel && document.documentElement.clientWidth ||
        		document.body.clientWidth;
        };
	height = $.viewportHeight();
	width = $.viewportWidth();
	quadWidth = $(window).width()/2 * .9;
	quadHeight = $(window).height()/2 * .9;
	$("#movie").css('top', $(window).height()/2 - 200);
    $("#movie").css('left', $(window).width()/2 - 275); 
	$("#skip").css('top',$(window).height()/2 + 245);
	$("#skip").css('left', $(window).width()/2 - 24); 
	$("#logo").css('left',$(window).width()/2 - 199);
	$("#address").css('left',-400);
	$("#address").css('top',$(window).height()/2);
	$("#triangle").css('left',$(window).width()/2 - 33);
	$("#triangle").css('top',$(window).height()/2 - 33);
	$("#prices").css('top',(height/2) * .05);
	$("#prices").css('width',quadWidth);
	$("#prices").css('height',quadHeight);
	$("#shop").css('left',((width/4) * 3) - (quadWidth/2));
	$("#shop").css('width',quadWidth);
	$("#shop").css('height',quadHeight);
	$("#map").css('top',(height/2) + (height/2 * .05));
	$("#map").css('left',-quadWidth);
	$("#map").css('width',quadWidth);
	$("#map").css('height',quadHeight);
	
	$("#skip").click(function(){
		movieFinished("");
	});

	$("#map").click(function(){
		window.location="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=%E9%8E%8C%E5%80%89%E5%B8%82%E9%95%B7%E8%B0%B72-17-21&sll=37.0625,-95.677068&sspn=47.033113,114.169922&ie=UTF8&hq=&hnear=%EF%BC%92%E4%B8%81%E7%9B%AE%EF%BC%91%EF%BC%97+%EF%BC%92%EF%BC%91%E9%95%B7%E8%B0%B7,+Kamakura+City,+Kanagawa+Prefecture,+Japan&z=16";
	});
	
});

function movieFinished(text){
	    var method1 = "easeOutQuad";//easeInQuad
		$("#movie").remove();
		$("#skip").hide();
	var lefty = $(window).width()/4 - 199;
	var uppy = $(window).height()/4 - 112;
	if (lefty < 1){
		lefty = 10;
	}
	if (uppy < 1){
		uppy = 10;
	}
	$("#logo").animate({left:lefty,top:uppy}, {duration: 2000, easing: method1});
	$("#address").animate({left:lefty,top:uppy+120},{duration:2000,easing:method1});
	$("#prices").animate({left:width/2 + (width/4*.1)},{duration:2000,easing: method1});
	$("#shop").animate({top:height/2 + (height/2 * .05)},{duration:2000,easing: method1});
	$("#map").animate({left:(width/2 * .05)},{duration:2000,easing: method1});
}



function load(page) {
	var load = window.open(page,'','scrollbars=no,menubar=no,height=500,width=600,resizable=no,toolbar=no,location=no,status=no');
}