  
  
  
  
//IE6画像ちらつき  
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

  
//TAB変更のJavascript  
  
$(function(){
	$(".TabAreaSet").each(function(){
		var TabAreaAmount = $(this).find(".TabAreaChgMenu").children("li").length;
		var ActiveTabNo;
		for(i=0;i<TabAreaAmount;i++){
			if($(this).find(".TabAreaChgMenu li").eq(i).attr("class") == "On"){
				ActiveTabNo = i;
			}
		}
		for(i=0;i<TabAreaAmount;i++){
			if(i!=ActiveTabNo){
				// $(this).find(".TabAreaContents").eq(i).hide();
			}
		}
		$(this).find(".TabAreaChgMenu li a").click(function(){
			$(this).parents("li").eq(0).addClass("Clicked");
			var ClickedTabNo;
			for(i=0;i<TabAreaAmount;i++){
				if(
					$(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).attr("class")!=null
					&& $(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).attr("class").indexOf("Clicked")!=-1
				){
					ClickedTabNo = i;
					$(this).parents("li").eq(0).removeClass("Clicked");
					$(this).parents("li").eq(0).addClass("On");
				}else if($(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).attr("class")!=null){
					$(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgMenu li").eq(i).removeClass("On");
				}
			}
			for(i=0;i<TabAreaAmount;i++){
				if(i!=ClickedTabNo){
					// $(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgContents").eq(0).find(".TabAreaContents").eq(i).hide();
				}
			}
			// $(this).parents(".TabAreaSet").eq(0).find(".TabAreaChgContents").eq(0).find(".TabAreaContents").eq(ClickedTabNo).show();
			// return false;
		});
	});
});



function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}

// popUpメニュー 2010/08/19 S.Yamaguchi

function popUp(obj, id, x) {

    var elm = document.getElementById(id);
    var elmOya = obj;
    var popTop = 0;
    var popLeft = 0;
    
    elm.style.display = 'block';
    elm.style.position = 'absolute';

    // offsetTop だとずれる事があったので getBoundingClientRect に変更 2010/08/24 S.Yamaguchi

    /*
    
    do {
        popTop += elmOya.offsetTop || 0;
        popLeft += elmOya.offsetLeft || 0;
        elmOya = elmOya.offsetParent;
    } while (elmOya);

    elm.style.top = popTop + 'px';
    elm.style.left = (popLeft + x) + 'px';

    */

    var pos = obj.getBoundingClientRect();
    var html = document.documentElement;
    var body = document.body;

    elm.style.top = (pos.top + (body.scrollTop || html.scrollTop) - html.clientTop - 30) + 'px';
    // pos.topが+30ほどずれる環境があるため、固定値に変更 2010/08/24 S.Yamaguchi
    elm.style.top = '90px';
    elm.style.left = (pos.left + ((body.scrollLeft || html.scrollLeft) - html.clientLeft) + x) + 'px';
}

function popDown(id) {
    document.getElementById(id).style.display = 'none';
}





