var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;

$(document).ready(function() 
{
	$(".bluebox").backgroundCanvas(); 
});

// Draw the background  on load and resize
$(window).load(function () 
{ 	
	drawBackground(); 

	// make sure this is last as it throws an error in IE8
	$('img.map').maphilight({
		fade: false,
		fillColor: '006400',
		fillOpacity: 0.2,
		stroke: true,
		strokeColor: '006400', /*53C832*/
		strokeOpacity: 1,
		strokeWidth: 3
	});


});

$(window).resize(function()
{
	drawBackground(); 
});

function drawBackground()
{
	$(".bluebox").backgroundCanvasPaint(blueBox); 
}

//drawing bluebox
function blueBox(context, width, height, canvas, $canvas, $canvasDiv, $content, $element ) 
{
		var options = {x:0, height: height, width: width, radius:14,  border: 0 };
		var backgroundGradient = context.createLinearGradient(0, 0, 0, height - 2);
		backgroundGradient.addColorStop(0 ,'#EEEEFF');
		backgroundGradient.addColorStop(1, '#AAAAFF');
		context.fillStyle = "#9999EF";
		
		// Draw the blue border rectangle 
		$.canvasPaint.roundedRect(context,options);
		
		// Draw the gradient filled inner rectangle
		options.border = 1;
		context.fillStyle = backgroundGradient; 
		$.canvasPaint.roundedRect(context,options);
}

$(function (){ 
			
// slideshow
    $("#controller").jFlow({
        slides: "#slides",
        width: "350px",
        height: "240px",
		controller: ".jFlowControl", 
		slideWrapper : "#jFlowSlide", 
		selectedWrapper: "jFlowSelected",
		duration: 400,
		prev: ".jFlowPrev", 
		next: ".jFlowNext" 
    });
	
// makes IE release the button state 
  	$(".release").click(function() { 
	$(this).blur();
  });

	$("#infomenu dd").hide();
	$("#infomenu dt a").hover(function(){
			$("#infomenu dd:visible").slideUp("slow");
			$(this).parent().next().slideDown("slow");
	});
	
	$("#dial").click(function() { 
	window.location="/kinkyuu/";
  });

});
