// JavaScript Document
//USBxml読み込みよう

function open_up() {
   	jQuery(this).css("background-position","-26px right");
}
function open_down() {
   	jQuery(this).css("background-position","top right");
}

function setNews(){
  	//初期設定
	var inH = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight)-400;
	jQuery("#back_ct").css("height","8em");
	jQuery("#openOsirase").toggle(
		function () {
   			jQuery(this).next("#osiraseBox").animate({height: inH},500);
			jQuery("img",this).replaceWith("<img src='/img/gt/btn_close.gif' class='btn_oc'>");
 	 	},
  		function () {
   			jQuery(this).next("#osiraseBox").animate({height: "10em"},200);
			jQuery("img",this).replaceWith("<img src='/img/gt/btn_open.gif' class='btn_oc'>");
  		}
	);
	jQuery("#openNews").toggle(
		function () {
   			jQuery(this).next("#newsBox").animate({height: inH},500);
			jQuery("img",this).replaceWith("<img src='/img/gt/btn_close.gif' class='btn_oc'>");
 	 	},
  		function () {
   			jQuery(this).next("#newsBox").animate({height: "10em"},200);
			jQuery("img",this).replaceWith("<img src='/img/gt/btn_open.gif' class='btn_oc'>");
  		}
	);
	jQuery("#openOsirase").hover(open_up,open_down);
	jQuery("#openNews").hover(open_up,open_down);
}




function popU(){
	jQuery("div.usbPop", this).animate({opacity: "show", bottom: "40px"},200);
	jQuery("div.usbPop0", this).animate({opacity: "show", bottom: "40px"},200);
	jQuery(this).animate({bottom: "10px"},100,function(){jQuery(this).animate({bottom: "0px"},200)});
}
function popD(){		
	jQuery("div.usbPop", this).hide().css("bottom","0px");
	jQuery("div.usbPop0", this).hide().css("bottom","0px");				
	jQuery(this).animate({bottom: "0px"},200);
}


function setUsb(p){
	for (i = 0; i < p; i++) {
    	jQuery('#usb'+i).hover(popU,popD);
	}
	jQuery('#listening').hover(popU,popD);
	jQuery('#jimaku').hover(popU,popD);
	jQuery('#umemo').hover(popU,popD);
	jQuery('#zero').hover(popU,popD);
	jQuery('#excel').hover(popU,popD);
	jQuery('#eco').hover(popU,popD);
	jQuery('#tf').hover(popU,popD);
	jQuery('#mail').hover(popU,popD);
}
