
var g={select:function(img_num,destination){var main=document.getElementById(destination);selected_img=img_num;var replacement=eval('img'+selected_img);if(replacement.src)main.src=replacement.src;return false;},change:function(destination,replacement){var main=document.getElementById(destination);if(replacement.src)
main.src=replacement.src;return false;},next:function(destination){selected_img+=1;try{var vobj=eval('img'+selected_img);}catch(e){var vobj='';}
if(vobj)
g.change(destination,vobj);else
selected_img-=1;},previous:function(destination){selected_img-=1;try{var vobj=eval('img'+selected_img);}catch(e){var vobj='';}
if(vobj)
g.change(destination,vobj);else
selected_img+=1;}}
var util={popup:function(url,w,h,params){var id='popupWin';var w=w||screen.availWidth*.8;var h=h||screen.availHeight*.7;var params=params||'toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0, resizable=1';var win=window.open(url,id,params+', width='+w+', height='+h+', left='+(screen.availWidth/2-w/2)+', top='+(screen.availHeight/2-h/2));},has_class:function(ele,cls){return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));},add_class:function(ele,cls){if(!this.has_class(ele,cls))ele.className+=" "+cls;},remove_class:function(ele,cls){if(this.has_class(ele,cls)){var reg=new RegExp('(\\s|^)'+cls+'(\\s|$)');ele.className=ele.className.replace(reg,' ');}},add_event:function(obj,type,fn){if(obj.attachEvent){obj['e'+type+fn]=fn;obj[type+fn]=function(){obj['e'+type+fn](window.event);}
obj.attachEvent('on'+type,obj[type+fn]);}else{obj.addEventListener(type,fn,false);}},remove_event:function(obj,type,fn){if(obj.detachEvent){obj.detachEvent('on'+type,obj[type+fn]);obj[type+fn]=null;}else{obj.removeEventListener(type,fn,false);}},ucwords:function(val){val=val.split(' ');newVal='';for(var i=0;i<val.length;i++){newVal+=val[i].substring(0,1).toUpperCase()+val[i].substring(1,val[i].length)+' ';}
return newVal;},scroll_to:function(id){var el=document.getElementById(id);var curleft=0;var curtop=0;do{curleft+=el.offsetLeft;curtop+=el.offsetTop;}while(el=el.offsetParent);window.scrollTo(curleft,curtop);}}
try{document.execCommand('BackgroundImageCache',false,true);}catch(ignoreme){}
