function zeroPad(number,digits){number=String(number);while(number.length<digits)number='0'+number;return number;}
function getGmtOffset(){var hours=new Date().getTimezoneOffset()/60;var prefix=hours<0?'+':'-';hours=Math.abs(hours);return prefix+zeroPad(Math.floor(hours),2)+':'+zeroPad((hours%1)*60,2);}
var tzo=(new Date().getTimezoneOffset()/60)*(-1);createCookie("user_timezone",tzo,30)
function getTimezoneName(){tmSummer=new Date(Date.UTC(2005,6,30,0,0,0,0));sumTime=-1*tmSummer.getTimezoneOffset();tmWinter=new Date(Date.UTC(2005,12,30,0,0,0,0));winTime=-1*tmWinter.getTimezoneOffset();if(sumTime==-720&&winTime==-720)return'Dateline Standard Time';if(sumTime==-660&&winTime==-660)return'Samoa Standard Time';if(sumTime==-600&&winTime==-600)return'Hawaiian Standard Time';if(sumTime==-480&&winTime==-480)return'Alaskan Standard Time';if(sumTime==-420&&winTime==-480)return'Pacific Standard Time';if(sumTime==-420&&winTime==-420)return'Mountain Standard Time';if(sumTime==-360&&winTime==-420)return'Mexico Standard Time';if(sumTime==-360&&winTime==-360)return'Central America Standard Time';if(sumTime==-300&&winTime==-360)return'Central Standard Time';if(sumTime==-300&&winTime==-300)return'Eastern Standard Time';if(sumTime==-240&&winTime==-300)return'Eastern Standard Time';if(sumTime==-180&&winTime==-240)return'Atlantic Standard Time';if(sumTime==-240&&winTime==-240)return'SA Western Standard Time';if(sumTime==-240&&winTime==-180)return'Pacific SA Daylight Time';if(sumTime==-150&&winTime==-210)return'New Foundland Standard Time';if(sumTime==-180&&winTime==-120)return'E. South America Standard Time';if(sumTime==-180&&winTime==-180)return'SA Eastern Standard Time';if(sumTime==-120&&winTime==-180)return'Greenland Standard Time';if(sumTime==-60&&winTime==-120)return'Mid-Atlantic Standard Time';if(sumTime==0&&winTime==-60)return'Azores Standard Time';if(sumTime==-60&&winTime==-60)return'Cape Verde Standard Time';if(sumTime==0&&winTime==0)return'Greenwich Standard Time';if(sumTime==60&&winTime==0)return'GMT Standard Time';if(sumTime==120&&winTime==60)return'Europe Standard Time';if(sumTime==60&&winTime==60)return'W. Central Africa Standard Time';if(sumTime==180&&winTime==120)return'Egypt Standard Time';if(sumTime==120&&winTime==120)return'South Africa Standard Time';if(sumTime==240&&winTime==180)return'Russian Standard Time';if(sumTime==180&&winTime==180)return'E. Africa Standard Time';if(sumTime==270&&winTime==210)return'Iran Standard Time';if(sumTime==240&&winTime==240)return'Arabian Standard Time';if(sumTime==300&&winTime==240)return'Caucasus Standard Time';if(sumTime==270&&winTime==270)return'Afghanistan Standard Time';if(sumTime==360&&winTime==300)return'Ekaterinburg Standard Time';if(sumTime==300&&winTime==300)return'West Asia Standard Time';if(sumTime==330&&winTime==330)return'India Standard Time';if(sumTime==345&&winTime==345)return'Nepal Standard Time';if(sumTime==420&&winTime==360)return'N. Central Asia Standard Time';if(sumTime==360&&winTime==360)return'Sri Lanka Standard Time';if(sumTime==390&&winTime==390)return'Myanmar Standard Time';if(sumTime==420&&winTime==420)return'SE Asia Standard Time';if(sumTime==480&&winTime==420)return'North Asia Standard Time';if(sumTime==480&&winTime==480)return'China Standard Time';if(sumTime==540&&winTime==480)return'North Asia East Standard Time';if(sumTime==540&&winTime==540)return'Tokyo Standard Time';if(sumTime==600&&winTime==540)return'Yakutsk Standard Time';if(sumTime==570&&winTime==630)return'Cen. Australia Daylight Time';if(sumTime==570&&winTime==570)return'AUS Central Standard Time';if(sumTime==600&&winTime==600)return'E. Australia Standard Time';if(sumTime==600&&winTime==660)return'AUS Eastern Standard Time';if(sumTime==660&&winTime==600)return'Vladivostok Standard Time';if(sumTime==660&&winTime==660)return'Central Pacific Standard Time';if(sumTime==720&&winTime==780)return'New Zealand Daylight Time';if(sumTime==720&&winTime==720)return'Fiji Standard Time';if(sumTime==780&&winTime==780)return'Tonga Standard Time';}
getTimezoneName();var IE=document.all?true:false;document.onmousedown=getMouseXY;var tempX=0;var tempY=0;var cX=0;var cY=0;var passfocus;var currentPhoto=0;var picsaveWidth=0;var eventFade=new Array();var fillFade;function imposeMaxLength(Object,maxlen){return(Object.value.length<=maxlen);}
function center_me(Xwidth,Yheight,divid){var scrolledX,scrolledY;if(self.pageYOffset){scrolledX=self.pageXOffset;scrolledY=self.pageYOffset;}else if(document.documentElement&&document.documentElement.scrollTop){scrolledX=document.documentElement.scrollLeft;scrolledY=document.documentElement.scrollTop;}else if(document.body){scrolledX=document.body.scrollLeft;scrolledY=document.body.scrollTop;}
var centerX,centerY;if(self.innerHeight){centerX=self.innerWidth;centerY=self.innerHeight;}else if(document.documentElement&&document.documentElement.clientHeight){centerX=document.documentElement.clientWidth;centerY=document.documentElement.clientHeight;}else if(document.body){centerX=document.body.clientWidth;centerY=document.body.clientHeight;}
var leftOffset=scrolledX+(centerX-Xwidth)/2;var topOffset=scrolledY+(centerY-Yheight)/2;var o=document.getElementById(divid);var r=o.style;r.position='absolute';r.top=topOffset+'px';r.left=leftOffset+'px';r.display="block";}
function array_crop(){var myArray=new Array();myArray[0]=document.getElementById('input_crop_x').value;myArray[1]=document.getElementById('input_crop_y').value;myArray[2]=document.getElementById('input_crop_width').value;myArray[3]=document.getElementById('input_crop_height').value;myArray[4]=document.getElementById('crop_suid').value;myArray[5]=document.getElementById('crop_area').value;return myArray;}
function fliptab(tab,wich){var i;divs=document.getElementsByTagName('div');for(i=0;i<divs.length;i++){if(divs[i].id.substring(0,tab.length)==tab){divs[i].style.zIndex=i;if(divs[i].id==tab+"_"+wich){divs[i].style.zIndex=divs.length;}}}
tds=document.getElementsByTagName('td');for(i=0;i<tds.length;i++){if(tds[i].id.substring(0,tab.length)==tab){if(tds[i].id==tab+"_"+wich){tds[i].style.backgroundColor="#006D9C";tds[i].style.color="#ffffff";}else{tds[i].style.backgroundColor="#f7f7f7";tds[i].style.color="#006D9C";}}}}
function scaleImg(what){what=document.getElementById(what);if(navigator.appName=="Netscape")winW=window.innerWidth;if(navigator.appName.indexOf("Microsoft")!=-1)winW=document.body.offsetWidth;if(what.width>720||picsaveWidth>720){if(what.width==720){what.width=picsaveWidth;}else{picsaveWidth=what.width;what.style.cursor="pointer";what.width=720;}}}
function kill_overlay(rand,cid,mdid,loader){sel=document.getElementById('adult_ok'+rand);if(sel.options[sel.selectedIndex].value==0){document.location='browse_videos.php'}else{createCookie('adult_verification',1,100);hide_me('adultoverlay'+rand);event_process(cid,mdid+"|1",'welcome_video',loader);}}
function doc_jump(anch){document.location.hash=anch;}
function delete_me(id){aId=document.getElementById(id);if(aId){aId.parentNode.removeChild(aId);}}
function passit(ip){if(passfocus)return;var np=ip.cloneNode(true);np.type='password';if(np.value!=ip.value)
np.value=ip.value;np.disabled=false;ip.parentNode.replaceChild(np,ip);passfocus=true;return np;}
function GetSelectVal(id){sel=document.getElementById(id);return sel.options[sel.selectedIndex].value;}
function getSelRadioValue(radio_name,form){frm=document.getElementById(form);for(i=0;i<frm.elements.length;i++){if(frm.elements[i].type=='radio'&&frm.elements[i].name==radio_name){if(frm.elements[i].checked==true){return frm.elements[i].value;}}}}
function UpdateCursorPosition(e){cX=e.pageX;cY=e.pageY;}
function UpdateCursorPositionDocAll(e){cX=event.clientX;cY=event.clientY;}
if(document.all){document.onmousemove=UpdateCursorPositionDocAll;}
else{document.onmousemove=UpdateCursorPosition;}
function AssignPosition(mdiv,correction){d=document.getElementById(mdiv);if(parseInt(navigator.appVersion)>3){if(navigator.appName=="Netscape"){winW=window.innerWidth;winH=window.innerHeight;}
if(navigator.appName.indexOf("Microsoft")!=-1){winW=document.body.offsetWidth;winH=document.body.offsetHeight;}}
scrolls=getScrollXY();d.style.left=(winW/2-d.offsetWidth/2)+"px";d.style.top=(winH/2-d.offsetHeight/2+scrolls[1])+"px";}
function getScrollXY(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
return[scrOfX,scrOfY];}
function showFullScreen(url){window.open(url,'fullplay','fullscreen=yes, scrollbars=none');}
function create_css_picker(objId,preset){var myFontPicker=new FontPicker();myFontPicker.boundControl=objId;myFontPicker.scriptAction="";if(preset=='box'){myFontPicker.showDemo=true;myFontPicker.showBold=false;myFontPicker.showItalic=false;myFontPicker.showUnderline=false;myFontPicker.showFontFace=false;myFontPicker.showFontSize=false;myFontPicker.showColor=false;myFontPicker.showBorderSize=true;myFontPicker.showBorderColor=true;myFontPicker.showBackColor=true;myFontPicker.showStatus=true;myFontPicker.demoMessage="BOX"}else{myFontPicker.showDemo=true;myFontPicker.showBold=true;myFontPicker.showItalic=true;myFontPicker.showUnderline=true;myFontPicker.showFontFace=true;myFontPicker.showFontSize=true;myFontPicker.showColor=true;myFontPicker.showBorderSize=true;myFontPicker.showBorderColor=true;myFontPicker.showBackColor=true;myFontPicker.showStatus=true;myFontPicker.demoMessage="text text text text text"}
myFontPicker.width="400px";var myFontPicker_FontArray=new Array();myFontPicker.fontSize_minimum=8;myFontPicker.fontSize_maximum=32;myFontPicker.Instantiate();}
function select_value(selId,val){sel=document.getElementById(selId);if(!sel)return;try{for(i=0;i<sel.options.length;i++){if(sel.options[i].value==val){sel.options[i].selected=true;return;}}}catch(e){}}
function getMouseXY(e){if(IE){tempX=event.clientX+document.body.scrollLeft;tempY=event.clientY+document.body.scrollTop;}else{tempX=e.pageX;tempY=e.pageY;}
if(tempX<0){tempX=0;}
if(tempY<0){tempY=0;}
return true;}
function set_position(divid,myEvent,cX,cY){mydiv=document.getElementById(divid);mydiv.style.position='absolute';if(IE){tempX=myEvent.clientX+document.body.scrollLeft;tempY=myEvent.clientY+document.body.scrollTop;}else{tempX=myEvent.pageX;tempY=myEvent.pageY;}
mydiv.style.left=tempX+cX;mydiv.style.top=tempY+cY;}
function bif(id){chk=document.getElementById(id);if(chk)chk.checked=!chk.checked;}
function Pulsate(element,opacity,duration,steps,options){new Rico.Effect.FadeTo(element,opacity,duration,steps,options);new Rico.Effect.FadeTo(element,1,duration,steps,options);}
function select_all(sel){sel=document.getElementById(sel);for(i=0;i<sel.length;i++){sel.options[i].selected=true;}}
function uncheckRadios(frm){oform=document.getElementById(frm);els=oform.elements;for(i=0;i<els.length;i++){if(els[i].type=='radio'){els[i].checked=false;}}}
function show_me(id,frm,sh_mode){aId=document.getElementById(id);if(!sh_mode)sh_mode="block";if(aId){aId.style.display=sh_mode;aId.style.visibility="visible";}
aFrm=document.getElementById(frm);if(aFrm){aFrm.style.display=sh_mode;aFrm.style.visibility="visible";}}
function hide_me(id,frm){aId=document.getElementById(id);if(aId){aId.style.display="none";}
aFrm=document.getElementById(frm);if(aFrm){aFrm.style.display="none";}}
function kill_me(id){aId=document.getElementById(id);if(aId){aId.parentNode.removeChild(aId);}}
var slide_height=1;var slide_speed=25;var slidePlus;var slideMinus;function slide_visible(elem,max_height){eval("slide_active="+elem+"_slide_active");if(slide_active==0){slide_active=1;divPlusOne(elem,max_height);}else if(slide_active==1){slide_active=0;divMinusOne(elem);}
eval(elem+"_slide_active=slide_active");}
function divPlusOne(elem,max_height){clearTimeout(slideMinus);eval("slide_height="+elem+"_slide_height");if(slide_height<=max_height){document.getElementById(elem).style.display="block";slide_height=slide_height+slide_speed;document.getElementById(elem).style.height=slide_height+'px';slidePlus=window.setTimeout('divPlusOne("'+elem+'","'+max_height+'")',1);}
eval(elem+"_slide_height=slide_height");}
function divMinusOne(elem){clearTimeout(slidePlus);eval("slide_height="+elem+"_slide_height");if(slide_height>=10){slide_height=slide_height-slide_speed;document.getElementById(elem).style.height=slide_height+'px';slideMinus=window.setTimeout('divMinusOne("'+elem+'")',1);eval(elem+"_slide_done=0");}else{try{document.getElementById(elem).style.display="none";}catch(e){}
eval(elem+"_slide_done=1");}
eval(elem+"_slide_height=slide_height");}
function m_collapse(elem,img,path){mdiv=document.getElementById(elem);mimg=document.getElementById("img_"+elem);mhint=document.getElementById(elem+"_h");if(!path)path="images/";if(!mdiv.style.display||mdiv.style.display=="block"){mdiv.style.display='none';if(mimg)mimg.src=path+img+"max.gif";if(mhint)mhint.style.display='block';createCookie("m_collapse_"+elem,1,356);}else{mdiv.style.display='block';if(mimg)mimg.src=path+img+"min.gif";if(mhint)mhint.style.display='none';eraseCookie("m_collapse_"+elem);}}
function restoreCollapse(path){var nameEQ="m_collapse_";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){cookVal=c.substring(nameEQ.length,c.length);if(cookVal){var el=c.split('=');elId=el[0].substring(nameEQ.length);ele=document.getElementById(elId);if(ele){ele.style.display='block';m_collapse(ele.id,'',path);}}}}}
function ExpandCollapse(mode,path){var nameEQ="mc_";var divs=document.getElementsByTagName('div');for(var i=0;i<divs.length;i++){if(divs[i].id&&divs[i].id.indexOf(nameEQ)==0){mdiv=document.getElementById(divs[i].id);if(mode){if(mdiv.style.display=='none')m_collapse(mdiv.id,'',path);}else{if(mdiv.style.display=='block'||mdiv.style.display=='')m_collapse(mdiv.id,'',path);}}}}
function hideWindowed(div,iframe){iframe.style.top=div.style.top;iframe.style.left=div.style.left;iframe.style.width=div.style.width;iframe.style.height=div.style.height;iframe.style.zIndex=div.style.zIndex-1;iframe.style.display='block';}
var checkedall=false;function checkAll(form){if(checkedall){uncheckAll(form);return;}
for(i=0;i<form.elements.length;i++){var chkName=form.elements[i];if(form.elements[i].type=='checkbox'){chkName.checked=true;}}
checkedall=true;}
function uncheckAll(form){for(i=0;i<form.elements.length;i++){var chkName=form.elements[i];if(form.elements[i].type=='checkbox'){chkName.checked=false;}}
checkedall=false;}
function have_selected(form){for(i=0;i<form.elements.length;i++){var chkName=form.elements[i];if(chkName.type=='checkbox'){if(chkName.id.substr(0,2)=='c_'){if(chkName.checked==true){return true;}}}}
return false;}
function changecss(theClass,element,value){var cssRules;if(document.all){cssRules='rules';}else if(document.getElementById){cssRules='cssRules';}
classnames=theClass.split('|');for(var i=0;i<classnames.length;i++){for(var S=0;S<document.styleSheets.length;S++){for(var R=0;R<document.styleSheets[S][cssRules].length;R++){if(document.styleSheets[S][cssRules][R].selectorText=="."+classnames[i]){for(var j=0;j<document.styleSheets[S][cssRules][R].style.length;j++){alert(document.styleSheets[S][cssRules][R].style[j]);}
document.styleSheets[S][cssRules][R].style[element]=value;}}}}}
function findPosX(obj)
{var curleft=0;if(obj.offsetParent)
{while(obj.offsetParent)
{curleft+=obj.offsetLeft;obj=obj.offsetParent;}}
else if(obj.x)
curleft+=obj.x;return curleft;}
function findPosY(obj)
{var curtop=0;if(obj.offsetParent)
{while(obj.offsetParent)
{curtop+=obj.offsetTop;obj=obj.offsetParent;}}
else if(obj.y)
curtop+=obj.y;return curtop;}
function checkIt(string){var detect=navigator.userAgent.toLowerCase();place=detect.indexOf(string)+1;return place;}
function findObj(n,d){if(typeof n!="string")return n;var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++){x=d.forms[i][n];}
for(i=0;!x&&d.layers&&i<d.layers.length;i++){x=findObj(n,d.layers[i].document);}
if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function isValidAlphaNum(text)
{var i;for(i=0;i<text.length;i++)
{ch=text.substr(i,1);if(!((ch>="a"&&ch<="z")||(ch>="A"&&ch<="Z")||(ch>="0"&&ch<="9")||ch=="-"||ch=="_"||ch=="."||ch==" "))
{return false;}}
return true;}
function isValidGeneral(text)
{var i;for(i=0;i<text.length;i++)
{ch=text.substr(i,1);if(!((ch>="a"&&ch<="z")||(ch>="A"&&ch<="Z")||(ch>="0"&&ch<="9")||ch=="?"||ch=="-"||ch=="_"||ch=="."||ch==","||ch==" "||ch=="@"||ch=="!"||ch=="*"||ch=='$'||ch=='#'||ch=='&'||ch=='/'))
{return false;}}
return true;}
function isValidAlphaNumSpec(text)
{var i;for(i=0;i<text.length;i++)
{ch=text.substr(i,1);if(!((ch>="a"&&ch<="z")||(ch>="A"&&ch<="Z")||(ch>="0"&&ch<="9")||ch=="-"||ch=="_"||ch=="."||ch==" "))
{return false;}}
return true;}
function isValidEmail(str)
{var supported=0;if(window.RegExp)
{var tempStr="a";var tempReg=new RegExp(tempStr);if(tempReg.test(tempStr))supported=1;}
if(!supported)
return(str.indexOf(".")>2)&&(str.indexOf("@")>0);var r1=new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");var r2=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");return(!r1.test(str)&&r2.test(str));}
function isValidNum(text)
{var i;for(i=0;i<text.length;i++)
{ch=text.substr(i,1);if(!((ch>="0"&&ch<="9")||ch=="-"||ch=="_"||ch=="."||ch==" "))
{return false;}}
return true;}
function isValidMatch(str,form,exist){m=str.split(";");if(form){frm=findObj(form);var pass1=find_on_form(m[0],frm);}else{var pass1=findObj(m[0]);}
if(exist){if(!pass1.value){return true;}}
if(form){var pass2=find_on_form(m[1],frm);}else{var pass2=findObj(m[1]);}
if(pass1.value!=pass2.value){pass1.value="";pass2.value="";pass1.focus();return false;}
return true;}
function isValidOne(str,form){m=str.split(";");for(i=0;i<m.length;i++){if(form){frm=findObj(form);var pass1=find_on_form(m[i],frm);}else{var pass1=findObj(m[i]);}
if(pass1.value!="")return true;}
return false;}
function isValidSelectCount(str,form,exist){m=str.split(";");if(form){frm=findObj(form);var pass1=find_on_form(m[0],frm);}else{var pass1=findObj(m[0]);}
var sel_count=0;var maxCnt=pass1.options.length;for(var i=0;i<maxCnt-1;i++){if((pass1.options[i]!=null)&&(pass1.options[i].selected==true)){sel_count++;}}
if(exist){if(!sel_count)return false;}
if(sel_count>m[1]){return false;}
return true;}
function isValidCheckboxCount(str,form,exist){m=str.split(";");oform=document.getElementById(form);els=oform.elements;var sel_count=0;for(i=0;i<els.length;i++){if(els[i].id==m[0]){if(els[i].checked){sel_count++;}}}
if(exist){if(!sel_count)return false;}
if(sel_count>m[1]){return false;}
return true;}
function isValidLength(str,form,exist){m=str.split(";");if(form){frm=findObj(form);var pass1=find_on_form(m[0],frm);}else{var pass1=findObj(m[0]);}
if(exist){if(!pass1.value){return true;}}
if(pass1.value.length<m[1]){pass1.value="";pass1.focus();return false;}
return true;}
function isNull(str,form){if(form){frm=findObj(form);var o=find_on_form(str,frm);}else{var o=findObj(str);}
if(!o){alert(str+" dont exists ");return true;}
if(o.value=="0"||o.value==""){o.focus();return true;}
return false;}
function isSet(str,form){if(form){frm=findObj(form);var o=find_on_form(str,frm);}else{var o=findObj(str);}
if(!o){alert(str+" dont exists ");return true;}
if(o.value=="undefined"){o.focus();return true;}
return false;}
function find_on_form(currVar,oFormName){if(typeof oFormName=="string"){oFormName=document.forms[oFormName]||document.getElementById(oFormName);}
if(typeof currVar!="string"){currVarName=currVar.id;}else{currVarName=currVar;}
for(var i=0;i<oFormName.elements.length;i++){var el=oFormName.elements[i];if(el.id==currVarName||el.name==currVarName){return el;}}
return null;}
function getCheckedValue(radioObj,frm){if(!radioObj||!frm){alert("Radio validation need a form or radio supplied is invalid");return"";}
radioName=radioObj.name;radioObj=frm[radioName];var radioLength=radioObj.length;if(radioLength==undefined)
if(radioObj.checked)
return radioObj.value;else
return"";for(var i=0;i<radioLength;i++){if(radioObj[i].checked){return radioObj[i].value;}}
return"";}
function validateForm(val_names,val_types,val_titles,form){var currVar;var i;for(i=0;i<val_names.length;i++){if(val_types[i]<=8){if(form){currFrm=findObj(form);currVar=find_on_form(val_names[i],currFrm);}else{currVar=findObj(val_names[i]);}}else{currVar=val_names[i];}
if(currVar){if(val_types[i]<=8){if(val_types[i]<5){if(currVar.value==""){alert(val_titles[i]);currVar.focus();return false;}}else{val_types[i]-=4;}
if((val_types[i]==1)&&!isValidAlphaNum(currVar.value)){alert(val_titles[i]);currVar.focus();return false;}
if((val_types[i]==2)&&!isValidNum(currVar.value)){alert(val_titles[i]);currVar.focus();return false;}
if((val_types[i]==3)&&!isValidEmail(currVar.value)){alert(val_titles[i]);currVar.focus();return false;}
if((val_types[i]==4)&&!isValidGeneral(currVar.value)){alert(val_titles[i]);currVar.focus();return false;}}else{if((val_types[i]==9)&&!isValidMatch(currVar,form)){alert(val_titles[i]);return false;}
if((val_types[i]==10)&&!isValidLength(currVar,form)){alert(val_titles[i]);return false;}
if((val_types[i]==11)&&isNull(currVar,form)){alert(val_titles[i]);return false;}
if((val_types[i]==12)&&!isValidLength(currVar,form,true)){alert(val_titles[i]);return false;}
if((val_types[i]==13)&&!isValidMatch(currVar,form,true)){alert(val_titles[i]);return false;}
if((val_types[i]==14)&&!isValidSelectCount(currVar,form)){alert(val_titles[i]);return false;}
if((val_types[i]==15)&&!isValidSelectCount(currVar,form,true)){alert(val_titles[i]);return false;}
if((val_types[i]==16)&&!isValidCheckboxCount(currVar,form,true)){alert(val_titles[i]);return false;}
if((val_types[i]==17)&&!isValidOne(currVar,form,true)){alert(val_titles[i]);return false;}
if((val_types[i]==19)){val=GetEditorContents(currVar);if(!val){alert(val_titles[i]);return false;}}
if((val_types[i]==20)&&!isValidConditional(currVar,form,true)){alert(val_titles[i]);return false;}
if((val_types[i]==21)&&!isValidDate(currVar,form,true)){alert(val_titles[i]);return false;}
if((val_types[i]==22)){if(form){currFrm=findObj(form);currVar=find_on_form(val_names[i],currFrm);}else{currVar=findObj(val_names[i]);}
if(currVar.type=='radio'){rVal=getCheckedValue(currVar,currFrm);if(!rVal){alert(val_titles[i]);currVar.focus();return false;}}else{alert("Only radio buttons can be validated this way");return false;}}}}else{alert('JS: You try to validate inexistent field '+val_names[i]);return false;}}
return true;}
var _p;function init_ajax(){_p=ajax_loader.prototype=new pAjax;_p.load_select=function(suid,html_obj,method,extra,multi,wait){var oRequest=this.prepare(method,pAjaxRequest.POST);oRequest.setURI("ajax_loader.php");oRequest.setParam("suid",suid);oRequest.setParam("html_obj",html_obj);if(extra)oRequest.setParam("extra",extra);if(multi)oRequest.setParam("multi",multi);if(wait)ajax_wait(mdiv,0,"");oRequest.execute(pAjaxRequest.ASYNC);}
_p.record_action=function(mdiv,suid,method,wait,mode){var oRequest=this.prepare(method,pAjaxRequest.POST);oRequest.setURI("ajax.php");oRequest.setParam("mdiv",mdiv);oRequest.setParam("suid",suid);if(wait)ajax_wait(mdiv,0,"");if(!mode){oRequest.execute(pAjaxRequest.ASYNC);}else{oRequest.execute(pAjaxRequest.SYNC);}}
_p.record_post_form=function(mdiv,frm,method,wait,mode){var oRequest=this.prepare(method,pAjaxRequest.POST);oRequest.setURI("ajax.php");oRequest.setParam("mdiv",mdiv);frm=document.getElementById(frm);if(oRequest.setFormParam(frm))return;if(wait)ajax_wait(mdiv,0,"");if(!mode){oRequest.execute(pAjaxRequest.ASYNC);}else{oRequest.execute(pAjaxRequest.SYNC);}}
_p.onCreate=function(){}
_p.onLoad=function(){var data=this.getResponse();eval(data[0]+"(data[1],data[2]);");mouter=document.getElementById('outer');if(mouter)hide_me('outer');n=3;if(n)setTimeout("ajax_fade()",n);}}
function ajax_loader(){pAjax.call(this);pAjax.setDebugMode(false);}
function ajax_wait(mdiv,n,s){l=findPosX(document.getElementById(mdiv));t=findPosY(document.getElementById(mdiv));w=document.getElementById(mdiv).offsetWidth;h=document.getElementById(mdiv).offsetHeight;document.getElementById(mdiv).innerHTML="";document.getElementById(mdiv).style.width=w;document.getElementById(mdiv).style.height=h;document.getElementById('statusContainer').style.left=l+2;document.getElementById('statusContainer').style.top=t+h/2;document.getElementById('statusContainer').style.width=w-4;Effect.Appear('statusContainer',{duration:0.4,to:1});$('statusContainer').style.visibility="visible";if(n)setTimeout("ajax_fade()",n);}
function ajax_fade(){if(document.getElementById('statusContainer'))$('statusContainer').style.visibility='hidden';}
function loader(obj_name,list){hideLoader(obj_name);var box2=document.getElementById(obj_name);if(list=="null")return;reset_select(obj_name);for(i=0;i<list.length;i++){box2.options[i]=new Option(list[i].label,list[i].value);}
try{eval("sel"+obj_name+"();");}catch(e){}}
function load_select(sel,obj,method,extra,multi){init_ajax();if(typeof(sel)=='string'){vals=sel;}else{if(sel.options[sel.selectedIndex].value=="0")return;vals=sel.options[sel.selectedIndex].value;}
showLoader(obj);_p.load_select(vals,obj,method,extra,multi);}
function hideLoader(obj){ldr=document.getElementById(obj+"_loader");if(ldr)ldr.parentNode.removeChild(ldr);}
function showLoader(obj){try{ldr=document.getElementById(obj);loader_span=document.createElement("span");loader_span.id=obj+"_loader";loader_span.style.float="left";loader_span.style.position="absolute";loader_span.innerHTML='<img src=ajax-loader.gif>';ldr.parentNode.insertBefore(loader_span,ldr);}catch(e){}}
function reset_select(sel){var box2=document.getElementById(sel);if(box2){while(box2.options[0]!=null){box2.options[0]=null;}}}
var old_content="";function fill_data(content,mdiv){cdiv=document.getElementById(mdiv);if(cdiv){if(content!="")cdiv.innerHTML=content;try{if(eventFade[mdiv]){new Rico.Effect.FadeTo(mdiv,1,100,10);}
eventFade[mdiv]='';}catch(e){}}
var lajax=cdiv.previousSibling;if(lajax&&lajax.id=='ajaxloader')cdiv.parentNode.removeChild(lajax);run_js(mdiv);}
function fill_data_style(content,mdiv){var browserName=navigator.appName;cdiv=document.getElementById(mdiv);if(browserName=="Netscape"){for(i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].title){document.styleSheets[i].disabled=true;if(document.styleSheets[i].title=='themesty')
document.styleSheets[i].disabled=false;}}
content[1]=content[0]+content[1];}else{if(browserName=="Microsoft Internet Explorer"){for(i=0;i<document.styleSheets.length;i++){if(document.styleSheets[i].title=='themesty')document.styleSheets[i].cssText=content[0];}}}
if(cdiv){cdiv.innerHTML=content[1];}
try{new Rico.Effect.FadeTo(mdiv,1,500,20);}catch(e){}
run_js(mdiv);}
function fill_data_end(content,mdiv){document.getElementById(mdiv[0]).innerHTML=content;document.getElementById(mdiv[1]).innerHTML="Edit";}
function record_cancel(mdiv,lnk){document.getElementById(mdiv).innerHTML=old_content;document.getElementById(lnk).innerHTML="Edit";}
function record_edit(mdiv,id,method){init_ajax();old_content=document.getElementById(mdiv).innerHTML;_p.record_action(mdiv,id,method,1);}
function record_save(mdiv,method,form){init_ajax();field=find_on_form('receditAction',form);if(!field)return false;field.value=1;_p.record_post_form(mdiv,form,method);}
function create_new_list(mdiv,frm,method){init_ajax();_p.record_post_form(mdiv,frm,method);}
function delete_list(mdiv,id,method){init_ajax();_p.record_action(mdiv,id,method);}
function edit_friend_comment(mdiv,frm,method){init_ajax();_p.record_post_form(mdiv,frm,method);}
function show_preview(sel){document.getElementById('canvas').style.display="block";document.getElementById('pholder').style.display="block";document.getElementById('tips').style.display="none";for(i=0;i<sel.options.length;i++){if(sel.options[i].selected){init_ajax();_p.record_action('canvas',sel.options[i].value,'preview_video');break;}}}
function hide_preview(){document.getElementById('canvas').style.display="none";document.getElementById('pholder').style.display="none";document.getElementById('tips').style.display="block";}
function film_strip(limit,id,method,mdiv,plid,stop_fade){init_ajax();args=new Array();args[0]=id;args[1]=limit;args[2]=plid;if(!stop_fade){try{eventFade[mdiv]=new Rico.Effect.FadeTo(mdiv,.05,10,10);}catch(e){}}
_p.record_action(mdiv,args,method);}
function post_comment(mdiv,frm,method){init_ajax();_p.record_post_form(mdiv,frm,method);fm=findObj(frm);try{var cm=find_on_form('comment',fm);cm.value='';}catch(e){}}
function delete_topic(mdiv,id,method){init_ajax();_p.record_action(mdiv,id,method);}
function subscription(mdiv,id,method){init_ajax();_p.record_action(mdiv,id,method);}
function group_subscription(mdiv,id,method){init_ajax();_p.record_action(mdiv,id,method);}
function subscribe_tag(mdiv,id,method,loader){init_ajax();show_me('sresult');if(loader)document.getElementById(mdiv).innerHTML='<img src='+loader+'>';_p.record_action(mdiv,id,method);}
function done_subscription(val,res){if(res){tt=val.split("|");document.getElementById('butSubscr').value=tt[0];}else{alert('Ajax error');}
run_js(tt[1]);}
function done_add_friend(val,res){if(res){document.getElementById('addtofriends').innerHTML=val;}else{alert('Ajax error');}
run_js(val);hide_me('channel_actions');hide_me('actionsDivBig');show_me('watchActionsTable')}
function fill_playlist(content,mdiv){plays=content[0];viewsel=content[1];suid=content[2];methodSel=content[3];mdivSel=content[4];plid=content[5];cdiv=document.getElementById(mdiv);if(cdiv){cdiv.innerHTML=plays;try{new Rico.Effect.FadeTo(mdiv,1,100,5);}catch(e){}}
init_ajax();try{new Rico.Effect.FadeTo(mdivSel,.0,100,5);}catch(e){}
args=new Array();args[0]=suid;args[1]=0;if(!viewsel){args[2]=-1;_p.record_action(mdivSel,args,methodSel);}else{args[2]=plid;_p.record_action(mdivSel,args,methodSel);}
run_js(mdiv);}
function refreshAd(mdiv){var d=document.getElementById(mdiv);if(d){var s=d.getElementsByTagName('iframe');if(s&&s.length){s[0].src=s[0].src+'&'+new Date().getTime();}}
return true;}
function run_js(mdiv){myDiv=document.getElementById(mdiv);if(myDiv){htmlString=myDiv.innerHTML;}else{htmlString=mdiv;}
htmlString="aa"+htmlString+"bb";var re=/<script\b.*?>([\s\S]*?)<\/script/ig;var match;while(match=re.exec(htmlString)){eval(match[1]);}}
function watch_action(mdiv,id,method,height,loader){init_ajax();if(loader)document.getElementById(mdiv).innerHTML='<img src='+loader+'>';show_me("actionsDivBig");hide_me('watchActionsTable');if(height)document.getElementById('actionsDivBig').style.height=height;_p.record_action(mdiv,id,method);}
function watch_action_done(mdiv,frm,method,loader){init_ajax();show_me("actionsDivBig");hide_me('watchActionsTable');_p.record_post_form(mdiv,frm,method);if(loader)document.getElementById(mdiv).innerHTML='<img src='+loader+'>';}
function channel_action(mdiv,id,method,height,loader,showDiv){init_ajax();if(loader)document.getElementById(mdiv).innerHTML='<img src='+loader+'>';if(!showDiv)showDiv="yes";if(showDiv=="yes")show_me(mdiv);if(height)document.getElementById(mdiv).style.height=height;_p.record_action(mdiv,id,method);}
function channel_share_done(mdiv,frm,method){init_ajax();_p.record_post_form(mdiv,frm,method);}
function approve_group_media(mdid,ugid,mode,mdiv,method){init_ajax();args=new Array();args[0]=mdid;args[1]=ugid;args[2]=mode;try{eventFade[mdiv]=new Rico.Effect.FadeTo(mdiv,.05,200,20);}catch(e){}
_p.record_action(mdiv,args,method);}
function delete_tag_sub(mdiv,seltag,id,method){init_ajax();args=new Array();args[0]=seltag;args[1]=id;_p.record_action(mdiv,args,method);}
function reload_theme(mdiv,frm,method){init_ajax();_p.record_post_form(mdiv,frm,method);}
function reload_theme_preset(mdiv,thm,method){init_ajax();_p.record_action(mdiv,thm,method);}
function send_rating(rate,mdid,mdiv,method){init_ajax();args=new Array();args[0]=rate;args[1]=mdid;document.getElementById(mdiv).style.position='relative';document.getElementById(mdiv).style.display='block';_p.record_action(mdiv,args,method);}
var pb_status;function call_pb(id,mdiv,method){setTimeout("refresh_pb('"+id+"','"+mdiv+"','"+method+"')",5000)}
function refresh_pb(id,mdiv,method){init_ajax();_p.record_action(mdiv,id,method,0);}
function fill_pb(content,mdiv){pb_status=content[0];if(content[0]=='refresh'||pb_status=='working')setTimeout("refresh_pb('"+content[1]+"','"+mdiv+"','upload_progress')",5000);cdiv=document.getElementById(mdiv);if(content[0]=='done')content[2]="Upload finished";if(cdiv){cdiv.innerHTML=content[2];new Rico.Effect.FadeTo(mdiv,1,100,5);}
run_js(mdiv);}
function load_banner(mdiv,wich){init_ajax();if(!document.getElementById(mdiv))return;_p.record_action(mdiv,wich,"get_banners");}
function event_exec(mdiv,arg,method){init_ajax();if(mdiv){mdivO=document.getElementById(mdiv);if(!mdivO){return;}}
frm=document.getElementById(arg);if(frm&&typeof frm!="undefined"){_p.record_post_form(mdiv,arg,method,0,true);}else{_p.record_action(mdiv,arg,method,false,true);}}
function accept_p_comment(mdiv,id,method){init_ajax();_p.record_action(mdiv,id,method);}
function event_process(mdiv,arg,method,loader,keepContent,stop_fade){init_ajax();if(mdiv){mdivO=document.getElementById(mdiv);if(!mdivO){return;}}
if(!stop_fade){try{eventFade[mdiv]=new Rico.Effect.FadeTo(mdiv,.05,10,10);}catch(e){}}
if(loader){if(keepContent){var spal=document.createElement('div');spal.setAttribute('style','position:absolute;');spal.setAttribute('id','ajaxloader');var al=document.createElement('img');al.setAttribute('src',loader);spal.appendChild(al);document.getElementById(mdiv).setAttribute('style','position:relative');document.getElementById(mdiv).parentNode.insertBefore(spal,document.getElementById(mdiv));}else{var spal=document.createElement('div');spal.setAttribute('style','position:absolute;');spal.setAttribute('id','ajaxloader');var al=document.createElement('img');al.setAttribute('src',loader);spal.appendChild(al);document.getElementById(mdiv).setAttribute('style','position:relative');document.getElementById(mdiv).parentNode.insertBefore(spal,document.getElementById(mdiv));}}
frm=document.getElementById(arg);if(frm&&typeof frm!="undefined"){_p.record_post_form(mdiv,arg,method);}else{_p.record_action(mdiv,arg,method,false);}}
function display_photo(mdiv,src){content="<img class=thumb style='float:right' src="+src+">";dv=document.getElementById(mdiv);if(dv)dv.innerHTML=content;closer=document.getElementById('closer');if(closer)closer.style.width=dv.style.width;}
function GetEditorContents(name)
{var oEditor=FCKeditorAPI.GetInstance(name);return oEditor.GetXHTML(true);}
function post_profile_comment(mdiv,frm,method){init_ajax();_p.record_post_form(mdiv,frm,method);}
function loadobjs(){if(!document.getElementById)return;for(i=0;i<arguments.length;i++){var file=arguments[i];var fileref="";if(loadedobjects.indexOf(file)==-1){if(file.indexOf(".js")!=-1){fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");fileref.setAttribute("src",file);}else if(file.indexOf(".css")!=-1){fileref=document.createElement("link")
fileref.setAttribute("rel","stylesheet");fileref.setAttribute("type","text/css");fileref.setAttribute("href",file);}}
if(fileref!=""){document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" "}}}
function recreate_element(el){ele=document.getElementById(el);var clone=ele.cloneNode(false);pele=ele.parentNode;pele.removeChild(ele);pele.appendChild(clone);}
function createCookie(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=/";}
function readCookie(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;}
function clearCookies(){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);cn=c.split('=');c=cn[0];eraseCookie(c);}}
function eraseCookie(name){createCookie(name,"",-1);}
function AddaNote(pc,transfert,editable){var notes=new PhotoNoteContainer(document.getElementById(pc));var newNote=new PhotoNote(transfert);newNote.onsave=function(note){var mynote=new Array();mynote[0]=note.id;mynote[1]=note.rect.left;mynote[2]=note.rect.top;mynote[3]=note.rect.width;mynote[4]=note.rect.height;mynote[5]=note.text;mynote[6]=note.container.element.id;event_process('save_fedback',mynote,"photo_note_save");notes.DeleteNote(note);return false;}
newNote.ondelete=function(note){var mynote=new Array();mynote[0]=note.id;event_process('just_ping',mynote,"photo_note_delete");return true;}
notes.AddNote(newNote);if(editable)notes.readonly=true;}
function search_suggest(inp,speed){if(!speed)speed=6000;if(inp.value.length>2){show_me('suggestions');clearTimeout(ctime);if(inp.value.indexOf('\'')>0)return false;clearInterval(timerClock);timerClock=setInterval("stopTips=false;initIdle("+speed+")",20000);ctime=setTimeout('event_process(\'suggestions\',\''+encodeURIComponent(inp.value)+'\',\'search_suggestions\',\'admin_templates/images/ajax_loader.gif\')',2000);}else{if(inp.value.length==0){document.getElementById('suggestions').innerHTML="<font class='tips' style='color:gray'>&nbsp;</font>";}}}
function UpdateStatus(speed,handle){clearInterval(timerClock);i=Math.round((announcements.length-1)*Math.random())
if(document.getElementById('suggestions')){var handler="";if(!handle)handler=" <span title='Tips box - Click to read random selected one' onclick='UpdateStatus("+speed+","+handle+")' class='tipbut'>...</span> ";document.getElementById('suggestions').innerHTML=announcements[i]+handler;timerClock=setInterval("UpdateStatus("+speed+","+handle+")",speed);}}
function initIdle(speed,handle){if(!speed)speed=6000;if(stopTips){clearInterval(timerClock);timerClock=setInterval("stopTips=false;initIdle("+speed+")",speed);return;}
var i;clearInterval(timerClock);timerClock=setInterval("UpdateStatus("+speed+","+handle+")",speed);}
var schTime;function search_schools(inp,loader){if(inp.value.length>2){clearTimeout(schTime);if(inp.value.indexOf('\'')>0)return false;schTime=setTimeout('event_process(\'divSchoolTips\',\'schools|'+inp.value+'\',\'school_tip\',\''+loader+'\')',2000);}}
function FCKeditor_OnComplete_(editorInstance){if(editorInstance.Name=="im_txtarea")my_func="imkeyup";if(editorInstance.Name=="aaamsg")my_func="my_function";if(document.all){eval('editorInstance.EditorDocument.attachEvent("onkeyup", '+my_func+')');}else{eval('editorInstance.EditorDocument.addEventListener("keyup", '+my_func+', true )');}}
var imdiv;var imsuid;var im_username;var im_typing=false;var im_history=0;var im_focus_chat=0;var im_shift_win=0;var im_flashy;function winresize(obj){mhistid='im_history_'+obj.key.replace('div_im_chat','');mhist=document.getElementById(mhistid);winH=$(obj.key+"_body").getHeight();hdiv=winH-230;if(mhist)mhist.style.height=hdiv+"px";}
function im_create_chat(suid,loader,popup_w,img_path,wm){show_close_button=1;show_maximize_button=0;if(popup_w){var w=new_mydow({"handle":'div_im_chat'+suid,"close":0,"minimize":0,"maximize":0,"x":1,"y":1,"w":320,"h":590,"title":".......","img_path":img_path});}else{var w=new_mydow({"handle":'div_im_chat'+suid,"w":330,"h":500,"title":".......","img_path":img_path});}
mydow_event(w.handle,"on_resize",winresize);$(w.statbar).update(".....");$(w.body).update("please wait...");event_process('div_im_chat'+suid+"_body",suid+'|'+popup_w+'|'+wm,'im_chat',loader,true,true);}
function im_kill_me(id){mydow_close(id);}
function im_set_focus(){im_chat_win=document.getElementById('div_im_chat'+im_focus_chat);if(!im_chat_win)return;txt=im_chat_win.getElementsByTagName('textarea');txt[0].className='im_focus_chat';txt[0].focus();}
function imkeyup(evt){alert('imkeyup');var nbr=(window.event)?event.keyCode:evt.which;if(nbr==13){nbr=0;im_send_message(txarea,imdiv,imsuid);}else{if(im_typing==false&&txarea.value){im_typing==true;event_process(imdiv+"_itype",imsuid,'im_typing','',true,true);}}}
function imtxtblur(txta){im_typing==false;event_process(imdiv+"_itype",imsuid+"|1",'im_typing','',true,true);}
function im_fill_data(content,mdiv){cdiv=document.getElementById(mdiv);try{if(cdiv){if(content!="")cdiv.innerHTML=content;}
run_js(mdiv);lajax=cdiv.previousSibling;if(lajax&&lajax.id=='ajaxloader')cdiv.parentNode.removeChild(lajax);}catch(e){throw("im_fill_data"+e)}}
function trim(stringToTrim){return stringToTrim.replace(/^\s+|\s+$/g,"");}
function ltrim(stringToTrim){return stringToTrim.replace(/^\s+/,"");}
function rtrim(stringToTrim){return stringToTrim.replace(/\s+$/,"");}
function im_send_message(mdiv,suid,editorID){txt=GetEditorContents(editorID);txt=trim(txt);txt=txt.replace(/(.*)<br[\s]\/>($)/g,"$1$2");txt=trim(txt);txt=txt.replace(/(.*)<br[\s]\/>($)/g,"$1$2");txt=trim(txt);txt=txt.replace(/(.*)<br[\s]\/>($)/g,"$1$2");txt=trim(txt);if(!txt)return;try{var oEditor=FCKeditorAPI.GetInstance(editorID);oEditor.SetData('');oEditor.Focus();}catch(e){}
var myArray=new Array();myArray[0]=suid;myArray[1]=txt;myArray[2]=im_history;event_process(mdiv,myArray,'im_chat_message','',true,true);}
function im_load_history(ldvar,mdiv,params,fct){try{clearTimeout(ldvar);}catch(e){}
event_process(mdiv,params,fct,'',true,true)}
function im_scroll(mdiv,dopt){if(mdiv.scrollTop==0){show_me(dopt);}else{hide_me(dopt);}}
var flashy_break;var im_window_title=document.title;function im_settitle(txt,mode,suid,wtit){if(!wtit)wtit=im_window_title;if(!im_username)im_username="";if(flashy_break)mode=0;try{if(mode){mode=0;document.title=txt+im_username;document.getElementById('div_im_chat'+suid+'_title').className="im_title_alert";}else{mode=1;document.title=wtit;document.getElementById('div_im_chat'+suid+'_title').className="im_title";}}catch(e){}
try{clearTimeout(im_flashy);}catch(e){}
if(!flashy_break){im_flashy=setTimeout("im_settitle('"+txt+"',"+mode+","+suid+",'"+wtit+"')",1500);}else{flashy_break=false;}}
function im_toggle_alert(className){it=document.getElementById('im_toggle');if(it)it.className=className;}
function im_delay_refresh(){try{clearTimeout(divim_contact_listVar)}catch(e){}
divim_contact_listVar=setTimeout("event_process('divim_contact_list','all','im_contact_list','',true,true)",20000);}
function im_typing_check(inst){txt=FCKeditorAPI.__Instances[inst].GetHTML();tx=txt.replace("<br />","");if(tx)return 1;return 0;};var Prototype={Version:'1.6.0.2',Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf('AppleWebKit/')>-1,Gecko:navigator.userAgent.indexOf('Gecko')>-1&&navigator.userAgent.indexOf('KHTML')==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement('div').__proto__&&document.createElement('div').__proto__!==document.createElement('form').__proto__},ScriptFragment:'<script[^>]*>([\\S\\s]*?)<\/script>',JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(x){return x}};if(Prototype.Browser.MobileSafari)
Prototype.BrowserFeatures.SpecificElementExtensions=false;var Class={create:function(){var parent=null,properties=$A(arguments);if(Object.isFunction(properties[0]))
parent=properties.shift();function klass(){this.initialize.apply(this,arguments);}
Object.extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){var subclass=function(){};subclass.prototype=parent.prototype;klass.prototype=new subclass;parent.subclasses.push(klass);}
for(var i=0;i<properties.length;i++)
klass.addMethods(properties[i]);if(!klass.prototype.initialize)
klass.prototype.initialize=Prototype.emptyFunction;klass.prototype.constructor=klass;return klass;}};Class.Methods={addMethods:function(source){var ancestor=this.superclass&&this.superclass.prototype;var properties=Object.keys(source);if(!Object.keys({toString:true}).length)
properties.push("toString","valueOf");for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&Object.isFunction(value)&&value.argumentNames().first()=="$super"){var method=value,value=Object.extend((function(m){return function(){return ancestor[m].apply(this,arguments)};})(property).wrap(method),{valueOf:function(){return method},toString:function(){return method.toString()}});}
this.prototype[property]=value;}
return this;}};var Abstract={};Object.extend=function(destination,source){for(var property in source)
destination[property]=source[property];return destination;};Object.extend(Object,{inspect:function(object){try{if(Object.isUndefined(object))return'undefined';if(object===null)return'null';return object.inspect?object.inspect():String(object);}catch(e){if(e instanceof RangeError)return'...';throw e;}},toJSON:function(object){var type=typeof object;switch(type){case'undefined':case'function':case'unknown':return;case'boolean':return object.toString();}
if(object===null)return'null';if(object.toJSON)return object.toJSON();if(Object.isElement(object))return;var results=[];for(var property in object){var value=Object.toJSON(object[property]);if(!Object.isUndefined(value))
results.push(property.toJSON()+': '+value);}
return'{'+results.join(', ')+'}';},toQueryString:function(object){return $H(object).toQueryString();},toHTML:function(object){return object&&object.toHTML?object.toHTML():String.interpret(object);},keys:function(object){var keys=[];for(var property in object)
keys.push(property);return keys;},values:function(object){var values=[];for(var property in object)
values.push(object[property]);return values;},clone:function(object){return Object.extend({},object);},isElement:function(object){return object&&object.nodeType==1;},isArray:function(object){return object!=null&&typeof object=="object"&&'splice'in object&&'join'in object;},isHash:function(object){return object instanceof Hash;},isFunction:function(object){return typeof object=="function";},isString:function(object){return typeof object=="string";},isNumber:function(object){return typeof object=="number";},isUndefined:function(object){return typeof object=="undefined";}});Object.extend(Function.prototype,{argumentNames:function(){var names=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return names.length==1&&!names[0]?[]:names;},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}},bindAsEventListener:function(){var __method=this,args=$A(arguments),object=args.shift();return function(event){return __method.apply(object,[event||window.event].concat(args));}},curry:function(){if(!arguments.length)return this;var __method=this,args=$A(arguments);return function(){return __method.apply(this,args.concat($A(arguments)));}},delay:function(){var __method=this,args=$A(arguments),timeout=args.shift()*1000;return window.setTimeout(function(){return __method.apply(__method,args);},timeout);},wrap:function(wrapper){var __method=this;return function(){return wrapper.apply(this,[__method.bind(this)].concat($A(arguments)));}},methodize:function(){if(this._methodized)return this._methodized;var __method=this;return this._methodized=function(){return __method.apply(null,[this].concat($A(arguments)));};}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+'-'+
(this.getUTCMonth()+1).toPaddedString(2)+'-'+
this.getUTCDate().toPaddedString(2)+'T'+
this.getUTCHours().toPaddedString(2)+':'+
this.getUTCMinutes().toPaddedString(2)+':'+
this.getUTCSeconds().toPaddedString(2)+'Z"';};var Try={these:function(){var returnValue;for(var i=0,length=arguments.length;i<length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}
return returnValue;}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(str){return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,'\\$1');};var PeriodicalExecuter=Class.create({initialize:function(callback,frequency){this.callback=callback;this.frequency=frequency;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},execute:function(){this.callback(this);},stop:function(){if(!this.timer)return;clearInterval(this.timer);this.timer=null;},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();}finally{this.currentlyExecuting=false;}}}});Object.extend(String,{interpret:function(value){return value==null?'':String(value);},specialChar:{'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','\\':'\\\\'}});Object.extend(String.prototype,{gsub:function(pattern,replacement){var result='',source=this,match;replacement=arguments.callee.prepareReplacement(replacement);while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length);}else{result+=source,source='';}}
return result;},sub:function(pattern,replacement,count){replacement=this.gsub.prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0)return match[0];return replacement(match);});},scan:function(pattern,iterator){this.gsub(pattern,iterator);return String(this);},truncate:function(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?'...':truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this);},strip:function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'');},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'');},extractScripts:function(){var matchAll=new RegExp(Prototype.ScriptFragment,'img');var matchOne=new RegExp(Prototype.ScriptFragment,'im');return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||['',''])[1];});},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)});},escapeHTML:function(){var self=arguments.callee;self.text.data=this;return self.div.innerHTML;},unescapeHTML:function(){var div=new Element('div');div.innerHTML=this.stripTags();return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject('',function(memo,node){return memo+node.nodeValue}):div.childNodes[0].nodeValue):'';},toQueryParams:function(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match)return{};return match[1].split(separator||'&').inject({},function(hash,pair){if((pair=pair.split('='))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join('='):pair[0];if(value!=undefined)value=decodeURIComponent(value);if(key in hash){if(!Object.isArray(hash[key]))hash[key]=[hash[key]];hash[key].push(value);}
else hash[key]=value;}
return hash;});},toArray:function(){return this.split('');},succ:function(){return this.slice(0,this.length-1)+
String.fromCharCode(this.charCodeAt(this.length-1)+1);},times:function(count){return count<1?'':new Array(count+1).join(this);},camelize:function(){var parts=this.split('-'),len=parts.length;if(len==1)return parts[0];var camelized=this.charAt(0)=='-'?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++)
camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1);return camelized;},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();},underscore:function(){return this.gsub(/::/,'/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();},dasherize:function(){return this.gsub(/_/,'-');},inspect:function(useDoubleQuotes){var escapedString=this.gsub(/[\x00-\x1f\\]/,function(match){var character=String.specialChar[match[0]];return character?character:'\\u00'+match[0].charCodeAt().toPaddedString(2,16);});if(useDoubleQuotes)return'"'+escapedString.replace(/"/g,'\\"')+'"';return"'"+escapedString.replace(/'/g,'\\\'')+"'";},toJSON:function(){return this.inspect(true);},unfilterJSON:function(filter){return this.sub(filter||Prototype.JSONFilter,'#{1}');},isJSON:function(){var str=this;if(str.blank())return false;str=this.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"/g,'');return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON())return eval('('+json+')');}catch(e){}
throw new SyntaxError('Badly formed JSON string: '+this.inspect());},include:function(pattern){return this.indexOf(pattern)>-1;},startsWith:function(pattern){return this.indexOf(pattern)===0;},endsWith:function(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d;},empty:function(){return this=='';},blank:function(){return /^\s*$/.test(this);},interpolate:function(object,pattern){return new Template(this,pattern).evaluate(object);}});if(Prototype.Browser.WebKit||Prototype.Browser.IE)Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');},unescapeHTML:function(){return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');}});String.prototype.gsub.prepareReplacement=function(replacement){if(Object.isFunction(replacement))return replacement;var template=new Template(replacement);return function(match){return template.evaluate(match)};};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement('div'),text:document.createTextNode('')});with(String.prototype.escapeHTML)div.appendChild(text);var Template=Class.create({initialize:function(template,pattern){this.template=template.toString();this.pattern=pattern||Template.Pattern;},evaluate:function(object){if(Object.isFunction(object.toTemplateReplacements))
object=object.toTemplateReplacements();return this.template.gsub(this.pattern,function(match){if(object==null)return'';var before=match[1]||'';if(before=='\\')return match[2];var ctx=object,expr=match[3];var pattern=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;match=pattern.exec(expr);if(match==null)return before;while(match!=null){var comp=match[1].startsWith('[')?match[2].gsub('\\\\]',']'):match[1];ctx=ctx[comp];if(null==ctx||''==match[3])break;expr=expr.substring('['==match[3]?match[1].length:match[0].length);match=pattern.exec(expr);}
return before+String.interpret(ctx);});}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(iterator,context){var index=0;iterator=iterator.bind(context);try{this._each(function(value){iterator(value,index++);});}catch(e){if(e!=$break)throw e;}
return this;},eachSlice:function(number,iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var index=-number,slices=[],array=this.toArray();while((index+=number)<array.length)
slices.push(array.slice(index,index+number));return slices.collect(iterator,context);},all:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result=true;this.each(function(value,index){result=result&&!!iterator(value,index);if(!result)throw $break;});return result;},any:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result=false;this.each(function(value,index){if(result=!!iterator(value,index))
throw $break;});return result;},collect:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var results=[];this.each(function(value,index){results.push(iterator(value,index));});return results;},detect:function(iterator,context){iterator=iterator.bind(context);var result;this.each(function(value,index){if(iterator(value,index)){result=value;throw $break;}});return result;},findAll:function(iterator,context){iterator=iterator.bind(context);var results=[];this.each(function(value,index){if(iterator(value,index))
results.push(value);});return results;},grep:function(filter,iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var results=[];if(Object.isString(filter))
filter=new RegExp(filter);this.each(function(value,index){if(filter.match(value))
results.push(iterator(value,index));});return results;},include:function(object){if(Object.isFunction(this.indexOf))
if(this.indexOf(object)!=-1)return true;var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;},inGroupsOf:function(number,fillWith){fillWith=Object.isUndefined(fillWith)?null:fillWith;return this.eachSlice(number,function(slice){while(slice.length<number)slice.push(fillWith);return slice;});},inject:function(memo,iterator,context){iterator=iterator.bind(context);this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},invoke:function(method){var args=$A(arguments).slice(1);return this.map(function(value){return value[method].apply(value,args);});},max:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result;this.each(function(value,index){value=iterator(value,index);if(result==null||value>=result)
result=value;});return result;},min:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result;this.each(function(value,index){value=iterator(value,index);if(result==null||value<result)
result=value;});return result;},partition:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var trues=[],falses=[];this.each(function(value,index){(iterator(value,index)?trues:falses).push(value);});return[trues,falses];},pluck:function(property){var results=[];this.each(function(value){results.push(value[property]);});return results;},reject:function(iterator,context){iterator=iterator.bind(context);var results=[];this.each(function(value,index){if(!iterator(value,index))
results.push(value);});return results;},sortBy:function(iterator,context){iterator=iterator.bind(context);return this.map(function(value,index){return{value:value,criteria:iterator(value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0;}).pluck('value');},toArray:function(){return this.map();},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(Object.isFunction(args.last()))
iterator=args.pop();var collections=[this].concat(args).map($A);return this.map(function(value,index){return iterator(collections.pluck(index));});},size:function(){return this.toArray().length;},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>';}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(iterable){if(!iterable)return[];if(iterable.toArray)return iterable.toArray();var length=iterable.length||0,results=new Array(length);while(length--)results[length]=iterable[length];return results;}
if(Prototype.Browser.WebKit){$A=function(iterable){if(!iterable)return[];if(!(Object.isFunction(iterable)&&iterable=='[object NodeList]')&&iterable.toArray)return iterable.toArray();var length=iterable.length||0,results=new Array(length);while(length--)results[length]=iterable[length];return results;};}
Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(iterator){for(var i=0,length=this.length;i<length;i++)
iterator(this[i]);},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(value){return value!=null;});},flatten:function(){return this.inject([],function(array,value){return array.concat(Object.isArray(value)?value.flatten():[value]);});},without:function(){var values=$A(arguments);return this.select(function(value){return!values.include(value);});},reverse:function(inline){return(inline!==false?this:this.toArray())._reverse();},reduce:function(){return this.length>1?this:this[0];},uniq:function(sorted){return this.inject([],function(array,value,index){if(0==index||(sorted?array.last()!=value:!array.include(value)))
array.push(value);return array;});},intersect:function(array){return this.uniq().findAll(function(item){return array.detect(function(value){return item===value});});},clone:function(){return[].concat(this);},size:function(){return this.length;},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']';},toJSON:function(){var results=[];this.each(function(object){var value=Object.toJSON(object);if(!Object.isUndefined(value))results.push(value);});return'['+results.join(', ')+']';}});if(Object.isFunction(Array.prototype.forEach))
Array.prototype._each=Array.prototype.forEach;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(item,i){i||(i=0);var length=this.length;if(i<0)i=length+i;for(;i<length;i++)
if(this[i]===item)return i;return-1;};if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=function(item,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().indexOf(item);return(n<0)?n:i-n-1;};Array.prototype.toArray=Array.prototype.clone;function $w(string){if(!Object.isString(string))return[];string=string.strip();return string?string.split(/\s+/):[];}
if(Prototype.Browser.Opera){Array.prototype.concat=function(){var array=[];for(var i=0,length=this.length;i<length;i++)array.push(this[i]);for(var i=0,length=arguments.length;i<length;i++){if(Object.isArray(arguments[i])){for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++)
array.push(arguments[i][j]);}else{array.push(arguments[i]);}}
return array;};}
Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16);},succ:function(){return this+1;},times:function(iterator){$R(0,this,true).each(iterator);return this;},toPaddedString:function(length,radix){var string=this.toString(radix||10);return'0'.times(length-string.length)+string;},toJSON:function(){return isFinite(this)?this.toString():'null';}});$w('abs round ceil floor').each(function(method){Number.prototype[method]=Math[method].methodize();});function $H(object){return new Hash(object);};var Hash=Class.create(Enumerable,(function(){function toQueryPair(key,value){if(Object.isUndefined(value))return key;return key+'='+encodeURIComponent(String.interpret(value));}
return{initialize:function(object){this._object=Object.isHash(object)?object.toObject():Object.clone(object);},_each:function(iterator){for(var key in this._object){var value=this._object[key],pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}},set:function(key,value){return this._object[key]=value;},get:function(key){return this._object[key];},unset:function(key){var value=this._object[key];delete this._object[key];return value;},toObject:function(){return Object.clone(this._object);},keys:function(){return this.pluck('key');},values:function(){return this.pluck('value');},index:function(value){var match=this.detect(function(pair){return pair.value===value;});return match&&match.key;},merge:function(object){return this.clone().update(object);},update:function(object){return new Hash(object).inject(this,function(result,pair){result.set(pair.key,pair.value);return result;});},toQueryString:function(){return this.map(function(pair){var key=encodeURIComponent(pair.key),values=pair.value;if(values&&typeof values=='object'){if(Object.isArray(values))
return values.map(toQueryPair.curry(key)).join('&');}
return toQueryPair(key,values);}).join('&');},inspect:function(){return'#<Hash:{'+this.map(function(pair){return pair.map(Object.inspect).join(': ');}).join(', ')+'}>';},toJSON:function(){return Object.toJSON(this.toObject());},clone:function(){return new Hash(this);}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive;},_each:function(iterator){var value=this.start;while(this.include(value)){iterator(value);value=value.succ();}},include:function(value){if(value<this.start)
return false;if(this.exclusive)
return value<this.end;return value<=this.end;}});var $R=function(start,end,exclusive){return new ObjectRange(start,end,exclusive);};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(iterator){this.responders._each(iterator);},register:function(responder){if(!this.include(responder))
this.responders.push(responder);},unregister:function(responder){this.responders=this.responders.without(responder);},dispatch:function(callback,request,transport,json){this.each(function(responder){if(Object.isFunction(responder[callback])){try{responder[callback].apply(responder,[request,transport,json]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(options){this.options={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:'',evalJSON:true,evalJS:true};Object.extend(this.options,options||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters))
this.options.parameters=this.options.parameters.toQueryParams();else if(Object.isHash(this.options.parameters))
this.options.parameters=this.options.parameters.toObject();}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,url,options){$super(options);this.transport=Ajax.getTransport();this.request(url);},request:function(url){this.url=url;this.method=this.options.method;var params=Object.clone(this.options.parameters);if(!['get','post'].include(this.method)){params['_method']=this.method;this.method='post';}
this.parameters=params;if(params=Object.toQueryString(params)){if(this.method=='get')
this.url+=(this.url.include('?')?'&':'?')+params;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
params+='&_=';}
try{var response=new Ajax.Response(this);if(this.options.onCreate)this.options.onCreate(response);Ajax.Responders.dispatch('onCreate',this,response);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous)this.respondToReadyState.bind(this).defer(1);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=='post'?(this.options.postBody||params):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType)
this.onStateChange();}
catch(e){this.dispatchException(e);}},onStateChange:function(){var readyState=this.transport.readyState;if(readyState>1&&!((readyState==4)&&this._complete))
this.respondToReadyState(this.transport.readyState);},setRequestHeaders:function(){var headers={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){headers['Content-type']=this.options.contentType+
(this.options.encoding?'; charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)
headers['Connection']='close';}
if(typeof this.options.requestHeaders=='object'){var extras=this.options.requestHeaders;if(Object.isFunction(extras.push))
for(var i=0,length=extras.length;i<length;i+=2)
headers[extras[i]]=extras[i+1];else
$H(extras).each(function(pair){headers[pair.key]=pair.value});}
for(var name in headers)
this.transport.setRequestHeader(name,headers[name]);},success:function(){var status=this.getStatus();return!status||(status>=200&&status<300);},getStatus:function(){try{return this.transport.status||0;}catch(e){return 0}},respondToReadyState:function(readyState){var state=Ajax.Request.Events[readyState],response=new Ajax.Response(this);if(state=='Complete'){try{this._complete=true;(this.options['on'+response.status]||this.options['on'+(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(response,response.headerJSON);}catch(e){this.dispatchException(e);}
var contentType=response.getHeader('Content-type');if(this.options.evalJS=='force'||(this.options.evalJS&&this.isSameOrigin()&&contentType&&contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
this.evalResponse();}
try{(this.options['on'+state]||Prototype.emptyFunction)(response,response.headerJSON);Ajax.Responders.dispatch('on'+state,this,response,response.headerJSON);}catch(e){this.dispatchException(e);}
if(state=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction;}},isSameOrigin:function(){var m=this.url.match(/^\s*https?:\/\/[^\/]*/);return!m||(m[0]=='#{protocol}//#{domain}#{port}'.interpolate({protocol:location.protocol,domain:document.domain,port:location.port?':'+location.port:''}));},getHeader:function(name){try{return this.transport.getResponseHeader(name)||null;}catch(e){return null}},evalResponse:function(){try{return eval((this.transport.responseText||'').unfilterJSON());}catch(e){this.dispatchException(e);}},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch('onException',this,exception);}});Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Response=Class.create({initialize:function(request){this.request=request;var transport=this.transport=request.transport,readyState=this.readyState=transport.readyState;if((readyState>2&&!Prototype.Browser.IE)||readyState==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(transport.responseText);this.headerJSON=this._getHeaderJSON();}
if(readyState==4){var xml=transport.responseXML;this.responseXML=Object.isUndefined(xml)?null:xml;this.responseJSON=this._getResponseJSON();}},status:0,statusText:'',getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||'';}catch(e){return''}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders();}catch(e){return null}},getResponseHeader:function(name){return this.transport.getResponseHeader(name);},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders();},_getHeaderJSON:function(){var json=this.getHeader('X-JSON');if(!json)return null;json=decodeURIComponent(escape(json));try{return json.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}},_getResponseJSON:function(){var options=this.request.options;if(!options.evalJSON||(options.evalJSON!='force'&&!(this.getHeader('Content-type')||'').include('application/json'))||this.responseText.blank())
return null;try{return this.responseText.evalJSON(options.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,container,url,options){this.container={success:(container.success||container),failure:(container.failure||(container.success?null:container))};options=Object.clone(options);var onComplete=options.onComplete;options.onComplete=(function(response,json){this.updateContent(response.responseText);if(Object.isFunction(onComplete))onComplete(response,json);}).bind(this);$super(url,options);},updateContent:function(responseText){var receiver=this.container[this.success()?'success':'failure'],options=this.options;if(!options.evalScripts)responseText=responseText.stripScripts();if(receiver=$(receiver)){if(options.insertion){if(Object.isString(options.insertion)){var insertion={};insertion[options.insertion]=responseText;receiver.insert(insertion);}
else options.insertion(receiver,responseText);}
else receiver.update(responseText);}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,container,url,options){$super(options);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=container;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(response){if(this.options.decay){this.decay=(response.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=response.responseText;}
this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});function $(element){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)
elements.push($(arguments[i]));return elements;}
if(Object.isString(element))
element=document.getElementById(element);return Element.extend(element);}
if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(expression,parentElement){var results=[];var query=document.evaluate(expression,$(parentElement)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=query.snapshotLength;i<length;i++)
results.push(Element.extend(query.snapshotItem(i)));return results;};}
if(!window.Node)var Node={};if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});}
(function(){var element=this.Element;this.Element=function(tagName,attributes){attributes=attributes||{};tagName=tagName.toLowerCase();var cache=Element.cache;if(Prototype.Browser.IE&&attributes.name){tagName='<'+tagName+' name="'+attributes.name+'">';delete attributes.name;return Element.writeAttribute(document.createElement(tagName),attributes);}
if(!cache[tagName])cache[tagName]=Element.extend(document.createElement(tagName));return Element.writeAttribute(cache[tagName].cloneNode(false),attributes);};Object.extend(this.Element,element||{});}).call(window);Element.cache={};Element.Methods={visible:function(element){return $(element).style.display!='none';},toggle:function(element){element=$(element);Element[Element.visible(element)?'hide':'show'](element);return element;},hide:function(element){$(element).style.display='none';return element;},show:function(element){$(element).style.display='';return element;},remove:function(element){element=$(element);element.parentNode.removeChild(element);return element;},update:function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();if(Object.isElement(content))return element.update().insert(content);content=Object.toHTML(content);element.innerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;},replace:function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();else if(!Object.isElement(content)){content=Object.toHTML(content);var range=element.ownerDocument.createRange();range.selectNode(element);content.evalScripts.bind(content).defer();content=range.createContextualFragment(content.stripScripts());}
element.parentNode.replaceChild(content,element);return element;},insert:function(element,insertions){element=$(element);if(Object.isString(insertions)||Object.isNumber(insertions)||Object.isElement(insertions)||(insertions&&(insertions.toElement||insertions.toHTML)))
insertions={bottom:insertions};var content,insert,tagName,childNodes;for(var position in insertions){content=insertions[position];position=position.toLowerCase();insert=Element._insertionTranslations[position];if(content&&content.toElement)content=content.toElement();if(Object.isElement(content)){insert(element,content);continue;}
content=Object.toHTML(content);tagName=((position=='before'||position=='after')?element.parentNode:element).tagName.toUpperCase();childNodes=Element._getContentFromAnonymousElement(tagName,content.stripScripts());if(position=='top'||position=='after')childNodes.reverse();childNodes.each(insert.curry(element));content.evalScripts.bind(content).defer();}
return element;},wrap:function(element,wrapper,attributes){element=$(element);if(Object.isElement(wrapper))
$(wrapper).writeAttribute(attributes||{});else if(Object.isString(wrapper))wrapper=new Element(wrapper,attributes);else wrapper=new Element('div',wrapper);if(element.parentNode)
element.parentNode.replaceChild(wrapper,element);wrapper.appendChild(element);return wrapper;},inspect:function(element){element=$(element);var result='<'+element.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(pair){var property=pair.first(),attribute=pair.last();var value=(element[property]||'').toString();if(value)result+=' '+attribute+'='+value.inspect(true);});return result+'>';},recursivelyCollect:function(element,property){element=$(element);var elements=[];while(element=element[property])
if(element.nodeType==1)
elements.push(Element.extend(element));return elements;},ancestors:function(element){return $(element).recursivelyCollect('parentNode');},descendants:function(element){return $(element).select("*");},firstDescendant:function(element){element=$(element).firstChild;while(element&&element.nodeType!=1)element=element.nextSibling;return $(element);},immediateDescendants:function(element){if(!(element=$(element).firstChild))return[];while(element&&element.nodeType!=1)element=element.nextSibling;if(element)return[element].concat($(element).nextSiblings());return[];},previousSiblings:function(element){return $(element).recursivelyCollect('previousSibling');},nextSiblings:function(element){return $(element).recursivelyCollect('nextSibling');},siblings:function(element){element=$(element);return element.previousSiblings().reverse().concat(element.nextSiblings());},match:function(element,selector){if(Object.isString(selector))
selector=new Selector(selector);return selector.match($(element));},up:function(element,expression,index){element=$(element);if(arguments.length==1)return $(element.parentNode);var ancestors=element.ancestors();return Object.isNumber(expression)?ancestors[expression]:Selector.findElement(ancestors,expression,index);},down:function(element,expression,index){element=$(element);if(arguments.length==1)return element.firstDescendant();return Object.isNumber(expression)?element.descendants()[expression]:element.select(expression)[index||0];},previous:function(element,expression,index){element=$(element);if(arguments.length==1)return $(Selector.handlers.previousElementSibling(element));var previousSiblings=element.previousSiblings();return Object.isNumber(expression)?previousSiblings[expression]:Selector.findElement(previousSiblings,expression,index);},next:function(element,expression,index){element=$(element);if(arguments.length==1)return $(Selector.handlers.nextElementSibling(element));var nextSiblings=element.nextSiblings();return Object.isNumber(expression)?nextSiblings[expression]:Selector.findElement(nextSiblings,expression,index);},select:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element,args);},adjacent:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element.parentNode,args).without(element);},identify:function(element){element=$(element);var id=element.readAttribute('id'),self=arguments.callee;if(id)return id;do{id='anonymous_element_'+self.counter++}while($(id));element.writeAttribute('id',id);return id;},readAttribute:function(element,name){element=$(element);if(Prototype.Browser.IE){var t=Element._attributeTranslations.read;if(t.values[name])return t.values[name](element,name);if(t.names[name])name=t.names[name];if(name.include(':')){return(!element.attributes||!element.attributes[name])?null:element.attributes[name].value;}}
return element.getAttribute(name);},writeAttribute:function(element,name,value){element=$(element);var attributes={},t=Element._attributeTranslations.write;if(typeof name=='object')attributes=name;else attributes[name]=Object.isUndefined(value)?true:value;for(var attr in attributes){name=t.names[attr]||attr;value=attributes[attr];if(t.values[attr])name=t.values[attr](element,value);if(value===false||value===null)
element.removeAttribute(name);else if(value===true)
element.setAttribute(name,name);else element.setAttribute(name,value);}
return element;},getHeight:function(element){return $(element).getDimensions().height;},getWidth:function(element){return $(element).getDimensions().width;},classNames:function(element){return new Element.ClassNames(element);},hasClassName:function(element,className){if(!(element=$(element)))return;var elementClassName=element.className;return(elementClassName.length>0&&(elementClassName==className||new RegExp("(^|\\s)"+className+"(\\s|$)").test(elementClassName)));},addClassName:function(element,className){if(!(element=$(element)))return;if(!element.hasClassName(className))
element.className+=(element.className?' ':'')+className;return element;},removeClassName:function(element,className){if(!(element=$(element)))return;element.className=element.className.replace(new RegExp("(^|\\s+)"+className+"(\\s+|$)"),' ').strip();return element;},toggleClassName:function(element,className){if(!(element=$(element)))return;return element[element.hasClassName(className)?'removeClassName':'addClassName'](className);},cleanWhitespace:function(element){element=$(element);var node=element.firstChild;while(node){var nextNode=node.nextSibling;if(node.nodeType==3&&!/\S/.test(node.nodeValue))
element.removeChild(node);node=nextNode;}
return element;},empty:function(element){return $(element).innerHTML.blank();},descendantOf:function(element,ancestor){element=$(element),ancestor=$(ancestor);var originalAncestor=ancestor;if(element.compareDocumentPosition)
return(element.compareDocumentPosition(ancestor)&8)===8;if(element.sourceIndex&&!Prototype.Browser.Opera){var e=element.sourceIndex,a=ancestor.sourceIndex,nextAncestor=ancestor.nextSibling;if(!nextAncestor){do{ancestor=ancestor.parentNode;}
while(!(nextAncestor=ancestor.nextSibling)&&ancestor.parentNode);}
if(nextAncestor&&nextAncestor.sourceIndex)
return(e>a&&e<nextAncestor.sourceIndex);}
while(element=element.parentNode)
if(element==originalAncestor)return true;return false;},scrollTo:function(element){element=$(element);var pos=element.cumulativeOffset();window.scrollTo(pos[0],pos[1]);return element;},getStyle:function(element,style){element=$(element);style=style=='float'?'cssFloat':style.camelize();var value=element.style[style];if(!value){var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null;}
if(style=='opacity')return value?parseFloat(value):1.0;return value=='auto'?null:value;},getOpacity:function(element){return $(element).getStyle('opacity');},setStyle:function(element,styles){element=$(element);var elementStyle=element.style,match;if(Object.isString(styles)){element.style.cssText+=';'+styles;return styles.include('opacity')?element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]):element;}
for(var property in styles)
if(property=='opacity')element.setOpacity(styles[property]);else
elementStyle[(property=='float'||property=='cssFloat')?(Object.isUndefined(elementStyle.styleFloat)?'cssFloat':'styleFloat'):property]=styles[property];return element;},setOpacity:function(element,value){element=$(element);element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value;return element;},getDimensions:function(element){element=$(element);var display=$(element).getStyle('display');if(display!='none'&&display!=null)
return{width:element.offsetWidth,height:element.offsetHeight};var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;var originalDisplay=els.display;els.visibility='hidden';els.position='absolute';els.display='block';var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display=originalDisplay;els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},makePositioned:function(element){element=$(element);var pos=Element.getStyle(element,'position');if(pos=='static'||!pos){element._madePositioned=true;element.style.position='relative';if(window.opera){element.style.top=0;element.style.left=0;}}
return element;},undoPositioned:function(element){element=$(element);if(element._madePositioned){element._madePositioned=undefined;element.style.position=element.style.top=element.style.left=element.style.bottom=element.style.right='';}
return element;},makeClipping:function(element){element=$(element);if(element._overflow)return element;element._overflow=Element.getStyle(element,'overflow')||'auto';if(element._overflow!=='hidden')
element.style.overflow='hidden';return element;},undoClipping:function(element){element=$(element);if(!element._overflow)return element;element.style.overflow=element._overflow=='auto'?'':element._overflow;element._overflow=null;return element;},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){if(element.tagName=='BODY')break;var p=Element.getStyle(element,'position');if(p!=='static')break;}}while(element);return Element._returnOffset(valueL,valueT);},absolutize:function(element){element=$(element);if(element.getStyle('position')=='absolute')return;var offsets=element.positionedOffset();var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position='absolute';element.style.top=top+'px';element.style.left=left+'px';element.style.width=width+'px';element.style.height=height+'px';return element;},relativize:function(element){element=$(element);if(element.getStyle('position')=='relative')return;element.style.position='relative';var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+'px';element.style.left=left+'px';element.style.height=element._originalHeight;element.style.width=element._originalWidth;return element;},cumulativeScrollOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return Element._returnOffset(valueL,valueT);},getOffsetParent:function(element){if(element.offsetParent)return $(element.offsetParent);if(element==document.body)return $(element);while((element=element.parentNode)&&element!=document.body)
if(Element.getStyle(element,'position')!='static')
return $(element);return $(document.body);},viewportOffset:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body&&Element.getStyle(element,'position')=='absolute')break;}while(element=element.offsetParent);element=forElement;do{if(!Prototype.Browser.Opera||element.tagName=='BODY'){valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;}}while(element=element.parentNode);return Element._returnOffset(valueL,valueT);},clonePosition:function(element,source){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});source=$(source);var p=source.viewportOffset();element=$(element);var delta=[0,0];var parent=null;if(Element.getStyle(element,'position')=='absolute'){parent=element.getOffsetParent();delta=parent.viewportOffset();}
if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop;}
if(options.setLeft)element.style.left=(p[0]-delta[0]+options.offsetLeft)+'px';if(options.setTop)element.style.top=(p[1]-delta[1]+options.offsetTop)+'px';if(options.setWidth)element.style.width=source.offsetWidth+'px';if(options.setHeight)element.style.height=source.offsetHeight+'px';return element;}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:'class',htmlFor:'for'},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(proceed,element,style){switch(style){case'left':case'top':case'right':case'bottom':if(proceed(element,'position')==='static')return null;case'height':case'width':if(!Element.visible(element))return null;var dim=parseInt(proceed(element,style),10);if(dim!==element['offset'+style.capitalize()])
return dim+'px';var properties;if(style==='height'){properties=['border-top-width','padding-top','padding-bottom','border-bottom-width'];}
else{properties=['border-left-width','padding-left','padding-right','border-right-width'];}
return properties.inject(dim,function(memo,property){var val=proceed(element,property);return val===null?memo:memo-parseInt(val,10);})+'px';default:return proceed(element,style);}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(proceed,element,attribute){if(attribute==='title')return element.title;return proceed(element,attribute);});}
else if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(proceed,element){element=$(element);var position=element.getStyle('position');if(position!=='static')return proceed(element);element.setStyle({position:'relative'});var value=proceed(element);element.setStyle({position:position});return value;});$w('positionedOffset viewportOffset').each(function(method){Element.Methods[method]=Element.Methods[method].wrap(function(proceed,element){element=$(element);var position=element.getStyle('position');if(position!=='static')return proceed(element);var offsetParent=element.getOffsetParent();if(offsetParent&&offsetParent.getStyle('position')==='fixed')
offsetParent.setStyle({zoom:1});element.setStyle({position:'relative'});var value=proceed(element);element.setStyle({position:position});return value;});});Element.Methods.getStyle=function(element,style){element=$(element);style=(style=='float'||style=='cssFloat')?'styleFloat':style.camelize();var value=element.style[style];if(!value&&element.currentStyle)value=element.currentStyle[style];if(style=='opacity'){if(value=(element.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))
if(value[1])return parseFloat(value[1])/100;return 1.0;}
if(value=='auto'){if((style=='width'||style=='height')&&(element.getStyle('display')!='none'))
return element['offset'+style.capitalize()]+'px';return null;}
return value;};Element.Methods.setOpacity=function(element,value){function stripAlpha(filter){return filter.replace(/alpha\([^\)]*\)/gi,'');}
element=$(element);var currentStyle=element.currentStyle;if((currentStyle&&!currentStyle.hasLayout)||(!currentStyle&&element.style.zoom=='normal'))
element.style.zoom=1;var filter=element.getStyle('filter'),style=element.style;if(value==1||value===''){(filter=stripAlpha(filter))?style.filter=filter:style.removeAttribute('filter');return element;}else if(value<0.00001)value=0;style.filter=stripAlpha(filter)+'alpha(opacity='+(value*100)+')';return element;};Element._attributeTranslations={read:{names:{'class':'className','for':'htmlFor'},values:{_getAttr:function(element,attribute){return element.getAttribute(attribute,2);},_getAttrNode:function(element,attribute){var node=element.getAttributeNode(attribute);return node?node.value:"";},_getEv:function(element,attribute){attribute=element.getAttribute(attribute);return attribute?attribute.toString().slice(23,-2):null;},_flag:function(element,attribute){return $(element).hasAttribute(attribute)?attribute:null;},style:function(element){return element.style.cssText.toLowerCase();},title:function(element){return element.title;}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:'cellPadding',cellspacing:'cellSpacing'},Element._attributeTranslations.read.names),values:{checked:function(element,value){element.checked=!!value;},style:function(element,value){element.style.cssText=value?value:'';}}};Element._attributeTranslations.has={};$w('colSpan rowSpan vAlign dateTime accessKey tabIndex '+'encType maxLength readOnly longDesc').each(function(attr){Element._attributeTranslations.write.names[attr.toLowerCase()]=attr;Element._attributeTranslations.has[attr.toLowerCase()]=attr;});(function(v){Object.extend(v,{href:v._getAttr,src:v._getAttr,type:v._getAttr,action:v._getAttrNode,disabled:v._flag,checked:v._flag,readonly:v._flag,multiple:v._flag,onload:v._getEv,onunload:v._getEv,onclick:v._getEv,ondblclick:v._getEv,onmousedown:v._getEv,onmouseup:v._getEv,onmouseover:v._getEv,onmousemove:v._getEv,onmouseout:v._getEv,onfocus:v._getEv,onblur:v._getEv,onkeypress:v._getEv,onkeydown:v._getEv,onkeyup:v._getEv,onsubmit:v._getEv,onreset:v._getEv,onselect:v._getEv,onchange:v._getEv});})(Element._attributeTranslations.read.values);}
else if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1)?0.999999:(value==='')?'':(value<0.00001)?0:value;return element;};}
else if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value;if(value==1)
if(element.tagName=='IMG'&&element.width){element.width++;element.width--;}else try{var n=document.createTextNode(' ');element.appendChild(n);element.removeChild(n);}catch(e){}
return element;};Element.Methods.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);};}
if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();if(Object.isElement(content))return element.update().insert(content);content=Object.toHTML(content);var tagName=element.tagName.toUpperCase();if(tagName in Element._insertionTranslations.tags){$A(element.childNodes).each(function(node){element.removeChild(node)});Element._getContentFromAnonymousElement(tagName,content.stripScripts()).each(function(node){element.appendChild(node)});}
else element.innerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;};}
if('outerHTML'in document.createElement('div')){Element.Methods.replace=function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();if(Object.isElement(content)){element.parentNode.replaceChild(content,element);return element;}
content=Object.toHTML(content);var parent=element.parentNode,tagName=parent.tagName.toUpperCase();if(Element._insertionTranslations.tags[tagName]){var nextSibling=element.next();var fragments=Element._getContentFromAnonymousElement(tagName,content.stripScripts());parent.removeChild(element);if(nextSibling)
fragments.each(function(node){parent.insertBefore(node,nextSibling)});else
fragments.each(function(node){parent.appendChild(node)});}
else element.outerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;};}
Element._returnOffset=function(l,t){var result=[l,t];result.left=l;result.top=t;return result;};Element._getContentFromAnonymousElement=function(tagName,html){var div=new Element('div'),t=Element._insertionTranslations.tags[tagName];if(t){div.innerHTML=t[0]+html+t[1];t[2].times(function(){div=div.firstChild});}else div.innerHTML=html;return $A(div.childNodes);};Element._insertionTranslations={before:function(element,node){element.parentNode.insertBefore(node,element);},top:function(element,node){element.insertBefore(node,element.firstChild);},bottom:function(element,node){element.appendChild(node);},after:function(element,node){element.parentNode.insertBefore(node,element.nextSibling);},tags:{TABLE:['<table>','</table>',1],TBODY:['<table><tbody>','</tbody></table>',2],TR:['<table><tbody><tr>','</tr></tbody></table>',3],TD:['<table><tbody><tr><td>','</td></tr></tbody></table>',4],SELECT:['<select>','</select>',1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD});}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(element,attribute){attribute=Element._attributeTranslations.has[attribute]||attribute;var node=$(element).getAttributeNode(attribute);return node&&node.specified;}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement('div').__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement('div').__proto__;Prototype.BrowserFeatures.ElementExtensions=true;}
Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions)
return Prototype.K;var Methods={},ByTag=Element.Methods.ByTag;var extend=Object.extend(function(element){if(!element||element._extendedByPrototype||element.nodeType!=1||element==window)return element;var methods=Object.clone(Methods),tagName=element.tagName,property,value;if(ByTag[tagName])Object.extend(methods,ByTag[tagName]);for(property in methods){value=methods[property];if(Object.isFunction(value)&&!(property in element))
element[property]=value.methodize();}
element._extendedByPrototype=Prototype.emptyFunction;return element;},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(Methods,Element.Methods);Object.extend(Methods,Element.Methods.Simulated);}}});extend.refresh();return extend;})();Element.hasAttribute=function(element,attribute){if(element.hasAttribute)return element.hasAttribute(attribute);return Element.Methods.Simulated.hasAttribute(element,attribute);};Element.addMethods=function(methods){var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;if(!methods){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)});}
if(arguments.length==2){var tagName=methods;methods=arguments[1];}
if(!tagName)Object.extend(Element.Methods,methods||{});else{if(Object.isArray(tagName))tagName.each(extend);else extend(tagName);}
function extend(tagName){tagName=tagName.toUpperCase();if(!Element.Methods.ByTag[tagName])
Element.Methods.ByTag[tagName]={};Object.extend(Element.Methods.ByTag[tagName],methods);}
function copy(methods,destination,onlyIfAbsent){onlyIfAbsent=onlyIfAbsent||false;for(var property in methods){var value=methods[property];if(!Object.isFunction(value))continue;if(!onlyIfAbsent||!(property in destination))
destination[property]=value.methodize();}}
function findDOMClass(tagName){var klass;var trans={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};if(trans[tagName])klass='HTML'+trans[tagName]+'Element';if(window[klass])return window[klass];klass='HTML'+tagName+'Element';if(window[klass])return window[klass];klass='HTML'+tagName.capitalize()+'Element';if(window[klass])return window[klass];window[klass]={};window[klass].prototype=document.createElement(tagName).__proto__;return window[klass];}
if(F.ElementExtensions){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true);}
if(F.SpecificElementExtensions){for(var tag in Element.Methods.ByTag){var klass=findDOMClass(tag);if(Object.isUndefined(klass))continue;copy(T[tag],klass.prototype);}}
Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh)Element.extend.refresh();Element.cache={};};document.viewport={getDimensions:function(){var dimensions={};var B=Prototype.Browser;$w('width height').each(function(d){var D=d.capitalize();dimensions[d]=(B.WebKit&&!document.evaluate)?self['inner'+D]:(B.Opera)?document.body['client'+D]:document.documentElement['client'+D];});return dimensions;},getWidth:function(){return this.getDimensions().width;},getHeight:function(){return this.getDimensions().height;},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);}};var Selector=Class.create({initialize:function(expression){this.expression=expression.strip();this.compileMatcher();},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath)return false;var e=this.expression;if(Prototype.Browser.WebKit&&(e.include("-of-type")||e.include(":empty")))
return false;if((/(\[[\w-]*?:|:checked)/).test(this.expression))
return false;return true;},compileMatcher:function(){if(this.shouldUseXPath())
return this.compileXPathMatcher();var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return;}
this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],'');break;}}}
this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join('\n'));Selector._cache[this.expression]=this.matcher;},compileXPathMatcher:function(){var e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m;if(Selector._cache[e]){this.xpath=Selector._cache[e];return;}
this.matcher=['.//*'];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){if(m=e.match(ps[i])){this.matcher.push(Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m));e=e.replace(m[0],'');break;}}}
this.xpath=this.matcher.join('');Selector._cache[this.expression]=this.xpath;},findElements:function(root){root=root||document;if(this.xpath)return document._getElementsByXPath(this.xpath,root);return this.matcher(root);},match:function(element){this.tokens=[];var e=this.expression,ps=Selector.patterns,as=Selector.assertions;var le,p,m;while(e&&le!==e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){if(as[i]){this.tokens.push([i,Object.clone(m)]);e=e.replace(m[0],'');}else{return this.findElements(document).include(element);}}}}
var match=true,name,matches;for(var i=0,token;token=this.tokens[i];i++){name=token[0],matches=token[1];if(!Selector.assertions[name](element,matches)){match=false;break;}}
return match;},toString:function(){return this.expression;},inspect:function(){return"#<Selector:"+this.expression.inspect()+">";}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:'/following-sibling::*',tagName:function(m){if(m[1]=='*')return'';return"[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']";},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(m){m[1]=m[1].toLowerCase();return new Template("[@#{1}]").evaluate(m);},attr:function(m){m[1]=m[1].toLowerCase();m[3]=m[5]||m[6];return new Template(Selector.xpath.operators[m[2]]).evaluate(m);},pseudo:function(m){var h=Selector.xpath.pseudos[m[1]];if(!h)return'';if(Object.isFunction(h))return h(m);return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);},operators:{'=':"[@#{1}='#{3}']",'!=':"[@#{1}!='#{3}']",'^=':"[starts-with(@#{1}, '#{3}')]",'$=':"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",'*=':"[contains(@#{1}, '#{3}')]",'~=':"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",'|=':"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{'first-child':'[not(preceding-sibling::*)]','last-child':'[not(following-sibling::*)]','only-child':'[not(preceding-sibling::* or following-sibling::*)]','empty':"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",'checked':"[@checked]",'disabled':"[@disabled]",'enabled':"[not(@disabled)]",'not':function(m){var e=m[6],p=Selector.patterns,x=Selector.xpath,le,v;var exclusion=[];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in p){if(m=e.match(p[i])){v=Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m);exclusion.push("("+v.substring(1,v.length-1)+")");e=e.replace(m[0],'');break;}}}
return"[not("+exclusion.join(" and ")+")]";},'nth-child':function(m){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m);},'nth-last-child':function(m){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m);},'nth-of-type':function(m){return Selector.xpath.pseudos.nth("position() ",m);},'nth-last-of-type':function(m){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m);},'first-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-of-type'](m);},'last-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-last-of-type'](m);},'only-of-type':function(m){var p=Selector.xpath.pseudos;return p['first-of-type'](m)+p['last-of-type'](m);},nth:function(fragment,m){var mm,formula=m[6],predicate;if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';if(mm=formula.match(/^(\d+)$/))
return'['+fragment+"= "+mm[1]+']';if(mm=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(mm[1]=="-")mm[1]=-1;var a=mm[1]?Number(mm[1]):1;var b=mm[2]?Number(mm[2]):0;predicate="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(predicate).evaluate({fragment:fragment,a:a,b:b});}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(m){m[3]=(m[5]||m[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m);},pseudo:function(m){if(m[6])m[6]=m[6].replace(/"/g,'\\"');return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(element,matches){return matches[1].toUpperCase()==element.tagName.toUpperCase();},className:function(element,matches){return Element.hasClassName(element,matches[1]);},id:function(element,matches){return element.id===matches[1];},attrPresence:function(element,matches){return Element.hasAttribute(element,matches[1]);},attr:function(element,matches){var nodeValue=Element.readAttribute(element,matches[1]);return nodeValue&&Selector.operators[matches[2]](nodeValue,matches[5]||matches[6]);}},handlers:{concat:function(a,b){for(var i=0,node;node=b[i];i++)
a.push(node);return a;},mark:function(nodes){var _true=Prototype.emptyFunction;for(var i=0,node;node=nodes[i];i++)
node._countedByPrototype=_true;return nodes;},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++)
node._countedByPrototype=undefined;return nodes;},index:function(parentNode,reverse,ofType){parentNode._countedByPrototype=Prototype.emptyFunction;if(reverse){for(var nodes=parentNode.childNodes,i=nodes.length-1,j=1;i>=0;i--){var node=nodes[i];if(node.nodeType==1&&(!ofType||node._countedByPrototype))node.nodeIndex=j++;}}else{for(var i=0,j=1,nodes=parentNode.childNodes;node=nodes[i];i++)
if(node.nodeType==1&&(!ofType||node._countedByPrototype))node.nodeIndex=j++;}},unique:function(nodes){if(nodes.length==0)return nodes;var results=[],n;for(var i=0,l=nodes.length;i<l;i++)
if(!(n=nodes[i])._countedByPrototype){n._countedByPrototype=Prototype.emptyFunction;results.push(Element.extend(n));}
return Selector.handlers.unmark(results);},descendant:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName('*'));return results;},child:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){for(var j=0,child;child=node.childNodes[j];j++)
if(child.nodeType==1&&child.tagName!='!')results.push(child);}
return results;},adjacent:function(nodes){for(var i=0,results=[],node;node=nodes[i];i++){var next=this.nextElementSibling(node);if(next)results.push(next);}
return results;},laterSibling:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,Element.nextSiblings(node));return results;},nextElementSibling:function(node){while(node=node.nextSibling)
if(node.nodeType==1)return node;return null;},previousElementSibling:function(node){while(node=node.previousSibling)
if(node.nodeType==1)return node;return null;},tagName:function(nodes,root,tagName,combinator){var uTagName=tagName.toUpperCase();var results=[],h=Selector.handlers;if(nodes){if(combinator){if(combinator=="descendant"){for(var i=0,node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName(tagName));return results;}else nodes=this[combinator](nodes);if(tagName=="*")return nodes;}
for(var i=0,node;node=nodes[i];i++)
if(node.tagName.toUpperCase()===uTagName)results.push(node);return results;}else return root.getElementsByTagName(tagName);},id:function(nodes,root,id,combinator){var targetNode=$(id),h=Selector.handlers;if(!targetNode)return[];if(!nodes&&root==document)return[targetNode];if(nodes){if(combinator){if(combinator=='child'){for(var i=0,node;node=nodes[i];i++)
if(targetNode.parentNode==node)return[targetNode];}else if(combinator=='descendant'){for(var i=0,node;node=nodes[i];i++)
if(Element.descendantOf(targetNode,node))return[targetNode];}else if(combinator=='adjacent'){for(var i=0,node;node=nodes[i];i++)
if(Selector.handlers.previousElementSibling(targetNode)==node)
return[targetNode];}else nodes=h[combinator](nodes);}
for(var i=0,node;node=nodes[i];i++)
if(node==targetNode)return[targetNode];return[];}
return(targetNode&&Element.descendantOf(targetNode,root))?[targetNode]:[];},className:function(nodes,root,className,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);return Selector.handlers.byClassName(nodes,root,className);},byClassName:function(nodes,root,className){if(!nodes)nodes=Selector.handlers.descendant([root]);var needle=' '+className+' ';for(var i=0,results=[],node,nodeClassName;node=nodes[i];i++){nodeClassName=node.className;if(nodeClassName.length==0)continue;if(nodeClassName==className||(' '+nodeClassName+' ').include(needle))
results.push(node);}
return results;},attrPresence:function(nodes,root,attr,combinator){if(!nodes)nodes=root.getElementsByTagName("*");if(nodes&&combinator)nodes=this[combinator](nodes);var results=[];for(var i=0,node;node=nodes[i];i++)
if(Element.hasAttribute(node,attr))results.push(node);return results;},attr:function(nodes,root,attr,value,operator,combinator){if(!nodes)nodes=root.getElementsByTagName("*");if(nodes&&combinator)nodes=this[combinator](nodes);var handler=Selector.operators[operator],results=[];for(var i=0,node;node=nodes[i];i++){var nodeValue=Element.readAttribute(node,attr);if(nodeValue===null)continue;if(handler(nodeValue,value))results.push(node);}
return results;},pseudo:function(nodes,name,value,root,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);if(!nodes)nodes=root.getElementsByTagName("*");return Selector.pseudos[name](nodes,value,root);}},pseudos:{'first-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.previousElementSibling(node))continue;results.push(node);}
return results;},'last-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.nextElementSibling(node))continue;results.push(node);}
return results;},'only-child':function(nodes,value,root){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
if(!h.previousElementSibling(node)&&!h.nextElementSibling(node))
results.push(node);return results;},'nth-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root);},'nth-last-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true);},'nth-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,false,true);},'nth-last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true,true);},'first-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,false,true);},'last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,true,true);},'only-of-type':function(nodes,formula,root){var p=Selector.pseudos;return p['last-of-type'](p['first-of-type'](nodes,formula,root),formula,root);},getIndices:function(a,b,total){if(a==0)return b>0?[b]:[];return $R(1,total).inject([],function(memo,i){if(0==(i-b)%a&&(i-b)/a>=0)memo.push(i);return memo;});},nth:function(nodes,formula,root,reverse,ofType){if(nodes.length==0)return[];if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';var h=Selector.handlers,results=[],indexed=[],m;h.mark(nodes);for(var i=0,node;node=nodes[i];i++){if(!node.parentNode._countedByPrototype){h.index(node.parentNode,reverse,ofType);indexed.push(node.parentNode);}}
if(formula.match(/^\d+$/)){formula=Number(formula);for(var i=0,node;node=nodes[i];i++)
if(node.nodeIndex==formula)results.push(node);}else if(m=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-")m[1]=-1;var a=m[1]?Number(m[1]):1;var b=m[2]?Number(m[2]):0;var indices=Selector.pseudos.getIndices(a,b,nodes.length);for(var i=0,node,l=indices.length;node=nodes[i];i++){for(var j=0;j<l;j++)
if(node.nodeIndex==indices[j])results.push(node);}}
h.unmark(nodes);h.unmark(indexed);return results;},'empty':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.tagName=='!'||(node.firstChild&&!node.innerHTML.match(/^\s*$/)))continue;results.push(node);}
return results;},'not':function(nodes,selector,root){var h=Selector.handlers,selectorType,m;var exclusions=new Selector(selector).findElements(root);h.mark(exclusions);for(var i=0,results=[],node;node=nodes[i];i++)
if(!node._countedByPrototype)results.push(node);h.unmark(exclusions);return results;},'enabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(!node.disabled)results.push(node);return results;},'disabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.disabled)results.push(node);return results;},'checked':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.checked)results.push(node);return results;}},operators:{'=':function(nv,v){return nv==v;},'!=':function(nv,v){return nv!=v;},'^=':function(nv,v){return nv.startsWith(v);},'$=':function(nv,v){return nv.endsWith(v);},'*=':function(nv,v){return nv.include(v);},'~=':function(nv,v){return(' '+nv+' ').include(' '+v+' ');},'|=':function(nv,v){return('-'+nv.toUpperCase()+'-').include('-'+v.toUpperCase()+'-');}},split:function(expression){var expressions=[];expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){expressions.push(m[1].strip());});return expressions;},matchElements:function(elements,expression){var matches=$$(expression),h=Selector.handlers;h.mark(matches);for(var i=0,results=[],element;element=elements[i];i++)
if(element._countedByPrototype)results.push(element);h.unmark(matches);return results;},findElement:function(elements,expression,index){if(Object.isNumber(expression)){index=expression;expression=false;}
return Selector.matchElements(elements,expression||'*')[index||0];},findChildElements:function(element,expressions){expressions=Selector.split(expressions.join(','));var results=[],h=Selector.handlers;for(var i=0,l=expressions.length,selector;i<l;i++){selector=new Selector(expressions[i].strip());h.concat(results,selector.findElements(element));}
return(l>1)?h.unique(results):results;}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(a,b){for(var i=0,node;node=b[i];i++)
if(node.tagName!=="!")a.push(node);return a;},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++)
node.removeAttribute('_countedByPrototype');return nodes;}});}
function $$(){return Selector.findChildElements(document,$A(arguments));}
var Form={reset:function(form){$(form).reset();return form;},serializeElements:function(elements,options){if(typeof options!='object')options={hash:!!options};else if(Object.isUndefined(options.hash))options.hash=true;var key,value,submitted=false,submit=options.submit;var data=elements.inject({},function(result,element){if(!element.disabled&&element.name){key=element.name;value=$(element).getValue();if(value!=null&&(element.type!='submit'||(!submitted&&submit!==false&&(!submit||key==submit)&&(submitted=true)))){if(key in result){if(!Object.isArray(result[key]))result[key]=[result[key]];result[key].push(value);}
else result[key]=value;}}
return result;});return options.hash?data:Object.toQueryString(data);}};Form.Methods={serialize:function(form,options){return Form.serializeElements(Form.getElements(form),options);},getElements:function(form){return $A($(form).getElementsByTagName('*')).inject([],function(elements,child){if(Form.Element.Serializers[child.tagName.toLowerCase()])
elements.push(Element.extend(child));return elements;});},getInputs:function(form,typeName,name){form=$(form);var inputs=form.getElementsByTagName('input');if(!typeName&&!name)return $A(inputs).map(Element.extend);for(var i=0,matchingInputs=[],length=inputs.length;i<length;i++){var input=inputs[i];if((typeName&&input.type!=typeName)||(name&&input.name!=name))
continue;matchingInputs.push(Element.extend(input));}
return matchingInputs;},disable:function(form){form=$(form);Form.getElements(form).invoke('disable');return form;},enable:function(form){form=$(form);Form.getElements(form).invoke('enable');return form;},findFirstElement:function(form){var elements=$(form).getElements().findAll(function(element){return'hidden'!=element.type&&!element.disabled;});var firstByIndex=elements.findAll(function(element){return element.hasAttribute('tabIndex')&&element.tabIndex>=0;}).sortBy(function(element){return element.tabIndex}).first();return firstByIndex?firstByIndex:elements.find(function(element){return['input','select','textarea'].include(element.tagName.toLowerCase());});},focusFirstElement:function(form){form=$(form);form.findFirstElement().activate();return form;},request:function(form,options){form=$(form),options=Object.clone(options||{});var params=options.parameters,action=form.readAttribute('action')||'';if(action.blank())action=window.location.href;options.parameters=form.serialize(true);if(params){if(Object.isString(params))params=params.toQueryParams();Object.extend(options.parameters,params);}
if(form.hasAttribute('method')&&!options.method)
options.method=form.method;return new Ajax.Request(action,options);}};Form.Element={focus:function(element){$(element).focus();return element;},select:function(element){$(element).select();return element;}};Form.Element.Methods={serialize:function(element){element=$(element);if(!element.disabled&&element.name){var value=element.getValue();if(value!=undefined){var pair={};pair[element.name]=value;return Object.toQueryString(pair);}}
return'';},getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();return Form.Element.Serializers[method](element);},setValue:function(element,value){element=$(element);var method=element.tagName.toLowerCase();Form.Element.Serializers[method](element,value);return element;},clear:function(element){$(element).value='';return element;},present:function(element){return $(element).value!='';},activate:function(element){element=$(element);try{element.focus();if(element.select&&(element.tagName.toLowerCase()!='input'||!['button','reset','submit'].include(element.type)))
element.select();}catch(e){}
return element;},disable:function(element){element=$(element);element.blur();element.disabled=true;return element;},enable:function(element){element=$(element);element.disabled=false;return element;}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(element,value){switch(element.type.toLowerCase()){case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(element,value);default:return Form.Element.Serializers.textarea(element,value);}},inputSelector:function(element,value){if(Object.isUndefined(value))return element.checked?element.value:null;else element.checked=!!value;},textarea:function(element,value){if(Object.isUndefined(value))return element.value;else element.value=value;},select:function(element,index){if(Object.isUndefined(index))
return this[element.type=='select-one'?'selectOne':'selectMany'](element);else{var opt,value,single=!Object.isArray(index);for(var i=0,length=element.length;i<length;i++){opt=element.options[i];value=this.optionValue(opt);if(single){if(value==index){opt.selected=true;return;}}
else opt.selected=index.include(value);}}},selectOne:function(element){var index=element.selectedIndex;return index>=0?this.optionValue(element.options[index]):null;},selectMany:function(element){var values,length=element.length;if(!length)return null;for(var i=0,values=[];i<length;i++){var opt=element.options[i];if(opt.selected)values.push(this.optionValue(opt));}
return values;},optionValue:function(opt){return Element.extend(opt).hasAttribute('value')?opt.value:opt.text;}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,element,frequency,callback){$super(callback,frequency);this.element=$(element);this.lastValue=this.getValue();},execute:function(){var value=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(value)?this.lastValue!=value:String(this.lastValue)!=String(value)){this.callback(this.element,value);this.lastValue=value;}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=Class.create({initialize:function(element,callback){this.element=$(element);this.callback=callback;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')
this.registerFormCallbacks();else
this.registerCallback(this.element);},onElementEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this);},registerCallback:function(element){if(element.type){switch(element.type.toLowerCase()){case'checkbox':case'radio':Event.observe(element,'click',this.onElementEvent.bind(this));break;default:Event.observe(element,'change',this.onElementEvent.bind(this));break;}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element);}});if(!window.Event)var Event={};Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(event){var element;switch(event.type){case'mouseover':element=event.fromElement;break;case'mouseout':element=event.toElement;break;default:return null;}
return Element.extend(element);}});Event.Methods=(function(){var isButton;if(Prototype.Browser.IE){var buttonMap={0:1,1:4,2:2};isButton=function(event,code){return event.button==buttonMap[code];};}else if(Prototype.Browser.WebKit){isButton=function(event,code){switch(code){case 0:return event.which==1&&!event.metaKey;case 1:return event.which==1&&event.metaKey;default:return false;}};}else{isButton=function(event,code){return event.which?(event.which===code+1):(event.button===code);};}
return{isLeftClick:function(event){return isButton(event,0)},isMiddleClick:function(event){return isButton(event,1)},isRightClick:function(event){return isButton(event,2)},element:function(event){var node=Event.extend(event).target;return Element.extend(node.nodeType==Node.TEXT_NODE?node.parentNode:node);},findElement:function(event,expression){var element=Event.element(event);if(!expression)return element;var elements=[element].concat(element.ancestors());return Selector.findElement(elements,expression,0);},pointer:function(event){return{x:event.pageX||(event.clientX+
(document.documentElement.scrollLeft||document.body.scrollLeft)),y:event.pageY||(event.clientY+
(document.documentElement.scrollTop||document.body.scrollTop))};},pointerX:function(event){return Event.pointer(event).x},pointerY:function(event){return Event.pointer(event).y},stop:function(event){Event.extend(event);event.preventDefault();event.stopPropagation();event.stopped=true;}};})();Event.extend=(function(){var methods=Object.keys(Event.Methods).inject({},function(m,name){m[name]=Event.Methods[name].methodize();return m;});if(Prototype.Browser.IE){Object.extend(methods,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(event){if(!event)return false;if(event._extendedByPrototype)return event;event._extendedByPrototype=Prototype.emptyFunction;var pointer=Event.pointer(event);Object.extend(event,{target:event.srcElement,relatedTarget:Event.relatedTarget(event),pageX:pointer.x,pageY:pointer.y});return Object.extend(event,methods);};}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,methods);return Prototype.K;}})();Object.extend(Event,(function(){var cache=Event.cache;function getEventID(element){if(element._prototypeEventID)return element._prototypeEventID[0];arguments.callee.id=arguments.callee.id||1;return element._prototypeEventID=[++arguments.callee.id];}
function getDOMEventName(eventName){if(eventName&&eventName.include(':'))return"dataavailable";return eventName;}
function getCacheForID(id){return cache[id]=cache[id]||{};}
function getWrappersForEventName(id,eventName){var c=getCacheForID(id);return c[eventName]=c[eventName]||[];}
function createWrapper(element,eventName,handler){var id=getEventID(element);var c=getWrappersForEventName(id,eventName);if(c.pluck("handler").include(handler))return false;var wrapper=function(event){if(!Event||!Event.extend||(event.eventName&&event.eventName!=eventName))
return false;Event.extend(event);handler.call(element,event);};wrapper.handler=handler;c.push(wrapper);return wrapper;}
function findWrapper(id,eventName,handler){var c=getWrappersForEventName(id,eventName);return c.find(function(wrapper){return wrapper.handler==handler});}
function destroyWrapper(id,eventName,handler){var c=getCacheForID(id);if(!c[eventName])return false;c[eventName]=c[eventName].without(findWrapper(id,eventName,handler));}
function destroyCache(){for(var id in cache)
for(var eventName in cache[id])
cache[id][eventName]=null;}
if(window.attachEvent){window.attachEvent("onunload",destroyCache);}
return{observe:function(element,eventName,handler){element=$(element);var name=getDOMEventName(eventName);var wrapper=createWrapper(element,eventName,handler);if(!wrapper)return element;if(element.addEventListener){element.addEventListener(name,wrapper,false);}else{element.attachEvent("on"+name,wrapper);}
return element;},stopObserving:function(element,eventName,handler){element=$(element);var id=getEventID(element),name=getDOMEventName(eventName);if(!handler&&eventName){getWrappersForEventName(id,eventName).each(function(wrapper){element.stopObserving(eventName,wrapper.handler);});return element;}else if(!eventName){Object.keys(getCacheForID(id)).each(function(eventName){element.stopObserving(eventName);});return element;}
var wrapper=findWrapper(id,eventName,handler);if(!wrapper)return element;if(element.removeEventListener){element.removeEventListener(name,wrapper,false);}else{element.detachEvent("on"+name,wrapper);}
destroyWrapper(id,eventName,handler);return element;},fire:function(element,eventName,memo){element=$(element);if(element==document&&document.createEvent&&!element.dispatchEvent)
element=document.documentElement;var event;if(document.createEvent){event=document.createEvent("HTMLEvents");event.initEvent("dataavailable",true,true);}else{event=document.createEventObject();event.eventType="ondataavailable";}
event.eventName=eventName;event.memo=memo||{};if(document.createEvent){element.dispatchEvent(event);}else{element.fireEvent(event.eventType,event);}
return Event.extend(event);}};})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var timer;function fireContentLoadedEvent(){if(document.loaded)return;if(timer)window.clearInterval(timer);document.fire("dom:loaded");document.loaded=true;}
if(document.addEventListener){if(Prototype.Browser.WebKit){timer=window.setInterval(function(){if(/loaded|complete/.test(document.readyState))
fireContentLoadedEvent();},0);Event.observe(window,"load",fireContentLoadedEvent);}else{document.addEventListener("DOMContentLoaded",fireContentLoadedEvent,false);}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;fireContentLoadedEvent();}};}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(element,content){return Element.insert(element,{before:content});},Top:function(element,content){return Element.insert(element,{top:content});},Bottom:function(element,content){return Element.insert(element,{bottom:content});},After:function(element,content){return Element.insert(element,{after:content});}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},within:function(element,x,y){if(this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element,x,y);this.xcomp=x;this.ycomp=y;this.offset=Element.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=Element.cumulativeScrollOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=Element.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth);},overlap:function(mode,element){if(!mode)return 0;if(mode=='vertical')
return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight;if(mode=='horizontal')
return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth;},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(element){Position.prepare();return Element.absolutize(element);},relativize:function(element){Position.prepare();return Element.relativize(element);},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(source,target,options){options=options||{};return Element.clonePosition(target,source,options);}};if(!document.getElementsByClassName)document.getElementsByClassName=function(instanceMethods){function iter(name){return name.blank()?null:"[contains(concat(' ', @class, ' '), ' "+name+" ')]";}
instanceMethods.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(element,className){className=className.toString().strip();var cond=/\s/.test(className)?$w(className).map(iter).join(''):iter(className);return cond?document._getElementsByXPath('.//*'+cond,element):[];}:function(element,className){className=className.toString().strip();var elements=[],classNames=(/\s/.test(className)?$w(className):null);if(!classNames&&!className)return elements;var nodes=$(element).getElementsByTagName('*');className=' '+className+' ';for(var i=0,child,cn;child=nodes[i];i++){if(child.className&&(cn=' '+child.className+' ')&&(cn.include(className)||(classNames&&classNames.all(function(name){return!name.toString().blank()&&cn.include(' '+name+' ');}))))
elements.push(Element.extend(child));}
return elements;};return function(className,parentElement){return $(parentElement||document.body).getElementsByClassName(className);};}(Element.Methods);Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd))return;this.set($A(this).concat(classNameToAdd).join(' '));},remove:function(classNameToRemove){if(!this.include(classNameToRemove))return;this.set($A(this).without(classNameToRemove).join(' '));},toString:function(){return $A(this).join(' ');}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();;var Scriptaculous={Version:'1.8.1',require:function(libraryName){document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');},REQUIRED_PROTOTYPE:'1.6.0',load:function(){function convertVersionString(versionString){var r=versionString.split('.');return parseInt(r[0])*100000+parseInt(r[1])*1000+parseInt(r[2]);}
if((typeof Prototype=='undefined')||(typeof Element=='undefined')||(typeof Element.Methods=='undefined')||(convertVersionString(Prototype.Version)<convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
throw("script.aculo.us requires the Prototype JavaScript framework >= "+
Scriptaculous.REQUIRED_PROTOTYPE);$A(document.getElementsByTagName("script")).findAll(function(s){return(s.src&&s.src.match(/scriptaculous\.js(\?.*)?$/))}).each(function(s){var path=s.src.replace(/scriptaculous\.js(\?.*)?$/,'');var includes=s.src.match(/\?.*load=([a-z,]*)/);(includes?includes[1]:'builder,effects,dragdrop,controls,slider,sound').split(',').each(function(include){Scriptaculous.require(path+include+'.js')});});}}
Scriptaculous.load();;function SocialBookmark(siteName,siteUrl,addUrl,anchorTitle,img,imgAlt){this.siteName=siteName;this.siteUrl=siteUrl;this.addUrl=addUrl;this.anchorTitle=anchorTitle;this.img=img;this.imgAlt=imgAlt;}
var design=false;var socialBookmark=new Array();socialBookmark[0]=new SocialBookmark("dg","http://digg.com/","http://digg.com/submit?phase=2&amp;url=<u>","Digg This!","dg.png","");socialBookmark[1]=new SocialBookmark("dl","http://del.icio.us/","http://del.icio.us/post?url=<u>&amp;title=<t>","Bookmark This to del.icio.us","dl.png","");socialBookmark[2]=new SocialBookmark("bl","http://www.blinklist.com/","http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Description=<d>&amp;Url=<u>&amp;Title=<t>","BlinkList This!","bl.png","");socialBookmark[3]=new SocialBookmark("bm","http://blogmarks.net/","http://blogmarks.net/my/new.php?mini=1&amp;title=<t>&amp;url=<u>","Blogmark This!","bm.png","");socialBookmark[4]=new SocialBookmark("fl","http://www.furl.net/","http://www.furl.net/storeIt.jsp?u=<u>&amp;t=<t>","Bookmark To Furl!","fl.png","");socialBookmark[5]=new SocialBookmark("gg","http://www.google.com/","http://www.google.com/bookmarks/mark?op=add&amp;bkmk=<u>&amp;title=<t>","Bookmark To Google!","gg.png","");socialBookmark[6]=new SocialBookmark("nz","http://www.netvouz.com/","http://www.netvouz.com/action/submitBookmark?url=<u>&amp;title=<t>&amp;popup=no","Bookmark To Netvouz!","nz.png","");socialBookmark[7]=new SocialBookmark("rd","http://reddit.com/","http://reddit.com/submit?url=<u>&amp;title=<t>","Add To Reddit!","rd.png","");socialBookmark[8]=new SocialBookmark("sy","http://www.simpy.com/","http://www.simpy.com/simpy/LinkAdd.do?href=<u>&amp;title=<t>","Simpy This!","sy.png","");socialBookmark[9]=new SocialBookmark("sp","http://www.spurl.net/","http://www.spurl.net/spurl.php?url=<u>&amp;title=<t>","Spurl This!","sp.png","");socialBookmark[10]=new SocialBookmark("yo","http://beta.bookmarks.yahoo.com/","http://beta.bookmarks.yahoo.com/toolbar/savebm?t=<t>&amp;u=<u>","Add to Yahoo Bookmarks Beta!","yo.png","");socialBookmark[11]=new SocialBookmark("mw","http://myweb2.search.yahoo.com/","http://myweb2.search.yahoo.com/myresults/bookmark?t=<t>&amp;u=<u>","Add to Yahoo My Web Beta!","mw.png","");socialBookmark[12]=new SocialBookmark("me","http://meneame.net/","http://meneame.net/submit.php?title=<t>&amp;url=<u>","Add to Meneame!","me.png","");socialBookmark[13]=new SocialBookmark("fq","http://tec.fresqui.com/","http://tec.fresqui.com/post?url=<u>&amp;title=<t>","Add to Fresqui!","fq.png","");socialBookmark[14]=new SocialBookmark("al","http://advertlover.com/","http://advertlover.com/submit.php?phase=2&amp;url=<u>&amp;title=<t>","Add to Advert Lover!","al.png","");socialBookmark[15]=new SocialBookmark("mg","http://ma.gnolia.com/","http://ma.gnolia.com/bookmarklet/add?url=<u>&amp;title=<t>","Add to Magnolia!","mg.png","");socialBookmark[16]=new SocialBookmark("sd","http://www.shadows.com/","http://www.shadows.com/shadows.aspx?url=<u>","Add to Shadows!","sd.png","");socialBookmark[17]=new SocialBookmark("sc","http://www.scuttle.org/","http://www.scuttle.org/bookmarks.php/maxpower?action=add&amp;address=<u>&amp;title=<t>","Add to Scuttle!","sc.png","");socialBookmark[18]=new SocialBookmark("fb","http://www.facebook.com/","http://www.facebook.com/share.php?u=<u>&t=<t>","Share on Facebook!","fb.png","");function drawBookmarks(page,title,list,img_root,place){if((page==''||typeof page=='undefined')&&(title==''||typeof title=='undefined')&&(list==''||typeof list=='undefined'))design=true;if(!design)bkmk='<br /><div id="bookmarks">';for(var i=0;i<socialBookmark.length;i++){if(design&&((i%10)==0))document.write('<hr/>');if(design){link=' href="#" onClick="toggleLink(this,document.forms[\'socialbookmarks\'].sel)" ';}else{link=' href="'+socialBookmark[i].addUrl+'" ';}
if(!design)link=link.replace('<u>',page);if(!design)link=link.replace('<t>',title);if(list.indexOf(socialBookmark[i].siteName)!=-1)
bkmk=bkmk+'&nbsp;<a target="_blank" id="'+socialBookmark[i].siteName+'" '+link+' title="'+socialBookmark[i].anchorTitle+'"><img src="'+img_root+socialBookmark[i].img+'" alt="'+socialBookmark[i].imgAlt+'" height="16" width="16" /></a> ';}
if(!design)document.getElementById(place).innerHTML=bkmk+'</div><br><br>';};var uniquepageid=window.location.href.replace("http://"+window.location.hostname,"").replace(/^\//,"")
function animatedcollapse(divId,animatetime,persistexpand,initstate){this.divId=divId
this.divObj=document.getElementById(divId)
this.divObj.style.overflow="hidden"
this.timelength=animatetime
this.initstate=(typeof initstate!="undefined"&&initstate=="block")?"block":"none"
this.isExpanded=this.getCookie(divId)
this.contentheight=parseInt(this.divObj.style.height)
var thisobj=this
if(isNaN(this.contentheight)){animatedcollapse.dotask(window,function(){thisobj._getheight(persistexpand)},"load")
if(!persistexpand&&this.initstate=="none"||persistexpand&&this.isExpanded!="yes")
this.divObj.style.display="none"}else if(!persistexpand&&this.initstate=="none"||persistexpand&&this.isExpanded!="yes"){this.divObj.style.display="none";this.divObj.style.height="1px";}
if(persistexpand)animatedcollapse.dotask(window,function(){animatedcollapse.setCookie(uniquepageid+"-"+thisobj.divId,thisobj.isExpanded)},"unload")}
animatedcollapse.prototype._getheight=function(persistexpand){this.contentheight=this.divObj.offsetHeight
if(!persistexpand&&this.initstate=="none"||persistexpand&&this.isExpanded!="yes"){this.divObj.style.height="1px"
this.divObj.style.display="none";}
else
this.divObj.style.display="block";this.divObj.style.height=this.contentheight+"px"}
animatedcollapse.prototype._slideengine=function(direction){var elapsed=new Date().getTime()-this.startTime
var thisobj=this
if(elapsed<this.timelength){var distancepercent=(direction=="down")?animatedcollapse.curveincrement(elapsed/this.timelength):1-animatedcollapse.curveincrement(elapsed/this.timelength)
if(distancepercent*this.contentheight>0){this.divObj.style.height=distancepercent*this.contentheight+"px"}else{this.divObj.style.height="1px";}
this.runtimer=setTimeout(function(){thisobj._slideengine(direction)},10)}else{this.divObj.style.height=(direction=="down")?this.contentheight+"px":"1px"
this.isExpanded=(direction=="down")?"yes":"no"
if(this.isExpanded=="no")this.divObj.style.display="none";this.runtimer=null}}
animatedcollapse.prototype.close=function(){this.divObj.style.display="none";this.divObj.style.height="1px"
this.isExpanded="no"
this.runtimer=null}
animatedcollapse.prototype.slidedown=function(){if(typeof this.runtimer=="undefined"||this.runtimer==null){if(isNaN(this.contentheight))
alert("Please wait until document has fully loaded then click again")
else if(parseInt(this.divObj.style.height)==1){this.divObj.style.display="block";this.startTime=new Date().getTime()
this._slideengine("down")}}}
animatedcollapse.prototype.slideup=function(){if(typeof this.runtimer=="undefined"||this.runtimer==null){if(isNaN(this.contentheight))
alert("Please wait until document has fully loaded then click again")
else if(parseInt(this.divObj.style.height)==this.contentheight){this.startTime=new Date().getTime()
this._slideengine("up")}}}
animatedcollapse.prototype.slideit=function(){if(isNaN(this.contentheight))
alert("Please wait until document has fully loaded then click again")
else if(parseInt(this.divObj.style.height)==1){this.slidedown();}else if(parseInt(this.divObj.style.height)==this.contentheight){this.slideup();}}
animatedcollapse.curveincrement=function(percent){return(1-Math.cos(percent*Math.PI))/2}
animatedcollapse.dotask=function(target,functionref,tasktype){var tasktype=(window.addEventListener)?tasktype:"on"+tasktype
if(target.addEventListener)
target.addEventListener(tasktype,functionref,false)
else if(target.attachEvent)
target.attachEvent(tasktype,functionref)}
animatedcollapse.prototype.getCookie=function(Name){Name=uniquepageid+"-"+Name;var acd=subcookiejar.fetch('acollapsediv');if(acd)return acd[Name];return;var re=new RegExp(Name+"=[^;]+","i");if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return""}
animatedcollapse.setCookie=function(name,value,days){if(typeof value=="undefined")value='no';if(typeof days=="undefined")days=30;var acd=new Object()
acd[name]=value;subcookiejar.bake("acollapsediv",acd,days);return;if(typeof days!="undefined"){var expireDate=new Date()
var expstring=expireDate.setDate(expireDate.getDate()+days)
document.cookie=name+"="+value+"; expires="+expireDate.toGMTString()}
else
document.cookie=name+"="+value}
var cookiejar={bake:function(cookieName,cookieValue,days,path){var expires='';if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString();}
var thePath='; path=/';if(path){thePath='; path='+path;}
document.cookie=cookieName+'='+escape(cookieValue)+expires+thePath;return true;},fetch:function(cookieName){var nameEQ=cookieName+'=';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 unescape(c.substring(nameEQ.length,c.length));}}
return null;},crumble:function(cookieName){return cookiejar.bake(cookieName,'',-1);}};var subcookiejar={nameValueSeparator:'$$:$$',subcookieSeparator:'$$/$$',bake:function(cookieName,subcookieObj,days,path){var existingCookie;if(existingCookie=subcookiejar.fetch(cookieName)){for(var i in existingCookie){if(!(i in subcookieObj)){subcookieObj[i]=existingCookie[i];}}}
var cookieValue='';for(var i in subcookieObj){cookieValue+=i+subcookiejar.nameValueSeparator;cookieValue+=subcookieObj[i];cookieValue+=subcookiejar.subcookieSeparator;}
cookieValue=cookieValue.substring(0,cookieValue.length-subcookiejar.subcookieSeparator.length);return cookiejar.bake(cookieName,cookieValue,days,path);},fetch:function(cookieName,subcookieName){var cookieValue=cookiejar.fetch(cookieName);if(!cookieValue){return null;}
var subcookies=cookieValue.split(subcookiejar.subcookieSeparator);var cookieObj={};for(var i=0,sclen=subcookies.length;i<sclen;i++){var sc=subcookies[i].split(subcookiejar.nameValueSeparator);cookieObj[sc[0]]=sc[1];}
if(subcookieName!=undefined){if(subcookieName in cookieObj){return cookieObj[subcookieName];}
return null;}
return cookieObj;},crumble:function(cookieName,subcookieName,days,path){var cookieValue=cookiejar.fetch(cookieName);if(!cookieValue){return false;}
var newCookieObj={};var subcookies=cookieValue.split(subcookiejar.subcookieSeparator);for(var i=0,sclen=subcookies.length;i<sclen;i++){var sc=subcookies[i].split(subcookiejar.nameValueSeparator);if(sc[0]!=subcookieName){newCookieObj[sc[0]]=sc[1];}}
return subcookiejar.bake(cookieName,newCookieObj,days,path);}};;var indicator_img_path="/images/indicator.gif";var indicator_img_html="<img name=\"ibox_indicator\" src=\""+indicator_img_path+"\" alt=\"Loading...\" style=\"width:128px;height:128px;\"/>";var opacity_level=8;var ibAttr="rel";var imgPreloader=new Image();function init_ibox(){var elem_wrapper="ibox";createIbox(document.getElementsByTagName("body")[0]);var docRoot=document.getElementsByTagName("a");var e;for(var i=0;i<docRoot.length-1;i++){e=docRoot[i];if(e.getAttribute(ibAttr)){var t=e.getAttribute(ibAttr);if((t.indexOf("ibox")!=-1)||t.toLowerCase()=="ibox"){e.onclick=function(){var t=this.getAttribute(ibAttr);var params=parseQuery(t.substr(5,999));var url=this.href;if(this.target!=""){url=this.target}
var title=this.title;if(showIbox(url,title,params)){showBG();window.onscroll=maintPos;window.onresize=maintPos;}
return false;};}}}}
showBG=function(){var box_w=getElem('ibox_w');box_w.style.opacity=0;box_w.style.filter='alpha(opacity=0)';setBGOpacity=setOpacity;for(var i=0;i<=opacity_level;i++){setTimeout("setIboxOpacity('ibox_w',"+i+")",70*i);}
box_w.style.display="";var pagesize=new getPageSize();var scrollPos=new getScrollPos();var ua=navigator.userAgent;if(ua.indexOf("MSIE ")!=-1){box_w.style.width=pagesize.width+'px';}
box_w.style.height=pagesize.height+scrollPos.scrollY+'px';}
hideBG=function(){var box_w=getElem('ibox_w');box_w.style.display="none";}
var loadCancelled=false;showIndicator=function(){var ibox_p=getElem('ibox_progress');ibox_p.style.display="";posToCenter(ibox_p);ibox_p.onclick=function(){hideIbox();hideIndicator();loadCancelled=true;}}
hideIndicator=function(){var ibox_p=getElem('ibox_progress');ibox_p.style.display="none";ibox_p.onclick=null;}
createIbox=function(elem){var strHTML="<div id=\"ibox_w\" style=\"display:none;\"></div>";strHTML+="<div id=\"ibox_progress\" style=\"display:none;\">";strHTML+=indicator_img_html;strHTML+="</div>";strHTML+="<div id=\"ibox_wrapper\" style=\"display:none\">";strHTML+="<div id=\"ibox_content\"></div>";strHTML+="<div id=\"ibox_footer_wrapper\"><div id=\"ibox_close\" style=\"float:right;\">";strHTML+="<a id=\"ibox_close_a\" href=\"javascript:void(null);\" >Click here to close</a></div>";strHTML+="<div id=\"ibox_footer\">&nbsp;</div></div></div></div>";var docBody=document.getElementsByTagName("body")[0];var ibox=document.createElement("div");ibox.setAttribute("id","ibox");ibox.style.display='';ibox.innerHTML=strHTML;elem.appendChild(ibox);}
var ibox_w_height=0;showIbox=function(url,title,params){var ibox=getElem('ibox_wrapper');var ibox_type=0;var ibox_footer=getElem('ibox_footer');if(title!=""){ibox_footer.innerHTML=title;}else{ibox_footer.innerHTML="&nbsp;";}
var urlString=/\.jpg|\.jpeg|\.png|\.gif|\.html|\.htm|\.php|\.cfm|\.asp|\.aspx|\.jsp|\.jst|\.rb|\.rhtml|\.txt/g;var urlType=url.match(urlString);if(urlType=='.jpg'||urlType=='.jpeg'||urlType=='.png'||urlType=='.gif'){ibox_type=1;}else if(url.indexOf("#")!=-1){ibox_type=2;}else if(urlType=='.htm'||urlType=='.html'||urlType=='.php'||urlType=='.asp'||urlType=='.aspx'||urlType=='.jsp'||urlType=='.jst'||urlType=='.rb'||urlType=='.txt'||urlType=='.rhtml'||urlType=='.cfm'){ibox_type=3;}else{if(params['type']){ibox_type=parseInt(params['type']);}
else{hideIbox();return false;}}
ibox_type=parseInt(ibox_type);switch(ibox_type){case 1:showIndicator();imgPreloader=new Image();imgPreloader.onload=function(){imgPreloader=resizeImageToScreen(imgPreloader);hideIndicator();var strHTML="<img name=\"ibox_img\" src=\""+url+"\" style=\"width:"+imgPreloader.width+"px;height:"+imgPreloader.height+"px;border:0;cursor:hand;margin:0;padding:0;position:absolute;\"/>";if(loadCancelled==false){ibox.style.height=imgPreloader.height+'px';ibox.style.width=imgPreloader.width+'px';ibox.style.display="";ibox.style.visibility="hidden";posToCenter(ibox);ibox.style.visibility="visible";setIBoxContent(strHTML);}}
loadCancelled=false;imgPreloader.src=url;break;case 2:var strHTML="";if(params['height']){ibox.style.height=params['height']+'px';}
else{ibox.style.height='280px';}
if(params['width']){ibox.style.width=params['width']+'px';}
else{ibox.style.width='450px';}
ibox.style.display="";ibox.style.visibility="hidden";posToCenter(ibox);ibox.style.visibility="visible";getElem('ibox_content').style.overflow="auto";var elemSrcId=url.substr(url.indexOf("#")+1,1000);var elemSrc=getElem(elemSrcId);if(elemSrc){strHTML=elemSrc.innerHTML;}
setIBoxContent(strHTML);break;case 3:if(params['height']){ibox.style.height=params['height']+'px';}
else{ibox.style.height='280px';}
if(params['width']){ibox.style.width=params['width']+'px';}
else{ibox.style.width='450px';}
ibox.style.display="";ibox.style.visibility="hidden";posToCenter(ibox);ibox.style.visibility="visible";getElem('ibox_content').style.overflow="auto";eval(params['ajax']);break;default:}
ibox.style.opacity=0;ibox.style.filter='alpha(opacity=0)';var ibox_op_level=10;setIboxOpacity=setOpacity;for(var i=0;i<=ibox_op_level;i++){setTimeout("setIboxOpacity('ibox_wrapper',"+i+")",30*i);}
if(ibox_type==2||ibox_type==3){ibox.onclick=null;getElem("ibox_close_a").onclick=function(){hideIbox();}
getElem("ibox_w").onclick=function(){hideIbox();}
document.onkeydown=keyboardAction;}else{ibox.onclick=hideIbox;getElem("ibox_close_a").onclick=null;}
return true;}
keyboardAction=function(e){if(e==null){keycode=event.keyCode;escapeKey=27;}else{keycode=e.keyCode;escapeKey=e.DOM_VK_ESCAPE;}
key=String.fromCharCode(keycode).toLowerCase();if((key=='x')||(key=='o')||(key=='c')||(keycode==escapeKey)){hideIbox();}}
setOpacity=function(elemid,value){var e=getElem(elemid);e.style.opacity=value/10;e.style.filter='alpha(opacity='+value*10+')';}
resizeImageToScreen=function(objImg){var pagesize=new getPageSize();var x=pagesize.width-100;var y=pagesize.height-100;if(objImg.width>x){objImg.height=objImg.height*(x/objImg.width);objImg.width=x;if(objImg.height>y){objImg.width=objImg.width*(y/objImg.height);objImg.height=y;}}
else if(objImg.height>y){objImg.width=objImg.width*(y/objImg.height);objImg.height=y;if(objImg.width>x){objImg.height=objImg.height*(x/objImg.width);objImg.width=x;}}
return objImg;}
maintPos=function(){var ibox=getElem('ibox_wrapper');var box_w=getElem('ibox_w');var pagesize=new getPageSize();var scrollPos=new getScrollPos();var ua=navigator.userAgent;if(ua.indexOf("MSIE ")!=-1){box_w.style.width=pagesize.width+'px';}
if(ua.indexOf("Opera/9")!=-1){box_w.style.height=document.body.scrollHeight+'px';}
else{box_w.style.height=pagesize.height+scrollPos.scrollY+'px';}
posToCenter(ibox);}
hideIbox=function(){hideBG();var ibox=getElem('ibox_wrapper');ibox.style.display="none";clearIboxContent();window.onscroll=null;}
posToCenter=function(elem){var scrollPos=new getScrollPos();var pageSize=new getPageSize();var emSize=new getElementSize(elem);var x=Math.round(pageSize.width/2)-(emSize.width/2)+scrollPos.scrollX;var y=Math.round(pageSize.height/2)-(emSize.height/2)+scrollPos.scrollY;elem.style.left=x+'px';elem.style.top=y+'px';}
getScrollPos=function(){var docElem=document.documentElement;this.scrollX=self.pageXOffset||(docElem&&docElem.scrollLeft)||document.body.scrollLeft;this.scrollY=self.pageYOffset||(docElem&&docElem.scrollTop)||document.body.scrollTop;}
getPageSize=function(){var docElem=document.documentElement
this.width=self.innerWidth||(docElem&&docElem.clientWidth)||document.body.clientWidth;this.height=self.innerHeight||(docElem&&docElem.clientHeight)||document.body.clientHeight;}
getElementSize=function(elem){this.width=elem.offsetWidth||elem.style.pixelWidth;this.height=elem.offsetHeight||elem.style.pixelHeight;}
setIBoxContent=function(str){clearIboxContent();var e=getElem('ibox_content');e.style.overflow="auto";e.innerHTML=str;}
clearIboxContent=function(){var e=getElem('ibox_content');e.innerHTML="";}
getElem=function(elemId){return document.getElementById(elemId);}
parseQuery=function(query){var Params=new Object();if(!query)return Params;var Pairs=query.split(/[;&]/);for(var i=0;i<Pairs.length;i++){var KeyVal=Pairs[i].split('=');if(!KeyVal||KeyVal.length!=2)continue;var key=unescape(KeyVal[0]);var val=unescape(KeyVal[1]);val=val.replace(/\+/g,' ');Params[key]=val;}
return Params;}
createRequestObject=function(){var xmlhttp;/*@cc_on
 @if (@_jscript_version>= 5)
   try {xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
   } catch (e) {
     try {xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
     catch (E) {xmlhttp = false;}
   }
 @else
  xmlhttp = false;
 @end @*/if(!xmlhttp&&typeof XMLHttpRequest!="undefined"){try{xmlhttp=new XMLHttpRequest();}catch(e){xmlhttp=false;}}
return xmlhttp;}
var http=createRequestObject();function addEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true;}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}else{return false;}}
addEvent(window,'load',init_ibox);;var cropToolBorderWidth=1;var smallSquareWidth=7;var crop_imageWidth=600;var crop_imageHeight=450;var crop_originalImageWidth=300;var crop_originalImageHeight=300;var crop_minimumPercent=10;var crop_maximumPercent=200;var crop_minimumWidthHeight=50;var updateFormValuesAsYouDrag=false;if(!document.all)updateFormValuesAsYouDrag=false;var crop_handler='images/small_square.gif';var crop_script_alwaysPreserveAspectRatio=true;var crop_script_fixedRatio=true;var crop_script_browserIsOpera=navigator.userAgent.indexOf('Opera')>=0?true:false;var cropDiv_left=false;var cropDiv_top=false;var cropDiv_right=false;var cropDiv_bottom=false;var cropDiv_dotted=false;var crop_currentResizeType=false;var cropEvent_posX;var cropEvent_posY;var cropEvent_eventX;var cropEvent_eventY;var crop_resizeCounter=-1;var crop_moveCounter=-1;var crop_imageDiv=false;var imageDiv_currentWidth=false;var imageDiv_currentHeight=false;var imageDiv_currentLeft=false;var imageDiv_currentTop=false;var smallSquare_tl;var smallSquare_tc;var smallSquare_tr;var smallSquare_lc;var smallSquare_rc;var smallSquare_bl;var smallSquare_bc;var smallSquare_br;var offsetSmallSquares=Math.floor(smallSquareWidth/2);var cropScriptAjaxObjects=new Array();var preserveAspectRatio=false;var cropWidthRatio=false;function crop_createDivElements()
{crop_imageDiv=document.getElementById('imageContainer');cropDiv_left=document.createElement('DIV');cropDiv_left.className='crop_transparentDiv';cropDiv_left.style.visibility='visible';cropDiv_left.style.left='0px';cropDiv_left.style.top='0px';cropDiv_left.style.height=crop_imageHeight+'px';cropDiv_left.style.width='0px';cropDiv_left.innerHTML='<span></span>';crop_imageDiv.appendChild(cropDiv_left);cropDiv_top=document.createElement('DIV');cropDiv_top.className='crop_transparentDiv';cropDiv_top.style.visibility='visible';cropDiv_top.style.left='0px';cropDiv_top.style.top='0px';cropDiv_top.style.height='0px';cropDiv_top.style.width=crop_imageWidth+'px';cropDiv_top.innerHTML='<span></span>';crop_imageDiv.appendChild(cropDiv_top);cropDiv_right=document.createElement('DIV');cropDiv_right.className='crop_transparentDiv';cropDiv_right.style.visibility='visible';cropDiv_right.style.left=(crop_imageWidth)+'px';cropDiv_right.style.top='0px';cropDiv_right.style.height=crop_imageHeight+'px';cropDiv_right.style.width='0px';cropDiv_right.innerHTML='<span></span>';crop_imageDiv.appendChild(cropDiv_right);cropDiv_bottom=document.createElement('DIV');cropDiv_bottom.className='crop_transparentDiv';cropDiv_bottom.style.visibility='visible';cropDiv_bottom.style.left='0px';cropDiv_bottom.style.top=(crop_imageHeight)+'px';cropDiv_bottom.style.height='0px';cropDiv_bottom.style.width=crop_imageWidth+'px';cropDiv_bottom.innerHTML='<span></span>';crop_imageDiv.appendChild(cropDiv_bottom);cropDiv_dotted=document.createElement('DIV');cropDiv_dotted.className='crop_dottedDiv';cropDiv_dotted.style.left='0px';cropDiv_dotted.style.top='0px';cropDiv_dotted.style.width=(crop_imageWidth-(cropToolBorderWidth*2))+'px';cropDiv_dotted.style.height=(crop_imageHeight-(cropToolBorderWidth*2))+'px';cropDiv_dotted.innerHTML='<div></div>';cropDiv_dotted.style.cursor='move';if(crop_script_browserIsOpera){var div=cropDiv_dotted.getElementsByTagName('DIV')[0];div.style.backgroundColor='transparent';cropDiv_bottom.style.backgroundColor='transparent';cropDiv_right.style.backgroundColor='transparent';cropDiv_top.style.backgroundColor='transparent';cropDiv_left.style.backgroundColor='transparent';}
cropDiv_dotted.onmousedown=cropScript_initMove;smallSquare_tl=document.createElement('IMG');smallSquare_tl.src=crop_handler;smallSquare_tl.style.position='absolute';smallSquare_tl.style.left=(-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_tl.style.top=(-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_tl.style.cursor='nw-resize';smallSquare_tl.id='nw-resize';smallSquare_tl.onmousedown=cropScript_initResize;cropDiv_dotted.appendChild(smallSquare_tl);smallSquare_tr=document.createElement('IMG');smallSquare_tr.src=crop_handler;smallSquare_tr.style.position='absolute';smallSquare_tr.style.left=(crop_imageWidth-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_tr.style.top=(-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_tr.style.cursor='ne-resize';smallSquare_tr.id='ne-resize';smallSquare_tr.onmousedown=cropScript_initResize;cropDiv_dotted.appendChild(smallSquare_tr);smallSquare_bl=document.createElement('IMG');smallSquare_bl.src=crop_handler;smallSquare_bl.style.position='absolute';smallSquare_bl.style.left=(-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_bl.style.top=(crop_imageHeight-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_bl.style.cursor='sw-resize';smallSquare_bl.id='sw-resize';smallSquare_bl.onmousedown=cropScript_initResize;cropDiv_dotted.appendChild(smallSquare_bl);smallSquare_br=document.createElement('IMG');smallSquare_br.src=crop_handler;smallSquare_br.style.position='absolute';smallSquare_br.style.left=(crop_imageWidth-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_br.style.top=(crop_imageHeight-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_br.style.cursor='se-resize';smallSquare_br.id='se-resize';smallSquare_br.onmousedown=cropScript_initResize;cropDiv_dotted.appendChild(smallSquare_br);smallSquare_tc=document.createElement('IMG');smallSquare_tc.src=crop_handler;smallSquare_tc.style.position='absolute';smallSquare_tc.style.left=(Math.floor(crop_imageWidth/2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_tc.style.top=(-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_tc.style.cursor='s-resize';smallSquare_tc.id='n-resize';smallSquare_tc.onmousedown=cropScript_initResize;cropDiv_dotted.appendChild(smallSquare_tc);smallSquare_bc=document.createElement('IMG');smallSquare_bc.src=crop_handler;smallSquare_bc.style.position='absolute';smallSquare_bc.style.left=(Math.floor(crop_imageWidth/2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_bc.style.top=(crop_imageHeight-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_bc.style.cursor='s-resize';smallSquare_bc.id='s-resize';smallSquare_bc.onmousedown=cropScript_initResize;cropDiv_dotted.appendChild(smallSquare_bc);smallSquare_lc=document.createElement('IMG');smallSquare_lc.src=crop_handler;smallSquare_lc.style.position='absolute';smallSquare_lc.style.left=(-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_lc.style.top=(Math.floor(crop_imageHeight/2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_lc.style.cursor='e-resize';smallSquare_lc.id='w-resize';smallSquare_lc.onmousedown=cropScript_initResize;cropDiv_dotted.appendChild(smallSquare_lc);smallSquare_rc=document.createElement('IMG');smallSquare_rc.src=crop_handler;smallSquare_rc.style.position='absolute';smallSquare_rc.style.left=(crop_imageWidth-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_rc.style.top=(Math.floor(crop_imageHeight/2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_rc.style.cursor='e-resize';smallSquare_rc.id='e-resize';smallSquare_rc.onmousedown=cropScript_initResize;cropDiv_dotted.appendChild(smallSquare_rc);crop_imageDiv.appendChild(cropDiv_dotted);}
function cropScript_initMove(e)
{if(document.all)e=event;if(e.target)source=e.target;else if(e.srcElement)source=e.srcElement;if(source.nodeType==3)
source=source.parentNode;if(source.id&&source.id.indexOf('resize')>=0)return;imageDiv_currentLeft=cropDiv_dotted.style.left.replace('px','')/1;imageDiv_currentTop=cropDiv_dotted.style.top.replace('px','')/1;imageDiv_currentWidth=cropDiv_dotted.style.width.replace('px','')/1;imageDiv_currentHeight=cropDiv_dotted.style.height.replace('px','')/1;cropEvent_eventX=e.clientX;cropEvent_eventY=e.clientY;crop_moveCounter=0;cropScript_timerMove();return false;}
function cropScript_timerMove()
{if(crop_moveCounter>=0&&crop_moveCounter<10){crop_moveCounter++;setTimeout('cropScript_timerMove()',1);return;}}
function cropScript_initResize(e)
{if(document.all)e=event;cropDiv_dotted.style.cursor='default';crop_currentResizeType=this.id;cropEvent_eventX=e.clientX;cropEvent_eventY=e.clientY;crop_resizeCounter=0;imageDiv_currentWidth=cropDiv_dotted.style.width.replace('px','')/1;imageDiv_currentHeight=cropDiv_dotted.style.height.replace('px','')/1;imageDiv_currentLeft=cropDiv_dotted.style.left.replace('px','')/1;imageDiv_currentTop=cropDiv_dotted.style.top.replace('px','')/1;cropWidthRatio=cropDiv_dotted.offsetWidth/cropDiv_dotted.offsetHeight;if(crop_script_fixedRatio)cropWidthRatio=crop_script_fixedRatio;if(document.all){var div=cropDiv_dotted.getElementsByTagName('DIV')[0];div.style.display='none';}
cropScript_timerResize();return false;}
function cropScript_timerResize()
{if(crop_resizeCounter>=0&&crop_resizeCounter<10){crop_resizeCounter=crop_resizeCounter+1;setTimeout('cropScript_timerResize()',1);return;}}
function cropScript_executeCrop(buttonObj)
{crop_startProgressBar();buttonObj.style.visibility='hidden';var ajaxIndex=cropScriptAjaxObjects.length;cropScriptAjaxObjects[ajaxIndex]=new sack();var url=crop_script_server_file+'?image_ref='+document.getElementById('input_image_ref').value
+'&x='+document.getElementById('input_crop_x').value
+'&y='+document.getElementById('input_crop_y').value
+'&width='+document.getElementById('input_crop_width').value
+'&height='+document.getElementById('input_crop_height').value
+'&percentSize='+document.getElementById('crop_percent_size').value
+'&convertTo='+document.getElementById('input_convert_to').options[document.getElementById('input_convert_to').selectedIndex].value;cropScriptAjaxObjects[ajaxIndex].requestFile=url;cropScriptAjaxObjects[ajaxIndex].onCompletion=function(){cropScript_cropCompleted(ajaxIndex,buttonObj);};cropScriptAjaxObjects[ajaxIndex].runAJAX();}
function cropScript_cropCompleted(ajaxIndex,buttonObj)
{buttonObj.style.visibility='';eval(cropScriptAjaxObjects[ajaxIndex].response)
cropScriptAjaxObjects[ajaxIndex]=false;crop_hideProgressBar();}
function crop_cancelEvent(e)
{if(document.all)e=event;if(e.target)source=e.target;else if(e.srcElement)source=e.srcElement;if(source.nodeType==3)
source=source.parentNode;if(source.tagName&&source.tagName.toLowerCase()=='input')return true;return false;}
var mouseMoveEventInProgress=false;function cropScript_mouseMove(e)
{if(mouseMoveEventInProgress)return;if(crop_moveCounter<10&&crop_resizeCounter<10)return;if(document.all)mouseMoveEventInProgress=true;if(document.all)e=event;if(crop_resizeCounter==10){if(crop_currentResizeType=='e-resize'||crop_currentResizeType=='ne-resize'||crop_currentResizeType=='se-resize'){cropDiv_dotted.style.width=Math.max(crop_minimumWidthHeight,(imageDiv_currentWidth+e.clientX-cropEvent_eventX))+'px';}
if(crop_currentResizeType=='s-resize'||crop_currentResizeType=='sw-resize'||crop_currentResizeType=='se-resize'){cropDiv_dotted.style.height=Math.max(crop_minimumWidthHeight,(imageDiv_currentHeight+e.clientY-cropEvent_eventY))+'px';}
if(crop_currentResizeType=='w-resize'||crop_currentResizeType=='sw-resize'||crop_currentResizeType=='nw-resize'){var tmpTop=cropDiv_dotted.style.left.replace('px','')/1;var newTop=Math.max(0,(imageDiv_currentLeft+e.clientX-cropEvent_eventX));if((newTop+crop_minimumWidthHeight)>(cropDiv_dotted.style.left.replace('px','')/1+cropDiv_dotted.style.width.replace('px','')/1)){newTop=(cropDiv_dotted.style.left.replace('px','')/1+cropDiv_dotted.style.width.replace('px','')/1)-crop_minimumWidthHeight;}
cropDiv_dotted.style.left=newTop+'px';cropDiv_dotted.style.width=(cropDiv_dotted.style.width.replace('px','')/1+tmpTop-cropDiv_dotted.style.left.replace('px','')/1)+'px';}
if(crop_currentResizeType=='n-resize'||crop_currentResizeType=='nw-resize'||crop_currentResizeType=='ne-resize'){var tmpTop=cropDiv_dotted.style.top.replace('px','')/1;var newTop=Math.max(0,(imageDiv_currentTop+e.clientY-cropEvent_eventY));if((newTop+crop_minimumWidthHeight)>(cropDiv_dotted.style.top.replace('px','')/1+cropDiv_dotted.style.height.replace('px','')/1)){newTop=(cropDiv_dotted.style.top.replace('px','')/1+cropDiv_dotted.style.height.replace('px','')/1)-crop_minimumWidthHeight;}
cropDiv_dotted.style.top=newTop+'px';cropDiv_dotted.style.height=(cropDiv_dotted.style.height.replace('px','')/1+tmpTop-cropDiv_dotted.style.top.replace('px','')/1)+'px';}
if((cropDiv_dotted.offsetHeight+(cropToolBorderWidth*2)+cropDiv_dotted.style.top.replace('px','')/1)>crop_imageHeight)
cropDiv_dotted.style.height=(crop_imageHeight-cropDiv_dotted.style.top.replace('px','')/1-(cropToolBorderWidth*2))+'px';if((cropDiv_dotted.offsetWidth+(cropToolBorderWidth*2)+cropDiv_dotted.style.left.replace('px','')/1)>crop_imageWidth)
cropDiv_dotted.style.width=(crop_imageWidth-cropDiv_dotted.style.left.replace('px','')/1-(cropToolBorderWidth*2))+'px';if(e.ctrlKey||crop_script_alwaysPreserveAspectRatio)preserveAspectRatio=true;else preserveAspectRatio=false;if(preserveAspectRatio){var tmpRatio=cropDiv_dotted.offsetWidth/cropDiv_dotted.offsetHeight;if(tmpRatio<cropWidthRatio){cropDiv_dotted.style.width=(cropDiv_dotted.style.height.replace('px','')/1*cropWidthRatio)+'px';}else{cropDiv_dotted.style.height=(cropDiv_dotted.style.width.replace('px','')/1/cropWidthRatio)+'px';}
if((cropDiv_dotted.offsetHeight+(cropToolBorderWidth*2)+cropDiv_dotted.style.top.replace('px','')/1)>crop_imageHeight){var ratioToAdjust=(crop_imageHeight-cropDiv_dotted.style.top.replace('px','')/1)/(cropDiv_dotted.offsetHeight+(cropToolBorderWidth*2));if(Math.round((cropDiv_dotted.style.width.replace('px','')*ratioToAdjust)+cropToolBorderWidth)>=crop_minimumWidthHeight){cropDiv_dotted.style.height=Math.round((cropDiv_dotted.style.height.replace('px','')*ratioToAdjust)+cropToolBorderWidth)+'px';cropDiv_dotted.style.width=Math.round((cropDiv_dotted.style.width.replace('px','')*ratioToAdjust)+cropToolBorderWidth)+'px';}else{cropDiv_dotted.style.top=(crop_imageHeight-cropDiv_dotted.style.height.replace('px',''))+'px';}}
if((cropDiv_dotted.offsetWidth+(cropToolBorderWidth*2)+cropDiv_dotted.style.left.replace('px','')/1)>crop_imageWidth){var ratioToAdjust=(crop_imageWidth-cropDiv_dotted.style.left.replace('px','')/1)/(cropDiv_dotted.offsetWidth+(cropToolBorderWidth*2));if(Math.round((cropDiv_dotted.style.height.replace('px','')*ratioToAdjust)+cropToolBorderWidth)>=crop_minimumWidthHeight){cropDiv_dotted.style.height=Math.round((cropDiv_dotted.style.height.replace('px','')*ratioToAdjust)+cropToolBorderWidth)+'px';cropDiv_dotted.style.width=Math.round((cropDiv_dotted.style.width.replace('px','')*ratioToAdjust)+cropToolBorderWidth)+'px';}else{cropDiv_dotted.style.left=(crop_imageWidth-cropDiv_dotted.style.width.replace('px',''))+'px';}}}
if(!crop_script_fixedRatio&&!e.ctrlKey)cropWidthRatio=cropDiv_dotted.offsetWidth/cropDiv_dotted.offsetHeight;}
if(crop_moveCounter==10){var tmpLeft=imageDiv_currentLeft+e.clientX-cropEvent_eventX;if(tmpLeft<0)tmpLeft=0;if((tmpLeft+imageDiv_currentWidth+(cropToolBorderWidth*2))>crop_imageWidth)tmpLeft=crop_imageWidth-imageDiv_currentWidth-(cropToolBorderWidth*2);cropDiv_dotted.style.left=tmpLeft+'px';var tmpTop=imageDiv_currentTop+e.clientY-cropEvent_eventY;if(tmpTop<0)tmpTop=0;if((tmpTop+imageDiv_currentHeight+(cropToolBorderWidth*2))>crop_imageHeight)tmpTop=crop_imageHeight-imageDiv_currentHeight-(cropToolBorderWidth*2);cropDiv_dotted.style.top=tmpTop+'px';}
repositionSmallSquares();resizeTransparentSquares();if(updateFormValuesAsYouDrag)cropScript_updateFormValues();mouseMoveEventInProgress=false;}
function repositionSmallSquares()
{smallSquare_tc.style.left=(Math.floor((cropDiv_dotted.style.width.replace('px','')/1+(cropToolBorderWidth*2))/2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_bc.style.left=(Math.floor((cropDiv_dotted.style.width.replace('px','')/1+(cropToolBorderWidth*2))/2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_tr.style.left=(cropDiv_dotted.style.width.replace('px','')/1+(cropToolBorderWidth*2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_rc.style.left=(cropDiv_dotted.style.width.replace('px','')/1+(cropToolBorderWidth*2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_br.style.left=(cropDiv_dotted.style.width.replace('px','')/1+(cropToolBorderWidth*2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_br.style.top=(cropDiv_dotted.style.height.replace('px','')/1+(cropToolBorderWidth*2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_bc.style.top=(cropDiv_dotted.style.height.replace('px','')/1+(cropToolBorderWidth*2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_bl.style.top=(cropDiv_dotted.style.height.replace('px','')/1+(cropToolBorderWidth*2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_lc.style.top=(Math.floor((cropDiv_dotted.style.height.replace('px','')/1+cropToolBorderWidth)/2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';smallSquare_rc.style.top=(Math.floor((cropDiv_dotted.style.height.replace('px','')/1+cropToolBorderWidth)/2)-offsetSmallSquares-(cropToolBorderWidth*2))+'px';}
function resizeTransparentSquares()
{cropDiv_left.style.width=cropDiv_dotted.style.left;cropDiv_right.style.width=Math.max(0,crop_imageWidth-(cropToolBorderWidth*2)-(cropDiv_dotted.style.width.replace('px','')/1+cropDiv_dotted.style.left.replace('px','')/1))+'px';cropDiv_right.style.left=(cropDiv_dotted.style.width.replace('px','')/1+(cropToolBorderWidth*2)+cropDiv_dotted.style.left.replace('px','')/1)+'px';cropDiv_bottom.style.height=Math.max(0,crop_imageHeight-(cropToolBorderWidth*2)-(cropDiv_dotted.style.height.replace('px','')/1+cropDiv_dotted.style.top.replace('px','')/1))+'px';cropDiv_bottom.style.top=(cropDiv_dotted.style.height.replace('px','')/1+(cropToolBorderWidth*2)+cropDiv_dotted.style.top.replace('px','')/1)+'px';cropDiv_top.style.height=cropDiv_dotted.style.top;cropDiv_bottom.style.left=cropDiv_dotted.style.left;cropDiv_bottom.style.width=(cropDiv_dotted.style.width.replace('px','')/1+(cropToolBorderWidth*2))+'px';cropDiv_top.style.left=cropDiv_dotted.style.left;cropDiv_top.style.width=(cropDiv_dotted.style.width.replace('px','')/1+(cropToolBorderWidth*2))+'px';if(cropDiv_left.style.width=='0px')cropDiv_left.style.visibility='hidden';else cropDiv_left.style.visibility='visible';if(cropDiv_right.style.width=='0px')cropDiv_right.style.visibility='hidden';else cropDiv_right.style.visibility='visible';if(cropDiv_bottom.style.width=='0px')cropDiv_bottom.style.visibility='hidden';else cropDiv_bottom.style.visibility='visible';}
function cropScript_updateFormValues()
{document.getElementById('input_crop_x').value=Math.round(cropDiv_dotted.style.left.replace('px','')/1*(crop_originalImageWidth/crop_imageWidth));document.getElementById('input_crop_y').value=Math.round(cropDiv_dotted.style.top.replace('px','')/1*(crop_originalImageHeight/crop_imageHeight));document.getElementById('input_crop_width').value=Math.round((cropDiv_dotted.style.width.replace('px','')/1+(cropToolBorderWidth*2))*(crop_originalImageWidth/crop_imageWidth));document.getElementById('input_crop_height').value=Math.round((cropDiv_dotted.style.height.replace('px','')/1+(cropToolBorderWidth*2))*(crop_originalImageHeight/crop_imageHeight));}
function cropScript_stopResizeMove()
{crop_resizeCounter=-1;crop_moveCounter=-1;cropDiv_dotted.style.cursor='move';cropScript_updateFormValues();if(document.all){var div=cropDiv_dotted.getElementsByTagName('DIV')[0];div.style.display='block';}}
function cropScript_setCropSizeByInput()
{var obj_x=document.getElementById('input_crop_x');var obj_y=document.getElementById('input_crop_y');var obj_width=document.getElementById('input_crop_width');var obj_height=document.getElementById('input_crop_height');obj_x.value=obj_x.value.replace(/[^0-9]/gi,'');obj_y.value=obj_y.value.replace(/[^0-9]/gi,'');obj_width.value=obj_width.value.replace(/[^0-9]/gi,'');obj_height.value=obj_height.value.replace(/[^0-9]/gi,'');if(obj_x.value.length==0)obj_x.value=0;if(obj_y.value.length==0)obj_y.value=0;if(obj_width.value.length==0)obj_width.value=crop_originalImageWidth;if(obj_height.value.length==0)obj_height.value=crop_originalImageHeight;if(obj_x.value>(crop_originalImageWidth-crop_minimumWidthHeight))obj_x.value=crop_originalImageWidth-crop_minimumWidthHeight;if(obj_y.value>(crop_originalImageHeight-crop_minimumWidthHeight))obj_y.value=crop_originalImageHeight-crop_minimumWidthHeight;if(obj_width.value/1>crop_originalImageWidth)obj_width.value=crop_originalImageWidth-obj_x.value/1;if(obj_height.value/1>crop_originalImageHeight)obj_height.value=crop_originalImageHeight-obj_y.value/1;if(obj_x.value/1+obj_width.value/1>crop_originalImageWidth)obj_width.value=crop_originalImageWidth-obj_x.value;if(obj_y.value/1+obj_height.value/1>crop_originalImageHeight)obj_height.value=crop_originalImageHeight-obj_y.value;cropDiv_dotted.style.left=Math.round(obj_x.value/1*(crop_imageWidth/crop_originalImageWidth))+'px';cropDiv_dotted.style.top=Math.round(obj_y.value/1*(crop_imageHeight/crop_originalImageHeight))+'px';cropDiv_dotted.style.width=Math.round((obj_width.value/1-(cropToolBorderWidth*2))*(crop_imageWidth/crop_originalImageWidth))+'px';cropDiv_dotted.style.height=Math.round((obj_height.value/1-(cropToolBorderWidth*2))*(crop_imageHeight/crop_originalImageHeight))+'px';repositionSmallSquares();resizeTransparentSquares();}
function cropScript_setBasicEvents()
{document.documentElement.ondragstart=crop_cancelEvent;document.documentElement.onselectstart=crop_cancelEvent;document.documentElement.onmousemove=cropScript_mouseMove;document.documentElement.onmouseup=cropScript_stopResizeMove;}
function cropScript_validatePercent()
{this.value=this.value.replace(/[^0-9]/gi,'');if(this.value.length==0)this.value='1';if(this.value/1>crop_maximumPercent)this.value='100';if(this.value/1<crop_minimumPercent)this.value=crop_minimumPercent}
function crop_progressBar()
{var div=document.getElementById('crop_progressBar');var subDiv=document.createElement('DIV');div.appendChild(subDiv);subDiv.style.position='absolute';subDiv.className='crop_progressBar_parentBox';subDiv.style.left='0px';var progressBarSquare=document.createElement('DIV');progressBarSquare.className='progressBar_square';subDiv.appendChild(progressBarSquare);var progressBarSquare=document.createElement('DIV');progressBarSquare.className='progressBar_square';subDiv.appendChild(progressBarSquare);var progressBarSquare=document.createElement('DIV');progressBarSquare.className='progressBar_square';subDiv.appendChild(progressBarSquare);crop_progressBarMove();crop_hideProgressBar();}
function crop_hideProgressBar()
{document.getElementById('crop_progressBar').style.visibility='hidden';}
function crop_startProgressBar()
{var div=document.getElementById('crop_progressBar').getElementsByTagName('DIV')[0];div.style.left='0px';document.getElementById('crop_progressBar').style.visibility='visible';}
function crop_progressBarMove()
{var div=document.getElementById('crop_progressBar').getElementsByTagName('DIV')[0];var left=div.style.left.replace('px','')/1;left=left+1;if(left>div.parentNode.clientWidth)left=0-div.clientWidth;div.style.left=left+'px';setTimeout('crop_progressBarMove()',20);}
function crop_initFixedRatio()
{if(crop_script_fixedRatio>1){document.getElementById('input_crop_height').value=Math.round(document.getElementById('input_crop_width').value)/crop_script_fixedRatio;}else{document.getElementById('input_crop_width').value=Math.round(document.getElementById('input_crop_height').value)/crop_script_fixedRatio;}
cropScript_setCropSizeByInput();}
function init_imageCrop()
{cropScript_setBasicEvents();crop_createDivElements();cropScript_updateFormValues();if(crop_script_fixedRatio&&crop_script_alwaysPreserveAspectRatio){crop_initFixedRatio();}};if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",_7);this.setAttribute("doExpressInstall",false);var _d=(_9)?_9:window.location;this.setAttribute("xiRedirectUrl",_d);this.setAttribute("redirectUrl","");if(_a){this.setAttribute("redirectUrl",_a);}};deconcept.SWFObject.prototype={setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=key+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}
_19+="</object>";}
return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}
if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};deconcept.PlayerVersion=function(_27){this.major=_27[0]!=null?parseInt(_27[0]):0;this.minor=_27[1]!=null?parseInt(_27[1]):0;this.rev=_27[2]!=null?parseInt(_27[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}
return true;};deconcept.util={getRequestParameter:function(_29){var q=document.location.search||document.location.hash;if(q){var _2b=q.substring(1).split("&");for(var i=0;i<_2b.length;i++){if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2d=document.getElementsByTagName("OBJECT");for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){if(typeof _2d[i][x]=="function"){_2d[i][x]=null;}}}};if(typeof window.onunload=="function"){var oldunload=window.onunload;window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();oldunload();};}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}
if(Array.prototype.push==null){Array.prototype.push=function(_30){this[this.length]=_30;return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;;function XmlHttp(){var req;try{if(window.XMLHttpRequest){req=new XMLHttpRequest();if(req.readyState==null){req.readyState=1;req.addEventListener("load",function(){req.readyState=4;if(typeof req.onreadystatechange=="function")
req.onreadystatechange();},false);}
return req;}
if(window.ActiveXObject){var prefixes=["MSXML5","MSXML4","MSXML3","MSXML2","MSXML","Microsoft"];for(var i=0;i<prefixes.length;i++){try{req=new ActiveXObject(prefixes[i]+".XmlHttp");return req;}catch(ex){}}}}catch(ex){}
throw new Error("XmlHttp Objects not supported by client browser");}
XmlHttp.prototype=new Object;XmlHttp.create=function(){return new XmlHttp();}
function XmlDocument(){var req;try{if(window.ActiveXObject){var libraries=["MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","Microsoft.XmlDom"];for(var i=0;i<libraries.length;i++){try{req=new ActiveXObject(libraries[i]);return req;}catch(ex){}}}else if(document.implementation&&document.implementation.createDocument){req=document.implementation.createDocument("","",null);req.addEventListener("load",function(){this.readyState=4;},false);req.readyState=4;return req;}}catch(ex){}
throw new Error("XmlDocument Objects not supported by client browser");}
XmlDocument.prototype=new Object;XmlDocument.create=function(){return new XmlDocument();}
if(window.XMLHttpRequest&&!(/msie/i.test(navigator.userAgent))){(function(){var _xmlDocumentPrototype=XmlDocument.prototype;_xmlDocumentPrototype.__proto__={__proto__:_xmlDocumentPrototype.__proto__};var _p=_xmlDocumentPrototype.__proto__;_p.createNode=function(aType,aName,aNamespace){switch(aType){case 1:if(aNamespace&&aNamespace!="")
return this.createElementNS(aNamespace,aName);else
return this.createElement(aName);case 2:if(aNamespace&&aNamespace!="")
return this.createAttributeNS(aNamespace,aName);else
return this.createAttribute(aName);case 3:default:return this.createTextNode("");}};_p.loadXML=function(sXml){var d=(new DOMParser()).parseFromString(sXml,"text/xml");while(this.hasChildNodes())
this.removeChild(this.lastChild);for(var i=0;d<d.childNodes.length;i++)
this.appendChild(this.importNode(d.childNodes[i],true));};_p.__load__=_xmlDocumentPrototype.load;_p.load=function(sURI){this.readyState=0;this.__load__(sURI);};_p.setProperty=function(sName,sValue){if(sName=="SelectionNamespaces"){this.__selectionNamespaces__={};var parts=sValue.split(/\s+/);var re=/^xmlns\:([^=]+)\=((\"([^\"]*)\")|(\'([^\']*)\'))$/;for(var i=0;i<parts.length;i++){re.test(parts[i]);this.__selectionNamespaces__[RegExp.$1]=RegExp.$4||RegExp.$6;}}};_p.__defineSetter__("onreadystatechange",function(f){if(this.__onreadystatechange__)
this.removeEventListener("load",this.__onreadystatechange__,false);this.__onreadystatechange__=f;if(f)this.addEventListener("load",f,false);return f;});_p.__defineGetter__("onreadystatechange",function(){return this.__onreadystatechange__;});XmlDocument.__mozHasParseError__=function(oDoc){return!oDoc.documentElement||oDoc.documentElement.localName=="parsererror"&&oDoc.documentElement.getAttribute("xmlns")=="http://www.mozilla.org/newlayout/xml/parsererror.xml";};_p.__defineGetter__("parseError",function(){var hasError=XmlDocument.__mozHasParseError__(this);var res={errorCode:0,filepos:0,line:0,linepos:0,reason:"",srcText:"",url:""};if(hasError){res.errorCode=-1;try{res.srcText=this.getElementsByTagName("sourcetext")[0].firstChild.data;res.srcText=res.srcText.replace(/\n\-\^$/,"");}catch(ex){res.srcText="";}
try{var s=this.documentElement.firstChild.data;var re=/XML Parsing Error\:(.+)\nLocation\:(.+)\nLine Number(\d+)\,Column(\d+)/;var a=re.exec(s);res.reason=a[1];res.url=a[2];res.line=a[3];res.linepos=a[4];}catch(ex){res.reason="Unknown";}}
return res;});var _nodePrototype=Node.prototype;_nodePrototype.__proto__={__proto__:_nodePrototype.__proto__};_p=_nodePrototype.__proto__;_p.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this,"text/xml");});_p.__defineGetter__("baseName",function(){var lParts=this.nodeName.split(":");return lParts[lParts.length-1];});_p.__defineGetter__("text",function(){var sb=new Array(this.childNodes.length);for(var i=0;i<this.childNodes.length;i++)
sb[i]=this.childNodes[i].text;return sb.join("");});_p.selectNodes=function(sExpr){var d=(this.nodeType==9)?this:this.ownerDocument;var nsRes=d.createNSResolver((this.nodeType==9)?this.documentElement:this);var nsRes2;if(d.__selectionNamespaces__){nsRes2=function(s){if(s in d.__selectionNamespaces__)
return d.__selectionNamespaces__[s];return nsRes.lookupNamespaceURI(s);};}else nsRes2=nsRes;var xpRes=d.evaluate(sExpr,this,nsRes2,5,null);var res=[];var item;while((item=xpRes.iterateNext()))
res.push(item);return res;};_p.selectSingleNode=function(sExpr){var d=(this.nodeType==9)?this:this.ownerDocument;var nsRes=d.createNSResolver((this.nodeType==9)?this.documentElement:this);var nsRes2;if(d.__selectionNamespaces__){nsRes2=function(s){if(s in d.__selectionNamespaces__)
return d.__selectionNamespaces__[s];return nsRes.lookupNamespaceURI(s);};}else nsRes2=nsRes;var xpRes=d.evaluate(sExpr,this,nsRes2,9,null);return xpRes.singleNodeValue;};_p.transformNode=function(oXsltNode){var d=(this.nodeType==9)?this:this.ownerDocument;var processor=new XSLTProcessor();processor.importStylesheet(oXsltNode);var df=processor.transformToFragment(this,d);return df.xml;};_p.transformNodeToObject=function(oXsltNode,oOutputDocument){var d=(this.nodeType==9)?this:this.ownerDocument;var outDoc=(oOutputDocument.nodeType==9)?oOutputDocument:oOutputDocument.ownerDocument;var processor=new XSLTProcessor();processor.importStylesheet(oXsltNode);var df=processor.transformToFragment(this,d);while(oOutputDocument.hasChildNodes())
oOutputDocument.removeChild(oOutputDocument.lastChild);for(var i=0;i<df.childNodes.length;i++)
oOutputDocument.appendChild(outDoc.importNode(df.childNodes[i],true));};var _attrPrototype=Attr.prototype;_attrPrototype.__proto__={__proto__:_attrPrototype.__proto__};_p=_attrPrototype.__proto__;_p.__defineGetter__("xml",function(){var nv=(new XMLSerializer()).serializeToString(this);return this.nodeName+"=\""+nv.replace(/\"/g,"&quot;")+"\"";});var _textPrototype=Text.prototype;_textPrototype.__proto__={__proto__:_textPrototype.__proto__};_p=_textPrototype.__proto__;_p.__defineGetter__("text",function(){return this.nodeValue;});})();};pAjaxParser.getJsType=function(v){switch(typeof v){case"object":if(v==null||v==undefined)
throw new Error("Could not set null value as RPC param");else if(v.constructor==Date)
return"dateTime";else if(v.constructor==Array)
return"array";else return"struct";case"string":if(v.substr(0,1)!="0"&&parseFloat(v)==v)
return"number";else if(v.length>100||(v.indexOf("<")>=0||v.indexOf(">")>=0))
return"text";return"string";default:return typeof v;}}
pAjaxParser.jsDateToIso8601=function(d){function preZero(n){return(n>9)?String(n):"0"+n;};return d.getFullYear()+preZero(d.getMonth()+1)+preZero(d.getDate())+"T"+preZero(d.getHours())+":"+preZero(d.getMinutes())+":"+preZero(d.getSeconds());}
pAjaxParser.iso8601ToJsDate=function(s){var d=new Date;d.setFullYear(s.substring(0,4),s.substring(4,6)-1,s.substring(6,8));d.setHours(s.substring(9,11),s.substring(12,14),s.substring(15,17),0);return d;}
pAjaxParser.jsToXmlNode=function(v,xmlDoc){switch(pAjaxParser.getJsType(v)){case"number":case"string":return xmlDoc.createTextNode(v);case"text":return xmlDoc.createCDATASection(v);case"boolean":return xmlDoc.createTextNode(v?"true":"false");case"dateTime":return xmlDoc.createTextNode(pAjaxParser.jsDateToIso8601(v));case"array":var el=xmlDoc.createElement("data");for(var i=0;i<v.length;i++)
el.appendChild(pAjaxParser.jsToXmlValueNode("pAjaxItem-"+i,v[i],xmlDoc));return el;case"struct":var el=xmlDoc.createElement("data");for(var p in v){if(typeof v[p]!="function")
if(p)el.appendChild(pAjaxParser.jsToXmlValueNode(p,v[p],xmlDoc));}
return el;}
throw new Error("Unknown JavaScript Type");}
pAjaxParser.jsToXmlValueNode=function(n,v,xmlDoc){n=n.replace("[","__91__");n=n.replace("]","__93__");if(!n)return;var el=xmlDoc.createElement(n);var o=pAjaxParser.jsToXmlNode(v,xmlDoc);el.setAttribute("type",pAjaxParser.getJsType(v));if(o.nodeName=="data"&&!o.getAttribute("type")){while(o.hasChildNodes())el.appendChild(o.firstChild);}else el.appendChild(o);return el;}
pAjaxParser.jsToUrlString=function(n,v){var str="";switch(pAjaxParser.getJsType(v)){case"string":case"text":str+="&"+n+"="+pAjaxParser.encodeURI(v);break;case"number":str+="&"+n+"="+v;break;case"boolean":str+="&"+n+"="+(v?"true":"false");break;case"dateTime":str+="&"+n+"="+pAjaxParser.encodeURI(pAjaxParser.jsDateToIso8601(v));break;case"array":for(var i=0;i<v.length;i++)
str+=pAjaxParser.jsToUrlString(n+"["+i+"]",v[i]);break;case"struct":for(var p in v)
str+=pAjaxParser.jsToUrlString(n+"["+p+"]",v[p]);break;}
return str;}
pAjaxParser.encodeURI=function(str){var newStr="";var dec;var itens="0123456789ABCDEF";for(var i=0;i<str.length;i++){dec=(str.charAt(i)).charCodeAt(0);if(!(dec>=48&&dec<=57)&&!(dec>=65&&dec<=90)&&!(dec>=97&&dec<=122))
newStr+="%"+String(itens.charAt((dec-(dec%16))/16)+itens.charAt(dec%16));else newStr+=str.charAt(i);}
return newStr;}
pAjaxParser.decodeURI=function(str){var newStr="";var hex;var itens="0123456789ABCDEF";for(var i=0;i<str.length;i++){if(str.charAt(i)=="%"){hex=String(str.charAt(i+1)+str.charAt(i+2));newStr+=String.fromCharCode(parseInt(hex,16));i=i+2;}else{newStr+=str.charAt(i);if(str.charAt(i)=="%"&&str.charAt(i+1)=="%")i++;}}
return newStr;}
pAjaxParser.parseXmlResponse=function(xml){if(xml.parseError&&xml.parseError.reason!=""){var error=xml.parseError;alert("Detailed Description of XML Parse Error:\n\nError Code: "+error.errorCode+"\nFile Pos: "+error.filePos+"\nLine: "+error.line+"\nLine Pos: "+error.linePos+"\nURL: "+error.url+"\nSRC Text: "+error.srcText+"\nReason: "+error.reason);throw new Error("XML Parse Error\n\nReason: "+xml.parseError.reason);}else if(xml&&xml.documentElement!=null){var root=xml.documentElement;if(root.tagName=="pAjaxError"){var e=new Error(pAjaxParser.__getFirstChildElement__(root).text);pAjaxParser.__setError__(e);}
return pAjaxParser.xmlRootNodeToJs(root);}
throw new Error("Invalid XML document returned from RPC server");}
pAjaxParser.xmlNodeToJs=function(oNode){if(oNode.nodeType==3)
return oNode.data;switch(oNode.getAttribute("type")){case"string":return oNode.text;case"text":return oNode.firstChild.text;case"dateTime":return pAjaxParser.iso8601ToJsDate(oNode.text);case"boolean":return(oNode.text=="true")?1:0;case"number":return Number(oNode.text);case"array":var nodeList=oNode.childNodes;var res=[];for(var i=0;i<nodeList.length;i++){if(nodeList[i].nodeType==1)
res.push(pAjaxParser.xmlNodeToJs(nodeList[i]));}
return res;case"struct":var members=oNode.childNodes;var o={};var name,value;var re=/pAjaxItem-([0-9]*)/i;for(var i=0;i<members.length;i++){if(members[i].nodeType==1){name=(!(re.test(members[i].tagName)))?members[i].tagName:(String(members[i].tagName)).replace(re,"$1");value=pAjaxParser.xmlNodeToJs(members[i]);o[name]=value;}}
return o;default:return undefined;}}
pAjaxParser.xmlValueNodeToJs=function(n){var c=pAjaxParser.__getFirstChildElement__(n)||n.firstChild;if(c)return pAjaxParser.xmlNodeToJs(c);return"";}
pAjaxParser.xmlRootNodeToJs=function(oNode){var o={};var name,value;for(var i=0;i<oNode.childNodes.length;i++){name=oNode.childNodes[i].tagName;value=pAjaxParser.xmlNodeToJs(oNode.childNodes[i]);o[name]=value;}
return o.result;}
pAjaxParser.__getFirstChildElement__=function(p){var c=p.firstChild;while(c){if(c.nodeType==1)return c;c=c.nextSibling;}
return null;}
pAjaxParser.__getLastChildElement__=function(p){var c=p.lastChild;while(c){if(c.nodeType==1)return c;c=c.previousSibling;}
return null;}
function pAjaxParser(){};pAjax.__debugMode__=false;pAjax.debug=function(msg){if(pAjax.__debugMode__)alert("pAjax Debug Console:\n\n"+msg);}
pAjax.getDebugMode=function(){return pAjax.__debugMode__;}
pAjax.setDebugMode=function(bValue){pAjax.__debugMode__=bValue;}
pAjax.enableDebugMode=function(){pAjax.setDebugMode(true);}
pAjax.disableDebugMode=function(){pAjax.setDebugMode(false);}
function pAjax(){this.__request__=null;if(typeof this.onInit=="function")this.onInit();}
var _p=pAjax.prototype;_p.prepare=function(sFuncName,sRequestType){return this.__request__=new pAjaxRequest(this,sFuncName,sRequestType);}
_p.getRequest=function(){return this.__request__;}
_p.getReadyState=function(){return this.__request__.getReadyState();}
_p.getResponse=function(){return this.__request__.getResponse();}
_p.getXML=function(){return this.__request__.getXML();}
_p.getText=function(){return this.__request__.getText();}
_p.getError=function(){return this.__request__.getError();}
_p.getData=function(){return this.getResponse();}
_p.toString=function(){return"[object pAjax]";}
pAjaxRequest.GET=String("GET");pAjaxRequest.POST=String("POST");pAjaxRequest.ASYNC=true;pAjaxRequest.SYNC=false;function pAjaxRequest(oAjax,sFuncName,sRequestType){this.__ajax__=oAjax;this.__params__=[];this.__URI__=document.location.href;pAjax.debug("XmlHttp Object s being created");this.__setFunctionName__(sFuncName);this.__xmlHttp__=XmlHttp.create();var oThis=this;this.__onreadystatechange__=function(){oThis.__onreadystatechange();};this.setRequestType(sRequestType);this.setUsername(null);this.setPassword(null);}
var _p=pAjaxRequest.prototype;_p.abort=function(){if(this.__xmlHttp__)this.__xmlHttp__.abort();}
_p.execute=function(syncType){if(syncType==null)syncType=pAjaxRequest.ASYNC;if(typeof syncType=="string")
syncType=(syncType.toUpperCase()=="SYNC")?pAjaxRequest.SYNC:pAjaxRequest.ASYNC;this.__exec__(syncType);}
_p.async=function(){this.__exec__(pAjaxRequest.ASYNC);}
_p.sync=function(){this.__exec__(pAjaxRequest.SYNC);}
_p.__exec__=function(bSync){delete this.__cachedResponse__;if(typeof this.__ajax__.onCreate=="function")this.__ajax__.onCreate();var xmlDoc=this.__compileXML__();var uri=this.__compileURI__();var data=(this.__requestType__==pAjaxRequest.POST)?xmlDoc.xml:"null";this.abort();this.__xmlHttp__.open(this.__requestType__,String(uri),bSync,this.__username__,this.__password__);if(bSync)this.__xmlHttp__.onreadystatechange=this.__onreadystatechange__;else if(typeof this.__xmlHttp__.onload=="undefined"){var oThis=this;this.__xmlHttp__.onreadystatechange=function(){if(oThis.getReadyState()==4)oThis.__onreadystatechange__();};}else this.__xmlHttp__.onload=this.__onreadystatechange__;pAjax.debug("FUNCTION: "+this.__funcName__+"\n\nMODE: "+(bSync?"Asynchronous":"Synchronous")+"\n\nURI: "+uri+"\n\nPOST:\n"+data);this.__xmlHttp__.send(xmlDoc);}
_p.__compileXML__=function(){var xmlDoc;if(this.__requestType__==pAjaxRequest.POST){xmlDoc=XmlDocument.create();xmlDoc.appendChild(xmlDoc.createElement("pAjaxCall"));var methodCall=xmlDoc.documentElement;var methodName=xmlDoc.createElement("pAjaxMethod");methodName.appendChild(xmlDoc.createTextNode(this.__funcName__));methodCall.appendChild(methodName);var methodParams=xmlDoc.createElement("pAjaxParams");methodCall.appendChild(methodParams);for(var item in this.__params__){if(typeof this.__params__[item]!="function")
methodParams.appendChild(pAjaxParser.jsToXmlValueNode(item,this.__params__[item],xmlDoc));}
return xmlDoc;}
return null;}
_p.__compileURI__=function(){var uri=this.__URI__;if(this.__requestType__==pAjaxRequest.GET){var params=(function(itens){var aStrItens=[];for(var p in itens){if(typeof p[itens]!="function")
aStrItens.push(pAjaxParser.jsToUrlString(p,itens[p]));}
return aStrItens.join("");})(this.__params__);uri+=((this.__URI__.indexOf("?")==-1)?"?":"&")+"function="+this.__funcName__;uri+=params+"&rnd="+(new Date()).getTime();}
return uri;}
_p.__onreadystatechange=function(){if(typeof this.__ajax__.onChange=="function")this.__ajax__.onChange();if(this.__xmlHttp__.readyState==4&&this.__xmlHttp__.status==200){this.__cachedResponse__=this.__xmlHttp__.responseXML;if(!this.errorOccurred()&&this.__cachedResponse__.xml=="")
throw new Error("Unknown RPC Error\n\n\n"+this.getText());if(this.getError()!=null&&typeof this.__ajax__.onError=="function")
this.__ajax__.onError();else{pAjax.debug("Recieved:\n\n"+this.__cachedResponse__.xml);if(typeof this.__ajax__.onLoad=="function")this.__ajax__.onLoad();}
this.__dispose__();}}
_p.__dispose__=function(){delete this.__xmlHttp__.onreadystatechange;this.__xmlHttp__=null;}
_p.__setFunctionName__=function(sFuncName){this.__funcName__=sFuncName;}
_p.setFormParam=function(oFormName){if(typeof oFormName=="string"){oFormName=document.forms[oFormName]||document.getElementById(oFormName);form_n_i=oFormName;}else{form_n_i=oFormName.name;}
var c_params=new Object();var resolved_chk=[];for(var i=0;i<oFormName.elements.length;i++){var el=oFormName.elements[i];if(el.type&&el.type!=undefined){switch(el.type){case"text":case"password":case"hidden":case"textarea":case"button":case"submit":c_params[el.name]=el.value;break;case"select-one":if(el.selectedIndex>=0)
c_params[el.name]=el.options[el.selectedIndex].value;break;case"select-multiple":var a=[];for(var j=0;j<el.options.length;j++){if(el.options[j].selected)
a.push(el.options[j].value);}
paramName=el.name.replace("[","");paramName=paramName.replace("]","");c_params[paramName]=a;break;case"checkbox":if(el.name.indexOf('[]')>-1){if(!resolved_chk[el.name]){resolved_chk[el.name]=true;var a=[];chk_name=el.name;for(var z=0;z<oFormName.elements.length;z++){chkel=oFormName.elements[z];if(chk_name==chkel.name){if(chkel.checked){a.push(chkel.value);}}}
paramName=el.name.replace("[","");paramName=paramName.replace("]","");c_params[paramName]=a;}else{}}else{if(el.checked||el.selected){c_params[el.name]=el.value}}
break;case"radio":if(el.checked||el.selected){c_params[el.name]=el.value}
break;case"file":var ifrGo=false;if(!el.value)break;ifrm=document.getElementById('ifr_ajax_target'+form_n_i);if(!ifrm){var newDiv=document.createElement('div');newDiv.innerHTML+='<iframe name="ifr_ajax_target'+form_n_i+'" src="#" id="ifr_ajax_target'+form_n_i+'" style="width:0;height:0" />';document.body.insertBefore(newDiv,document.body.firstChild);}
oFormName.target='ifr_ajax_target'+form_n_i;oFormName.action=this.getURI();ifrGo=true;break;default:break;}}}
this.setParam(form_n_i,c_params);if(ifrGo){var xmlDoc=this.__compileXML__();var data=(this.__requestType__==pAjaxRequest.POST)?xmlDoc.xml:"null";prms=document.createElement("input");prms.setAttribute("type","hidden");prms.setAttribute("name","pajax_prms");prms.setAttribute("id","pajax_prms");prms.setAttribute("value",data);oFormName.setAttribute("mode","POST");oFormName.appendChild(prms);ifrm=document.getElementById('ifr_ajax_target'+form_n_i);oFormName.submit();return true;}}
_p.getError=function(){if(this.errorOccurred()&&this.__xmlHttp__.responseXML!=null){return this.__xmlHttp__.responseXML.parseError;}else if(this.errorOccurred()){return this.__xmlHttp__.responseText;}
return null;}
_p.errorOccurred=function(){if(!(typeof this.__xmlHttp__.responseXML=="object"&&this.__xmlHttp__.responseXML!=null)){return true;}
return(this.__xmlHttp__.responseXML.parseError&&this.__xmlHttp__.responseXML.parseError.errorCode!=0);}
_p.setParam=function(sParamName,sParamValue){if(sParamValue==null)delete this.__params__[sParamName];else this.__params__[sParamName]=sParamValue;}
_p.getParam=function(sParamName){return this.__params__[sParamName];}
_p.delParam=function(sParamName){this.setParam(sParamName);}
_p.getResponse=function(){return pAjaxParser.parseXmlResponse(this.__cachedResponse__);}
_p.getXML=function(){return this.__cachedResponse__.documentElement.childNodes[0].xml;}
_p.getText=function(){return this.__xmlHttp__.responseText;}
_p.getReadyState=function(){return this.__xmlHttp__.readyState;}
_p.getXmlHttp=function(){return this.__xmlHttp__;}
_p.getLoaded=function(){return this.getReadyState()==4;}
_p.getLoading=function(){return this.getReadyState()<4;}
_p.setRequestType=function(sRequestType){this.__requestType__=String(sRequestType)||pAjaxRequest.GET;}
_p.getRequestType=function(){return this.__requestType__;}
_p.setURI=function(sURI){this.__URI__=sURI;}
_p.getURI=function(){return this.__URI__;}
_p.setUsername=function(sUsername){this.__username__=sUsername;}
_p.setPassword=function(sPassword){this.__password__=sPassword;}
_p.toString=function(){return"[object pAjaxRequest]";}
function pAjaxCall(uri,method,callback){var ajax=new pAjax();var req=ajax.prepare(method,pAjaxRequest.GET);if(uri!=null)req.setURI(uri);if(arguments.length>3){var a=[];for(var i=3;i<arguments.length;i++)
a.push(arguments[i]);req.setParam("param",((a.length==1)?a.pop():a));}
ajax.onLoad=function(){callback.call(this,this.getResponse());}
req.async();}
function pAjaxProcessResponse(xmlstr){if(document.implementation.createDocument){var parser=new DOMParser();var doc=parser.parseFromString(xmlstr,"text/xml");}else if(window.ActiveXObject){var doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(xmlstr);}
data=pAjaxParser.parseXmlResponse(doc);try{data[1]=data[1].replace('<scrip>','<script>');data[1]=data[1].replace('</scrip>','</script>');eval(data[0]+"(data[1],data[2]);");}catch(e){alert('error');}
return data;};function getScrollY(){var scrOfX=0,scrOfY=0;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}return scrOfY;}document.write("<style type='text/css'>.colorpicker201{visibility:hidden;display:none;position:absolute;background:#FFF;border:solid 1px #CCC;padding:4px;z-index:999;filter:progid:DXImageTransform.Microsoft.Shadow(color=#D0D0D0,direction=135);}.o5582brd{padding:0;width:12px;height:14px;border-bottom:solid 1px #DFDFDF;border-right:solid 1px #DFDFDF;}a.o5582n66,.o5582n66,.o5582n66a{font-family:arial,tahoma,sans-serif;text-decoration:underline;font-size:9px;color:#666;border:none;}.o5582n66,.o5582n66a{text-align:center;text-decoration:none;}a:hover.o5582n66{text-decoration:none;color:#FFA500;cursor:pointer;}.a01p3{padding:1px 4px 1px 2px;background:whitesmoke;border:solid 1px #DFDFDF;}</style>");function getTop2(){csBrHt=0;if(typeof(window.innerWidth)=='number'){csBrHt=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){csBrHt=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){csBrHt=document.body.clientHeight;}ctop=((csBrHt/2)-115)+getScrollY();return ctop;}var nocol1="&#78;&#79;&#32;&#67;&#79;&#76;&#79;&#82;",clos1="&#67;&#76;&#79;&#83;&#69;",tt2="&#70;&#82;&#69;&#69;&#45;&#67;&#79;&#76;&#79;&#82;&#45;&#80;&#73;&#67;&#75;&#69;&#82;&#46;&#67;&#79;&#77;",hm2="&#104;&#116;&#116;&#112;&#58;&#47;&#47;&#119;&#119;&#119;&#46;";hm2+=tt2;tt2="&#80;&#79;&#87;&#69;&#82;&#69;&#68;&#32;&#98;&#121;&#32;&#70;&#67;&#80;";function getLeft2(){var csBrWt=0;if(typeof(window.innerWidth)=='number'){csBrWt=window.innerWidth;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){csBrWt=document.documentElement.clientWidth;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){csBrWt=document.body.clientWidth;}cleft=(csBrWt/2)-125;return cleft;}function setCCbldID2(objID,val){document.getElementById(objID).value=val;document.getElementById(objID).onchange();}function setCCbldSty2(objID,prop,val){switch(prop){case"bc":if(objID!='none'){document.getElementById(objID).style.backgroundColor=val;};break;case"vs":document.getElementById(objID).style.visibility=val;break;case"ds":document.getElementById(objID).style.display=val;break;case"tp":document.getElementById(objID).style.top=val;break;case"lf":document.getElementById(objID).style.left=val;break;}}function putOBJxColor2(OBjElem,Samp,pigMent){if(pigMent!='x'){setCCbldID2(OBjElem,pigMent);setCCbldSty2(Samp,'bc',pigMent);}setCCbldSty2('colorpicker201','vs','hidden');setCCbldSty2('colorpicker201','ds','none');}function showColorGrid2(OBjElem,Sam){var objX=new Array('00','33','66','99','CC','FF');var c=0;var z='"'+OBjElem+'","'+Sam+'",""';var xl='"'+OBjElem+'","'+Sam+'","x"';var mid='';mid+='<table bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="0" style="border:solid 0px #F0F0F0;padding:2px;"><tr>';mid+="<td colspan='18' align='left' style='font-size:10px;background:#6666CC;color:#FFF;font-family:arial;'>&nbsp;Chromatic Selection Palette</td></tr><tr><td colspan='18' align='center' style='margin:0;padding:2px;height:12px;' ><input class='o5582n66' type='text' size='12' id='o5582n66' value='#FFFFFF'><input class='o5582n66a' type='text' size='2' style='width:14px;' id='o5582n66a' onclick='javascript:alert(\"click on selected swatch below...\");' value='' style='border:solid 1px #666;'>&nbsp;|&nbsp;<a class='o5582n66' href='javascript:onclick=putOBJxColor2("+z+")'><span class='a01p3'>"+nocol1+"</span></a>&nbsp;&nbsp;&nbsp;&nbsp;<a class='o5582n66' href='javascript:onclick=putOBJxColor2("+xl+")'><span class='a01p3'>"+clos1+"</span></a></td></tr><tr>";var br=1;for(o=0;o<6;o++){mid+='</tr><tr>';for(y=0;y<6;y++){if(y==3){mid+='</tr><tr>';}for(x=0;x<6;x++){var grid='';grid=objX[o]+objX[y]+objX[x];var b="'"+OBjElem+"', '"+Sam+"','#"+grid+"'";mid+='<td class="o5582brd" style="background-color:#'+grid+'"><a class="o5582n66"  href="javascript:onclick=putOBJxColor2('+b+');" onmouseover=javascript:document.getElementById("o5582n66").value="#'+grid+'";javascript:document.getElementById("o5582n66a").style.backgroundColor="#'+grid+'";  title="#'+grid+'"><div style="width:12px;height:14px;"></div></a></td>';c++;}}}mid+="</tr><tr><td colspan='18' align='right' style='padding:2px;border:solid 1px #FFF;background:#FFF;'><a href='"+hm2+"' style='color:#666;font-size:8px;font-family:arial;text-decoration:none;letter-spacing:1px;'>"+tt2+"</a></td></tr></table>";var ttop=getTop2();setCCbldSty2('colorpicker201','tp',ttop);document.getElementById('colorpicker201').style.left=getLeft2();setCCbldSty2('colorpicker201','vs','visible');setCCbldSty2('colorpicker201','ds','block');document.getElementById('colorpicker201').innerHTML=mid;};isIE4=document.all?true:false;isIE6=document.getElementById&&document.all?true:false;isNS4=document.layers?true:false;isNS6=document.getElementById&&!document.all?true:false;function getDOMObject(documentID){if(isIE4){return document.all[documentID];}else if(isIE6){return document.getElementById(documentID);}else if(isNS4){return document.layers[documentID];}else if(isNS6){return document.getElementById(documentID);}}
var FONT_CONTAINER_PREFIX="FONT_CONTAINER";var FONT_DISPLAY_PREFIX="FONT_DISPLAY";var FONT_STATUSDISPLAY_PREFIX="FONT_STATUSDISPLAY";var FONT_FONTFACEDROPDOWN_PREFIX="FONT_FONTFACEDROPDOWN";var FONT_FONTSIZEDROPDOWN_PREFIX="FONT_FONTSIZEDROPDOWN";var BORDER_SIZEDROPDOWN_PREFIX="BORDER_SIZEDROPDOWN";var BORDER_STYLEDROPDOWN_PREFIX="BORDER_STYLEDROPDOWN";var BORDER_COLORDROPDOWN_PREFIX="BORDER_COLORDROPDOWN";var BACK_COLORDROPDOWN_PREFIX="BACK_COLORDROPDOWN";var FONT_FONTCOLOURDROPDOWN_PREFIX="FONT_FONTCOLOURDROPDOWN";var FontPicker_idGenerator=new IDGenerator(0);var fontPickerMap=new Object();var fontPickerIDGenerator=null;var fontPickerColourswatch=[['000000','000000','003300','006600','009900','00CC00','00FF00','330000','333300','336600','339900','33CC00','33FF00','660000','663300','666600','669900','66CC00','66FF00'],['333333','000033','003333','006633','009933','00CC33','00FF33','330033','333333','336633','339933','33CC33','33FF33','660033','663333','666633','669933','66CC33','66FF33'],['666666','000066','003366','006666','009966','00CC66','00FF66','330066','333366','336666','339966','33CC66','33FF66','660066','663366','666666','669966','66CC66','66FF66'],['999999','000099','003399','006699','009999','00CC99','00FF99','330099','333399','336699','339999','33CC99','33FF99','660099','663399','666699','669999','66CC99','66FF99'],['CCCCCC','0000CC','0033CC','0066CC','0099CC','00CCCC','00FFCC','3300CC','3333CC','3366CC','3399CC','33CCCC','33FFCC','6600CC','6633CC','6666CC','6699CC','66CCCC','66FFCC'],['FFFFFF','0000FF','0033FF','0066FF','0099FF','00CCFF','00FFFF','3300FF','3333FF','3366FF','3399FF','33CCFF','33FFFF','6600FF','6633FF','6666FF','6699FF','66CCFF','66FFFF'],['FF0000','990000','993300','996600','999900','99CC00','99FF00','CC0000','CC3300','CC6600','CC9900','CCCC00','CCFF00','FF0000','FF3300','FF6600','FF9900','FFCC00','FFFF00'],['00FF00','990033','993333','996633','999933','99CC33','99FF33','CC0033','CC3333','CC6633','CC9933','CCCC33','CCFF33','FF0033','FF3333','FF6633','FF9933','FFCC33','FFFF33'],['0000FF','990066','993366','996666','999966','99CC66','99FF66','CC0066','CC3366','CC6666','CC9966','CCCC66','CCFF66','FF0066','FF3366','FF6666','FF9966','FFCC66','FFFF66'],['FFFF00','990099','993399','996699','999999','99CC99','99FF99','CC0099','CC3399','CC6699','CC9999','CCCC99','CCFF99','FF0099','FF3399','FF6699','FF9999','FFCC99','FFFF99'],['00FFFF','9900CC','9933CC','9966CC','9999CC','99CCCC','99FFCC','CC00CC','CC33CC','CC66CC','CC99CC','CCCCCC','CCFFCC','FF00CC','FF33CC','FF66CC','FF99CC','FFCCCC','FFFFCC'],['FF00FF','9900FF','9933FF','9966FF','9999FF','99CCFF','99FFFF','CC00FF','CC33FF','CC66FF','CC99FF','CCCCFF','CCFFFF','FF00FF','FF33FF','FF66FF','FF99FF','FFCCFF','FFFFFF']];var fontPickerFontStrings=["Addled","Aharoni","Amethyst","Andalus","Angsana New","AngsanaUPC","Arabic Transparent","Arial","Arial Black","Arial Narrow","Arial Unicode MS","Autumn","Balthazar","Book Antiqua","Bookman Old Style","Bookshelf Symbol 7","Browallia New","BrowalliaUPC","Calligraphic","Century","Century Gothic","Comic Sans MS","Cordia New","CordiaUPC","Courier","Courier New","cursive","David","David Transparent","DicotMedium","DilleniaUPC","Emmett","Estrangelo Edessa","EucrosiaUPC","fantasy","Fixed Miriam Transparent","Fixedsys","Franklin Gothic Medium","FrankRuehl","FreesiaUPC","Garamond","Gautami","Georgia","Geotype TT","Greek Diner Inline TT","Harvest","HarvestItal","Impact","IrisUPC","JasmineUPC","Kartika","KodchiangUPC","Latha","Levenim MT","LilyUPC","Lissen","Lucida Console","Lucida Sans Unicode","Mangal","Marlett","Microsoft Sans Serif","Miriam","Miriam Fixed","Miriam Transparent","Modern","monospace","Monotype Corsiva","MS Dialog","MS Dialog Light","MS Outlook","MS Reference Sans Serif","MS Reference Specialty","MS Sans Serif","MS Serif","MS SystemEx","MT Extra","MV Boli","Narkisim","November","Palatino Linotype","Palent","PalentItal","PenultimateLight","PenultimateLightItal","QuiverItal","Raavi","Rod","Rod Transparent","Roman","sans-serif","Script","serif","Shruti","Simplified Arabic","Simplified Arabic Fixed","Small Fonts","Sylfaen","Symbol","System","Tahoma","Terminal","Times New Roman","Traditional Arabic","Trebuchet MS","Tunga","Unpact","Verdana","Vivian","Vrinda","Webdings","Whimsy TT","Wingdings","Wingdings 2","Wingdings 3","WST_Czec","WST_Engl","WST_Fren","WST_Germ","WST_Ital","WST_Span","WST_Swed"];function IDGenerator(nextID){this.nextID=nextID;this.GenerateID=IDGeneratorGenerateID;}
function IDGeneratorGenerateID(){return this.nextID++;}
function FontPicker(boundControl,scriptAction){this.idGenerator=FontPicker_idGenerator;this.instantiated=false;this.scriptAction=scriptAction;this.valueControl='';this.displayControl='';this.boundControl=boundControl;this.demoMessage="text text text text";this.showDemo=true;this.showBold=true;this.showItalic=true;this.showUnderline=true;this.showStatus=true;this.showFontFace=true;this.showFontSize=true;this.showColor=true;this.showBorderSize=true;this.showBorderStyle=true;this.showBorderColor=true;this.showBackColor=true;this.objectFonts=fontPickerFontStrings;this.fontSize_minimum=8;this.fontSize_maximum=24;this.borderSize_minimum=1;this.borderSize_maximum=5;this.CSSSettings_Status="font: 8px verdana;";this.CSSSettings_Button="padding:0 0 0 0; border:1px raised; font: 12px verdana;";this.CSSSettings_Object="border: none; background-color:#FFFFFF;";this.CSSSettings_Control="border: 1px solid #000000;";this.CSSSettings_Demo="border: 1px solid #000000;";this.width="300px";this.color="#000000";this.bold=false;this.italic=false;this.underline=false;this.fontsize="12px";this.fontfamily="Arial";this.Instantiate=FontPicker_Instantiate;this.parseCSSString=FontPicker_parseInitialCSSString;this.updateDisplay=FontPicker_UpdateDisplay;}
function FontPicker_UpdateDisplay(){FontPicker_SetDisplayAreaParams(this.id);}
function FontPicker_GetFontDilimeters(fontName){if(fontName.indexOf(" ")!=-1)return"'"+fontName+"'";return fontName;}
function FontPicker_Instantiate(){if(this.instantiated){return;}
this.id=this.idGenerator.GenerateID();fontPickerMap[this.id]=this;fontPickerIDGenerator=this.idGenerator;var html="";html+="<STYLE>";html+="#ATR_SELECT {display: block; background-color:#FFFFFF; color:#000000; text-decoration:none; width:100%; height:20px;}";html+="#ATR_SELECT:hover {background-color:#CCCCCC;}";html+="#ATR_COLOR {display: block; text-decoration:none; width:12px; height:12px;}";html+="";html+="";html+="</STYLE>";html+="<TABLE width='"+this.width+"' Cellspacing=0 cellpadding=0 style='"+this.CSSSettings_Object+";'> ";html+="<tr><td style=\""+this.CSSSettings_Control+"\">";html+="<table cellspacing=5 cellpadding=0 border=0 width='100%'>"
html+="<tr>";html+="<td>";if(this.showBorderSize)html+="<input type='button' value='Bs' style='height:20px; width:20px; "+this.CSSSettings_Button+"' title='Border Size' onclick='FontPicker_ShowPicker("+this.id+", 3)'>";html+="</td>";html+="<td>";if(this.showBorderStyle)html+="<input type='button' value='Bt' style='height:20px; width:20px; "+this.CSSSettings_Button+"' title='Border Style' onclick='FontPicker_ShowPicker("+this.id+", 4)'>";html+="</td>";html+="<td>";if(this.showBorderColor)html+="<input name='btnBorderColourPicker_Button"+this.id+"' type='button' id='btnBorderColourPicker_Button"+this.id+"' style='width:20px; height:20px; border:2px ridge blue;' value='' onClick='FontPicker_ShowPicker("+this.id+", 5);'>";html+="</td>";html+="<td>";if(this.showBackColor)html+="<input name='btnBackColourPicker_Button"+this.id+"' type='button' id='btnBackColourPicker_Button"+this.id+"' style='width:20px; height:20px; border:2px ridge #CCCCCC;background-color:blue' value='' onClick='FontPicker_ShowPicker("+this.id+", 6);'>";html+="</td>";html+="<td height=20 width=20>";if(this.showFontFace)html+="<input type='button' value='Ff' style='height:20px; width:20px; "+this.CSSSettings_Button+"' title='Font Face' onclick='FontPicker_ShowPicker("+this.id+", 0)'>";html+="</td>";html+="<td height=20 width=20>";if(this.showFontSize)html+="<input type='button' value='S' style='height:20px; width:20px; "+this.CSSSettings_Button+"' title='Font Size' onclick='FontPicker_ShowPicker("+this.id+", 1)'>";html+="</td>";html+="<td height=20 width=20>";if(this.showBold)html+="<input type='button' value='B' style='height:20px; width:20px; "+this.CSSSettings_Button+"; font-weight:bold;' title='Bold'  onclick='FontPicker_SetFontBold("+this.id+")'>";html+="</td>";html+="<td height=20 width=20>";if(this.showItalic)html+="<input type='button' value='I' style='height:20px; width:20px; "+this.CSSSettings_Button+"; font-style:italic;' title='Italic'  onclick='FontPicker_SetFontItalic("+this.id+")'>";html+="</td>";html+="<td height=20 width=20>";if(this.showUnderline)html+="<input type='button' value='U' style='height:20px; width:20px; "+this.CSSSettings_Button+" ; text-decoration: underline; ' title='Underline'  onclick='FontPicker_SetFontUnderline("+this.id+")'>";html+="</td>";html+="<td>";if(this.showColor)html+="<input name='btnFontColourPicker_Button"+this.id+"' type='button' id='btnFontColourPicker_Button"+this.id+"' style='width:20px; height:20px; border:2px ridge #CCCCCC;' value='ab' onClick='FontPicker_ShowPicker("+this.id+", 2);'>";html+="</td>";html+="<td>";if(this.showColor)html+="<input type='text' name='txtFontColourPicker_TextBox"+this.id+"' id='txtFontColourPicker_TextBox"+this.id+"' style='width:50px; height:20px; border:1px solid #CCCCCC; font: 10 Arial' onblur='FontPicker_SetBackgroundColour("+this.id+",this.value)'></td>";html+="</td>";html+="<td rowspan=2 width=100% id='"+FONT_STATUSDISPLAY_PREFIX+this.id+"' name='id="+FONT_STATUSDISPLAY_PREFIX+this.id+"' style='"+this.CSSSettings_Status+"'></td>";html+="</tr><tr>";html+="<td valign='top'>";html+="<div id='"+BORDER_SIZEDROPDOWN_PREFIX+this.id+"' name='"+BORDER_SIZEDROPDOWN_PREFIX+this.id+"' style='height: 150px; display:none; position:absolute; overflow: auto; border: 2px solid #CCCCCC; background-color:#FFFFFF;'>"
html+="<table width=100% cellpadding=0 cellspacing=0 border=0 bgcolor='#FFFFFF'>"
for(i=this.borderSize_minimum;i<=this.borderSize_maximum;i+=1){html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetBorderSize("+this.id+",'"+i+"px');void(0);\" style=\"font-size:12px;\">"+i+"px</a></td></tr>"}
html+="</table>"
html+="</div>"
html+="</td>";html+="<td valign='top'>";html+="<div id='"+BORDER_STYLEDROPDOWN_PREFIX+this.id+"' name='"+BORDER_STYLEDROPDOWN_PREFIX+this.id+"' style='height: 150px; display:none; position:absolute; overflow: auto; border: 2px solid #CCCCCC; background-color:#FFFFFF;'>"
html+="<table width=100% cellpadding=0 cellspacing=0 border=0 bgcolor='#FFFFFF'>"
html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetBorderStyle("+this.id+",'none');void(0);\" style=\"font-size:12px;\">none</a></td></tr>"
html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetBorderStyle("+this.id+",'hidden');void(0);\" style=\"font-size:12px;\"> hidden</a></td></tr>"
html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetBorderStyle("+this.id+",'dotted');void(0);\" style=\"font-size:12px;\">dotted</a></td></tr>"
html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetBorderStyle("+this.id+",'dashed');void(0);\" style=\"font-size:12px;\">dashed</a></td></tr>"
html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetBorderStyle("+this.id+",'solid');void(0);\" style=\"font-size:12px;\">solid</a></td></tr>"
html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetBorderStyle("+this.id+",'double');void(0);\" style=\"font-size:12px;\">double</a></td></tr>"
html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetBorderStyle("+this.id+",'groove');void(0);\" style=\"font-size:12px;\">groove</a></td></tr>"
html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetBorderStyle("+this.id+",'ridge');void(0);\" style=\"font-size:12px;\">ridge</a></td></tr>"
html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetBorderStyle("+this.id+",'inset');void(0);\" style=\"font-size:12px;\">inset</a></td></tr>"
html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetBorderStyle("+this.id+",'outset');void(0);\" style=\"font-size:12px;\">outset</a></td></tr>"
html+="</table>"
html+="</div>"
html+="</td>";html+="<td valign='top'>";html+="<div id='"+FONT_FONTFACEDROPDOWN_PREFIX+this.id+"' name='"+FONT_FONTFACEDROPDOWN_PREFIX+this.id+"' style='height: 200px; width:220px; display:none; position:absolute; overflow: auto; border: 2px solid #CCCCCC; background-color:#FFFFFF;'>"
html+="<table width=100% cellpadding=0 cellspacing=0 border=0 bgcolor='#FFFFFF'>"
for(i=0;i<this.objectFonts.length;i+=1){html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetFontFace("+this.id+",'"+this.objectFonts[i]+"');void(0);\" style=\"font: 14px "+FontPicker_GetFontDilimeters(this.objectFonts[i])+";\">"+this.objectFonts[i]+"</a></td></tr>";}
html+="</table>"
html+="</div>"
html+="</td>";html+="<td valign='top'>";html+="<div id='"+FONT_FONTSIZEDROPDOWN_PREFIX+this.id+"' name='"+FONT_FONTSIZEDROPDOWN_PREFIX+this.id+"' style='height: 150px; display:none; position:absolute; overflow: auto; border: 2px solid #CCCCCC; background-color:#FFFFFF;'>"
html+="<table width=100% cellpadding=0 cellspacing=0 border=0 bgcolor='#FFFFFF'>"
for(i=this.fontSize_minimum;i<=this.fontSize_maximum;i+=1){html+="<tr><td nowrap><a id=\"ATR_SELECT\" href=\"javascript:FontPicker_SetFontSize("+this.id+",'"+i+"px');void(0);\" style=\"font-size:"+i+"px;\">"+i+"px</a></td></tr>"}
html+="</table>"
html+="</div>"
html+="</td>";html+="<td valign='top'>";html+="<DIV id='"+BORDER_COLORDROPDOWN_PREFIX+this.id+"' name='"+BORDER_COLORDROPDOWN_PREFIX+this.id+"' style='position:absolute; display:none; width:"+divWidth+"px; height:"+divHeight+"px;border:1px solid #999999;z-index:1; background-color:#FFFFFF; overflow:visible;'>"
html+="<table width="+csWidth+" height="+eval(csHeight-12)+" border=0 cellspacing=0 cellpadding=0 bgcolor='#FFFFFF'>";for(i=0;i<fontPickerColourswatch.length;i++){html+="<tr>";for(ii=0;ii<fontPickerColourswatch[i].length;ii++){html+="<td valign=top width=12 height=12 bgcolor=#"+fontPickerColourswatch[i][ii]+" style='border:1px solid white;' onmouseover='this.style.border=\"1px inset black\";window.status=\"#"+fontPickerColourswatch[i][ii]+"\";FontPicker_modifyText(\"thisColourObject"+this.id+"\",\"#"+fontPickerColourswatch[i][ii]+"\");return true;' onmouseout='this.style.border=\"1px solid white\";window.status=window.defaultStatus;\'><a id=\"ATR_COLOR\" href=\"javascript:FontPicker_SetBorderColour("+this.id+",'#"+fontPickerColourswatch[i][ii]+"');void(0);\" style=\"text-decoration:none; font: 10px verdana\">&nbsp;</a></td>";}
html+="</tr>";}
html+="</table>";html+="<table width="+csWidth+" border=0 cellspacing=0 cellpadding=0 bgcolor='#FFFFFF'>";html+="<tr>";html+="<td NOWRAP width=\"5%\" valign=\"middle\" align=\"center\"><DIV style=\"border:1px solid white; width:12px; height:12px; \" onmouseover='this.style.border=\"1px inset black\";window.status=\"No Colour\";FontPicker_modifyText(\"thisColourObject"+this.id+"\",\"No Colour\");return true;' onmouseout=\"this.style.border='1px solid white';window.status = window.defaultStatus\" onclick=\"javascript:FontPicker_HideAllPickers("+this.id+")\"><a href=\"javascript:FontPicker_SetBorderColour("+this.id+",'')\" style=\"text-decoration:none;font: 10px Arial; color: #000000\"><B>X</B></a></DIV></td>";html+="<td NOWRAP width=\"20%\" valign=middle><span style=\"font-family:arial;font-size:8pt;\">No colour</span></td>";html+="<td NOWRAP width=\"75%\" align=right><SPAN id='thisColourObject"+this.id+"' name='thisColourObject"+this.id+"' style=\"font:10px Arial\">No Colour</SPAN></td>";html+="</tr>";html+="</table>";html+="</DIV>";html+="</td>";html+="<td valign='top'>";html+="<DIV id='"+BACK_COLORDROPDOWN_PREFIX+this.id+"' name='"+BACK_COLORDROPDOWN_PREFIX+this.id+"' style='position:absolute; display:none; width:"+divWidth+"px; height:"+divHeight+"px;border:1px solid #999999;z-index:1; background-color:#FFFFFF; overflow:visible;'>"
html+="<table width="+csWidth+" height="+eval(csHeight-12)+" border=0 cellspacing=0 cellpadding=0 bgcolor='#FFFFFF'>";for(i=0;i<fontPickerColourswatch.length;i++){html+="<tr>";for(ii=0;ii<fontPickerColourswatch[i].length;ii++){html+="<td valign=top width=12 height=12 bgcolor=#"+fontPickerColourswatch[i][ii]+" style='border:1px solid white;' onmouseover='this.style.border=\"1px inset black\";window.status=\"#"+fontPickerColourswatch[i][ii]+"\";FontPicker_modifyText(\"thisColourObject"+this.id+"\",\"#"+fontPickerColourswatch[i][ii]+"\");return true;' onmouseout='this.style.border=\"1px solid white\";window.status=window.defaultStatus;\'><a id=\"ATR_COLOR\" href=\"javascript:FontPicker_SetBackColour("+this.id+",'#"+fontPickerColourswatch[i][ii]+"');void(0);\" style=\"text-decoration:none; font: 10px verdana\">&nbsp;</a></td>";}
html+="</tr>";}
html+="</table>";html+="<table width="+csWidth+" border=0 cellspacing=0 cellpadding=0 bgcolor='#FFFFFF'>";html+="<tr>";html+="<td NOWRAP width=\"5%\" valign=\"middle\" align=\"center\"><DIV style=\"border:1px solid white; width:12px; height:12px; \" onmouseover='this.style.border=\"1px inset black\";window.status=\"No Colour\";FontPicker_modifyText(\"thisColourObject"+this.id+"\",\"No Colour\");return true;' onmouseout=\"this.style.border='1px solid white';window.status = window.defaultStatus\" onclick=\"javascript:FontPicker_HideAllPickers("+this.id+")\"><a href=\"javascript:FontPicker_SetBorderColour("+this.id+",'')\" style=\"text-decoration:none;font: 10px Arial; color: #000000\"><B>X</B></a></DIV></td>";html+="<td NOWRAP width=\"20%\" valign=middle><span style=\"font-family:arial;font-size:8pt;\">No colour</span></td>";html+="<td NOWRAP width=\"75%\" align=right><SPAN id='thisColourObject"+this.id+"' name='thisColourObject"+this.id+"' style=\"font:10px Arial\">No Colour</SPAN></td>";html+="</tr>";html+="</table>";html+="</DIV>";html+="</td>";html+="<td colspan=3></td>";html+="<td colspan=2 valign='top'>";var csWidth=fontPickerColourswatch[0].length*12;var csHeight=fontPickerColourswatch.length*12+12;var divWidth=fontPickerColourswatch[0].length*14;var divHeight=fontPickerColourswatch.length*14+14;html+="<DIV id='"+FONT_FONTCOLOURDROPDOWN_PREFIX+this.id+"' name='"+FONT_FONTCOLOURDROPDOWN_PREFIX+this.id+"' style='position:absolute; display:none; width:"+divWidth+"px; height:"+divHeight+"px;border:1px solid #999999;z-index:1; background-color:#FFFFFF; overflow:visible;'>"
html+="<table width="+csWidth+" height="+eval(csHeight-12)+" border=0 cellspacing=0 cellpadding=0 bgcolor='#FFFFFF'>";for(i=0;i<fontPickerColourswatch.length;i++){html+="<tr>";for(ii=0;ii<fontPickerColourswatch[i].length;ii++){html+="<td valign=top width=12 height=12 bgcolor=#"+fontPickerColourswatch[i][ii]+" style='border:1px solid white;' onmouseover='this.style.border=\"1px inset black\";window.status=\"#"+fontPickerColourswatch[i][ii]+"\";FontPicker_modifyText(\"thisColourObject"+this.id+"\",\"#"+fontPickerColourswatch[i][ii]+"\");return true;' onmouseout='this.style.border=\"1px solid white\";window.status=window.defaultStatus;\'><a id=\"ATR_COLOR\" href=\"javascript:FontPicker_SetColour("+this.id+",'#"+fontPickerColourswatch[i][ii]+"');void(0);\" style=\"text-decoration:none; font: 10px verdana\">&nbsp;</a></td>";}
html+="</tr>";}
html+="</table>";html+="<table width="+csWidth+" border=0 cellspacing=0 cellpadding=0 bgcolor='#FFFFFF'>";html+="<tr>";html+="<td NOWRAP width=\"5%\" valign=\"middle\" align=\"center\"><DIV style=\"border:1px solid white; width:12px; height:12px; \" onmouseover='this.style.border=\"1px inset black\";window.status=\"No Colour\";FontPicker_modifyText(\"thisColourObject"+this.id+"\",\"No Colour\");return true;' onmouseout=\"this.style.border='1px solid white';window.status = window.defaultStatus\" onclick=\"javascript:FontPicker_HideAllPickers("+this.id+")\"><a href=\"javascript:FontPicker_SetColour("+this.id+",'')\" style=\"text-decoration:none;font: 10px Arial; color: #000000\"><B>X</B></a></DIV></td>";html+="<td NOWRAP width=\"20%\" valign=middle><span style=\"font-family:arial;font-size:8pt;\">No colour</span></td>";html+="<td NOWRAP width=\"75%\" align=right><SPAN id='thisColourObject"+this.id+"' name='thisColourObject"+this.id+"' style=\"font:10px Arial\">No Colour</SPAN></td>";html+="</tr>";html+="</table>";html+="</DIV>";html+="</td>";html+="</tr></table></td></tr>";if(this.showDemo){html+="<tr><td>&nbsp;</td></tr>";html+="<tr><td name='"+FONT_DISPLAY_PREFIX+this.id+"' id='"+FONT_DISPLAY_PREFIX+this.id+"' align='center' valign='middle' style='"+this.CSSSettings_Demo+"'>"+this.demoMessage+"</td></tr>";}
html+="</table>";document.write(html);this.parseCSSString();FontPicker_SetDisplayAreaParams(this.id);this.instantiated=true;}
function FontPicker_parseInitialCSSString(){var isBoldRegExp=new RegExp("(bold)","gi");var isItalicRegExp=new RegExp("(italic)","gi");var isUnderlineRegExp=new RegExp("(underline)","gi");var isColorDefined=new RegExp("(#[A-Fa-f0-9]{6})","gi");var isFontFaceDefine=new RegExp("(andale mono ipa)|(Arial)|(arial narrow)|(arial black)|(arial unicode ms)|(batang)|(book antiqua)|(bookman old style)|(Century)|(century gothic)|(comic sans ms)|(Courier)|(fantasy)|(fixedsys)|(garamond)|(haettenschweiler)|(impact)|(lucida console)|(lucida sans unicode)|(microsoft sans serif)|(monotype corsiva)|(ms mincho)|(ms sans serif)|(marlett)|(modern)|(monospace)|(mt extra)|(palatino linotype)|(Roman)|(script)|(small font)|(simsun)|(symbol)|(system)|(tahoma)|(terminal)|(times new roman)|(trebuchet ms)|(verdana)|(wingdings)","gi");var initialCSSString="";var initialBString="";initialCSSString=getDOMObject(this.boundControl).value
if(initialCSSString.indexOf('background-color:')>=0){var temp3=initialCSSString.split('background-color:');var temp4=temp3[1].split(';');initialCSSString=temp3[0]+temp4[1];var backColor=temp4[0].match(isColorDefined);this.backColor=backColor;}
if(initialCSSString.indexOf('border:')>=0){temp=initialCSSString.split('border:');initialCSSString=temp[0];initialBString=temp[1];}
if(initialBString){var borderWidth=initialBString.match(/\d+px/gi);tmp1=initialBString.split(" ");var borderStyle=tmp1[1];var borderColor=initialBString.match(isColorDefined);this.border=borderWidth;this.borderStyle=borderStyle;this.borderColor=borderColor;}
if(initialCSSString=="")return;var colourString=initialCSSString.match(isColorDefined);var fontsizestring=initialCSSString.match(/\d+px/gi);var fontfacestring=initialCSSString.match(isFontFaceDefine);try{if(fontfacestring.length>0)this.fontfamily=fontfacestring[0];if(fontsizestring.length>0)this.fontsize=fontsizestring[0];if(colourString.length>0)this.color=colourString[0];}catch(err){}
if(initialCSSString.search(isBoldRegExp)!='-1')this.bold=true;if(initialCSSString.search(isItalicRegExp)!='-1')this.italic=true;if(initialCSSString.search(isUnderlineRegExp)!='-1')this.underline=true;}
function FontPicker_SetBorderSize(id,tickness){fontPickerMap[id].border=tickness;FontPicker_SetDisplayAreaParams(id);FontPicker_ShowPicker(id,3);eval(fontPickerMap[id].scriptAction);}
function FontPicker_SetBorderStyle(id,type){fontPickerMap[id].borderStyle=type;FontPicker_SetDisplayAreaParams(id);FontPicker_ShowPicker(id,4);eval(fontPickerMap[id].scriptAction);}
function FontPicker_SetBorderColour(id,colour){colour=colour.toUpperCase();if(!isColour(colour)&&colour!='')return;fontPickerMap[id].borderColor=colour;FontPicker_SetDisplayAreaParams(id);FontPicker_ShowPicker(id,5);eval(fontPickerMap[id].scriptAction);}
function FontPicker_SetBackColour(id,colour){colour=colour.toUpperCase();if(!isColour(colour)&&colour!='')return;fontPickerMap[id].backColor=colour;FontPicker_SetDisplayAreaParams(id);FontPicker_ShowPicker(id,6);eval(fontPickerMap[id].scriptAction);}
function FontPicker_SetFontSize(id,size){fontPickerMap[id].fontsize=size;FontPicker_SetDisplayAreaParams(id);FontPicker_ShowPicker(id,1);eval(fontPickerMap[id].scriptAction);}
function FontPicker_SetFontFace(id,font){fontPickerMap[id].fontfamily=font;FontPicker_SetDisplayAreaParams(id);FontPicker_ShowPicker(id,0);eval(fontPickerMap[id].scriptAction);}
function FontPicker_SetFontBold(id){fontPickerMap[id].bold=!fontPickerMap[id].bold;FontPicker_SetDisplayAreaParams(id);eval(fontPickerMap[id].scriptAction);}
function FontPicker_SetFontItalic(id){fontPickerMap[id].italic=!fontPickerMap[id].italic;FontPicker_SetDisplayAreaParams(id);eval(fontPickerMap[id].scriptAction);}
function FontPicker_SetFontUnderline(id){fontPickerMap[id].underline=!fontPickerMap[id].underline;FontPicker_SetDisplayAreaParams(id);eval(fontPickerMap[id].scriptAction);}
function FontPicker_getStyleString(id){var styleString="";var brd="";if(fontPickerMap[id].showFontSize)styleString+='font-size:'+fontPickerMap[id].fontsize+';';if(fontPickerMap[id].showFontFace)styleString+='font-family:'+FontPicker_GetFontDilimeters(fontPickerMap[id].fontfamily)+';';if(fontPickerMap[id].showColor)styleString+='color:'+fontPickerMap[id].color+';';if(fontPickerMap[id].showBold){if(fontPickerMap[id].bold){styleString+='font-weight:bold;';}else{styleString+='font-weight:normal;';}}
if(fontPickerMap[id].showItalic){if(fontPickerMap[id].italic){styleString+='font-style:italic;';}else{styleString+='font-style:normal;';}}
if(fontPickerMap[id].showUnderline){if(fontPickerMap[id].underline){styleString+='text-decoration:underline;';}else{styleString+='text-decoration:none;';}}
if(fontPickerMap[id].border){brd='border:'+fontPickerMap[id].border;}
if(fontPickerMap[id].borderStyle){if(!fontPickerMap[id].border){brd='border: 1px';}
brd+=" "+fontPickerMap[id].borderStyle;}
if(fontPickerMap[id].borderColor){if(!fontPickerMap[id].border){brd='border: 1px solid';}
brd+=" "+fontPickerMap[id].borderColor;}
if(brd){styleString+=brd+";";}
if(fontPickerMap[id].backColor){styleString+='background-color:'+fontPickerMap[id].backColor+';';}
return styleString;}
function FontPicker_SetDisplayAreaParams(id){var statusString="";if(fontPickerMap[id].showFontFace)statusString+="<b>Font-Face:</b> "+fontPickerMap[id].fontfamily+"<BR>";if(fontPickerMap[id].showFontSize)statusString+="<b>Font-Size:</b> "+fontPickerMap[id].fontsize+"<BR>";if(fontPickerMap[id].showBold)statusString+="<b>Bold:</b> "+fontPickerMap[id].bold+"<BR>";if(fontPickerMap[id].showItalic)statusString+="<b>Italic:</b> "+fontPickerMap[id].italic+"<BR>";if(fontPickerMap[id].showUnderline)statusString+="<b>Underline:</b> "+fontPickerMap[id].underline+"<BR>";if(fontPickerMap[id].border)statusString+="<b>Border-size:</b> "+(fontPickerMap[id].border?fontPickerMap[id].border:"-")+"<BR>";if(fontPickerMap[id].borderStyle)statusString+="<b>Border-style:</b> "+(fontPickerMap[id].borderStyle?fontPickerMap[id].borderStyle:"-")+"<BR>";if(fontPickerMap[id].borderColor)statusString+="<b>Border-color:</b> "+(fontPickerMap[id].borderColor?fontPickerMap[id].borderColor:"#000000")+"<BR>";if(fontPickerMap[id].backColor)statusString+="<b>Background-color:</b> "+(fontPickerMap[id].backColor?fontPickerMap[id].backColor:"#000000")+"<BR>";if(fontPickerMap[id].showStatus)getDOMObject(FONT_STATUSDISPLAY_PREFIX+id).innerHTML=statusString;getDOMObject(fontPickerMap[id].boundControl).value=FontPicker_getStyleString(id);if(fontPickerMap[id].showColor)getDOMObject('txtFontColourPicker_TextBox'+id).value=fontPickerMap[id].color;if(fontPickerMap[id].showColor)getDOMObject('btnFontColourPicker_Button'+id).style.color=fontPickerMap[id].color;if(fontPickerMap[id].borderColor)if(fontPickerMap[id].showBorderColor)getDOMObject('btnBorderColourPicker_Button'+id).style.borderColor=fontPickerMap[id].borderColor;if(fontPickerMap[id].backColor)if(fontPickerMap[id].showBackColor)getDOMObject('btnBackColourPicker_Button'+id).style.backgroundColor=fontPickerMap[id].backColor;if(fontPickerMap[id].showDemo){getDOMObject(FONT_DISPLAY_PREFIX+id).innerHTML=fontPickerMap[id].demoMessage;getDOMObject(FONT_DISPLAY_PREFIX+id).style.fontSize=fontPickerMap[id].fontsize;getDOMObject(FONT_DISPLAY_PREFIX+id).style.fontFamily=FontPicker_GetFontDilimeters(fontPickerMap[id].fontfamily);getDOMObject(FONT_DISPLAY_PREFIX+id).style.color=fontPickerMap[id].color;getDOMObject(FONT_DISPLAY_PREFIX+id).style.fontWeight=(fontPickerMap[id].bold?"bold":"normal");getDOMObject(FONT_DISPLAY_PREFIX+id).style.fontStyle=(fontPickerMap[id].italic?"italic":"normal");getDOMObject(FONT_DISPLAY_PREFIX+id).style.textDecoration=(fontPickerMap[id].underline?"underline":"none");getDOMObject(FONT_DISPLAY_PREFIX+id).style.borderWidth=(fontPickerMap[id].border?fontPickerMap[id].border:"");getDOMObject(FONT_DISPLAY_PREFIX+id).style.borderStyle=(fontPickerMap[id].borderStyle?fontPickerMap[id].borderStyle:"");getDOMObject(FONT_DISPLAY_PREFIX+id).style.borderColor=(fontPickerMap[id].borderColor?fontPickerMap[id].borderColor:"");getDOMObject(FONT_DISPLAY_PREFIX+id).style.backgroundColor=(fontPickerMap[id].backColor?fontPickerMap[id].backColor:"");}}
function isColour(colour){var myRegExp=new RegExp("#[A-Fa-f0-9]{6}","gi");if(colour.search(myRegExp)!=-1)return true;return false;}
function FontPicker_SetColour(id,colour){colour=colour.toUpperCase();if(!isColour(colour)&&colour!='')return;fontPickerMap[id].color=colour;FontPicker_SetDisplayAreaParams(id);FontPicker_ShowPicker(id,2);eval(fontPickerMap[id].scriptAction);}
function FontPicker_SetBackgroundColour(id,colour){colour=colour.toUpperCase();if(!isColour(colour)&&colour!='')return;fontPickerMap[id].color=colour;FontPicker_SetDisplayAreaParams(id);FontPicker_ShowPicker(id,2);eval(fontPickerMap[id].scriptAction);}
function FontPicker_ShowPicker(id,pickerID){switch(pickerID){case 0:getDOMObject(FONT_FONTFACEDROPDOWN_PREFIX+id).style.display=(String(getDOMObject(FONT_FONTFACEDROPDOWN_PREFIX+id).style.display).toLowerCase()=='inline'?"none":"inline");getDOMObject(FONT_FONTSIZEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(FONT_FONTCOLOURDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_SIZEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_STYLEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_COLORDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BACK_COLORDROPDOWN_PREFIX+id).style.display='none';break;case 1:getDOMObject(FONT_FONTSIZEDROPDOWN_PREFIX+id).style.display=(String(getDOMObject(FONT_FONTSIZEDROPDOWN_PREFIX+id).style.display).toLowerCase()=='inline'?"none":"inline");getDOMObject(FONT_FONTFACEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(FONT_FONTCOLOURDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_SIZEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_STYLEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_COLORDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BACK_COLORDROPDOWN_PREFIX+id).style.display='none';break;case 2:getDOMObject(FONT_FONTCOLOURDROPDOWN_PREFIX+id).style.display=(String(getDOMObject(FONT_FONTCOLOURDROPDOWN_PREFIX+id).style.display).toLowerCase()=='inline'?"none":"inline");getDOMObject(FONT_FONTFACEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(FONT_FONTFACEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_SIZEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_STYLEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_COLORDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BACK_COLORDROPDOWN_PREFIX+id).style.display='none';break;case 3:getDOMObject(BORDER_SIZEDROPDOWN_PREFIX+id).style.display=(String(getDOMObject(BORDER_SIZEDROPDOWN_PREFIX+id).style.display).toLowerCase()=='inline'?"none":"inline");getDOMObject(FONT_FONTFACEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(FONT_FONTCOLOURDROPDOWN_PREFIX+id).style.display='none';getDOMObject(FONT_FONTSIZEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_STYLEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_COLORDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BACK_COLORDROPDOWN_PREFIX+id).style.display='none';break;case 4:getDOMObject(BORDER_STYLEDROPDOWN_PREFIX+id).style.display=(String(getDOMObject(BORDER_STYLEDROPDOWN_PREFIX+id).style.display).toLowerCase()=='inline'?"none":"inline");getDOMObject(FONT_FONTFACEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(FONT_FONTCOLOURDROPDOWN_PREFIX+id).style.display='none';getDOMObject(FONT_FONTSIZEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_SIZEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_COLORDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BACK_COLORDROPDOWN_PREFIX+id).style.display='none';break;case 5:getDOMObject(BORDER_COLORDROPDOWN_PREFIX+id).style.display=(String(getDOMObject(BORDER_COLORDROPDOWN_PREFIX+id).style.display).toLowerCase()=='inline'?"none":"inline");getDOMObject(FONT_FONTFACEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(FONT_FONTCOLOURDROPDOWN_PREFIX+id).style.display='none';getDOMObject(FONT_FONTSIZEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_SIZEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_STYLEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BACK_COLORDROPDOWN_PREFIX+id).style.display='none';break;case 6:getDOMObject(BACK_COLORDROPDOWN_PREFIX+id).style.display=(String(getDOMObject(BACK_COLORDROPDOWN_PREFIX+id).style.display).toLowerCase()=='inline'?"none":"inline");getDOMObject(FONT_FONTFACEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(FONT_FONTCOLOURDROPDOWN_PREFIX+id).style.display='none';getDOMObject(FONT_FONTSIZEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_SIZEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_STYLEDROPDOWN_PREFIX+id).style.display='none';getDOMObject(BORDER_COLORDROPDOWN_PREFIX+id).style.display='none';break;}}
function FontPicker_modifyText(id,text){if(document.getElementById&&text!=''){obj=document.getElementById(id);obj.childNodes[0].data=text;}};var show_close_button=1;var show_maximize_button=1;var show_minimize_button=1;var min_win_size=21;var inner_frame_offset=44;var mydow_default_w=400;var mydow_default_h=350;var myhash=new Hash();var mydows=new Hash();var mouse={"x":0,"y":0,"delta_x":0,"delta_y":0};var dragxoffset=0;var dragyoffset=0;var ie=0;var mydow_class_frame={'position':'absolute','top':'10px','left':'10px','height':'auto','background':'#0000A0','border':'solid 1px black','padding':'1px','width':mydow_default_w+'px','height':mydow_default_h+'px','overflow':'hidden','zIndex':4,'MozBorderRadius':'.5em'}
var mydow_class_title={'padding':'2px','text-align ':'left','background':'url(img/grad.gif) #0000A0','font':' bold 10px sans-serif','height':'15px','color':'#FFFFFF','border':'1px solid #0000A0','white-space':'nowrap','overflow':'hidden','MozBorderRadius':'.5em .5em 0em 0em'};var mydow_class_body={'border':'1px solid black','border-bottom':'none','background':'#FFFFFF','font':'16px sans-serif','color':'#000000','overflow':'auto','height':'auto'};var mydow_class_statbar={'text-align':'left','background':'lightgrey','color':'#505050','height':'15px','line-height':'15px','font':'10px sans-serif','border':'1px solid black','white-space':'nowrap','overflow':'hidden','MozBorderRadius':'0em 0em .5em .5em'};function mydow_load(handle,url){new Ajax.Updater(handle+'_body',url,{method:'get'});}
function lower_all(){mydows.each(function(obj){$(obj.key+"_frame").setStyle({"zIndex":1000});$(obj.key+"_frame").setOpacity(.5);});}
function mydows_init(){if(navigator.userAgent.indexOf("MSIE")>-1){ie=true;mydow_class_title.height=20;ie=-2;}
document.observe('mousemove',function(e){mouse.delta_x=e.pointerX()-mouse.x;mouse.delta_y=e.pointerY()-mouse.y;mouse.x=e.pointerX();mouse.y=e.pointerY();mydows_drag();});document.observe('mousedown',function(e){var element=Event.element(e);if(element.readAttribute("id"))if(element.readAttribute("id").endsWith("_frame")){mydows_stop_select(true);}});document.observe('mouseup',function(e){mydows.each(function(h){mydow_property(h.key,"drag",0);mydow_property(h.key,"resize",0);$(h.key+"_title").setStyle({"cursor":"default"});mydows_stop_select(false);});});}
function mydows_drag(){try{mydows.each(function(obj){have_on_resize=1;if(obj.value.get("drag")==1){$(obj.key+"_frame").setStyle({"top":mouse.y-dragyoffset>-1?mouse.y-dragyoffset:0,"left":mouse.x-dragxoffset>-1?mouse.x-dragxoffset:0});have_on_resize=0;}
else if(obj.value.get("resize")=="e-resize"){var new_width=mouse.x-$(obj.key+"_frame").cumulativeOffset().left;$(obj.key+"_frame").setStyle({"width":new_width>min_win_size?new_width:min_win_size});$(obj.key+"_body").setStyle({"width":new_width-2+ie>min_win_size-2?new_width-2+ie+ie:min_win_size-2});$(obj.key+"_statbar").setStyle({"width":$(obj.key+"_body").getWidth()-2-ie});}
else if(obj.value.get("resize")=="w-resize"){var new_width=obj.value.get("resize_anchor_x")-mouse.x;$(obj.key+"_frame").setStyle({"left":mouse.x,"width":new_width>min_win_size?new_width:min_win_size});$(obj.key+"_body").setStyle({"width":new_width-2+ie>min_win_size-2?new_width-2+ie:min_win_size-2});$(obj.key+"_statbar").setStyle({"width":$(obj.key+"_body").getWidth()-2-ie});}
else if(obj.value.get("resize")=="n-resize"){var new_height=obj.value.get("resize_anchor_y")-mouse.y;$(obj.key+"_frame").setStyle({"top":mouse.y,"height":new_height>min_win_size?new_height:min_win_size});$(obj.key+"_body").setStyle({"height":new_height-inner_frame_offset>min_win_size-inner_frame_offset?new_height-inner_frame_offset:min_win_size-inner_frame_offset});}
else if(obj.value.get("resize")=="nw-resize"){var new_width=obj.value.get("resize_anchor_x")-mouse.x;var new_height=obj.value.get("resize_anchor_y")-mouse.y;$(obj.key+"_frame").setStyle({"top":mouse.y,"left":mouse.x,"width":new_width>min_win_size?new_width:min_win_size,"height":new_height>min_win_size?new_height:min_win_size});$(obj.key+"_body").setStyle({"width":new_width-2+ie>min_win_size-2?new_width-2+ie:min_win_size-2,"height":new_height-inner_frame_offset>min_win_size-inner_frame_offset?new_height-inner_frame_offset:min_win_size-inner_frame_offset});$(obj.key+"_statbar").setStyle({"width":$(obj.key+"_body").getWidth()-2-ie});}
else if(obj.value.get("resize")=="ne-resize"){var new_width=mouse.x-$(obj.key+"_frame").cumulativeOffset().left;var new_height=obj.value.get("resize_anchor_y")-mouse.y;$(obj.key+"_frame").setStyle({"top":mouse.y,"width":new_width>min_win_size?new_width:min_win_size,"height":new_height>min_win_size?new_height:min_win_size});$(obj.key+"_body").setStyle({"width":new_width-2+ie>min_win_size-2?new_width-2+ie:min_win_size-2,"height":new_height-inner_frame_offset>min_win_size-inner_frame_offset?new_height-inner_frame_offset:min_win_size-inner_frame_offset});$(obj.key+"_statbar").setStyle({"width":$(obj.key+"_body").getWidth()-2-ie});}
else if(obj.value.get("resize")=="se-resize"){var new_width=mouse.x-$(obj.key+"_frame").cumulativeOffset().left;var new_height=mouse.y-$(obj.key+"_frame").cumulativeOffset().top;$(obj.key+"_frame").setStyle({"width":new_width>min_win_size?new_width:min_win_size,"height":new_height>min_win_size?new_height:min_win_size});$(obj.key+"_body").setStyle({"width":new_width-2+ie>min_win_size-2?new_width-2+ie:min_win_size-2,"height":new_height-inner_frame_offset>min_win_size-inner_frame_offset?new_height-inner_frame_offset:min_win_size-inner_frame_offset});$(obj.key+"_statbar").setStyle({"width":$(obj.key+"_body").getWidth()-2-ie});}
else if(obj.value.get("resize")=="sw-resize"){var new_width=obj.value.get("resize_anchor_x")-mouse.x;var new_height=mouse.y-$(obj.key+"_frame").cumulativeOffset().top;$(obj.key+"_frame").setStyle({"left":mouse.x,"width":new_width>min_win_size?new_width:min_win_size,"height":new_height>min_win_size?new_height:min_win_size});$(obj.key+"_body").setStyle({"width":new_width-2+ie>min_win_size-2?new_width-2+ie:min_win_size-2,"height":new_height-inner_frame_offset>min_win_size-inner_frame_offset?new_height-inner_frame_offset:min_win_size-inner_frame_offset});$(obj.key+"_statbar").setStyle({"width":$(obj.key+"_body").getWidth()-2-ie});}
else if(obj.value.get("resize")=="s-resize"){var new_height=mouse.y-$(obj.key+"_frame").cumulativeOffset().top;$(obj.key+"_frame").setStyle({"height":new_height>min_win_size?new_height:min_win_size});$(obj.key+"_body").setStyle({"height":new_height-inner_frame_offset>min_win_size-inner_frame_offset?new_height-inner_frame_offset:min_win_size-inner_frame_offset});}
else{have_on_resize=0;}
if(have_on_resize){rs=obj.value.get('on_resize');if(rs)rs(obj);}});}catch(e){}}
function mydows_stop_select(state){if(state){document.onselectstart=new Function('return false');document.onmousedown=function(e){return false;};document.onclick=function(){return true;};}
else{document.onselectstart=new Function("return true");if(window.sidebar){document.onmousedown=function(){return true;};}}}
function kill_mydow(handle){$(handle+"_frame").remove();mydows.unset(handle);}
function new_mydow(params){var handle,ttl,img_path,x,y,w,h,scb,smaxb,sminb;handle=params["handle"];x=params["x"];y=params["y"];w=params["w"];h=params["h"];ttl=params["title"];img_path=params["img_path"];if(!img_path)img_path="img/";if(!ttl)ttl=handle;scb=typeof(params["close"])!='undefined'?params["close"]:show_close_button;smaxb=typeof(params["maximize"])!='undefined'?params["maximize"]:show_maximize_button;sminb=typeof(params["minimize"])!='undefined'?params["minimize"]:show_minimize_button;if(!mydows.get(handle)){var myframe=new Element("div",{"id":handle+"_frame","class":"mydow_frame"});myframe.setStyle(mydow_class_frame);var mytitle=new Element("div",{"id":handle+"_title","class":"mydow_title"}).update("<span id='"+handle+"_title_msg'>"+ttl+"</span>");mytitle.setStyle(mydow_class_title);if(smaxb){var mymaximizebutton=new Element("img",{"id":handle+"_maximizebutton","align":"right","src":img_path+"maximize0.gif","onmouseover":"this.src='"+img_path+"maximize1.gif';","onmouseout":"this.src='"+img_path+"maximize0.gif';"});mytitle.insert({"top":mymaximizebutton});}
if(sminb){var mymibutton=new Element("img",{"id":handle+"_mibutton","align":"right","src":img_path+"minimize0.gif","onmouseover":"this.src='"+img_path+"minimize1.gif';","onmouseout":"this.src='"+img_path+"minimize0.gif';"});mytitle.insert({"top":mymibutton});}
if(scb){var myxbutton=new Element("img",{"id":handle+"_xbutton","align":"right","src":img_path+"close0.gif","onmouseover":"this.src='"+img_path+"close1.gif';","onmouseout":"this.src='"+img_path+"close0.gif';"});mytitle.insert({"top":myxbutton});}
var mybody=new Element("div",{"id":handle+"_body","class":"mydow_body"}).update("&nbsp;");mybody.setStyle(mydow_class_body);var mystatbar=new Element("div",{"id":handle+"_statbar","class":"mydow_statbar"});mystatbar.setStyle(mydow_class_statbar);myframe.insert({"top":mystatbar});myframe.insert({"top":mybody});myframe.insert({"top":mytitle});$(document.body).insert({"top":myframe});nx=typeof(x)!='undefined'?x:document.viewport.getScrollOffsets().left+300;ny=typeof(y)!='undefined'?y:document.viewport.getScrollOffsets().top+200;nw=typeof(w)!='undefined'?w:mydow_default_w;nh=typeof(h)!='undefined'?h:mydow_default_h;mydow_set_position(handle,nx,ny,nw,nh);lower_all();mydows.set(handle,new Hash({"resize":0,"resize_anchor_x":0,"resize_anchor_y":0,"drag":0,"maximized":0,"old_coords":{'x':0,'y':0,'w':0,'h':0}}));if(sminb)mytitle.observe('dblclick',function(e){if(mydows.get(handle).get("minimized")){mydow_property(handle,"minimized",0);myframe.setStyle({'top':mydows.get(handle).get("old_coords").y,'left':mydows.get(handle).get("old_coords").x,'width':mydows.get(handle).get("old_coords").w,'height':mydows.get(handle).get("old_coords").h});mybody.setStyle({"width":mydows.get(handle).get("old_coords").w-2>min_win_size-2?mydows.get(handle).get("old_coords").w-2+ie:min_win_size-2,"height":mydows.get(handle).get("old_coords").h-inner_frame_offset>min_win_size-inner_frame_offset?mydows.get(handle).get("old_coords").h-inner_frame_offset:min_win_size-inner_frame_offset});mystatbar.setStyle({"width":mybody.getWidth()-2-ie});}
else{mydow_property(handle,"minimized",1);mydows.get(handle).get("old_coords").x=myframe.getStyle("left");mydows.get(handle).get("old_coords").y=myframe.getStyle("top");mydows.get(handle).get("old_coords").w=myframe.getWidth();mydows.get(handle).get("old_coords").h=myframe.getHeight();var new_width=140;var new_height=20;myframe.setStyle({'top':myframe.getStyle("top"),'left':0,'width':new_width,'height':new_height});mybody.setStyle({"width":new_width-2+ie>min_win_size-2?new_width-2+ie:min_win_size-2,"height":new_height-inner_frame_offset>min_win_size-inner_frame_offset?new_height-inner_frame_offset:min_win_size-inner_frame_offset});mystatbar.setStyle({"width":mybody.getWidth()-2-ie});}})
mytitle.observe('mousedown',function(e){if(mydows.get(handle).get("minimized")){mydow_property(handle,"minimized",0);myframe.setStyle({'top':mydows.get(handle).get("old_coords").y,'left':mydows.get(handle).get("old_coords").x,'width':mydows.get(handle).get("old_coords").w,'height':mydows.get(handle).get("old_coords").h});mybody.setStyle({"width":mydows.get(handle).get("old_coords").w-2>min_win_size-2?mydows.get(handle).get("old_coords").w-2+ie:min_win_size-2,"height":mydows.get(handle).get("old_coords").h-inner_frame_offset>min_win_size-inner_frame_offset?mydows.get(handle).get("old_coords").h-inner_frame_offset:min_win_size-inner_frame_offset});mystatbar.setStyle({"width":mybody.getWidth()-2-ie});return;}
dragxoffset=mouse.x-myframe.cumulativeOffset().left;dragyoffset=mouse.y-myframe.cumulativeOffset().top;mytitle.setStyle({"cursor":"move"});mydow_property(handle,"drag",1);mydows_stop_select(true);});mystatbar.observe('mousedown',function(e){mydows_stop_select(true);});myframe.observe('mousedown',function(e){mydow_property(handle,"resize",myframe.getStyle("cursor"));mydow_property(handle,"resize_anchor_x",myframe.getWidth()+myframe.cumulativeOffset().left);mydow_property(handle,"resize_anchor_y",myframe.getHeight()+myframe.cumulativeOffset().top);lower_all();myframe.setStyle({"zIndex":1003});myframe.setOpacity(50);});if(scb)myxbutton.observe('click',function(e){myframe.remove();mydows.unset(handle);});if(sminb)mymibutton.observe('click',function(e){if(mydows.get(handle).get("minimized")){mydow_property(handle,"minimized",0);myframe.setStyle({'top':mydows.get(handle).get("old_coords").y,'left':mydows.get(handle).get("old_coords").x,'width':mydows.get(handle).get("old_coords").w,'height':mydows.get(handle).get("old_coords").h});mybody.setStyle({"width":mydows.get(handle).get("old_coords").w-2>min_win_size-2?mydows.get(handle).get("old_coords").w-2+ie:min_win_size-2,"height":mydows.get(handle).get("old_coords").h-inner_frame_offset>min_win_size-inner_frame_offset?mydows.get(handle).get("old_coords").h-inner_frame_offset:min_win_size-inner_frame_offset});mystatbar.setStyle({"width":mybody.getWidth()-2-ie});}
else{mydow_property(handle,"minimized",1);mydows.get(handle).get("old_coords").x=myframe.getStyle("left");mydows.get(handle).get("old_coords").y=myframe.getStyle("top");mydows.get(handle).get("old_coords").w=myframe.getWidth();mydows.get(handle).get("old_coords").h=myframe.getHeight();var new_width=140;var new_height=20;myframe.setStyle({'top':myframe.getStyle("top"),'left':0,'width':new_width,'height':new_height});mybody.setStyle({"width":new_width-2+ie>min_win_size-2?new_width-2+ie:min_win_size-2,"height":new_height-inner_frame_offset>min_win_size-inner_frame_offset?new_height-inner_frame_offset:min_win_size-inner_frame_offset});mystatbar.setStyle({"width":mybody.getWidth()-2-ie});}});if(smaxb)mymaximizebutton.observe('click',function(e){if(mydows.get(handle).get("maximized")){mydow_property(handle,"maximized",0);myframe.setStyle({'top':mydows.get(handle).get("old_coords").y,'left':mydows.get(handle).get("old_coords").x,'width':mydows.get(handle).get("old_coords").w,'height':mydows.get(handle).get("old_coords").h});mybody.setStyle({"width":mydows.get(handle).get("old_coords").w-2>min_win_size-2?mydows.get(handle).get("old_coords").w-2+ie:min_win_size-2,"height":mydows.get(handle).get("old_coords").h-inner_frame_offset>min_win_size-inner_frame_offset?mydows.get(handle).get("old_coords").h-inner_frame_offset:min_win_size-inner_frame_offset});mystatbar.setStyle({"width":mybody.getWidth()-2-ie});}
else{window.scroll(0,0);mydow_property(handle,"maximized",1);mydows.get(handle).get("old_coords").x=myframe.getStyle("left");mydows.get(handle).get("old_coords").y=myframe.getStyle("top");mydows.get(handle).get("old_coords").w=myframe.getWidth();mydows.get(handle).get("old_coords").h=myframe.getHeight();var new_width=$(document.body).getWidth()+ie*20;var new_height=$(document.body).getHeight();myframe.setStyle({'top':5-2*ie,'left':5-2*ie,'width':new_width,'height':new_height});mybody.setStyle({"width":new_width-2+ie>min_win_size-2?new_width-2+ie:min_win_size-2,"height":new_height-inner_frame_offset>min_win_size-inner_frame_offset?new_height-inner_frame_offset:min_win_size-inner_frame_offset});mystatbar.setStyle({"width":mybody.getWidth()-2-ie});}});myframe.observe('keypress',function(e){alert('key');})
myframe.observe('mousemove',function(e){var t_win={x:myframe.cumulativeOffset().left,y:myframe.cumulativeOffset().top}
if(mouse.x>=t_win.x+myframe.getWidth()-10&&mouse.y>=t_win.y+10&&mouse.y<=t_win.y+myframe.getHeight()-10){myframe.setStyle({'cursor':'e-resize'});}
else if(mouse.x>=t_win.x+10&&mouse.x<=t_win.x+myframe.getWidth()-10&&mouse.y>=t_win.y+myframe.getHeight()-10){myframe.setStyle({'cursor':'s-resize'});}
else if(mouse.x<=t_win.x+10&&mouse.y>=t_win.y+10&&mouse.y<=t_win.y+myframe.getHeight()-10){myframe.setStyle({'cursor':'w-resize'});}
else if(mouse.x<=t_win.x+myframe.getWidth()-10&&mouse.x>=t_win.x+10&&mouse.y<=t_win.y+10){myframe.setStyle({'cursor':'n-resize'});}
else if(mouse.x>t_win.x+myframe.getWidth()-10&&mouse.y>t_win.y+myframe.getHeight()-10){myframe.setStyle({'cursor':'se-resize'});}
else if(mouse.x>t_win.x+myframe.getWidth()-10&&mouse.y<t_win.y+10){myframe.setStyle({'cursor':'ne-resize'});}
else if(mouse.x<t_win.x+10&&mouse.y>t_win.y+myframe.getHeight()-10){myframe.setStyle({'cursor':'sw-resize'});}
else if(mouse.x<t_win.x+10&&mouse.y<t_win.y+10){myframe.setStyle({'cursor':'nw-resize'});}
else{myframe.setStyle({'cursor':'default'});mydow_property(handle,"resize",0);}});}
return{'handle':handle,'body':handle+"_body",'frame':handle+"_frame",'title':handle+"_title",'title_msg':handle+"_title_msg",'statbar':handle+"_statbar"};}
function mydow_property(handle,prop,val){var properties=mydows.get(handle);properties.set(prop,val);mydows.set(handle,properties);}
function mydow_event(handle,event,val){var events=mydows.get(handle);events.set(event,val);mydows.set(handle,events);if(val){mydows.each(function(obj){if(handle=obj.key)val(obj);})}}
function mydow_set_position(handle,x,y,w,h){$(handle+"_frame").setStyle({'left':x,'top':y,'width':w,'height':h});$(handle+"_body").setStyle({"width":w-2>min_win_size-2?w-2+ie:min_win_size-2,"height":h-inner_frame_offset>min_win_size-inner_frame_offset?h-inner_frame_offset:min_win_size-inner_frame_offset});$(handle+"_statbar").setStyle({"width":$(handle+"_body").getWidth()-2-ie});}
function mydow_dimensions(handle){var result={'x':0,'y':0,'w':0,'h':0};result.x=$(handle+"_frame").cumulativeOffset().x;result.y=$(handle+"_frame").cumulativeOffset().y;result.w=$(handle+"_frame").getWidth();result.h=$(handle+"_frame").getHeight();return results;}
function mydow_close(handle){var myframe=document.getElementById(handle+"_frame");if(myframe){myframe.remove();mydows.unset(handle);}};Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof firstDayOfWeek=="number"?firstDayOfWeek:Calendar._FD;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")
Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}
Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")
Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}
Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)
SL=el.scrollLeft;if(is_div&&el.scrollTop)
ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}
return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}
while(related){if(related==el){return true;}
related=related.parentNode;}
return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}
var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}
el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;while(f.nodeType!=1||/^div$/i.test(f.tagName))
f=f.parentNode;return f;};Calendar.getTargetElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.target;while(f.nodeType!=1)
f=f.parentNode;return f;};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}
return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}
if(typeof parent!="undefined"){parent.appendChild(el);}
return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}
return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}
return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}
var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}
if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}
var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)
s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")
mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}
s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}
var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}
if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}
cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.innerHTML=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}
yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}
if(show){var s=yc.style;s.display="block";if(cd.navtype<0)
s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")
ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}
s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}
if(cal.timeout){clearTimeout(cal.timeout);}
var el=cal.activeDiv;if(!el){return false;}
var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}
var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}
with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}
var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))
Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}
ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else
dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)
if(range[i]==current)
break;while(count-->0)
if(decrease){if(--i<0)
i=range.length-1;}else if(++i>=range.length)
i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();}
var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}
Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}
var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}
Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}
return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}
var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}
cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}
cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}
cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}
var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver);}else
addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}
if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}
return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}
if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}
el.calendar.tooltips.innerHTML=el.ttip;}
if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}
return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled)
return false;removeClass(el,"hilite");if(el.caldate)
removeClass(el.parentNode,"rowhilite");if(el.calendar)
el.calendar.tooltips.innerHTML=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){if(cal.currentDateEl){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}}
cal.date.setDateOnly(el.caldate);date=cal.date;var other_month=!(cal.dateClicked=!el.otherMonth);if(!other_month&&!cal.currentDateEl)
cal._toggleMultipleDate(new Date(date));else
newdate=!el.disabled;if(other_month)
cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}
date=new Date(cal.date);if(el.navtype==0)
date.setDateOnly(new Date());cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}
date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}
alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}
break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}
break;case 1:if(mon<11){setMonth(mon+1);}else if(year<cal.maxYear){date.setFullYear(year+1);setMonth(0);}
break;case 2:if(year<cal.maxYear){date.setFullYear(year+1);}
break;case 100:cal.setFirstDayOfWeek(el.fdow);return;case 50:var range=el._range;var current=el.innerHTML;for(var i=range.length;--i>=0;)
if(range[i]==current)
break;if(ev&&ev.shiftKey){if(--i<0)
i=range.length-1;}else if(++i>=range.length)
i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}
break;}
if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}else if(el.navtype==0)
newdate=closing=true;}
if(newdate){ev&&cal.callHandler();}
if(closing){Calendar.removeClass(el,"hilite");ev&&cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}
this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}
div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)
cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;cell.innerHTML="<div unselectable='on'>"+text+"</div>";return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("&#x00d7;",1,200).ttip=Calendar._TT["CLOSE"];}
row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.innerHTML=Calendar._TT["WK"];}
for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}
this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);}
for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.calendar=this;Calendar._add_evs(cell);}}
if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||"&nbsp;";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.innerHTML=init;part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")
part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}
Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.innerHTML=":";span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)
AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else
cell.innerHTML="&nbsp;";cal.onSetTime=function(){var pm,hrs=this.date.getHours(),mins=this.date.getMinutes();if(t12){pm=(hrs>=12);if(pm)hrs-=12;if(hrs==0)hrs=12;AP.innerHTML=pm?"pm":"am";}
H.innerHTML=(hrs<10)?("0"+hrs):hrs;M.innerHTML=(mins<10)?("0"+mins):mins;};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.innerHTML,10);if(t12){if(/pm/i.test(AP.innerHTML)&&h<12)
h+=12;else if(/am/i.test(AP.innerHTML)&&h==12)
h=0;}
var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.innerHTML,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}
var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}
this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i<Calendar._MN.length;++i){var mn=Calendar.createElement("div");mn.className=Calendar.is_ie?"label-IEfix":"label";mn.month=i;mn.innerHTML=Calendar._SMN[i];div.appendChild(mn);}
div=Calendar.createElement("div",this.element);this.yearsCombo=div;div.className="combo";for(i=12;i>0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";div.appendChild(yr);}
this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){var cal=window._dynarch_popupCalendar;if(!cal||cal.multiple)
return false;(Calendar.is_ie)&&(ev=window.event);var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;if(ev.ctrlKey){switch(K){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(K){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var prev,x,y,ne,el,step;prev=K==37||K==38;step=(K==37||K==39)?1:7;function setVars(){el=cal.currentDateEl;var p=el.pos;x=p&15;y=p>>4;ne=cal.ar_days[y][x];};setVars();function prevMonth(){var date=new Date(cal.date);date.setDate(date.getDate()-step);cal.setDate(date);};function nextMonth(){var date=new Date(cal.date);date.setDate(date.getDate()+step);cal.setDate(date);};while(1){switch(K){case 37:if(--x>=0)
ne=cal.ar_days[y][x];else{x=6;K=38;continue;}
break;case 38:if(--y>=0)
ne=cal.ar_days[y][x];else{prevMonth();setVars();}
break;case 39:if(++x<7)
ne=cal.ar_days[y][x];else{x=0;K=40;continue;}
break;case 40:if(++y<cal.ar_days.length)
ne=cal.ar_days[y][x];else{nextMonth();setVars();}
break;}
break;}
if(ne){if(!ne.disabled)
Calendar.cellClick(ne);else if(prev)
prevMonth();else
nextMonth();}}
break;case 13:if(act)
Calendar.cellClick(cal.currentDateEl,ev);break;default:return false;}
return Calendar.stopEvent(ev);};Calendar.prototype._init=function(firstDayOfWeek,date){var today=new Date(),TY=today.getFullYear(),TM=today.getMonth(),TD=today.getDate();this.table.style.visibility="hidden";var year=date.getFullYear();if(year<this.minYear){year=this.minYear;date.setFullYear(year);}else if(year>this.maxYear){year=this.maxYear;date.setFullYear(year);}
this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)
day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=this.ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];var dates=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.innerHTML=date.getWeekNumber();cell=cell.nextSibling;}
row.className="daysrow";var hasdays=false,iday,dpos=ar_days[i]=[];for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){iday=date.getDate();var wday=date.getDay();cell.className="day";cell.pos=i<<4|j;dpos[j]=cell;var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML="&nbsp;";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}
cell.disabled=false;cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;if(dates)
dates[date.print("%Y%m%d")]=cell;if(this.getDateStatus){var status=this.getDateStatus(date,year,month,iday);if(this.getDateToolTip){var toolTip=this.getDateToolTip(date,year,month,iday);if(toolTip)
cell.title=toolTip;}
if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))
cell.disabled=true;cell.className+=" "+status;}}
if(!cell.disabled){cell.caldate=new Date(date);cell.ttip="_";if(!this.multiple&&current_month&&iday==mday&&this.hiliteToday){cell.className+=" selected";this.currentDateEl=cell;}
if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}
if(weekend.indexOf(wday.toString())!=-1)
cell.className+=cell.otherMonth?" oweekend":" weekend";}}
if(!(hasdays||this.showsOtherMonths))
row.className="emptyrow";}
this.title.innerHTML=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates();};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var i in this.multiple){var cell=this.datesCells[i];var d=this.multiple[i];if(!d)
continue;if(cell)
cell.className+=" selected";}}};Calendar.prototype._toggleMultipleDate=function(date){if(this.multiple){var ds=date.print("%Y%m%d");var cell=this.datesCells[ds];if(cell){var d=this.multiple[ds];if(!d){Calendar.addClass(cell,"selected");this.multiple[ds]=date;}else{Calendar.removeClass(cell,"selected");delete this.multiple[ds];}}}};Calendar.prototype.setDateToolTipHandler=function(unaryFunction){this.getDateToolTip=unaryFunction;};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}
this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){var calendar=window._dynarch_popupCalendar;if(!calendar){return false;}
var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}
this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}
this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}
this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}
function fixPosition(box){if(box.x<0)
box.x=0;if(box.y<0)
box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}
var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}
switch(valign){case"T":p.y-=h;break;case"B":p.y+=el.offsetHeight;break;case"C":p.y+=(el.offsetHeight-h)/2;break;case"t":p.y+=el.offsetHeight-h;break;case"b":break;}
switch(halign){case"L":p.x-=w;break;case"R":p.x+=el.offsetWidth;break;case"C":p.x+=(el.offsetWidth-w)/2;break;case"l":p.x+=el.offsetWidth-w;break;case"r":break;}
p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)
setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else
Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){if(!fmt)
fmt=this.dateFormat;this.setDate(Date.parseDate(str,fmt));};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera)
return;function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)
value=document.defaultView.getComputedStyle(obj,"").getPropertyValue("visibility");else
value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else
value='';}
return value;};var tags=new Array("applet","iframe","select");var el=this.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(this.hidden||(CX1>EX2)||(CX2<EX1)||(CY1>EY2)||(CY2<EY1)){if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}
cc.style.visibility=cc.__msh_save_visibility;}else{if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}
cc.style.visibility="hidden";}}}};Calendar.prototype._displayWeekdays=function(){var fdow=this.firstDayOfWeek;var cell=this.firstdayname;var weekend=Calendar._TT["WEEKEND"];for(var i=0;i<7;++i){cell.className="day name";var realday=(i+fdow)%7;if(i){cell.ttip=Calendar._TT["DAY_FIRST"].replace("%s",Calendar._DN[realday]);cell.navtype=100;cell.calendar=this;cell.fdow=realday;Calendar._add_evs(cell);}
if(weekend.indexOf(realday.toString())!=-1){Calendar.addClass(cell,"weekend");}
cell.innerHTML=Calendar._SDN[(i+fdow)%7];cell=cell.nextSibling;}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none";};Calendar.prototype._dragStart=function(ev){if(this.dragging){return;}
this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX;}
var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd);}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(str,fmt){var today=new Date();var y=0;var m=-1;var d=0;var a=str.split(/\W+/);var b=fmt.match(/%./g);var i=0,j=0;var hr=0;var min=0;for(i=0;i<a.length;++i){if(!a[i])
continue;switch(b[i]){case"%d":case"%e":d=parseInt(a[i],10);break;case"%m":m=parseInt(a[i],10)-1;break;case"%Y":case"%y":y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);break;case"%b":case"%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}
break;case"%H":case"%I":case"%k":case"%l":hr=parseInt(a[i],10);break;case"%P":case"%p":if(/pm/i.test(a[i])&&hr<12)
hr+=12;else if(/am/i.test(a[i])&&hr>=12)
hr-=12;break;case"%M":min=parseInt(a[i],10);break;}}
if(isNaN(y))y=today.getFullYear();if(isNaN(m))m=today.getMonth();if(isNaN(d))d=today.getDate();if(isNaN(hr))hr=today.getHours();if(isNaN(min))min=today.getMinutes();if(y!=0&&m!=-1&&d!=0)
return new Date(y,m,d,hr,min,0);y=0;m=-1;d=0;for(i=0;i<a.length;++i){if(a[i].search(/[a-zA-Z]+/)!=-1){var t=-1;for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){t=j;break;}}
if(t!=-1){if(m!=-1){d=m+1;}
m=t;}}else if(parseInt(a[i],10)<=12&&m==-1){m=a[i]-1;}else if(parseInt(a[i],10)>31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}
if(y==0)
y=today.getFullYear();if(m!=-1&&d!=0)
return new Date(y,m,d,hr,min,0);return today;};Date.prototype.getMonthDays=function(month){var year=this.getFullYear();if(typeof month=="undefined"){month=this.getMonth();}
if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&month==1){return 29;}else{return Date._MD[month];}};Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY);};Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*864e5))+1;};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));};Date.prototype.setDateOnly=function(date){var tmp=new Date(date);this.setDate(1);this.setFullYear(tmp.getFullYear());this.setMonth(tmp.getMonth());this.setDate(tmp.getDate());};Date.prototype.print=function(str){var m=this.getMonth();var d=this.getDate();var y=this.getFullYear();var wn=this.getWeekNumber();var w=this.getDay();var s={};var hr=this.getHours();var pm=(hr>=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)
ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml)
return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i<a.length;i++){var tmp=s[a[i]];if(tmp){re=new RegExp(a[i],'g');str=str.replace(re,tmp);}}
return str;};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(y){var d=new Date(this);d.__msh_oldSetFullYear(y);if(d.getMonth()!=this.getMonth())
this.setDate(28);this.__msh_oldSetFullYear(y);};window._dynarch_popupCalendar=null;;Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);param_default("multiple",null);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}
if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false;}
function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")
p.inputField.onchange();}
if(update&&p.displayArea)
p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")
p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")
p.flatCallback(cal);}
if(update&&p.singleClick&&cal.dateClicked)
cal.callCloseHandler();};if(params.flat!=null){if(typeof params.flat=="string")
params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false;}
var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat);}
if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value);}
cal.create(params.flat);cal.show();return false;}
var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)
params.date=Date.parseDate(dateEl.value||dateEl.innerHTML,dateFmt);if(!(cal&&params.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)
cal.setDate(params.date);cal.hide();}
if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}
cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate)
cal.create();cal.refresh();if(!params.position)
cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else
cal.showAt(params.position[0],params.position[1]);return false;};return cal;};;Calendar._DN=new Array
("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");Calendar._SDN=new Array
("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun");Calendar._FD=0;Calendar._MN=new Array
("January","February","March","April","May","June","July","August","September","October","November","December");Calendar._SMN=new Array
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");Calendar._TT={};Calendar._TT["INFO"]="About the calendar";Calendar._TT["ABOUT"]="DHTML Date/Time Selector\n"+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n"+"For latest version visit: http://www.dynarch.com/projects/calendar/\n"+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details."+"\n\n"+"Date selection:\n"+"- Use the \xab, \xbb buttons to select year\n"+"- Use the "+String.fromCharCode(0x2039)+", "+String.fromCharCode(0x203a)+" buttons to select month\n"+"- Hold mouse button on any of the above buttons for faster selection.";Calendar._TT["ABOUT_TIME"]="\n\n"+"Time selection:\n"+"- Click on any of the time parts to increase it\n"+"- or Shift-click to decrease it\n"+"- or click and drag for faster selection.";Calendar._TT["PREV_YEAR"]="Prev. year (hold for menu)";Calendar._TT["PREV_MONTH"]="Prev. month (hold for menu)";Calendar._TT["GO_TODAY"]="Go Today";Calendar._TT["NEXT_MONTH"]="Next month (hold for menu)";Calendar._TT["NEXT_YEAR"]="Next year (hold for menu)";Calendar._TT["SEL_DATE"]="Select date";Calendar._TT["DRAG_TO_MOVE"]="Drag to move";Calendar._TT["PART_TODAY"]=" (today)";Calendar._TT["DAY_FIRST"]="Display %s first";Calendar._TT["WEEKEND"]="0,6";Calendar._TT["CLOSE"]="Close";Calendar._TT["TODAY"]="Today";Calendar._TT["TIME_PART"]="(Shift-)Click or drag to change value";Calendar._TT["DEF_DATE_FORMAT"]="%Y-%m-%d";Calendar._TT["TT_DATE_FORMAT"]="%a, %b %e";Calendar._TT["WK"]="wk";Calendar._TT["TIME"]="Time:";