function p_o(o){return document.getElementById(o);}
function tpg_f()
{for(var i=1;i<=tpgn;i++)
{if(p_o('TGal'+i).style.display=='block')
{if(i==tpgn)
{p_o('TGal'+i).style.display='none';p_o('TGal1').style.display='block';return;}
else
{var active_tpg=i+1;p_o('TGal'+i).style.display='none';p_o('TGal'+active_tpg).style.display='block';p_o('TGal'+active_tpg).innerHTML=topgal[active_tpg];return;}}}}
function tpg_p()
{for(var i=1;i<=tpgn;i++)
{if(p_o('TGal'+i).style.display=='block')
{if(i==1)
{p_o('TGal'+i).style.display='none';p_o('TGal'+tpgn).style.display='block';p_o('TGal'+tpgn).innerHTML=topgal[tpgn];return;}
else
{p_o('TGal'+i).style.display='none';p_o('TGal'+(i-1)).style.display='block';p_o('TGal'+(i-1)).innerHTML=topgal[(i-1)];return;}}}}
function tpg_next()
{if(tpgn>1)
{tpg_f();}}
function tpg_previous()
{if(tpgn>1)
{tpg_p();}}
function setHdrSrc(hwCH,hqRY){if(hwCH=="Web"){p_o('stop2').className='';p_o('stop1').className='wBt';p_o('stopa2').className='';p_o('topft2').action=hqRY;}
if(hwCH=="Image"){p_o('stop1').className='';p_o('stop2').className='wBt';p_o('stopa2').className='nb';p_o('topft2').action=hqRY;}}
function setFtrSrc(fwCH,fqRY){if(fwCH=="Web"){p_o('stopf2').className='';p_o('stopf1').className='wBt';p_o('stopfa2').className='';document.btmSrcFrm.action=fqRY;}
if(fwCH=="Image"){p_o('stopf1').className='';p_o('stopf2').className='wBt';p_o('stopfa2').className='nb';document.btmSrcFrm.action=fqRY;}}
function submitHeaderSearch(event){if(event=="onclick"||eventIsEnterKey(event)){omo('topsrchbut','topsrch_enter');}else{return true;}}
function submitFooterSearch(event){if(event=="onclick"||eventIsEnterKey(event)){omo('topsrchbut','topsrch_enter');}else{return true;}}
function eventIsEnterKey(event){if(event&&event.which==13||window.event&&window.event.keyCode==13||event&&event.which==3||window.event&&window.event.keyCode==3){return true;}
return false;}
function setHomePageSkin(url,skinName){var compURL=url+"/"+"main/"+skinName+"_v1/"+skinName+"_v1.css";if(document.createStyleSheet){document.createStyleSheet(compURL);document.getElementById("bd").className=skinName;}
else{var styles="@import url(compURL);";var newSS=document.createElement('link');newSS.rel='stylesheet';newSS.href=compURL;newSS.type="text/css";newSS.media="all";document.getElementsByTagName("head")[0].appendChild(newSS);document.getElementById("bd").className=skinName;}}
function Weathertest(id,url,outputdiv)
{var name="";name=document.getElementById(id).value;if(name=="")
{alert("地域を入力しなおしてください");return false;}
name=name.replace(/&/g,"#");name=name.replace(/\?/g,"#");name=encodeURIComponent(name);url+="/"+name+"/";Set_CookieWeather("weather",name,'','/');AJAXmakeReq(url,outputdiv);}
var ajax_req=false;function AJAXmakeReq(url,outputHere){ajax_req=false;if(window.XMLHttpRequest){ajax_req=new XMLHttpRequest();if(ajax_req.overrideMimeType){ajax_req.overrideMimeType('text/xml');}}else if(window.ActiveXObject){try{ajax_req=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{ajax_req=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(!ajax_req){alert('サーバー接続エラー');return false;}
ajax_req.onreadystatechange=outputReq;ajax_req.open('GET',url,true);ajax_req.send(null);function outputReq(){try{if(ajax_req.readyState==4){if(ajax_req.status==200){var response=ajax_req.responseText;var outputDiv=document.getElementById(outputHere);outputDiv.innerHTML=response;document.getElementById('getwth').style.display='none';}else{alert('リクエストされた地域は確認できませんでした');}}}
catch(e){}}}
function Set_CookieWeather(name,value,expires,path)
{var oldValue=readCookie(name);var newValue=value;createCookie(name,encodeURI(newValue),'','/');}
function Set_Cookie(name,value,expires,path)
{var oldValue=readCookie(name);var newValue=value;if(oldValue!=null)
{createCookie(name,'','',-1);newValue=escape(newValue+",")+oldValue;}
createCookie(name,newValue,'','/');}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)
{return c.substring(nameEQ.length,c.length);}}
return null;}
function createCookie(name,value,expires,path)
{var today=new Date();today.setTime(today.getTime());if(expires)
{expires=expires*1000*60*60*24;}
var expires_date=new Date(today.getTime()+(expires));document.cookie=name+"="+value+
((expires)?";expires="+expires_date.toGMTString():"")+
((path)?";path="+path:"");}
function setAsHomePage(siteName,alternatePage)
{if(navigator.appName=="Microsoft Internet Explorer"){elementArray=document.getElementById("om_jumpbar").getElementsByTagName("a");element=elementArray[0];element.style.behavior='url(#default#homepage)';element.setHomePage(siteName);}
else{var theUrl=domainURLString+alternatePage;window.location.href=theUrl;return false;}}
var NewsBlock=function(containerId,curEle,totalEle,timeDelay)
{this.containerId=containerId;this.curElement=curEle;this.totalElements=totalEle;this.TGPsecs=0;this.TGPtimerRunning=false;this.TGPtimerID="";this.id=this.containerId;window[this.id]=this;var TGPdelay=timeDelay;var setElement=1;this.TGPmovieTrailler=function(setElement)
{if(this.curElement>this.totalElements)
{this.curElement=1;}
if(parseInt(setElement)>=1)
{this.curElement=parseInt(setElement);}
for(var z=1;z<=this.totalElements;z++)
{var id1=this.containerId+"_tc"+z;if(this.q_o(id1)){this.q_o(id1).style.display="none";}
var sty=this.containerId+"_t"+z;if(this.q_o(sty))
{this.q_o(sty).className="";this.q_o(sty).firstChild.className="";}}
id1=this.containerId+"_tc"+this.curElement;if(this.q_o(id1)){p_o(id1).innerHTML = ptGal[this.curElement-1];this.q_o(id1).style.display="block";}
sty=this.containerId+"_t"+this.curElement;if(this.q_o(sty)){this.q_o(sty).className="active";this.q_o(sty).firstChild.className="activeLnk";}}
this.TGPInitializeTimer=function(){this.TGPsecs=1;this.TGPStopTheClock();this.TGPStartTheTimer();}
this.TGPStopTheClock=function(){if(this.TGPtimerRunning){clearTimeout(this.TGPtimerID);}
this.TGPtimerRunning=false;}
this.TGPStartTheTimer=function(){if(this.TGPsecs==0){this.TGPInitializeTimer();if(this.curElement<this.totalElements)
{this.curElement=this.curElement+1;}else
{this.curElement=1;}
this.TGPmovieTrailler();}else
{this.TGPsecs=this.TGPsecs-1;this.TGPtimerRunning=true;this.TGPtimerID=setTimeout("window."+this.id+".TGPStartTheTimer()",TGPdelay);}}
this.q_o=function(o){if(document.getElementById(o))
{return document.getElementById(o);}else
{return false;}}
this.TGPPause=function(){this.TGPStopTheClock();}
this.TGPResume=function(){this.TGPInitializeTimer();}
this.TGPShow=function(setElement)
{if(this.curElement>this.totalElements)
{this.curElement=1;}
if(parseInt(setElement)>=1)
{this.curElement=parseInt(setElement);}
for(var z=1;z<=this.totalElements;z++)
{var id1=this.containerId+"_tc"+z;if(this.q_o(id1)){this.q_o(id1).style.display="none";}
var sty=this.containerId+"_t"+z;if(this.q_o(sty)){this.q_o(sty).className="";this.q_o(sty).firstChild.className="";}}
id1=this.containerId+"_tc"+this.curElement;if(this.q_o(id1)){p_o(id1).innerHTML = ptGal[this.curElement-1];this.q_o(id1).style.display="block";}
sty=this.containerId+"_t"+this.curElement;if(this.q_o(sty)){this.q_o(sty).className="active";this.q_o(sty).firstChild.className="activeLnk";}
this.TGPStopTheClock();}}
var elmid = "";
function p_o(o){return document.getElementById(o);}
function activateTab(id,mod,no_tabs){for(var i=1;i<=no_tabs;i++){if(p_o(mod+"_tc"+i)){if(id==i){if(mod=="tosnews1"){p_o(mod+"_tc"+i).innerHTML = nwsMod1[i-1]; elmid = p_o(mod+"_tc"+i); setTimeout("preLoadIE()",1);}if(mod=="tosnews"){p_o(mod+"_tc"+i).innerHTML = popBlg[i-1]; elmid = p_o(mod+"_tc"+i); setTimeout("preLoadIE()",1);}p_o(mod+"_tc"+i).style.display="block";p_o(mod+"_t"+i).className="active";}else{p_o(mod+"_tc"+i).style.display="none";p_o(mod+"_t"+i).className="";}}}}
function preLoadIE(){
 if(document.all){
  var iTags = elmid.getElementsByTagName('img');  
  for(var k=0; k < iTags.length; k++){ 
   return (function(k,elmid){
    return function(){
     var temp = new Image();
     temp.src = iTags[k].src;
     iTags[k].src = temp.src;
     }();
   })(k,elmid)
  }
 }
}


