
function ygmaDisplaySearchToggle(){
var ulygpw=document.getElementById('ygpw');
var ygmalogo=document.getElementById('ygmalogo');
ulygpw.style.display='block';
ygmalogo.style.marginTop='10px';
}
function ygmaToggleSearch(ygmaIsPropSearchFirst){
var ulygpw=document.getElementById('ygpw');
var f=document.forms.yhdr_form;
var b=f.elements.yhdr_submit_button;
var aHtml=[];
if(ygmaIsPropSearchOn){
if(ygmaIsPropSearchFirst){
aHtml.push('<li id="propsearch"><a id="awebsearch" class="off last" onclick="ygmaToggleSearch(ygmaIsPropSearchFirst);return false;" href="">'+ygmaPropName+'</a></li>');
aHtml.push('<li id="websearch" class="on">Web</li>');
}else{
aHtml.push('<li id="propsearch" class="on">Web</li>');
aHtml.push('<li id="websearch"><a id="awebsearch" class="off last" onclick="ygmaToggleSearch(ygmaIsPropSearchFirst);return false;" href="">'+ygmaPropName+'</a></li>');
}
f.action=ygmaWebAction;
b.value='Web Search';
b.title='Web Search';
ygmaIsPropSearchOn=false;
}else{
if(ygmaIsPropSearchFirst){
aHtml.push('<li id="propsearch" class="on">'+ygmaPropName+'</li>');
aHtml.push('<li id="websearch"><a id="awebsearch" class="off last" onclick="ygmaToggleSearch(ygmaIsPropSearchFirst);return false;" href="">Web</a></li>');
}else{
aHtml.push('<li id="propsearch"><a id="awebsearch" class="off last" onclick="ygmaToggleSearch(ygmaIsPropSearchFirst);return false;" href="">Web</a></li>');
aHtml.push('<li id="websearch" class="on">'+ygmaPropName+'</li>');
}
f.action=ygmaPropAction;
b.value=ygmaPropName+' Search';
b.title=ygmaPropName+' Search';
ygmaIsPropSearchOn=true;
}
ulygpw.innerHTML=aHtml.join('');
}
function updateEvent(dNode,sAction,fAction,bCapture,bState){
if(dNode.addEventListener){
if(bState){
dNode.addEventListener(sAction,fAction,bCapture);
}else{
dNode.removeEventListener(sAction,fAction,bCapture);
}
return true;
}else if(dNode.attachEvent){
var r=null;
if(bState){
r=dNode.attachEvent('on'+sAction,fAction);
}else{
r=dNode.detachEvent('on'+sAction,fAction);
}
return r;
}else{
dNode['on'+sAction]=bState?fAction:null;
}
}
function ygmaAnimateHelp(bState){
var dHelp=document.getElementById('ygmamu');
var fN=function(e){
e=window.event||e;
var dNode=e.srcElement||e.target;
if(dNode.id!='ygmamorelink'&&dHelp.style.display=='block'){
updateEvent(document,"click",fN,true,false);
ygmarndrmu('ygmamu',null);
}
};
updateEvent(document,"click",fN,true,true);
}
function ygmarndrmu(){
var dHelp=document.getElementById('ygmamu');
var bState=dHelp.style.display=='block'?true:false;
dHelp.style.display=bState?'none':'block';
var ygmaTopXY=YAHOO.util.Dom.getXY('ygmatop');
var mLinkxy=YAHOO.util.Dom.getRegion("ygmamorelink");
dHelp.style.left=((mLinkxy.left-5)-ygmaTopXY[0])+'px';
dHelp.style.top=((mLinkxy.bottom+5)-ygmaTopXY[1])+'px';
if(!bState){
ygmaAnimateHelp(bState);
}
}