
// 'stacks' is the Stacks global object.
// All of the other Stacks related Javascript will 
// be attatched to it.
var stacks = {};


// this call to jQuery gives us access to the globaal
// jQuery object. 
// 'noConflict' removes the '$' variable.
// 'true' removes the 'jQuery' variable.
// removing these globals reduces conflicts with other 
// jQuery versions that might be running on this page.
stacks.jQuery = jQuery.noConflict(true);

// Javascript for stacks_in_197_page4
// ---------------------------------------------------------------------

// Each stack has its own object with its own namespace.  The name of
// that object is the same as the stack's id.
stacks.stacks_in_197_page4 = {};

// A closure is defined and assigned to the stack's object.  The object
// is also passed in as 'stack' which gives you a shorthand for referring
// to this object from elsewhere.
stacks.stacks_in_197_page4 = (function(stack) {

	// When jQuery is used it will be available as $ and jQuery but only
	// inside the closure.
	var jQuery = stacks.jQuery;
	var $ = jQuery;
	

// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// DOO A MAP STACK BY http://www.doobox.co.uk XXXXXXX
// COPYRIGHT@2010 MR JG SIMPSON, TRADING AS DOOBOX
// ALL RIGHTS RESERVED XXXXXXXXXXXXXXXXXXXXXXXXXXX
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



$(document).ready(function() {

var doomaplocation = "516-0016三重県伊勢市神田久志本町1551-1";
var doomaptype = "1";
if (doomaptype == 1){
doomaptype = "roadmap"}
else{
doomaptype = "hybrid"} 
var doomapwidth = "250";
var doomapheight = "250";
var doozoomlevel = "15";
var doomappincolor = "A21B1F";
var dooamap;
var doomaplabelborder = "E6E6E6";
var doomaplabelbackground = "E6E6E6";

	
function dootidylocation(doomaplocation) {
	doomaplocation = doomaplocation.replace(/\<\s*br\s*\/\>/g,',');
	doomaplocation = doomaplocation.replace(/[\s]+/g,'+');
	doomaplocation = doomaplocation.replace(/\s*\,+\s*/g,',');
	return $.trim(doomaplocation);
}

doomaplocation = dootidylocation(doomaplocation);

$('.stacks_in_197_page4mapplus').click(function() {
	doozoomlevel = parseInt(doozoomlevel) + 1;
	$("#stacks_in_197_page4 .stacks_in_197_page4mapcontainer img").remove();
	dooshowthemap();
});


$('.stacks_in_197_page4mapminus').click(function() {
	doozoomlevel = parseInt(doozoomlevel) - 1;
	$("#stacks_in_197_page4 .stacks_in_197_page4mapcontainer img").remove();
	dooshowthemap();
});


function dooshowthemap() {
var dooamap = "http://maps.googleapis.com/maps/api/staticmap?center=" + doomaplocation + "&zoom=" + doozoomlevel + "&size="+ doomapwidth +"x"+ doomapheight +"&maptype="+ doomaptype +"&markers=|color:0x"+doomappincolor+"|"+ doomaplocation +"&sensor=false";
// Append the map

$("#stacks_in_197_page4 .stacks_in_197_page4mapcontainer").append('<img src="'+ dooamap +'" id="#stacks_in_197_page4dooamap" alt="Loading Map..."/>');
}


dooshowthemap();


var doomaplabelwidth = "250" - ("96" * 2);
var doomaplabelheight = "250" - ("96" * 2);
var doomaplabelleftoffset = doomaplabelwidth / 2 + 3;
var doomaplabeltopoffset = doomaplabelheight / 2 + 3;
var doomapdirections = $('.stacks_in_197_page4directions').clone().html();


 
 $(".stacks_in_197_page4dooamaplabel").mouseenter(function() {
 if ($('.stacks_in_197_page4directions .stacks_in').length > 0){
    $('.stacks_in_197_page4dooamaplabel').css({
    "position" : "absolute",
	"width": doomaplabelwidth + "px",
	"height": doomaplabelheight + "px",
	"top": "50%",
	"left": "50%",
	"marginTop": "-" + doomaplabeltopoffset + "px",
	"marginLeft": "-" + doomaplabelleftoffset + "px",
	"background" : "#" + doomaplabelbackground,
	"border" : "3px solid #" + doomaplabelborder,
	"display":"none"
	});
	$('.stacks_in_197_page4dooamaplabel').append("<div class='stacks_in_197_page4temp'>" + doomapdirections + "</div>").fadeIn();
	if($('.stacks_in_197_page4dooamaplabel').width() < 50){
	$('.stacks_in_197_page4dooamapalert').css("display","block");
	}
	}
  }).mouseleave(function(){
     $('.stacks_in_197_page4dooamaplabel').css({
    "position" : "absolute",
	"width": "40px",
	"height": "40px",
	"top": "50%",
	"left": "50%",
	"marginTop": "-40px",
	"marginLeft": "-20px",
	"background" : "transparent url(files/mouseCapture.png)",
	"border" : "none"
	});
	$('.stacks_in_197_page4temp').remove();
  });





});





// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
// END DOOBOX DOO A MAP STACK XXXXXXXXXXXXXXXXX
// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
	return stack;
})(stacks.stacks_in_197_page4);



