
vBShop_Admin_Obj=function()
{this.previews={};this.image_preview=function(name,url)
{var selectMatches=new RegExp('^sel_'+name+'_(\\d+)$','i');var selects=fetch_tags(document,'select');for(var s=0;s<selects.length;s++)
{if(selects[s].id.match(selectMatches))
{this.previews[selects[s].id]={'prev':name,'url':url};previmg=document.createElement('img');previmg.style.paddingLeft='10px';previmg.style.verticalAlign='middle';previmg.id=name;selects[s].onchange=function(){vBShop_Admin.image_change(this);};selects[s].parentNode.appendChild(previmg);this.image_change(selects[s]);break;};};};this.image_change=function(sel)
{if(data=vBShop_Admin.previews[sel.id])
{YAHOO.util.Dom.get(data['prev']).src=data['url']+sel.options[sel.options.selectedIndex].value;};};this.toggleRadio=function(theForm,checkVal,include)
{this.toggleAll(theForm,'radio',checkVal,include,true);};this.toggleAll=function(theForm,theType,checkVal,include,val)
{for(var i=0;i<theForm.elements.length;i++)
{var btn=theForm.elements[i];if(btn.type==theType&&btn.name.indexOf(include,0)!=-1)
{switch(theType)
{case"radio":if(btn.value==checkVal)
{btn.checked=val;}
break;case"select-one":btn.selectedIndex=val;break;default:btn.checked=val;break}}}};};var vBShop_Admin=new vBShop_Admin_Obj();