var thmmoretxt;
var thmclosetxt;
var thmcrslOn = false;
function themeCarouselTog(moretxt,closetxt,skin){
    thmmoretxt =  moretxt;
    thmclosetxt = closetxt;
    var thmmr = $("#mrThmA")[0];
    if(thmmr.className == "opnn"){
        slideDown("#themechooserWr");
        if(!thmCarouselInit) {
            $("#thmPrLdng").prepend(thmPreLdImg).show();
        }
        loadThemeChooser(skin);
        $("#mrThmA").html(closetxt);
        thmmr.className="clps";
        thmcrslOn = true;
    } else {
        slideUp("#themechooserWr");
        $("#mrThmA").html(moretxt);
        thmmr.className="opnn";
        thmcrslOn = false;
    }
}
function themeCarouselInlineDisable() {
    $.get(addState('ajax.jsp?module=themechooserinline'))
}
function loadThemeChooser(skin) {
    if(!thmCarouselInit) {
        slideDown("#thmCrslWr");
    } else {
        slideDown("#thmCrslWr");
    }
}
var thmCarouselInit=false;
if (jQueryEnabled){
    $(document).ready(function(){
        $(document).click(function(){
            if (thmcrslOn){
                themeCarouselTog(thmmoretxt,thmclosetxt);
            }
        });
        $("#themechooserWr").click(function(e) {
            cb(e);
        });
        $("#thm .sca").click(function(e) {
            cb(e);
        });

    });
}

