/* Copyright © Cutrope.com. All Rights Reserved. */
if(!window.ART){var ART={in_process:false,y_pos:0,x_pos:0,global_dimmer:false,_f_guid:0,txt_regexp:/^([a-zA-Z]+)$/,email_regexp:/^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/,url_regexp:/^(http(s?):\/\/|ftp:\/\/{1})(([a-zA-Z0-9\-]+\.){1,}([a-zA-Z0-9\-]+\.){1,})[a-zA-Z]{2,}$/i,url_regexp_loose:/^(http(s?):\/\/|ftp:\/\/{1})(([a-zA-Z0-9\-]+\.){1,})[a-zA-Z\/]{2,}$/i,url_regexp_articles:/^(http(s?):\/\/|ftp:\/\/{1})(([a-zA-Z0-9\-]+\.){1,})([a-zA-Z0-9]+\/){1}(([a-zA-Z0-9\/\-_#=\?]+)((\.[a-zA-Z]+)?)(([a-zA-Z0-9\/\-\?_#=]+)?))$/i,_agent:navigator.userAgent.toLowerCase(),_agent_version:navigator.productSub,is_ie:function(){return(ART._agent.indexOf("msie")!=-1&&ART._agent.indexOf("opera")==-1);},is_safari:function(all){if(all)return ART._agent.indexOf("khtml");return(ART._agent.indexOf("khtml")!=-1&&ART._agent.match(/3\.\d\.\d safari/)==null);},is_opera:function(){return ART._agent.indexOf("opera")!=-1;},is_mozilla:function(){return(ART._agent.indexOf("gecko")!=-1&&ART._agent_version>=20030210);},is_mac:function(){return(ART._agent.indexOf('macintosh')!=-1);},is_camino:function(){return(ART._agent.indexOf("camino")!=-1);},is_defined:function(_var){return(_var!="undefined"&&_var!=null);},is_array:function(_var){return _var instanceof Array;},is_string:function(_var){return(typeof _var=='string');},is_number:function(_var){return(typeof _var=='number');},is_numeric:function(_text){var val_chars='0123456789.';var is_num=true;for(i=0;((i<_text.length)&&(is_num==true));i++){if(val_chars.indexOf(_text.charAt(i))==-1)is_num=false;break;}return is_num;},is_object:function(_var){return(typeof _var=='object');},url_encode:function(str){return encodeURIComponent(str.toString());},is_dict:function(o){var str=String(o);return str.indexOf(" Object")!=-1;},is_function:function(_var){return(typeof _var=='function');},mod:function(x,y){return x-Math.floor(x/y)*y;},num_to_dollar:function(num){var prefix="$";var suffix="";if(num<0){prefix="($";suffix=")";num=-num;}var temp=Math.round(num*100.0);if(temp<10)return prefix+"0.0"+temp+suffix;if(temp<100)return prefix+"0."+temp+suffix;temp=prefix+temp;return temp.substring(0,temp.length-2)+"."+temp.substring(temp.length-2)+suffix;},format_percent:function(num,places){num=num*100;if(places)num=ART._round(num,places);else{num=ART._round(num,2);num=ART.format_currency(num);}num+='%';return num;},_round:function(num,places){if(!ART.is_number(num))return 0;num=num.toString();arrnum=num.split(".");if(arrnum.length==1)return num;if(places)num=Math.round(num*Math.pow(10,places))/Math.pow(10,places);else num=Math.round(num);return num;},format_currency:function(figure){if(!figure||figure.length==0)return'0.00';var strTemp=figure.toString();while(strTemp.indexOf(",")>-1){strTemp=strTemp.replace(",","");}strTemp=parseFloat(strTemp);figure=ART._round(figure,2);figure=figure.toString();var place=figure.indexOf(".");if(place>-1){if((figure.length-place)==2)figure+="0";}else figure+='.00';if(figure=='0.00')return'';return figure;},add_commas_to_num:function(_num,_remainder){if(!_num)return;var num=_num.split('.');var _before_decimal='';var _after_decimal='';_before_decimal=num[0];if(_remainder)_after_decimal=num.length>1?'.'+num[1]:'';var rgx=/(\d+)(\d{3})/;while(rgx.test(_before_decimal)){_before_decimal=_before_decimal.replace(rgx,'$1'+','+'$2');}return _before_decimal+_after_decimal;},page_width:function(){return window.innerWidth!=null?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:document.body!=null?document.body.clientWidth:null;},page_height:function(){return window.innerHeight!=null?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:document.body!=null?document.body.clientHeight:null;},pos_left:function(){return typeof window.pageXOffset!='undefined'?window.pageXOffset:document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft?document.body.scrollLeft:0;},pos_top:function(){return typeof window.pageYOffset!='undefined'?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop?document.body.scrollTop:0;},pos_right:function(){return ART.pos_left()+ART.page_width();},pos_bottom:function(){return ART.pos_top()+ART.page_height();},scroll_height:function(){return document.documentElement.scrollHeight;},scroll_width:function(){return document.documentElement.scrollWidth;},cursor_pos:function(e){var posx=0;var posy=0;if(!e)var e=window.event;if(e.pageX||e.pageY){posx=e.pageX;posy=e.pageY;}else if(e.clientX||e.clientY){posx=e.clientX+document.body.scrollLeft;posy=e.clientY+document.body.scrollTop;}return{x:posx,y:posy};},get_scroll_top:function(){var t;if(document.documentElement&&document.documentElement.scrollTop)t=document.documentElement.scrollTop;else if(document.body)t=document.body.scrollTop;return t;},relative_pos:function(elm){var pos_obj={'x':elm.offsetLeft,'y':elm.offsetTop};return pos_obj;},absolute_pos:function(elm){var pos_obj={'x':elm.offsetLeft,'y':elm.offsetTop};if(elm.offsetParent){var next=elm.offsetParent;while(next){pos_obj.x+=next.offsetLeft;pos_obj.y+=next.offsetTop;next=next.offsetParent;}}if(gBrowser.browser=='Safari'&&elm.style.position=='absolute'){pos_obj.x-=document.body.offsetLeft;pos_obj.y-=document.body.offsetTop;}return pos_obj;},is_overlapping:function(elm1,elm2){var pos_elm1=ART.absolute_pos(elm1);var pos_elm2=ART.absolute_pos(elm2);var top1=pos_elm1.y;var left1=pos_elm1.x;var right1=left1+elm1.offsetWidth;var bottom1=top1+elm1.offsetHeight;var top2=pos_elm2.y;var left2=pos_elm2.x;var right2=left2+elm2.offsetWidth;var bottom2=top2+elm2.offsetHeight;var get_sign=function(v){if(v>0)return"+";else if(v<0)return"-";else return 0;};if((get_sign(top1-bottom2)!=get_sign(bottom1-top2))&&(get_sign(left1-right2)!=get_sign(right1-left2)))return true;return false;},get_time:function(format){var time_string;var now=new Date();var hour=now.getHours();var minute=now.getMinutes();var second=now.getSeconds();var ap="AM";if(hour>11){ap="PM";}if(hour>12){hour=hour-12;}if(hour==0){hour=12;}if(minute<10){minute="0"+minute;}if(second<10){second="0"+second;}switch(format){case'hh:mm:ss tt':if(hour<10){hour="0"+hour;}time_string=hour+':'+minute+':'+second+' '+ap;break;case'h:mm tt':time_string=hour+':'+minute+" "+ap;break;case'hh:mm:ss':time_string=hour+':'+minute+':'+second;break;}return time_string;},get_date:function(format){var date_string;switch(format){case'mm/dd/yyyy':var date=new Date();var d=date.getDate();var day=(d<10)?'0'+d:d;var m=date.getMonth()+1;var month=(m<10)?'0'+m:m;var yy=date.getYear();var year=(yy<1000)?yy+1900:yy;date_string=month+"/"+day+"/"+year;break;case'mmm dd,yyyy':var months=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');var date=new Date();var day=date.getDate();var month=date.getMonth();var yy=date.getYear();var year=(yy<1000)?yy+1900:yy;date_string=months[month]+" "+day+", "+year;break;case'dd mmmm yyyy':var months=new Array('January','February','March','April','May','June','July','August','September','October','November','December');var date=new Date();var day=date.getDate();var month=date.getMonth();var yy=date.getYear();var year=(yy<1000)?yy+1900:yy;date_string=day+" "+months[month]+" "+year;break;}return date_string;},date_in_parts:function(){var _date=ART.get_date('mm/dd/yyyy').split('/');var _time=ART.get_time('hh:mm:ss').split(':');var _partial={'yy':_date[2],'mm':((_date[0]*1)-1),'dd':(_date[1]*1),'h':_time[0],'m':_time[1],'s':_time[2]};return _partial;},days_in_month:function(_month,_year){return 32-new Date(_year,_month,32).getDate();},compare_dates:function(_date1,_date2){var date1,date2;var month1,month2;var year1,year2;month1=parseInt(_date1.substring(0,_date1.indexOf("/")));date1=parseInt(_date1.substring(_date1.indexOf("/")+1,_date1.lastIndexOf("/")));year1=parseInt(_date1.substring(_date1.lastIndexOf("/")+1,_date1.length));month2=parseInt(_date2.substring(0,_date2.indexOf("/")));date2=parseInt(_date2.substring(_date2.indexOf("/")+1,_date2.lastIndexOf("/")));year2=parseInt(_date2.substring(_date2.lastIndexOf("/")+1,_date2.length));if(year1>year2)return 1;else if(year1<year2)return-1;else if(month1>month2)return 1;else if(month1<month2)return-1;else if(date1>date2)return 1;else if(date1<date2)return-1;else return 0;},trim:function(str){if(!str||!ART.is_string(str))return null;return str.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[ \t\r\f\v]{2,}/,' ');},random_string:function(length){var chars='abcdefghijklmnopqrstuvwxyz1234567890';var _string='';var char_length=chars.length;for(x=0;x<length;x++){i=Math.floor(Math.random()*char_length);_string+=chars.charAt(i);}return _string;},capitalize:function(str,_scope){var _scope=_scope||'all';if(_scope=='one')return str.toLowerCase().replace(/\b[a-z]/,function(match){return match.toUpperCase();});else return str.toLowerCase().replace(/\b[a-z]/g,function(match){return match.toUpperCase();});},clean:function(str){return ART.trim(str.replace(/\s\s/g,' '));},asc:function(_char){return _char.charCodeAt(0);},chr:function(_charcode){return String.fromCharCode(_charcode);},in_str:function(str,substr,ignore_case,start){if(start)str=str.substring(start,str.length);if(ignore_case){str=str.toLowerCase();substr=substr.toLowerCase();}if(str.indexOf(substr)>-1)return str.indexOf(substr)+1;else return 0;},left:function(str,char_count){return str.substring(0,char_count);},mid:function(str,start,end){if(!start)start=0;if(!end||end>str.length)end=str.length;if(end!=str.length)end=start+end;return str.substring(start,end);},replace:function(str,to_replace,replace_with){while(str.indexOf(to_replace)>-1){str=str.replace(to_replace,replace_with);}return str;},right:function(str,char_count){return str.substring((str.length-char_count),str.length);},val_email:function(str){if(!str.match(ART.email_regexp))return false;else return true;},val_url:function(str){if(!str.match(ART.url_regexp))return false;else return true;},val_url_loose:function(str){if(!str.match(ART.url_regexp_loose))return false;else return true;},val_url_articles:function(str){if(!str.match(ART.url_regexp_articles))return false;else return true;},change_color_of_text_vars:function(var_id,var_color){ART.GE(var_id).style.backgroundColor=var_color;return;},change_class_of_text_vars:function(var_id,var_class){ART.GE(var_id).className=var_class;return;},format_msg:function(action,txt_to_fix){var action=action||'encode';var _text=txt_to_fix||'';switch(action){case'encode':_text=_text.replace(new RegExp('\\n','g'),'_nl_');_text=_text.replace(new RegExp('\\r','g'),'_brk_');_text=_text.replace(new RegExp('\&','g'),'_amp_');_text=_text.replace(new RegExp('\>','g'),'_x_');_text=_text.replace(new RegExp('\<','g'),'_y_');_text=_text.replace(new RegExp('\"','g'),'_dbl_');_text=_text.replace(new RegExp('\,','g'),'_comma_');_text=_text.replace(new RegExp('\'','g'),'_app_');break;case'decode':_text=_text.replace(new RegExp('_nl_','g'),'\n');_text=_text.replace(new RegExp('_brk_','g'),'\r');_text=_text.replace(new RegExp('_amp_','g'),'&');_text=_text.replace(new RegExp('_x_','g'),'>');_text=_text.replace(new RegExp('_y_','g'),'<');_text=_text.replace(new RegExp('_dbl_','g'),'"');_text=_text.replace(new RegExp('_comma_','g'),',');_text=_text.replace(new RegExp('_app_','g'),'\'');break;}return _text;},js_to_html:function(txt_to_fix){var _text=txt_to_fix;_text=_text.replace(new RegExp('\\n','g'),'<BR>');return _text;},no_bull:function(evt){evt=(evt)?evt:event;var charCode=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));if(charCode==32||charCode==34||charCode==39||charCode==59)return false;return true;},no_bull_with_space:function(evt){evt=(evt)?evt:event;var charCode=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));if(charCode==34||charCode==39||charCode==59)return false;return true;},url_only:function(evt){evt=(evt)?evt:event;var charCode=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));if((charCode>44&&charCode<59)||(charCode>64&&charCode<91)||(charCode>96&&charCode<123)||(charCode==8))return true;return false;},numbers_only:function(evt){evt=(evt)?evt:event;var charCode=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));if(charCode>31&&(charCode<48||charCode>57))return false;return true;},letters_only:function(evt){evt=(evt)?evt:event;var charCode=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));if(charCode>31&&(charCode<65||charCode>90)&&(charCode<97||charCode>122))return false;return true;},letters_numbers_only:function(evt){evt=(evt)?evt:event;var charCode=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));if((charCode==32)||(charCode==45)||(charCode>47&&charCode<58)||(charCode>64&&charCode<91)||(charCode>96&&charCode<123)||(charCode==8))return true;return false;},auto_focus:function(curr_id,next_id,limit,evt){evt=(evt)?evt:event;var charCode=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));if(charCode>31&&ART.GE(curr_id).value.length==limit){ART.GE(next_id).focus();}},limit_input:function(limit_id,show_id,max_chars){var obj_1=ART.GE(limit_id);var obj_2=ART.GE(show_id);if(obj_1.value.length>max_chars)obj_1.value=obj_1.value.substring(0,max_chars);else{if(obj_2)obj_2.value=max_chars-obj_1.value.length;}},on_focus:function(obj,default_value,focused){var _val=obj.value.toLowerCase();if(focused){if(_val==default_value.toLowerCase())obj.value='';obj.style.color='#000000';}else{if(_val==default_value.toLowerCase()||_val==''){obj.style.color='#999999';obj.value=default_value;}}},dimmer:function(action,where_to_insert,what_to_cover){if(!action)var action='hide';if(!where_to_insert)var where_to_insert=ART.get_body();else var where_to_insert=ART.GE(where_to_insert);if(!what_to_cover)var what_to_cover=where_to_insert;var _cords=ART.relative_pos(what_to_cover);var set_globally=function(when){switch(when){case'before':ART.scrollbars('hide');if(gBrowser.browser=='Explorer'){ART.get_scroll();ART.set_ie('100%','hidden');ART.set_scroll(0,0);ART.hide_selects('hidden');}ART.global_dimmer=true;break;case'after':ART.scrollbars('show');if(gBrowser.browser=='Explorer'){ART.set_scroll(0,ART.y_pos);ART.set_ie('auto','auto');ART.hide_selects('visible');ART.x_pos=0;ART.y_pos=0;}ART.global_dimmer=false;break;}return;};switch(action){case'show':if(!ART.GE('overlay')){var overlay_obj=ART.DIV({'id':'overlay'});ART.IB(overlay_obj,ART.GE(where_to_insert).firstChild);if(gBrowser.browser=='Explorer'){overlay_obj.style.backgroundColor="#000000";overlay_obj.style.backgroundColor="transparent";overlay_obj.style.backgroundImage="url(http://images.cutrope.com/bg_dimmer.gif)";overlay_obj.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://images.cutrope.com/bg_dimmer.png',sizingMethod='scale')";}else overlay_obj.style.backgroundImage="url(http://images.cutrope.com/bg_dimmer.png)";}else var overlay_obj=ART.GE('overlay');overlay_obj.style.width=parseInt(what_to_cover.scrollWidth+300)+'px';overlay_obj.style.height=parseInt(what_to_cover.scrollHeight+300)+'px';ART.set_left(overlay_obj,_cords.x);ART.set_top(overlay_obj,_cords.y);if(where_to_insert===ART.get_body())set_globally('before');ART.show_element(overlay_obj);break;case'hide':if(ART.GE('overlay')){if(ART.global_dimmer)set_globally('after');ART.remove_element(ART.GE('overlay'));}break;}return;},set_ie:function(height,overflow){ART.get_body().style.height=height;ART.get_body().style.overflow=overflow;ART.get_html().style.height=height;ART.get_html().style.overflow=overflow;return;},hide_selects:function(visibility){var _selects=document.getElementsByTagName('select');for(i=0;i<_selects.length;i++){_selects[i].style.visibility=visibility;}},get_scroll:function(){if(self.pageYOffset){ART.y_pos=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){ART.y_pos=document.documentElement.scrollTop;}else if(ART.get_body()){ART.y_pos=ART.get_body().scrollTop;}},set_scroll:function(x,y){window.scrollTo(x,y);},scrollbars:function(action){switch(action){case'show':ART.get_body().style.overflow='auto';break;case'hide':ART.get_body().style.overflow='hidden';break;}return;},ft_into_cm:function(_ft,_in){var _ft=_ft||0;var _in=_in||0;var cm=0;cm=((parseFloat(_ft)*12)+parseFloat(_in))*2.54;return cm.toFixed(2);},spellcheck:function(_id,where_to_insert){var _spellchk_1=new spell_check();_spellchk_1.no_close_btn();_spellchk_1.deco_textarea(_id,where_to_insert);},processing:function(action){var obj_layer;if(!ART.GE('processing_div')){obj_layer=ART.DIV({'id':'processing_div'},'processing...');ART.ACN(ART.get_body(),obj_layer);}else obj_layer=ART.GE('processing_div');switch(action){case'on':x_pos=ART.pos_right()-105;y_pos=ART.pos_top()+2;ART.set_left(obj_layer,x_pos);ART.set_top(obj_layer,y_pos);ART.show_element(obj_layer);ART.in_process=true;ART.btns_enable('disable');break;case'off':ART.hide_element(obj_layer);ART.in_process=false;ART.btns_enable('enable');break;}},check_ext:function(x_file,file_type){var file_type=file_type||'img';var ext_ok=false;switch(file_type){case'img':var ext_array=new Array("jpg","png","bmp","gif","tiff");break;case'doc':var ext_array=new Array("doc","rtf","txt","xls","zip");break;}var x_ext=x_file.toLowerCase();while(x_ext.indexOf(".")!=-1){x_ext=x_ext.slice(x_ext.indexOf(".")+1);}for(var i=0;i<ext_array.length;i++){if(ext_array[i]==x_ext){ext_ok=true;break;}}return ext_ok;},btns_enable:function(action){var docs=document.getElementsByTagName('INPUT');switch(action){case'enable':for(i=0;i<docs.length;i++){if((docs[i].type=='Button')||(docs[i].type=='button')||(docs[i].type=='Submit')||(docs[i].type=='submit')){docs[i].disabled=false;}}break;case'disable':for(i=0;i<docs.length;i++){if((docs[i].type=='Button')||(docs[i].type=='button')||(docs[i].type=='Submit')||(docs[i].type=='submit')){docs[i].disabled=true;}}break;}return;},btns_enable_manually:function(){if(!ART.in_process)ART.btns_enable('enable');else ERRORS.show('please be patient. your previous request is still being processed.');},btn_enable:function(btn_id,action){switch(action){case'enable':ART.GE(btn_id).disabled=false;break;case'disable':ART.GE(btn_id).disabled=true;break;}return;},btn_enable_after_typing:function(button,target){var _button=ART.GE(button);var _target=ART.GE(target);if(_target.value.length>0)_button.disabled=false;else _button.disabled=true;},link_array:new Array(),disable_links:function(){var obj=document.links;for(var i=0;i<obj.length;i++){link_array[i]=obj[i].href.toString();if((obj[i].id!='lx$1_lnk')&&(obj[i].id!='lx$2_lnk')&&(obj[i].id!='lx$3_lnk')&&(obj[i].id!='lx$4_lnk')&&(obj[i].id!='lx$5_lnk')){obj[i].disabled=true;obj[i].onclick=new Function("return false;");}}},enable_links:function(){var obj=document.links;for(var i=0;i<obj.length;i++){obj[i].disabled=false;obj[i].href=link_array[i];obj[i].onclick=link_array[i];}},set_opacity:function(){var args=ART.force_array(arguments);var _value=args.pop();ART.map(args,function(elm){elm.style.opacity=_value;elm.style.filter="alpha(opacity="+_value*100+")";});},reset_opacity:function(){var args=ART.force_array(arguments);ART.map(args,function(elm){elm.style.opacity=1;elm.style.filter="";});},keys:function(obj){var rval=[];for(var prop in obj){rval.push(prop);}return rval;},values:function(obj){var rval=[];for(var prop in obj){rval.push(obj[prop]);}return rval;},set_bg:function(obj,_color){obj.style.backgroundColor=_color;return true;},str_to_JSON:function(txt){try{return eval('('+txt+')');}catch(e){return eval(txt);}},create_cookie:function(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else var expires="";document.cookie=name+"="+value+expires+"; path=/";},read_cookie:function(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;},erase_cookie:function(name){ART.create_cookie(name,"",-1);},get_body:function(){return document.getElementsByTagName('body')[0];},get_html:function(){return document.getElementsByTagName('html')[0];},get_element:function(id){if(ART.is_string(id)||ART.is_number(id))return document.getElementById(id);else return id;},get_elements:function(){var args=ART.flatten_list(arguments);var elements=new Array();for(var i=0;i<args.length;i++){var element=ART.get_element(args[i]);elements.push(element);}return elements;},get_elements_by_tag_and_classname:function(tag_name,class_name,parent,first_match){var class_elements=[];if(!ART.is_defined(parent))parent=document;if(!ART.is_defined(tag_name))tag_name='*';var els=parent.getElementsByTagName(tag_name);var els_len=els.length;var pattern=new RegExp("(^|\\s)"+class_name+"(\\s|$)");for(i=0,j=0;i<els_len;i++){if(pattern.test(els[i].className)||class_name==null){class_elements[j]=els[i];j++;}}if(first_match)return class_elements[0];else return class_elements;},node_walk:function(elm,tag_name,class_name,fn_next_elm){var p=fn_next_elm(elm);var check_fn;if(tag_name&&class_name){check_fn=function(p){return ART.node_name(p)==tag_name&&ART.has_class(p,class_name);}}else if(tag_name){check_fn=function(p){return ART.node_name(p)==tag_name;};}else{check_fn=function(p){return ART.has_class(p,class_name);};}while(p){if(check_fn(p))return p;p=fn_next_elm(p);}return null;},get_parent_bytc:function(elm,tag_name,class_name){return ART.node_walk(elm,tag_name,class_name,function(m){return m.parentNode;});},get_child_bytc:function(elm,tag_name,class_name){var elms=ART.get_elements_by_tag_and_classname(tag_name,class_name,elm);if(elms.length>0)return elms[0];else return null;},get_previous_sibling_bytc:function(elm,tag_name,class_name){return ART.node_walk(elm,tag_name,class_name,function(m){return m.previousSibling;});},get_next_sibling_bytc:function(elm,tag_name,class_name){return ART.node_walk(elm,tag_name,class_name,function(m){return m.nextSibling;});},get_form_element:function(form,name){form=ART.GE(form);var r=null;ART.map(form.elements,function(elm){if(elm.name&&elm.name==name)r=elm;});if(r)return r;ART.map(ART.GESBYTC('select',null,form),function(elm){if(elm.name&&elm.name==name)r=elm;});return r;},form_contents:function(form_id){var form_id=ART.GE(form_id);var r={};var func=function(elms){ART.map(elms,function(e){if(e.name)r[e.name]=e.value||'';});};func(ART.GESBYTC('input',null,form_id));func(ART.GESBYTC('textarea',null,form_id));return r;},node_name:function(elm){return elm.nodeName.toLowerCase();},get_select_value:function(select){var select=ART.GE(select);return select.options[select.selectedIndex].value;},has_parent:function(elm,parent_to_consider,max_look_up){if(elm==parent_to_consider)return true;if(max_look_up==0)return false;return ART.has_parent(elm.parentNode,parent_to_consider,max_look_up-1);},is_element_hidden:function(elm){return((elm.style.display=="none")||(elm.style.visibility=="hidden"));},document_insert:function(elm){if(typeof(elm)=='string')elm=ART.HTML2DOM(elm);document.write('<span id="dummy_holder"></span>');ART.swap_DOM(ART.GE('dummy_holder'),elm);},cloner:function(element){return function(){return element.cloneNode(true);}},append_to_top:function(elm){var args=ART.force_array(arguments).slice(1);if(args.length>=1){var first_child=elm.firstChild;if(first_child){while(true){var t_elm=args.shift();if(t_elm)ART.insert_before(t_elm,first_child);else break;}}else{ART.ACN.apply(null,arguments);}}return elm;},append_child_nodes:function(elm){if(arguments.length>=2){ART.map(arguments,function(n){if(ART.is_string(n))n=ART.TN(n);if(ART.is_defined(n))elm.appendChild(n);},1);}return elm;},replace_child_nodes:function(elm){var child;while((child=elm.firstChild))elm.removeChild(child);if(arguments.length<2)return elm;else return ART.append_child_nodes.apply(null,arguments);return elm;},insert_after:function(elm_to_insert,ref_elm){ref_elm.parentNode.insertBefore(elm_to_insert,ref_elm.nextSibling);return elm_to_insert;},insert_before:function(elm,reference_elm){reference_elm.parentNode.insertBefore(elm,reference_elm);return elm;},show_element:function(){var args=ART.flatten_list(arguments);ART.map(args,function(elm){elm.style.display='block';});},inline_element:function(){var args=ART.flatten_list(arguments);ART.map(args,function(elm){elm.style.display='inline';});},hide_element:function(){var args=ART.flatten_list(arguments);ART.map(args,function(elm){elm.style.display='none';});},swap_DOM:function(dest,src){dest=ART.GE(dest);var parent=dest.parentNode;if(src){src=ART.get_element(src);parent.replaceChild(src,dest);}else{parent.removeChild(dest);}return src;},remove_element:function(){var args=ART.flatten_elm_arguments(arguments);try{ART.map(args,function(elm){if(elm)ART.swap_DOM(elm,null);});}catch(e){}},create_DOM:function(name,attrs){var i=0,attr;var elm=document.createElement(name);var first_attr=attrs[0];if(ART.is_dict(attrs[i])){for(k in first_attr){attr=first_attr[k];if(k=="style")elm.style.cssText=attr;else if(k=="class"||k=='className')elm.className=attr;else elm.setAttribute(k,attr);}i++;}if(first_attr==null)i=1;for(var j=i;j<attrs.length;j++){var attr=attrs[j];if(attr){var type=typeof(attr);if(type=='string'||type=='number')attr=ART.TN(attr);elm.appendChild(attr);}}return elm;},TN:function(text){return document.createTextNode(text);},create_DOM_shortcuts:function(){var elms=["ul","li","td","tr","th","tbody","table","input","span","b","a","div","img","button","h1","h2","h3","br","textarea","form","p","select","option","iframe","script","center","dl","dt","dd","small","pre","strong","label","em"];var extends_extras=function(elm){ART[elm.toUpperCase()]=function(){return ART.create_DOM.apply(null,[elm,arguments]);};};ART.map(elms,extends_extras);},get_css_style:function(obj,property){var elm=ART.GE(obj);var pro=ART.camel_case(property);if(elm.currentStyle)var style=elm.currentStyle[pro];else if(window.getComputedStyle)var style=document.defaultView.getComputedStyle(elm,null).getPropertyValue(pro);return style;},hex_2_rgb:function(hex_string,default_){if(default_==undefined)default_=null;if(hex_string.substr(0,1)=='#')hex_string=hex_string.substr(1);var r;var g;var b;if(hex_string.length==3){r=hex_string.substr(0,1);r+=r;g=hex_string.substr(1,1);g+=g;b=hex_string.substr(2,1);b+=b;}else if(hex_string.length==6){r=hex_string.substr(0,2);g=hex_string.substr(2,2);b=hex_string.substr(4,2);}else return default_;r=parseInt(r,16);g=parseInt(g,16);b=parseInt(b,16);if(isNaN(r)||isNaN(g)||isNaN(b))return default_;else return{r:r/255,g:g/255,b:b/255};},rgb_2_hex:function(r,g,b,includeHash){r=Math.round(r*255);g=Math.round(g*255);b=Math.round(b*255);if(includeHash==undefined)includeHash=true;r=r.toString(16);if(r.length==1)r='0'+r;g=g.toString(16);if(g.length==1)g='0'+g;b=b.toString(16);if(b.length==1)b='0'+b;return((includeHash?'#':'')+r+g+b).toUpperCase();},hsv_2_rgb:function(hue,saturation,value){var red;var green;var blue;if(value==0.0){red=0;green=0;blue=0;}else{var i=Math.floor(hue*6);var f=(hue*6)-i;var p=value*(1-saturation);var q=value*(1-(saturation*f));var t=value*(1-(saturation*(1-f)));switch(i){case 1:red=q;green=value;blue=p;break;case 2:red=p;green=value;blue=t;break;case 3:red=p;green=q;blue=value;break;case 4:red=t;green=p;blue=value;break;case 5:red=value;green=p;blue=q;break;case 6:case 0:red=value;green=t;blue=p;break;}}return{r:red,g:green,b:blue};},rgb_2_hsv:function(red,green,blue){var max=Math.max(Math.max(red,green),blue);var min=Math.min(Math.min(red,green),blue);var hue;var saturation;var value=max;if(min==max){hue=0;saturation=0;}else{var delta=(max-min);saturation=delta/max;if(red==max)hue=(green-blue)/delta;else if(green==max)hue=2+((blue-red)/delta);else hue=4+((red-green)/delta);hue/=6;if(hue<0)hue+=1;if(hue>1)hue-=1;}return{h:hue,s:saturation,v:value};},set_style:function(){var args=ART.flatten_elm_arguments(arguments);var value=args.pop();var num_styles=['top','left','right','width','height'];if(ART.is_object(value)){ART.map(args,function(elm){ART.map(ART.keys(value),function(prop){var css_dim=value[prop];if(prop=='opacity'){ART.set_opacity(elm,css_dim);}else{if(ART.is_in(prop,num_styles))css_dim=ART.is_string(css_dim)&&css_dim||css_dim+'px';elm.style[prop]=css_dim;}});});}else{var property=args.pop();ART.map(args,function(elm){if(property=='opacity')ART.set_opacity(elm,value);else{if(ART.is_in(property,num_styles))value=ART.is_string(value)&&value||value+'px';elm.style[property]=value;}});}},set_visibility:function(){var args=ART.flatten_elm_arguments(arguments);var val=args.pop()&&'visible'||'hidden';ART.set_style(args,'visibility',val);},__css_dim:function(args,property){var args=ART.force_array(args);args.splice(args.length-1,0,property);ART.set_style.apply(null,args);},set_width:function(){return ART.__css_dim(arguments,'width');},set_height:function(){return ART.__css_dim(arguments,'height');},set_left:function(){return ART.__css_dim(arguments,'left');},set_right:function(){return ART.__css_dim(arguments,'right');},set_top:function(){return ART.__css_dim(arguments,'top');},set_class:function(){var args=ART.flatten_elm_arguments(arguments);var c=args.pop();ART.map(args,function(elm){elm.className=c;});},has_class:function(elm,cls){if(!elm||!elm.className)return false;var e_cls=elm.className;return(e_cls.length>0&&(e_cls==cls||new RegExp("(^|\\s)"+cls+"(\\s|$)").test(e_cls)));},add_class:function(){var args=ART.force_array(arguments);var cls=args.pop();var add_class=function(o){if(!new RegExp("(^|\\s)"+cls+"(\\s|$)").test(o.className));o.className+=(o.className?" ":"")+cls;};ART.map(args,function(elm){add_class(elm);});},remove_class:function(){var args=ART.flatten_elm_arguments(arguments);var cls=args.pop();var rm_class=function(o){o.className=o.className.replace(new RegExp("\\s?"+cls,'g'),"");};ART.map(args,function(elm){rm_class(elm);});},set_HTML:function(){var args=ART.flatten_elm_arguments(arguments);var html=args.pop();ART.map(args,function(elm){if(elm)elm.innerHTML=html;});return args[0];},RND:function(tmpl,ns,scope){scope=scope||window;var fn=function(w,g){g=g.split("|");var cnt=ns[g[0]];for(var i=1;i<g.length;i++)cnt=scope[g[i]](cnt);if(cnt==0||cnt==-1)cnt+='';return cnt||w;};return tmpl.replace(/%\(([A-Za-z0-9_|.]*)\)/g,fn);},HTML2DOM:function(html,first_child){var d=ART.DIV();d.innerHTML=html;if(first_child)return d.childNodes[0];else return d;},preload_images:function(){ART.AEV(window,'load',ART.partial(function(args){ART.map(args,function(src){var pic=new Image();pic.src=src;});},arguments));},get_event_element:function(e){if(e&&!e.type&&!e.keyCode)return e;var targ;if(!e)var e=window.event;if(e.target)targ=e.target;else if(e.srcElement)targ=e.srcElement;if(targ.nodeType==3)targ=targ.parentNode;return targ;},_get_real_scope:function(fn,extra_args){extra_args=ART.CRA(extra_args);var scope=fn._cscope||window;return function(){var args=ART.force_array(arguments).concat(extra_args);return fn.apply(scope,args);};},_unload_listeners:function(){if(ART.listeners)ART.map(ART.listeners,function(elm,type,fn){ART.remove_event_listener(elm,type,fn)});ART.listeners=[];},set_event_key:function(e){e.key=e.keyCode?e.keyCode:e.charCode;if(window.event){e.ctrl=window.event.ctrlKey;e.shift=window.event.shiftKey;}else{e.ctrl=e.ctrlKey;e.shift=e.shiftKey;}switch(e.key){case 63232:e.key=38;break;case 63233:e.key=40;break;case 63235:e.key=39;break;case 63234:e.key=37;break;}},add_event_listener:function(elms,type,handler,listen_once){elms=ART.CRA(elms);ART.map(elms,function(elm){if(listen_once)handler.listen_once=true;if(!handler.$f_guid)handler.$f_guid=ART._f_guid++;if(!elm.events)elm.events={};var handlers=elm.events[type];if(!handlers){handlers=elm.events[type]={};if(elm["on"+type])handlers[0]=elm["on"+type];}handlers[handler.$f_guid]=handler;elm["on"+type]=ART.handle_event;elm=null;});},handle_event:function(event){var me=this;event=event||window.event;ART.set_event_key(event);var handlers=this.events[event.type];var handlers_to_delete=[];for(var i in handlers){var handler=this.$$handle_event=handlers[i];this.$$handle_event(event);if(handler.listen_once)handlers_to_delete.push(handler);}if(handlers_to_delete.length>0)ART.map(handlers_to_delete,function(handler){delete me.events[event.type][handler.$f_guid];});},remove_event_listener:function(elms,type,handler){elms=ART.CRA(elms);ART.map(elms,function(elm){if(elm.events&&elm.events[type]){delete elm.events[type][handler.$f_guid];}});},bind:function(fn,scope,extra_args){fn._cscope=scope;return ART._get_real_scope(fn,extra_args);},_get_real_scope:function(fn,extra_args){extra_args=ART.CRA(extra_args);var scope=fn._cscope||window;return function(){try{var args=ART.force_array(arguments).concat(extra_args);return fn.apply(scope,args);}catch(e){}};},bind_methods:function(self){for(var k in self){var func=self[k];if(typeof(func)=='function'){self[k]=ART.bind(func,self);}}},_listen_once:function(elm,type,fn){var r_fn=function(){ART.remove_event_listener(elm,type,r_fn);fn(arguments);};return r_fn;},call_later:function(fn,interval){var fn_no_send=function(){fn();};window.setTimeout(fn_no_send,interval);},prevent_default:function(e){if(gBrowser.browser=='Explorer')window.event.returnValue=false;else e.preventDefault();},onload_extend:function(fn){var old_onload=window.onload;if(!ART.is_function(window.onload)){window.onload=fn;}else{window.onload=function(){if(old_onload)old_onload();fn();}}},map:function(list,fn,start_index,end_index){var i=0,l=list.length;if(start_index)i=start_index;if(end_index)l=end_index;for(i;i<l;i++){var val=fn(list[i],i);if(val!=undefined)return val;}},rmap:function(list,fn){var i=list.length-1,l=0;for(i;i>=l;i--){var val=fn.apply(null,[list[i],i]);if(val!=undefined)return val;}},filter:function(list,fn,start_index,end_index){var r=[];ART.map(list,function(elm){if(fn(elm))r.push(elm);},start_index,end_index);return r;},partial:function(fn){var args=ART.force_array(arguments);args.shift();return function(){args=args.concat(ART.force_array(arguments));return fn.apply(window,args);}},create_array:function(v){if(ART.is_array(v)&&!ART.is_string(v))return v;else if(!v)return[];else return[v];},force_array:function(args){var r=[];ART.map(args,function(elm){r.push(elm);});return r;},join:function(delim,list){try{return list.join(delim);}catch(e){var r=list[0]||'';ART.map(list,function(elm){r+=delim+elm;},1);return r+'';}},is_in:function(elm,list){var i=ART.get_index(elm,list);if(i!=-1)return true;else return false;},get_index:function(elm,list,eval_fn){for(var i=0;i<list.length;i++)if(eval_fn&&eval_fn(list[i])||elm==list[i])return i;return-1;},get_first:function(list){if(list.length>0)return list[0];else return null;},get_last:function(list){if(list.length>0)return list[list.length-1];else return null;},update:function(l1,l2){for(var i in l2)l1[i]=l2[i];return l1;},flatten_list:function(list){var r=[];var _flatten=function(r,l){ART.map(l,function(o){if(o==null){}else if(ART.is_array(o))_flatten(r,o);else r.push(o);});};_flatten(r,list);return r;},flatten_elm_arguments:function(args){return ART.flatten_list(ART.force_array(args));},filter_array:function(to_filter,to_remove){var j;for(var i=0;i<to_remove.length;i++){j=0;while(j<to_filter.length){if(to_filter[j]==to_remove[i])to_filter.splice(j,1);else j++;}}return to_filter;}};ART.Class=function(members){var fn=function(){if(arguments[0]!='no_init'){return this.init.apply(this,arguments);}};fn.prototype=members;ART.update(fn,ART.Class.prototype);return fn;};ART.Class.prototype={extend:function(members){var parent=new this('no_init');for(k in members){var prev=parent[k];var cur=members[k];if(prev&&prev!=cur&&typeof cur=='function'){cur=this._parentize(cur,prev);}parent[k]=cur;}return new ART.Class(parent);},implement:function(members){ART.update(this.prototype,members);},_parentize:function(cur,prev){return function(){this.parent=prev;return cur.apply(this,arguments);}}};ART.BEM=ART.btns_enable_manually;ART.BEMAT=ART.btn_enable_after_typing;ART.GE=ART.get_element;ART.GES=ART.get_elements;ART.GEF=ART.get_form_element;ART.APOS=ART.absolute_pos;ART.CRA=ART.create_array;ART.DI=ART.document_insert;ART.ACN=ART.append_child_nodes;ART.RCN=ART.replace_child_nodes;ART.AEV=ART.add_event_listener;ART.REV=ART.remove_event_listener;ART.GESBYTC=ART.get_elements_by_tag_and_classname;ART.GEPBYTC=ART.get_parent_bytc;ART.GECB=ART.get_child_bytc;ART.IA=ART.insert_after;ART.IB=ART.insert_before;ART.$=ART.format_currency;ART.$$=ART.num_to_dollar;ART.SV=ART.set_visibility;ART.create_DOM_shortcuts();}