
var g_highlight_rows=true;var mySlide=null;window.addEvent('domready',function(){$('top-nav').getElements('li.menu-item').addEvents({'mouseover':function(e){this.getElement('ul.sub-menu').addClass('sub-menu-over');},'mouseleave':function(e){this.getElement('ul.sub-menu').removeClass('sub-menu-over');}});if($('lang-bar')){var langSlide=new Fx.Slide('lang-bar');$('lang-sel').addEvent('click',function(e){e.stop();langSlide.toggle();});$('curr-lang').addEvent('click',function(e){e.stop();langSlide.toggle();});$('lang-bar').setStyle('display','block');langSlide.hide();}
highlight_rows();if($('help-box'))
{mySlide=new Fx.Slide('help-box');$('help-trig').addEvent('click',function(e){e=new Event(e);e.stop();mySlide.toggle();});$('help-box').setStyle('display','block');mySlide.hide();}
Element.implement({my_show:function(){this.setStyle('display','');},my_hide:function(){this.setStyle('display','none');}});$(document.body).getElements('a.in-mocha-win').each(function(item){item.addEvent('click',function(e){e=new Event(e).stop();var win_url=this.getProperty('href');var win_title=this.getProperty('title');var win_w=640;var win_h=320;var w_h_a=this.getProperty('rel');if(w_h_a!=null)
{w_h_a=w_h_a.split('x');if(w_h_a!=null)
{var win_w=w_h_a[0];var win_h=w_h_a[1];}}
if(this.hasClass('win-center'))
{var scroll=window.getScroll();var win_y=scroll.y+(window.getSize().y/2)-(win_h/2);var win_x=(window.getSize().x/2)-(win_w/2);}
else
{var pos=this.getPosition();var size=this.getSize();var win_x=pos.x;var win_y=pos.y+size.y+5;}
new MochaUI.Window({id:'additemfilewindow',title:win_title,loadMethod:'xhr',contentURL:win_url,type:'window',width:win_w,height:win_h,x:win_x,y:win_y,restrict:false,evalResponse:true,evalScripts:true,contentBgColor:'#ffffff',padding:{top:12,right:12,bottom:12,left:12},scrollbars:true});});});});function highlight_rows()
{if($(document.body).getElement('table.list'))
{var tab_e=$(document.body).getElement('table.list');if(tab_e)
{$(document.body).getElements('table.list').each(function(item){item.getElements('tr').each(function(e,i){if(e.getFirst('td'))
{e.addEvent('mouseenter',function(e){if(g_highlight_rows)
if(!this.hasClass('over'))
this.addClass('over');});e.addEvent('mouseleave',function(e){if(g_highlight_rows)
if(this.hasClass('over'))
this.removeClass('over');});}});});}}}
function pop_window(w_url,w_width,w_height,w_status)
{var w_args='scrollbars=yes,menubar=no';if(w_status==true)
w_args+='status=yes,';else
w_args+='status=no,';w_args+='width='+w_width+',';w_args+='height='+w_height+',';window.open(w_url,'',w_args);}
function generateGuid()
{var result,i,j;result='';for(j=0;j<32;j++)
{if(j==8||j==12||j==16||j==20)
result=result+'-';i=Math.floor(Math.random()*16).toString(16).toUpperCase();result=result+i;}
return result}
function print_error(err_msg)
{if($('error-row').hasClass('is-on')==false)
{$('error-row').my_show();$('error-row').addClass('is-on');}
var er=new Element('span',{'html':err_msg+'<br />'}).injectBottom('error-cnt');}
function print_error_in(err_msg,ele)
{if($(ele).hasClass('is-on')==false)
{$(ele).my_show();$(ele).addClass('is-on');}
var cont=ele.replace('row','cnt');var er=new Element('span',{'html':err_msg+'<br />'}).injectBottom(cont);}
var doMany=function()
{var request=new Request.JSON({url:'info.php?id='+$('up-id').getProperty('value')+'&f='+new Date().getTime(),method:'get',onComplete:function(response)
{if(response.started==1)
{$('prog-bar').setStyle('width',response.percent+'%');$('upload-perc').set('html',response.percent+'%');$('bytes-uploaded').set('html',response.bytes_uploaded_h);$('bytes-total').set('html',response.bytes_total_h);}}}).send();};window.addEvent('domready',function()
{$('user-copy-fields').addEvent('click',function(e){e=new Event(e).stop();$('u-street-contact').setProperty('value',$('u-street').getProperty('value'));$('u-zip-contact').setProperty('value',$('u-zip').getProperty('value'));$('u-city-contact').setProperty('value',$('u-city').getProperty('value'));$('u-state-contact').setProperty('value',$('u-state').getProperty('value'));$('u-country-contact').setProperty('value',$('u-country').getProperty('value'));});});
