
var JSTarget={init:function(_1,_2){if(document.getElementById&&document.createElement&&document.appendChild){var _3=((typeof _1=="undefined")||(_1==null))?"class":_1;var _4=((typeof _2=="undefined")||(_2==null))?"non-html":_2;var _5;var _6=document.getElementsByTagName("a");var _7;var _8=new RegExp("(^|\\s)"+_4+"(\\s|$)");for(var i=0;i<_6.length;i++){_7=_6[i];if((_3=="class")&&(_8.test(_7.className))||(_8.test(_7.getAttribute(_3)))){_5=document.createElement("em");_7.appendChild(_5);_7.onclick=JSTarget.openWin;}}_5=null;}},openWin:function(e){var _b=(!e)?window.event:e;if(_b.shiftKey||_b.altKey||_b.ctrlKey||_b.metaKey){return true;}else{var _c=window.open(this.getAttribute("href"),"_blank");if(_c){if(_c.focus){_c.focus();}return false;}_c=null;return true;}},addEvent:function(_d,_e,fn){if(_d.addEventListener){_d.addEventListener(_e,fn,false);}else{if(_d.attachEvent){_d["e"+_e+fn]=fn;_d[_e+fn]=function(){_d["e"+_e+fn](window.event);};_d.attachEvent("on"+_e,_d[_e+fn]);}}}};JSTarget.addEvent(window,"load",function(){JSTarget.init("rel","external");});function AutoSave()
{this.id=null;this.moduleName=null;this.data=new Object();this.timeout=30000;this.timer;this.post=function()
{if(this.id==''||this.id==undefined)
{this.id='autosave';}
if(this.moduleName==''||this.moduleName==undefined)
{return false;}
if(this.timeout==''||this.timeout==undefined)
{this.timeout=30000;}
if(this.timer!=undefined)
{var name='';var value='';var inputs=$('form input,select,textarea');for(var i=0;i<inputs.length;i++)
{id=$(inputs[i]).attr('id');name=$(inputs[i]).attr('name');if(name!=undefined)
{if(id==name&&FCKeditorAPI!=undefined)
{oEditor=FCKeditorAPI.GetInstance(id);value=oEditor.GetXHTML(oEditor.FormatOutput);}
else
{value=$(inputs[i]).attr('value');}
if(value==undefined)
{value='';}
this.data[name]=value;}}
$.post('/users/autosave/'+this.id+'/'+this.moduleName,this.data,function()
{var date=new Date()
var hour=date.getHours();var minute=date.getMinutes();meridian='am';if(hour>=12)
{meridian='pm';if(hour>12)
{hour-=12;}}
if(minute.toString().length==1)
{minute='0'+minute;}
var time=hour+':'+minute+' '+meridian;$('#autosave').html('Draft autosaved at '+time);});}
this.timer=setTimeout('autosave.post()',this.timeout);}}
function showOrder(id)
{document.getElementById(id).style.display='inline';return false;}