var myimages=new Array();function preloading(){for(x=0;x<preloadImgs.length;x++){alert('fun');myimages[x]=new Image();myimages[x].src=preloadImgs[x];}}
function submitForm(ele){var frm;if(ele=='')frm=document.forms[0];else frm=document.getElementById(ele);frm.submit();}
function addLoadEvent(func){var oldOnload=window.onload;if(typeof window.onload!='function'){window.onload=func;}
else{window.onload=function(){oldOnload();func();}}}
function sgWindow(url,w,h,name){url=sg_siteDir+url;top.mWindow=window.open(url,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width='+w+',height='+h+',screenX='+w+',screenY='+h+',top=50,left=50')
return;}
function tryEvent(id,type,fnc){if($(id)){Event.observe(id,type,fnc);}}
function mapEvent(sel,event,func){$$(sel).each(function(el){Event.observe(el,event,func);});}
function extend(destination,source){for(var property in source){destination[property]=source[property];}
return destination;}
var Class={create:function(){return function(){this.initialize.apply(this,arguments);}}}
if(typeof window.$==='undefined'){var $=function(id){return document.getElementById(id);};}
if(!Function.prototype.bind){Function.prototype.bind=function(object){var __method=this;return function(){__method.apply(object,arguments);};};}
if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=function(object){var __method=this;return function(event){__method.apply(object,[event||window.event].concat(arguments));};};}
sgSimpleMenu={smwid:'sgSimpleMenuWrapper',smt:0,smwol:0,smwot:2,smwel:'',init:function(){var objBody=document.body;var smw=document.createElement('div');smw.setAttribute('id',sgSimpleMenu.smwid);smw.style.position='absolute';smw.style.left='-400px';smw.style.top='-400px';smw.style.display='none';smw.onmouseover=sgSimpleMenu.clearTimer;smw.onmouseout=sgSimpleMenu.startTimer;objBody.appendChild(smw);smwel=document.getElementById(sgSimpleMenu.smwid);},show:function(el,a){if(!document.getElementById(sgSimpleMenu.smwid))
sgSimpleMenu.init();sgSimpleMenu.hide();el.onmouseout=sgSimpleMenu.startTimer;el.className=(el.className.indexOf('hover')==-1)?el.className+' hover':el.className;if(!sgSMP[a]){return;}
a=eval(sgSMP[a]);var ihtml='<ul>';for(i=0;i<a.length;i++){ihtml+='<li><a href="'+sg_urlPrefix+a[i][1]+'">'+a[i][0]+'</a></li>\r\n';}
ihtml+='</ul>';smwel.innerHTML=ihtml;iLeft=iRight=0;var obj=el;if(el.offsetParent){iLeft=el.offsetLeft;iTop=el.offsetTop;while(obj=obj.offsetParent){iLeft+=obj.offsetLeft;iTop+=obj.offsetTop;}}
iTop=eval(iTop+el.offsetHeight);iLeft=eval(iLeft+sgSimpleMenu.smwol);iTop=eval(iTop+sgSimpleMenu.smwot);smwel.style.left=iLeft+'px';smwel.style.top=iTop+'px';smwel.style.display='block';},hide:function(){sgSimpleMenu.clearTimer();smwel.style.display='none';smwel.innerHTML='';hs=document.getElementById('sgSimpleMenu');lis=hs.getElementsByTagName('li');for(i=0;i<lis.length;i++){lis[i].className=lis[i].className.replace('hover','');}},startTimer:function(e){sgSimpleMenu.smt=setTimeout("sgSimpleMenu.hide()",500);},clearTimer:function(){if(sgSimpleMenu.smt){clearTimeout(sgSimpleMenu.smt);sgSimpleMenu.smt=0;}}}
function createPrettySearch(el){var isSafari=(navigator.userAgent.toLowerCase().indexOf('safari')<0)?false:true;var wrapper=document.createElement('div');wrapper.className='prettysearchWrapper';if(!isSafari){var left=document.createElement('span');left.className='left';var right=document.createElement('span');right.className='right';}
var searchField=el;searchField.setAttribute('placeholder',el.value);if(isSafari){searchField.style.right='0';searchField.style.width='220px;';}
searchField.onfocus=function(){if(this.value==this.getAttribute('placeholder'))
this.value='';}
searchField.onblur=function(){if(this.value=='')
this.value=this.getAttribute('placeholder');}
var parent=el.parentNode;parent.removeChild(el);parent.appendChild(wrapper);if(!isSafari)wrapper.appendChild(left);wrapper.appendChild(searchField);if(!isSafari)wrapper.appendChild(right);}
function initPrettySearch(){var els=document.getElementsByTagName('input');for(var i=0;i<els.length;i++){if(els[i].className.indexOf('prettysearch')!=-1)
createPrettySearch(els[i]);}}