/* FED - Global search autocomplete v1.3
	name : globalSearchBox
	file : jquery.globalsearchbox-d.js
	author : Ali Hasan
	(c) Copyright 2009 AOL LLC
	$LastChangedDate: 2009-11-17 16:02:38 -0500 (Tue, 17 Nov 2009) $
	$Rev: 132896 $
*/
(function(a){a.fn.globalSearchBox=function(d){var c={apiUrl:"http://autocomplete.search.aol.com/autocomplete/get",apiIt:"ops-test",apiOutput:"json",apiCount:8,apiQueryParam:"q",apiDictionary:"",ui_form:"#GH_search_form",ui_input:"#GH_search_field",ui_submit:"#GH_search_button",ui_output:"#GH_search_results",initSmartSearch:true,ghostText:"",preserveGhostText:false,initFocus:false,fn:{}},e={},h=this,g={},f={ghostText:"",query:"",results:[],highlight:-1,$highlight:null,timer:null},b={init:function(i){g.$c=a(i);g.$input=a(e.ui_input);g.$output=a(e.ui_output);g.form=a(e.ui_form)[0];g.submit=a(e.ui_submit)[0];f.ghostText=(e.ghostText!=="")?e.ghostText:g.$input.val();g.$input.attr("autocomplete","off").bind("focus.GH",function(j){b.processInputFocus(j)}).bind("blur.GH",function(j){b.processInputBlur(j)});a(g.form).bind("submit.GH",function(j){b.selectSuggestion(j)});if(e.initSmartSearch){e.apiUrl=e.apiUrl+"?it="+e.apiIt+"&count="+e.apiCount+"&output="+e.apiOutput;if(e.apiDictionary!==""){e.apiUrl=e.apiUrl+"&dict="+e.apiDictionary}g.$input.bind("keyup.GH",function(j){b.processKeyPress(j)});g.$output.bind("mouseover.GH",function(j){b.moveHighlightMouse(j)}).bind("mouseover.GH",function(j){b.suspendBlurDetection(j)}).bind("mouseleave.GH",function(j){b.resumeBlurDetection(j)}).bind("click.GH",function(j){b.selectSuggestion(j)})}if(e.initFocus){g.$input.focus()}if(e.preserveGhostText){g.$label=a("<label />").attr("id","GH_search_label").text(f.ghostText).appendTo(g.form);g.$label.bind("click.GH_SL",function(j){b.preserveGhostText(true)});g.$input.bind("keyup.GH_SL",function(j){b.preserveGhostText(j)}).bind("click.GH_SL",function(j){b.preserveGhostText(j)}).bind("blur.GH_SL",function(j){setTimeout(function(){b.preserveGhostText(j)},250)})}},getVars:function(){return{options:e,ui:g,local:f}},processInputFocus:function(i){g.$input.addClass("GH_search_active").val((g.$input.val()===f.ghostText)?"":g.$input.val())},processInputBlur:function(i){g.$input.removeClass("GH_search_active").val((g.$input.val()==="")?f.ghostText:g.$input.val());b.displaySuggestions()},preserveGhostText:function(i){if(typeof i==="boolean"&&i){g.$input.focus()}g.$input.unbind("keyup.GH_SL").unbind("click.GH_SL").unbind("blur.GH_SL");g.$label.remove()},processKeyPress:function(l){var j=l.keyCode;if(j===38){b.moveHighlightKey(-1)}else{if(j===40){b.moveHighlightKey(1)}else{var i=l.target,k=a.trim(i.value);if(k!==""){if(f.timer!==null){clearTimeout(f.timer)}f.timer=setTimeout(function(){b.getSuggestions(k)},200)}else{b.displaySuggestions()}}}},moveHighlightKey:function(j){if(f.$highlight!==null){f.$highlight.removeClass("GH_highlight")}f.highlight=f.highlight+j;if(f.highlight>=f.results.length||f.highlight===-1){f.highlight=-1;g.$input.val(f.query)}else{if(f.highlight<-1){f.highlight=f.results.length-1}}if(f.highlight>-1){f.$highlight=a(f.results[f.highlight]);f.$highlight.addClass("GH_highlight");g.$input.val(f.$highlight.text())}},moveHighlightMouse:function(j){var i=j.target;if(i.nodeName==="B"){i=i.parentNode}if(f.$highlight!==null){f.$highlight.removeClass("GH_highlight")}f.highlight=f.results.index(i);f.$highlight=a(i).addClass("GH_highlight")},selectSuggestion:function(j){j.preventDefault();if(j!==undefined&&j.type==="click"){var i=j.target;if(i.nodeName==="B"){i=i.parentNode}g.$input.val(a(i).text())}if(g.$input.val()!==""&&g.$input.val()!==f.ghostText){g.form.submit()}},getSuggestions:function(j){var i=e.apiUrl+"&"+e.apiQueryParam+"="+j;a.ajax({dataType:"jsonp",url:i,jsonp:"cb",success:function(k){b.displaySuggestions(k)},error:function(){b.displaySuggestions()}})},suspendBlurDetection:function(){g.$input.unbind("blur.GH")},resumeBlurDetection:function(){g.$input.bind("blur.GH",function(i){b.processInputBlur(i)})},displaySuggestions:function(p){f.highlight=-1;f.$highlight=null;if(p!==undefined&&p[1].length>0){f.query=p[0];var o=p[1],j=a("<ul />"),m,k=o.length,n=new RegExp(f.query,"i"),q="<b>"+f.query+"</b>";for(m=0;m<k;m++){a("<li />").html(o[m].replace(n,q)).appendTo(j)}f.results=j.find("li");g.$output.empty().append(j).fadeIn("fast")}else{f.query="";f.results=[];g.$output.fadeOut("fast").empty()}}};a.extend(true,e,c,d);a.extend(true,b,e.fn);b.init(h);return h}})(jQuery);

