$(document).ready(function(){


// flatheights ////////////////////////////////////////

var sets = [], temp = [];
$('#boxWrapper > .containerBox').each(function(i) {
	temp.push(this);
	if (i % 2 == 1) {
	sets.push(temp);
	temp = [];
	}
    });



if (temp.length) sets.push(temp);
$.each(sets, function() {
	$(this).flatHeights();
});


$('#report > div').flatHeights();
$('#blogWrapper > div').flatHeights();
$('.lbEntry').flatHeights();
$('.p01').flatHeights();

//safari Scroll bar fix////////////////////////////////////////
if(jQuery.browser.safari){
	$CH = $('body').height();
	$WH = $(window).height();
	if($CH <= $WH){$('body').css('margin','0 15px 0 0');}
	$(window).resize(function(){
		$CHR = $('body').height();
		$WHR = $(window).height();
		if($CHR <= $WHR ){$('body').css('margin','0 15px 0 0');}
		else {$('body').css('margin','0');}
	});
}

//faq slidedown ////////////////////////////////////////
//$('.faq').each(function() {
//	$(this).children('h3 a').click(function(){
//	$(this).parent('.faq').children('.paragraph').slideToggle(100);
//});											
//});

//h3 rounded corner ////////////////////////////////////////

//$('#mainContent h3').corner('3px');


//End of doccument ready ////////////////////////////////////////
});

//smartRolloverIMG////////////////////////////////////////

function smartOver() {
smartRollover('wrapper');
}
function smartRollover(idName) {
if(document.getElementsByTagName) {
var images = document.getElementById(idName).getElementsByTagName("img");
for(var i=0; i < images.length; i++) {

if(images[i].getAttribute("src").match(/_default\./))
{
fileName = new Array(images[i].getAttribute("src").replace("_default.", "_over."));
preImages = new Array();
for (j=0; j<fileName.length; j++)
{
preImages[j] = new Image();
preImages[j].src = fileName[j];	 //「_on」の画像をプリロード
}

images[i].onmouseover = function() {
this.setAttribute("src", this.getAttribute("src").replace("_default.", "_over."));
}
images[i].onmouseout = function() {
this.setAttribute("src", this.getAttribute("src").replace("_over.", "_default."));
}
}
}
}
}
if(window.addEventListener) {
window.addEventListener("load", smartOver, false);
}
else if(window.attachEvent) {
window.attachEvent("onload", smartOver);
}
else{
window.onload = smartOver;
}

