
function plroot()
{return"http://"+window.location.hostname+"/pl"+"ayer/";}
function get_form_str(form_id)
{mform=document.getElementById(form_id);vars='';for(i=0;i<mform.length;i++)
{switch(mform[i].type)
{case"radio":case"checkbox":if(!mform[i].checked)break;default:vars=vars+encodeURIComponent(mform[i].name)+'='+encodeURIComponent(mform[i].value)+'&';}}
return vars;}
function setCookie(cookieName,cookieContent,cookieExpireTime){if(cookieExpireTime>0){var expDate=new Date()
expDate.setTime(expDate.getTime()+cookieExpireTime*1000*60*60)
var expires=expDate.toGMTString()
document.cookie=cookieName+"="+escape(cookieContent)+"; path="+escape('/')+"; expires="+expires}else{document.cookie=cookieName+"="+escape(cookieContent)+"; path="+escape('/')+"";}}
function getCookie(cookieName){var ourCookie=document.cookie
if(!ourCookie||ourCookie=="")return""
ourCookie=ourCookie.split(";")
var i=0
var Cookie
while(i<ourCookie.length){Cookie=ourCookie[i].split("=")[0]
if(Cookie.charAt(0)==" ")
Cookie=Cookie.substring(1)
if(Cookie==cookieName){return unescape(ourCookie[i].split("=")[1])}
i++}
return""}
function open_links(model_id)
{gcook=getCookie('model_'+model_id+'_gallery_open');if(gcook=='true')
{show_hdn('gallery',document.getElementById('more_gall_link'),document.getElementById('more_gall'),120,160);}
vcook=getCookie('model_'+model_id+'_video_open');if(vcook=='true')
{show_hdn('video',document.getElementById('more_videos_link'),document.getElementById('more_videos'),200,150);}
lcook=getCookie('model_'+model_id+'_links_open');if(lcook=='true')
{show_hdn('links',document.getElementById('more_links_link'),document.getElementById('more_links'),0,0);}}
function str_repeat(i,m)
{for(var o=[];m>0;o[--m]=i);return(o.join(''));}
function sprintf()
{var i=0,a,f=arguments[i++],o=[],m,p,c,x;while(f)
{if(m=/^[^\x25]+/.exec(f))o.push(m[0]);else if(m=/^\x25{2}/.exec(f))o.push('%');else if(m=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f))
{if(((a=arguments[m[1]||i++])==null)||(a==undefined))throw("Too few arguments.");if(/[^s]/.test(m[7])&&(typeof(a)!='number'))
throw("Expecting number but found "+typeof(a));switch(m[7]){case'b':a=a.toString(2);break;case'c':a=String.fromCharCode(a);break;case'd':a=parseInt(a);break;case'e':a=m[6]?a.toExponential(m[6]):a.toExponential();break;case'f':a=m[6]?parseFloat(a).toFixed(m[6]):parseFloat(a);break;case'o':a=a.toString(8);break;case's':a=((a=String(a))&&m[6]?a.substring(0,m[6]):a);break;case'u':a=Math.abs(a);break;case'x':a=a.toString(16);break;case'X':a=a.toString(16).toUpperCase();break;}
a=(/[def]/.test(m[7])&&m[2]&&a>0?'+'+a:a);c=m[3]?m[3]=='0'?'0':m[3].charAt(1):' ';x=m[5]-String(a).length;p=m[5]?str_repeat(c,x):'';o.push(m[4]?a+p:p+a);}
else throw("Huh ?!");f=f.substring(m[0].length);}
return o.join('');}
function comments_submit(type)
{var type=(type)?type:false;if(type=='wall')
{var ajax_url='/ajax/wallcomments/wallcomments.html';}
else
{var ajax_url='/ajax/comments/comments.html';}
vars=get_form_str('comments_form');comments_show_loader();comments_js_rec(ajax_url,'POST',vars,function(data){if(req.readyState==4)
{document.getElementById('comments_div').innerHTML=req.responseText;comments_hide_loader();}});}
function comments_delete(del_id)
{var del_id=(del_id)?del_id:0;var ajax_url='/ajax/wallcomments/wallcomments.html';vars=get_form_str('comments_form')+'delete_comment='+del_id;comments_show_loader();comments_js_rec(ajax_url,'POST',vars,function(data){if(req.readyState==4)
{document.getElementById('comments_div').innerHTML=req.responseText;comments_hide_loader();}});}
function comments_js_rec(url,typeq,vars,retf)
{req=false;if(window.XMLHttpRequest)
{try
{req=new XMLHttpRequest();}
catch(e)
{req=false;}}
else if(window.ActiveXObject)
{try
{req=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{req=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{req=false;}}}
if(vars.indexOf('_ajax')<=0)vars=vars+'&_ajax=1';if(vars.indexOf('&')==0)vars=vars.substr(vars.indexOf('&')+1,vars.length);if(req)
{req.onreadystatechange=retf;req.open(typeq,url,true);req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');req.send(vars);}}
function comments_get_main_vars()
{vars='';vars=vars+'&comment_object_type='+document.getElementById('comment_object_type').value;vars=vars+'&comment_object_id='+document.getElementById('comment_object_id').value;vars=vars+'&comment_object_main_id='+document.getElementById('comment_object_main_id').value;vars=vars+'&comment_object_url='+encodeURIComponent(document.getElementById('comment_object_url').value);return vars;}
function comments_slider(cnt,type)
{var type=(type)?type:false;if(type=='wall')
{var ajax_url='/ajax/wallcomments/wallcomments.html';}
else
{var ajax_url='/ajax/comments/comments.html';}
vars=comments_get_main_vars();vars=vars+'&comments_page='+cnt;comments_show_loader();comments_js_rec(ajax_url,'POST',vars,function(data){if(req.readyState==4)
{document.getElementById('comments_div').innerHTML=req.responseText;comments_hide_loader();}});}
function comments_show_loader()
{document.getElementById('comments_div').className='opacity50';}
function comments_hide_loader()
{document.getElementById('comments_div').className='';}
function add_friend(user_id,friend_id)
{var user_id=(user_id)?user_id:0;var friend_id=(friend_id)?friend_id:0;if(user_id!=0||friend_id!=0||user_id!=friend_id)
{vars='&user_id'+user_id+'&add_friend='+friend_id+'&friend_id='+friend_id;friends_js_rec('/ajax/friends/friends.html','POST',vars,function(data){if(req.readyState==4)
{document.getElementById('friends_div').innerHTML=req.responseText;}});}}
function del_friend(user_id,friend_id)
{var user_id=(user_id)?user_id:0;var friend_id=(friend_id)?friend_id:0;if(user_id!=0||friend_id!=0||user_id!=friend_id)
{vars='&user_id'+user_id+'&del_friend='+friend_id+'&friend_id='+friend_id;friends_js_rec('/ajax/friends/friends.html','POST',vars,function(data){if(req.readyState==4)
{document.getElementById('friends_div').innerHTML=req.responseText;}});}}
function friends_show_loader()
{document.getElementById('friends_div').className='opacity50';}
function friend_hide_loader()
{document.getElementById('friends_div').className='opacity100';}
function friends_js_rec(url,typeq,vars,retf)
{req=false;if(window.XMLHttpRequest)
{try
{req=new XMLHttpRequest();}
catch(e)
{req=false;}}
else if(window.ActiveXObject)
{try
{req=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{req=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{req=false;}}}
if(vars.indexOf('_ajax')<=0)vars=vars+'&_ajax=1';if(vars.indexOf('&')==0)vars=vars.substr(vars.indexOf('&')+1,vars.length);if(req)
{req.onreadystatechange=retf;req.open(typeq,url,true);req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');req.send(vars);}}
function rate(type)
{vars='';vars=vars+'&type='+type;el=document.getElementById('rate_sel');vars=vars+'&'+el.name+'='+el.options[el.selectedIndex].value;comments_js_rec('/ajax/rate/rate.html','POST',vars,function(data){if(req.readyState==4)
{if(req.responseText!=='NO')document.getElementById('rating_block').innerHTML=req.responseText;}});}
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){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"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(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"http://f.freudbox.com/expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},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[_16.length]=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");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_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");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_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{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}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(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[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(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;function tag_complete(eid,bid,output_)
{this.last_key=0;this.id=eid;this.input=document.getElementById(eid);this.bshow=document.getElementById(bid);this.bclass_hide='hidden_tag_help';this.bclass_show='showed_tag_help';this.binshow=document.getElementById(output_);this.sel_row=0;this.is_selection=false;this.n_destroy=function()
{this.clear_help();this.bshow.className=this.bclass_hide;}
this.clear_help=function()
{this.last_key=0;this.is_selection=false;this.sel_row=0;this.bshow.className=this.bclass_hide;while(this.bshow.childNodes.length)
{for(ind in this.bshow.childNodes)
{try
{this.bshow.removeChild(this.bshow.childNodes[ind]);}
catch(e)
{continue;}}}}
this.move_select=function(where)
{if(where=='down')
{if(!this.is_selection)
{this.sel_row=0;nrow=0;}else nrow=this.sel_row+1;try
{this.bshow.childNodes[nrow].className='output_in_selected';if(nrow>0)this.bshow.childNodes[this.sel_row].className='output_in';this.sel_row=nrow;this.is_selection=true;}
catch(e)
{try
{this.bshow.childNodes[0].className='output_in_selected';if(this.sel_row)this.bshow.childNodes[this.sel_row].className='output_in';this.sel_row=0;this.is_selection=true;}
catch(e)
{this.is_selection=false;}}}
if(where=='up')
{if(this.sel_row==0)
{nrow=this.bshow.childNodes.length-1;}else
nrow=this.sel_row-1;try
{this.bshow.childNodes[nrow].className='output_in_selected';this.bshow.childNodes[this.sel_row].className='output_in';this.sel_row=nrow;this.is_selection=true;}
catch(e)
{this.is_selection=false;}}}
this.complete=function(txt)
{nval=this.input.value;lind=nval.lastIndexOf(',');if(lind!=false)nval=nval.substr(0,lind+1);else nval='';this.input.value=nval+txt+',';this.tag_complete_go();}
this.onenter=function()
{if(this.is_selection)
{try
{txt_compl=this.bshow.childNodes[this.sel_row].textContent;if(!txt_compl)txt_compl=this.bshow.childNodes[this.sel_row].innerText;}catch(e)
{txt_compl=this.bshow.childNodes[this.sel_row].innerText;}
try
{this.complete(txt_compl);}catch(e)
{}}
return false;}
this.listener=function(ev_id)
{tg_ev=(ev_id)?ev_id:event;tg=(ev_id.target)?ev_id.target:ev_id.srcElement;code=tg_ev.keyCode;if(code==40||code==38)
{where=(code==40)?'down':'up';this.move_select(where);}else if(code==13)
{return this.onenter();}
else
{this.last_key=code;this.bshow.className=this.bclass_hide;setTimeout('tag_compliter_docomp(\''+tg.id+'\',\''+code+'\');',250);}}
this.tag_complete=function(elid,ccode)
{if(this.last_key!=ccode)return false;this.tag_complete_go();}
this.tag_complete_go=function()
{if(this.input.value.length<2)return false;ttt=escape(this.input.value);turl='/tags.html?mid='+this.id+'&start='+ttt;this.get_resource(turl);}
this.get_resource=function(url)
{req=false;if(window.XMLHttpRequest)
{try
{req=new XMLHttpRequest();}
catch(e)
{req=false;}}
else if(window.ActiveXObject)
{try
{req=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{req=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e)
{req=false;}}}
if(req)
{req.onreadystatechange=this.read_resource;req.open("GET",url,true);req.send("");}}
this.read_resource=function()
{if(req.readyState==4)
{if(req.status==200)
{txt=req.responseText;txts=txt.split("\n");mid=txts[0];txts[0]=false;tag_compliter[mid].show_help(txts);}
else
{alert("Error:"+req.statusText);}}}
this.show_help=function(txts)
{this.clear_help();this.bshow.className=this.bclass_show;this.bshow.style.width=this.input.clientWidth+'px';was=0;for(i=0;i<txts.length;i++)
{if(txts[i].length<1)continue;if(!txts[i])continue;if(txts[i]=='false')continue;var n_el=this.binshow.cloneNode(true);if(this.bshow.childNodes.length)this.bshow.insertBefore(n_el,this.bshow.childNodes[this.bshow.childNodes.length-1]);else
{try
{this.bshow.insertBefore(n_el)}
catch(e)
{this.bshow.insertBefore(n_el,this.bshow.childNodes[0]);}}
n_el.style.display='block';n_el.innerHTML=txts[i];was++;}
if(was<1)
{this.clear_help();}}}
var tag_compliter=new Array();var compliter_eid=new Array();function tag_compliter_init(eid,oid,output_in)
{compliter_eid[eid]=new Array();compliter_eid[eid][0]=oid;compliter_eid[eid][1]=output_in;tag_compliter_add_event(document.getElementById(eid),"keydown",function(eievent){tag_compliter_listener(eievent);});tag_compliter_add_event(document.getElementById(eid),"change",function(eievent){tag_compliter_desctroyer(eievent);});}
function tag_compliter_listener(eievent)
{tg_ev=(eievent)?eievent:event;tg=(eievent.target)?eievent.target:eievent.srcElement;if(!tag_compliter[tg.id])tag_compliter[tg.id]=new tag_complete(tg.id,compliter_eid[tg.id][0],compliter_eid[tg.id][1]);tag_compliter[tg.id].listener(eievent);}
function tag_compliter_docomp(elid,ccode)
{if(tag_compliter[elid])
{tag_compliter[elid].tag_complete(elid,ccode);}}
function tag_compliter_desctroyer(eievent)
{tg=(eievent.target)?eievent.target:eievent.srcElement;if(tag_compliter[tg.id])
{tag_compliter[tg.id].n_destroy();}
tag_compliter[tg.id]=false;}
function tag_compliter_add_event(el,event,func){if(el.addEventListener)
{el.addEventListener(event,func,false);}
else if(el.attachEvent)
{mfunc=function(){func(window.event);}
el.attachEvent("on"+event,mfunc);}
return true;}
jQuery.fn.extend({everyTime:function(interval,label,fn,times,belay){return this.each(function(){jQuery.timer.add(this,interval,label,fn,times,belay);});},oneTime:function(interval,label,fn){return this.each(function(){jQuery.timer.add(this,interval,label,fn,1);});},stopTime:function(label,fn){return this.each(function(){jQuery.timer.remove(this,label,fn);});}});jQuery.extend({timer:{guid:1,global:{},regex:/^([0-9]+)\s*(.*s)?$/,powers:{'ms':1,'cs':10,'ds':100,'s':1000,'das':10000,'hs':100000,'ks':1000000},timeParse:function(value){if(value==undefined||value==null)
return null;var result=this.regex.exec(jQuery.trim(value.toString()));if(result[2]){var num=parseInt(result[1],10);var mult=this.powers[result[2]]||1;return num*mult;}else{return value;}},add:function(element,interval,label,fn,times,belay){var counter=0;if(jQuery.isFunction(label)){if(!times)
times=fn;fn=label;label=interval;}
interval=jQuery.timer.timeParse(interval);if(typeof interval!='number'||isNaN(interval)||interval<=0)
return;if(times&&times.constructor!=Number){belay=!!times;times=0;}
times=times||0;belay=belay||false;if(!element.$timers)
element.$timers={};if(!element.$timers[label])
element.$timers[label]={};fn.$timerID=fn.$timerID||this.guid++;var handler=function(){if(belay&&this.inProgress)
return;this.inProgress=true;if((++counter>times&&times!==0)||fn.call(element,counter)===false)
jQuery.timer.remove(element,label,fn);this.inProgress=false;};handler.$timerID=fn.$timerID;if(!element.$timers[label][fn.$timerID])
element.$timers[label][fn.$timerID]=window.setInterval(handler,interval);if(!this.global[label])
this.global[label]=[];this.global[label].push(element);},remove:function(element,label,fn){var timers=element.$timers,ret;if(timers){if(!label){for(label in timers)
this.remove(element,label,fn);}else if(timers[label]){if(fn){if(fn.$timerID){window.clearInterval(timers[label][fn.$timerID]);delete timers[label][fn.$timerID];}}else{for(var fn in timers[label]){window.clearInterval(timers[label][fn]);delete timers[label][fn];}}
for(ret in timers[label])break;if(!ret){ret=null;delete timers[label];}}
for(ret in timers)break;if(!ret)
element.$timers=null;}}}});if(jQuery.browser.msie)
jQuery(window).one("unload",function(){var global=jQuery.timer.global;for(var label in global){var els=global[label],i=els.length;while(--i)
jQuery.timer.remove(els[i],label);}});jQuery.fn.crossSlide=function(opts,plan){var self=this,self_width=this.width(),self_height=this.height();function format(str){for(var i=1;i<arguments.length;i++)
str=str.replace(new RegExp('\\{'+(i-1)+'}','g'),arguments[i]);return str;}
function abort(){arguments[0]='crossSlide: '+arguments[0];throw format.apply(null,arguments);}
(function(proceed){var n_loaded=0;function loop(i,img){img.onload=function(e){n_loaded++;plan[i].width=img.width;plan[i].height=img.height;if(n_loaded==plan.length)
proceed();}
img.src=plan[i].src;if(i+1<plan.length)
loop(i+1,new Image());}
loop(0,new Image());})(function(){function parse_position_param(param){var zoom=1;var tokens=param.replace(/^\s*|\s*$/g,'').split(/\s+/);if(tokens.length>3)throw new Error();if(tokens[0]=='center')
if(tokens.length==1)
tokens=['center','center'];else if(tokens.length==2&&tokens[1].match(/^[\d.]+x$/i))
tokens=['center','center',tokens[1]];if(tokens.length==3)
zoom=parseFloat(tokens[2].match(/^([\d.]+)x$/i)[1]);var pos=tokens[0]+' '+tokens[1];if(pos=='left top'||pos=='top left')return{xrel:0,yrel:0,zoom:zoom};if(pos=='left center'||pos=='center left')return{xrel:0,yrel:.5,zoom:zoom};if(pos=='left bottom'||pos=='bottom left')return{xrel:0,yrel:1,zoom:zoom};if(pos=='center top'||pos=='top center')return{xrel:.5,yrel:0,zoom:zoom};if(pos=='center center')return{xrel:.5,yrel:.5,zoom:zoom};if(pos=='center bottom'||pos=='bottom center')return{xrel:.5,yrel:1,zoom:zoom};if(pos=='right top'||pos=='top right')return{xrel:1,yrel:0,zoom:zoom};if(pos=='right center'||pos=='center right')return{xrel:1,yrel:.5,zoom:zoom};if(pos=='right bottom'||pos=='bottom right')return{xrel:1,yrel:1,zoom:zoom};return{xrel:parseInt(tokens[0].match(/^(\d+)%$/)[1])/100,yrel:parseInt(tokens[1].match(/^(\d+)%$/)[1])/100,zoom:zoom};}
function position_to_css(p,phase){switch(phase){case 1:var pos=0;break;case 2:var pos=fade_ms/(p.time_ms+2*fade_ms);break;case 3:var pos=1-fade_ms/(p.time_ms+2*fade_ms);break;case 4:var pos=1;break;}
return{left:Math.round(p.from.left+pos*(p.to.left-p.from.left)),top:Math.round(p.from.top+pos*(p.to.top-p.from.top)),width:Math.round(p.from.width+pos*(p.to.width-p.from.width)),height:Math.round(p.from.height+pos*(p.to.height-p.from.height))};}
if(!opts.fade)
abort('missing fade parameter.');if(opts.speed&&opts.sleep)
abort('you cannot set both speed and sleep at the same time.');var fade_ms=Math.round(opts.fade*1000);if(opts.sleep)
var sleep=Math.round(opts.sleep*1000);if(opts.stopandgo)
var stopandgo=true;if(opts.speed)
var speed=opts.speed/1000,fade_px=Math.round(fade_ms*speed);self.empty().css({overflow:'hidden',padding:0});if(!/^(absolute|relative|fixed)$/.test(self.css('position')))
self.css({position:'relative'});if(!self.width()||!self.height())
abort('container element does not have its own width and height');if(opts.shuffle)
plan.sort(function(){return Math.random()-0.5;});for(var i=0;i<plan.length;++i){var p=plan[i];if(!p.src)
abort('missing src parameter in picture {0}.',i+1);if(speed){switch(p.dir){case'up':p.from={xrel:.5,yrel:0,zoom:1};p.to={xrel:.5,yrel:1,zoom:1};var slide_px=p.height-self_height-2*fade_px;break;case'down':p.from={xrel:.5,yrel:1,zoom:1};p.to={xrel:.5,yrel:0,zoom:1};var slide_px=p.height-self_height-2*fade_px;break;case'left':p.from={xrel:0,yrel:.5,zoom:1};p.to={xrel:1,yrel:.5,zoom:1};var slide_px=p.width-self_width-2*fade_px;break;case'right':p.from={xrel:1,yrel:.5,zoom:1};p.to={xrel:0,yrel:.5,zoom:1};var slide_px=p.width-self_width-2*fade_px;break;default:abort('missing or malformed "dir" parameter in picture {0}.',i+1);}
if(slide_px<=0)
abort('picture number {0} is too short for the desired fade duration.',i+1);p.time_ms=Math.round(slide_px/speed);if(p.time)p.time_ms=p.time_ms*p.time;}else if(!sleep){if(!p.from||!p.to||!p.time)
abort('missing either speed/sleep option, or from/to/time params in picture {0}.',i+1);try{p.from=parse_position_param(p.from)}catch(e){abort('malformed "from" parameter in picture {0}.',i+1);}
try{p.to=parse_position_param(p.to)}catch(e){abort('malformed "to" parameter in picture {0}.',i+1);}
if(!p.time)
abort('missing "time" parameter in picture {0}.',i+1);p.time_ms=Math.round(p.time*1000)}
if(p.from)
jQuery.each([p.from,p.to],function(i,from_to){from_to.width=Math.round(p.width*from_to.zoom);from_to.height=Math.round(p.height*from_to.zoom);from_to.left=Math.round((self_width-from_to.width)*from_to.xrel);from_to.top=Math.round((self_height-from_to.height)*from_to.yrel);});var elm;if(p.href)
elm=jQuery(format('<a href="{0}"><img src="{1}"/></a>',p.href,p.src));else
elm=jQuery(format('<img src="{0}"/>',p.src));if(p.onclick)
elm.click(p.onclick);if(p.alt)
elm.find('img').attr('alt',p.alt);elm.appendTo(self);}
speed=undefined;var imgs=self.find('img').css({position:'absolute',visibility:'hidden',top:0,left:0,border:0});imgs.eq(0).css({visibility:'visible'});if(!sleep)
imgs.eq(0).css(position_to_css(plan[0],2));var countdown=opts.loop;function create_chain(i,chainf){if(i%2==0){if(sleep){var i_sleep=i/2,i_hide=(i_sleep-1+plan.length)%plan.length,img_sleep=imgs.eq(i_sleep),img_hide=imgs.eq(i_hide);var newf=function(){img_hide.css('visibility','hidden');setTimeout(chainf,sleep);};}else{var i_slide=i/2,i_hide=(i_slide-1+plan.length)%plan.length,img_slide=imgs.eq(i_slide),img_hide=imgs.eq(i_hide),time=plan[i_slide].time_ms,slide_anim=position_to_css(plan[i_slide],3);var newf=function(){img_hide.css('visibility','hidden');img_slide.animate(slide_anim,time,'linear',chainf);};}}else{if(sleep){var i_from=Math.floor(i/2),i_to=Math.ceil(i/2)%plan.length,img_from=imgs.eq(i_from),img_to=imgs.eq(i_to),from_anim={},to_init={visibility:'visible'},to_anim={};if(i_to>i_from){to_init.opacity=0;to_anim.opacity=1;}else{from_anim.opacity=0;}
var newf=function(){img_to.css(to_init);if(from_anim.opacity!=undefined)
img_from.animate(from_anim,fade_ms,'linear',chainf);else
img_to.animate(to_anim,fade_ms,'linear',chainf);};}else{var i_from=Math.floor(i/2),i_to=Math.ceil(i/2)%plan.length,img_from=imgs.eq(i_from),img_to=imgs.eq(i_to),from_anim=position_to_css(plan[i_from],4),to_init=position_to_css(plan[i_to],1),to_anim=position_to_css(plan[i_to],2);if(i_to>i_from){to_init.opacity=0;to_anim.opacity=1;}else{from_anim.opacity=0;}
to_init.visibility='visible';var newf=function(){img_from.animate(from_anim,fade_ms,'linear');img_to.css(to_init);img_to.animate(to_anim,fade_ms,'linear',chainf);};}}
if(opts.loop&&i==plan.length*2-2){var newf_orig=newf;newf=function(){if(--countdown)newf_orig();}}
if(i>0)
return create_chain(i-1,newf);else{return newf;}}
if(stopandgo)
{var animation=create_chain(plan.length*2-2,function(){return setTimeout("change(1)");});}
else
{var animation=create_chain(plan.length*2-1,function(){return animation();});}
animation();});return self;};(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";var getData=function(data){if(typeof data!="string")return data;if(data.indexOf('{')<0){data=eval("("+data+")");}}
var getObject=function(data){if(typeof data!="string")return data;data=eval("("+data+")");return data;}
if(settings.type=="html5"){var object={};$(elem.attributes).each(function(){var name=this.nodeName;if(name.match(/^data-/))name=name.replace(/^data-/,'');else return true;object[name]=getObject(this.nodeValue);});}else{if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)
data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);if(e.length)
data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)
data=attr;}
object=getObject(data.indexOf("{")<0?"{"+data+"}":data);}
$.data(elem,settings.single,object);return object;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);(function($,undefined){$.fn.autoComplete=function(){var args=Slice.call(arguments),self=this,first=args.shift(),isMethod=(typeof first==='string');if(isMethod)first=first.replace('.','-');args=first==='button-supply'||first==='direct-supply'?$.isArray(args[0])&&$.isArray(args[0][0])?args[0]:args:args[1]===undefined&&$.isArray(args[0])?args[0]:args;return isMethod?$(self)[first==='option'&&args.length<2?'triggerHandler':'trigger']('autoComplete.'+first,args):first&&first[$.expando]?$(self).trigger(first,args):AutoCompleteFunction.call(self,first);};$.fn.bgiframe=$.fn.bgiframe?$.fn.bgiframe:$.fn.bgIframe?$.fn.bgIframe:function(){return this;};$.expando=$.expando!==undefined?$.expando:(function(){var event=$.Event('keyup'),i;for(i in event)
if(i.indexOf('jQuery')===0)
return i;return'jQuery'+event.timeStamp;})();function now(){return(new Date).getTime();}
var
TRUE=true,FALSE=false,Slice=Array.prototype.slice,AutoComplete=$.autoComplete={counter:0,length:0,stack:{},order:[],hasFocus:FALSE,getFocus:function(){return this.order[0]?this.stack[this.order[0]]:undefined;},getPrevious:function(){for(var i=1,l=this.order.length;i<l;i++)
if(this.order[i])
return this.stack[this.order[i]];return undefined;},remove:function(i){for(var k=0,l=this.order.length;k<l;k++)
if(this.order[k]===i)
this.order[k]=undefined;this.stack[i]=undefined;this.length--;delete this.stack[i];},getAll:function(){for(var i=0,l=this.counter,stack=[];i<l;i++)
if(this.stack[i])
stack.push(this.stack[i]);return $(stack);},defaults:{backwardsCompatible:FALSE,ajax:'/ajax/autocomplete/autocomplete.php/',ajaxCache:$.ajaxSettings.cache,dataSupply:[],dataFn:undefined,dataName:'ac-data',list:'auto-complete-list',rollover:'auto-complete-list-rollover',width:undefined,striped:undefined,maxHeight:undefined,newList:FALSE,postVar:'value',postData:{},minChars:1,maxItems:-1,maxRequests:0,requestType:'POST',inputControl:undefined,autoFill:FALSE,nonInput:undefined,multiple:FALSE,multipleSeparator:' ',onBlur:undefined,onFocus:undefined,onHide:undefined,onLoad:undefined,onMaxRequest:function(){},onRollover:undefined,onSelect:function(){$('#formsearch').submit()},onShow:undefined,onSubmit:function(){return TRUE;},spinner:undefined,preventEnterSubmit:FALSE,delay:0,useCache:TRUE,cacheLimit:50}},AutoCompleteFunction=function(options){return this.each(function(){var
self=this,$input=$(self).attr('autocomplete','off'),Active=TRUE,LastEvent={},inputval='',$elems={length:0},$li,view,ulHeight,liHeight,liPerView,ulOpen=FALSE,timeid,xhr,liFocus=-1,liData,separator,inputIndex=(function(){AutoComplete.length++;return++AutoComplete.counter;})(),requests=0,cache={length:0,val:undefined,list:{}},settings=$.extend({width:$input.outerWidth()-2},AutoComplete.defaults,options||{},$.metadata?$input.metadata():{}),$ul=!settings.newList&&$('ul.'+settings.list)[0]?$('ul.'+settings.list).eq(0).bgiframe().data('autoComplete',TRUE):$('<ul/>').appendTo('body').addClass(settings.list).bgiframe().hide().data('ac-selfmade',TRUE).data('autoComplete',TRUE),$doc=$(document).bind('click.autoComplete-'+inputIndex,function(event){var $elem;if(Active&&ulOpen&&(!LastEvent||event.timeStamp-LastEvent.timeStamp>200)&&($elem=$(event.target)).closest('ul').data('ac-input-index')!==inputIndex&&$elem.data('ac-input-index')!==inputIndex){$ul.hide(event);$input.blur();}
LastEvent=event;});newUl();settings.requestType=settings.requestType.toUpperCase();separator=settings.multiple?settings.multipleSeparator:undefined;AutoComplete.stack[inputIndex]=self;$input.data('autoComplete',TRUE).data('ac-input-index',inputIndex).data('ac-active',Active).data('ac-initial-settings',$.extend(TRUE,{},settings)).data('ac-settings',settings).bind(window.opera?'keypress.autoComplete':'keydown.autoComplete',function(event){if(!Active)return TRUE;var key=(LastEvent=event).keyCode,enter=FALSE;if(key==9&&ulOpen){select(event);}
else if(key==13&&$li){enter=settings.preventEnterSubmit&&ulOpen?FALSE:TRUE;select(event);}
else if(key==38){if(liFocus>0){liFocus--;up(event);}else{liFocus=-1;$input.val(inputval);$ul.hide(event);}}
else if(key==40){if(liFocus<$elems.length-1){liFocus++;down(event);}}
else if(key==33){if(liFocus>0){liFocus-=liPerView;if(liFocus<0)liFocus=0;up(event);}}
else if(key==34){if(liFocus<$elems.length-1){liFocus+=liPerView;if(liFocus>$elems.length-1)liFocus=$elems.length-1;down(event);}}
else if(settings.nonInput&&$.inArray(key,settings.nonInput)){$ul.html('').hide(event);}
else{return TRUE;}
LastEvent[$.expando+'_autoComplete_keydown']=TRUE;return enter;}).bind('keyup.autoComplete',function(event){if(!Active||LastEvent[$.expando+'_autoComplete_keydown'])return TRUE;inputval=$input.val();var key=(LastEvent=event).keyCode,val=separator?inputval.split(separator).pop():inputval;if(key!=13){cache.val=settings.inputControl===undefined?val:settings.inputControl.apply(self,settings.backwardsCompatible?[val,key,$ul,event]:[event,{val:val,key:key,ul:$ul}]);if(cache.val.length>=settings.minChars)
sendRequest(event,settings,cache,(key==8||key==32));else if(key==8)
$ul.html('').hide(event);}}).bind('blur.autoComplete',function(event){if(!Active||ulOpen)return TRUE;LastEvent=event;$input.data('ac-hasFocus',FALSE);liFocus=-1;if(AutoComplete.order[0]!==undefined)
AutoComplete.order.unshift(undefined);AutoComplete.hasFocus=FALSE;$ul.hide(event);if(settings.onBlur)settings.onBlur.apply(self,settings.backwardsCompatible?[inputval,$ul,event]:[event,{val:inputval,ul:$ul}]);}).bind('focus.autoComplete',function(event,flag){if(!Active||(AutoComplete.focus===inputIndex&&flag===$.expando+'_autoComplete')||LastEvent[$.expando+'_autoComplete_enter'])
return TRUE;LastEvent=event;if(inputIndex!=$ul.data('ac-input-index'))
$ul.html('').hide(event);$input.data('ac-hasFocus',TRUE);if(AutoComplete.order[0]===undefined){if(AutoComplete.order[1]===inputIndex)
AutoComplete.order.shift();else
AutoComplete.order[0]=inputIndex;}
else if(AutoComplete.order[0]!=inputIndex&&AutoComplete.order[1]!=inputIndex)
AutoComplete.order.unshift(inputIndex);if(AutoComplete.order.length>AutoComplete.defaults.cacheLimit)
AutoComplete.order.pop();AutoComplete.hasFocus=TRUE;if(settings.onFocus)settings.onFocus.apply(self,settings.backwardsCompatible?[$ul,event]:[event,{ul:$ul}]);}).bind('autoComplete.settings',function(event,newSettings){if(!Active)return TRUE;if($.isFunction(newSettings)){var ret=newSettings.apply(self,settings.backwardsCompatible?[settings,cache,$ul,event]:[event,{settings:settings,cache:cache,ul:$ul}]);if($.isArray(ret)&&ret[0]!==undefined){settings=$.extend(TRUE,{},settings,ret[0]||settings);cache=$.extend(TRUE,{},cache,ret[1]||cache);}}else{settings=$.extend(TRUE,{},settings,newSettings||{});}
settings.requestType=settings.requestType.toUpperCase();separator=settings.multiple?settings.multipleSeparator:undefined;$input.data('ac-settings',settings);$ul=!settings.newList&&$ul.hasClass(settings.list)?$ul:!settings.newList&&$('ul.'+settings.list)[0]?$('ul.'+settings.list).bgiframe().data('autoComplete',TRUE):$('<ul/>').appendTo('body').addClass(settings.list).bgiframe().hide().data('ac-selfmade',TRUE).data('autoComplete',TRUE);newUl();return LastEvent=event;}).bind('autoComplete.flush',function(event,cacheOnly){if(!Active)return TRUE;cache={length:0,val:undefined,list:{}};if(!cacheOnly)requests=0;return LastEvent=event;}).bind('autoComplete.button-ajax',function(event,postData,cacheName){if(!Active)return TRUE;LastEvent=event;$input.trigger('focus',[$.expando+'_autoComplete']);if(typeof postData==='string'){cacheName=postData;postData={};}
cache.val=cacheName||'NON_404_<>!@$^&';return sendRequest(event,$.extend(TRUE,{},settings,{maxItems:-1,postData:postData||{}}),cache);}).bind('autoComplete.button-supply',function(event,data,cacheName){if(!Active)return TRUE;LastEvent=event;$input.trigger('focus',[$.expando+'_autoComplete']);if(typeof data==='string'){cacheName=data;data=undefined;}
cache.val=cacheName||'NON_404_SUPPLY_<>!@$^&';data=$.isArray(data)&&data.length?data:settings.dataSupply;return sendRequest(event,$.extend(TRUE,{},settings,{maxItems:-1,dataSupply:data,dataFn:function(){return TRUE;}}),cache);}).bind('autoComplete.direct-supply',function(event,data,cacheName){if(!Active)return TRUE;LastEvent=event;$input.trigger('focus',[$.expando+'_autoComplete']);if(typeof data==='string'){cacheName=data;data=undefined;}
cache.val=cacheName||'NON_404_SUPPLY_<>!@$^&';data=$.isArray(data)&&data.length?data:settings.dataSupply;return loadResults(event,data,$.extend(TRUE,{},settings,{maxItems:-1,dataSupply:data,dataFn:function(){return TRUE;}}),cache);}).bind('autoComplete.search',function(event,value){if(!Active)return TRUE;cache.val=value||'';return sendRequest(LastEvent=event,settings,cache);}).bind('autoComplete.option',function(event){if(!Active)return TRUE;LastEvent=event;var args=Slice.call(arguments),length=args.length;return length==3?(function(){settings[args[1]]=args[2];$input.data('ac-settings',settings);return args[2];})():length==2?(function(){switch(args[1]){case'ul':return $ul;case'cache':return cache;case'xhr':return xhr;case'input':return $input;default:return settings[args[1]]||undefined;}})():settings;}).bind('autoComplete.enable',function(event){$input.data('ac-active',Active=TRUE);return LastEvent=event;}).bind('autoComplete.disable',function(event){$input.data('ac-active',Active=FALSE);$ul.html('').hide(event);return LastEvent=event;}).bind('autoComplete.destroy',function(event){$input.removeData('autoComplete').removeData('ac-input-index').removeData('ac-initial-settings').removeData('ac-settings').removeData('ac-active').unbind('.autoComplete').unbind('autoComplete.'+['settings','flush','button-ajax','button-supply','direct-supply','search','option','enable','disable','destroy'].join(' autoComplete.')).parents('form').eq(0).unbind('submit.autoComplete-'+inputIndex);$doc.unbind('click.autoComplete-'+inputIndex);AutoComplete.remove(inputIndex);Active=FALSE;var list=$ul.html('').hide(event).data('ac-inputs'),i;list[inputIndex]=undefined;for(i in list)
if(list[i]===TRUE)
return LastEvent=event;if($ul.data('ac-selfmade')===TRUE)$ul.remove();return LastEvent=event;}).parents('form').eq(0).bind('submit.autoComplete-'+inputIndex,function(event){if(!Active)return TRUE;var flag=LastEvent[$.expando+'_autoComplete_enter']||FALSE;LastEvent=event;return settings.preventEnterSubmit?(ulOpen||flag)?FALSE:settings.onSubmit.call(self,event,{form:this,ul:$ul}):settings.onSubmit.call(self,event,{form:this,ul:$ul});});function sendRequest(event,settings,cache,backSpace,timeout){if(settings.spinner)settings.spinner.call(self,event,{active:TRUE,ul:$ul});if(timeid)timeid=clearTimeout(timeid);if(settings.delay>0&&timeout===undefined)return timeid=setTimeout(function(){sendRequest(event,settings,cache,backSpace,TRUE);timeid=clearTimeout(timeid);},settings.delay);if(xhr)xhr.abort();if(settings.useCache&&cache.list[cache.val])
return loadResults(event,cache.list[cache.val],settings,cache,backSpace);if(settings.dataSupply.length)
return userSuppliedData(event,settings,cache,backSpace);if(settings.maxRequests&&++requests>=settings.maxRequests){$ul.html('').hide(event);if(settings.spinner)settings.spinner.call(self,event,{active:FALSE,ul:$ul});return requests>settings.maxRequests?FALSE:settings.onMaxRequest.apply(self,settings.backwardsCompatible?[cache.val,$ul,event,inputval]:[event,{search:cache.val,val:inputval,ul:$ul}]);}
settings.postData[settings.postVar]=cache.val
return xhr=$.ajax({type:settings.requestType,url:settings.ajax,data:settings.postData,dataType:'json',cache:settings.ajaxCache,success:function(list){loadResults(event,list,settings,cache,backSpace);},error:function(){$ul.html('').hide(event);if(settings.spinner)settings.spinner.call(self,event,{active:FALSE,ul:$ul});}});}
function userSuppliedData(event,settings,cache,backSpace){var list=[],args=[],fn=$.isFunction(settings.dataFn),regex=fn?undefined:new RegExp('^'+cache.val,'i'),k=0,entry,i=0,l=settings.dataSupply.length;for(;i<l;i++){entry=settings.dataSupply[i];entry=typeof entry==='object'&&entry.value?entry:{value:entry};args=settings.backwardsCompatible?[cache.val,entry.value,list,i,settings.dataSupply,$ul,event]:[event,{val:cache.val,entry:entry.value,list:list,i:i,supply:settings.dataSupply,ul:$ul}];if((fn&&settings.dataFn.apply(self,args))||(!fn&&entry.value.match(regex))){if(settings.maxItems>-1&&++k>settings.maxItems)
break;list.push(entry);}}
return loadResults(event,list,settings,cache,backSpace);}
function select(event){if(ulOpen){if(settings.onSelect)settings.onSelect.apply(self,settings.backwardsCompatible?[liData,$li,$ul,event]:[event,{data:liData,li:$li,ul:$ul}]);autoFill(undefined);inputval=$input.val();if(LastEvent.type=='keydown')LastEvent[$.expando+'_autoComplete_enter']=TRUE;}
$ul.hide(event);return $li;}
function up(event){if($li)$li.removeClass(settings.rollover);$ul.show(event);$li=$elems.eq(liFocus).addClass(settings.rollover);liData=$li.data(settings.dataName);if(!$li.length||!liData)return FALSE;autoFill(liData.value||'');if(settings.onRollover)settings.onRollover.apply(self,settings.backwardsCompatible?[liData,$li,$ul,event]:[event,{data:liData,li:$li,ul:$ul}]);var v=liFocus*liHeight;if(v<view-ulHeight){view=v+ulHeight
$ul.scrollTop(v);}
return $li;}
function down(event){if($li)$li.removeClass(settings.rollover);$ul.show(event);$li=$elems.eq(liFocus).addClass(settings.rollover);liData=$li.data(settings.dataName);if(!$li.length||!liData)return FALSE;autoFill(liData.value||'');var v=(liFocus+1)*liHeight;if(v>view)
$ul.scrollTop((view=v)-ulHeight);if(settings.onRollover)settings.onRollover.apply(self,settings.backwardsCompatible?[liData,$li,$ul,event]:[event,{data:liData,li:$li,ul:$ul}]);return $li;}
function newUl(){if(!$ul[$.expando+'_autoComplete']){var hide=$ul.hide,show=$ul.show;$ul.hide=function(event,speed,callback){if(settings.onHide&&ulOpen){settings.onHide.call(self,event,{ul:$ul});LastEvent[$.expando+'_autoComplete_hide']=TRUE;}
ulOpen=FALSE;return hide.call($ul,speed,callback);};$ul.show=function(event,speed,callback){if(settings.onShow&&!ulOpen)settings.onShow.call(self,event,{ul:$ul});ulOpen=TRUE;return show.call($ul,speed,callback);};$ul[$.expando+'_autoComplete']=TRUE;}
var list=$ul.data('ac-inputs')||{};list[inputIndex]=TRUE;return $ul.data('ac-inputs',list);}
function autoFill(val){if(val===undefined){var start,end;start=end=$input.val().length;}else{if(separator)val=inputval.substr(0,inputval.length-inputval.split(separator).pop().length)+val+separator;var start=inputval.length,end=val.length;$input.val(val);}
if(!settings.autoFill||start>end){return FALSE;}
else if(self.createTextRange){var range=self.createTextRange();if(val===undefined){range.move('character',start);range.select();}else{range.collapse(TRUE);range.moveStart("character",start);range.moveEnd("character",end);range.select();}}
else if(self.setSelectionRange){self.setSelectionRange(start,end);}
else if(self.selectionStart){self.selectionStart=start;self.selectionEnd=end;}
return TRUE;}
function loadResults(event,list,settings,cache,backSpace){if(settings.onLoad)list=settings.onLoad.call(self,event,{list:list,settings:settings,cache:cache,ul:$ul});if(settings.spinner)settings.spinner.call(self,event,{active:FALSE,ul:$ul});if(settings.useCache&&cache.list[cache.val]===undefined){cache.length++;cache.list[cache.val]=list;if(cache.length>settings.cacheLimit){cache.list={};cache.length=0;}}
if(!list||list.length<1)
return $ul.html('').hide(event);liFocus=-1;var offset=$input.offset(),container=[],aci=0,k=0,i=0,even=FALSE,length=list.length;for(;i<length;i++){if(list[i].value){if(settings.maxItems>-1&&++aci>settings.maxItems)
break;container.push(settings.striped&&even?'<li class="'+settings.striped+'">':'<li>',list[i].display||list[i].value,'</li>');even=!even;}}
$elems=$ul.html(container.join('')).children('li');for(length=$elems.length;k<length;k++){$.data($elems[k],settings.dataName,list[k]);$.data($elems[k],'ac-index',k);}
if(settings.autoFill&&!backSpace){liFocus=0;liData=list[0];autoFill(liData.value||'');$li=$elems.eq(0).addClass(settings.rollover);}
$ul.unbind('.autoComplete').data('ac-input-index',inputIndex).bind('mouseout.autoComplete',function(){$li.removeClass(settings.rollover);}).bind('mouseover.autoComplete',function(event){$li=$(event.target).closest('li');if($li.length<1)return FALSE;$elems.filter('.'+settings.rollover).removeClass(settings.rollover);liFocus=$li.addClass(settings.rollover).data('ac-index');liData=$li.data(settings.dataName);if(settings.onRollover)settings.onRollover.apply(self,settings.backwardsCompatible?[liData,$li,$ul,event]:[event,{data:liData,li:$li,ul:$ul}]);}).bind('click.autoComplete',function(event){$input.trigger('focus',[$.expando+'_autoComplete']);liData=$li.data(settings.dataName);$input.val(inputval=separator?inputval.substr(0,inputval.length-inputval.split(separator).pop().length)+liData.value+separator:liData.value);$ul.hide(event);autoFill(undefined);if(settings.onSelect)settings.onSelect.apply(self,settings.backwardsCompatible?[liData,$li,$ul,event]:[event,{data:liData,li:$li,ul:$ul}]);}).css({top:offset.top+$input.outerHeight(),left:offset.left,width:settings.width}).scrollTop(0);if(settings.maxHeight)$ul.css({height:liHeight*$elems.length>settings.maxHeight?settings.maxHeight:'auto',overflow:'auto'});ulHeight=$ul.show(event).outerHeight();view=ulHeight;liHeight=$elems.eq(0).outerHeight();liPerView=Math.floor(view/liHeight);LastEvent.timeStamp=now();return $ul;}});};})(jQuery);$(document).ready(function(){$('input[name=words]').autoComplete();});function polls_submit()
{vars=get_form_str('polls_form');ajax_url='/ajax/polls/polls.html';$.ajax({url:ajax_url,data:vars,cache:false,success:function(html){$("#polls_div").html(html);}});}
(function($){var ver="2.72";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){if($.fn.cycle.debug){log(s);}}function log(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "));}}$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}return this.each(function(){var opts=handleArguments(this,options,arg2);if(opts===false){return;}if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=this.cyclePause=0;var $cont=$(this);var $slides=opts.slideExpr?$(opts.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts2=buildOptions($cont,$slides,els,opts,o);if(opts2===false){return;}var startTime=opts2.continuous?10:getTimeout(opts2.currSlide,opts2.nextSlide,opts2,!opts2.rev);if(startTime){startTime+=(opts2.delay||0);if(startTime<10){startTime=10;}debug("first timeout: "+startTime);this.cycleTimeout=setTimeout(function(){go(els,opts2,0,!opts2.rev);},startTime);}});};function handleArguments(cont,options,arg2){if(cont.cycleStop==undefined){cont.cycleStop=0;}if(options===undefined||options===null){options={};}if(options.constructor==String){switch(options){case"stop":cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);}cont.cycleTimeout=0;$(cont).removeData("cycle.opts");return false;case"pause":cont.cyclePause=1;return false;case"resume":cont.cyclePause=0;if(arg2===true){options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}go(options.elements,options,1,1);}return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}if(typeof arg2=="string"){options.oneTimeFx=arg2;}go(options.elements,options,1,num>=options.currSlide);return false;}}return options;}function removeFilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeAttribute("filter");}catch(smother){}}}function buildOptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopCount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopCount=cont.cycleStop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removeFilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,!opts.rev);});}saveOriginalOpts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingSlide){opts.startingSlide=parseInt(opts.startingSlide);}if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++){opts.randomMap.push(i);}opts.randomMap.sort(function(a,b){return Math.random()-0.5;});opts.randomIndex=0;opts.startingSlide=opts.randomMap[0];}else{if(opts.startingSlide>=els.length){opts.startingSlide=0;}}opts.currSlide=opts.startingSlide=opts.startingSlide||0;var first=opts.startingSlide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z=first?i>=first?els.length-(i-first):first-i:els.length-i;$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removeFilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}var reshape=opts.containerResize&&!$cont.innerHeight();if(reshape){var maxw=0,maxh=0;for(var j=0;j<els.length;j++){var $e=$(els[j]),e=$e[0],w=$e.outerWidth(),h=$e.outerHeight();if(!w){w=e.offsetWidth;}if(!h){h=e.offsetHeight;}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh;}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}}if(opts.pause){$cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});}if(supportMultiTransitions(opts)===false){return false;}var requeue=false;options.requeueAttempts=options.requeueAttempts||0;$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:$el.height();this.cycleW=(opts.fit&&opts.width)?opts.width:$el.width();if($el.is("img")){var loadingIE=($.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var loadingFF=($.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var loadingOp=($.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var loadingOther=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(loadingIE||loadingFF||loadingOp||loadingOther){if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts<100){log(options.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){$(o.s,o.c).cycle(options);},opts.requeueTimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cycleW,this.cycleH);}}}return true;});if(requeue){return false;}opts.cssBefore=opts.cssBefore||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(":eq("+first+")").css(opts.cssBefore);if(opts.cssFirst){$($slides[first]).css(opts.cssFirst);}if(opts.timeout){opts.timeout=parseInt(opts.timeout);if(opts.speed.constructor==String){opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed);}if(!opts.sync){opts.speed=opts.speed/2;}while((opts.timeout-opts.speed)<250){opts.timeout+=opts.speed;}}if(opts.easing){opts.easeIn=opts.easeOut=opts.easing;}if(!opts.speedIn){opts.speedIn=opts.speed;}if(!opts.speedOut){opts.speedOut=opts.speed;}opts.slideCount=els.length;opts.currSlide=opts.lastSlide=first;if(opts.random){opts.nextSlide=opts.currSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1;}if(!opts.multiFx){var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multiFx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true]);}if(opts.next){$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?-1:1);});}if(opts.prev){$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?1:-1);});}if(opts.pager){buildPager(els,opts);}exposeAddSlide(opts,els);return opts;}function saveOriginalOpts(opts){opts.original={before:[],after:[]};opts.original.cssBefore=$.extend({},opts.cssBefore);opts.original.cssAfter=$.extend({},opts.cssAfter);opts.original.animIn=$.extend({},opts.animIn);opts.original.animOut=$.extend({},opts.animOut);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportMultiTransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexOf(",")>0){opts.multiFx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];tx=txs[fx];if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("No valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multiFx=true;opts.fxs=[];for(p in txs){tx=txs[p];if(txs.hasOwnProperty(p)&&$.isFunction(tx)){opts.fxs.push(p);}}}}if(opts.multiFx&&opts.randomizeEffects){var r1=Math.floor(Math.random()*20)+30;for(i=0;i<r1;i++){var r2=Math.floor(Math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}debug("randomized fx sequence: ",opts.fxs);}return true;}function exposeAddSlide(opts,els){opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slideCount=els.length;$s.css("position","absolute");$s[prepend?"prependTo":"appendTo"](opts.$cont);if(prepend){opts.currSlide++;opts.nextSlide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager){$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);}if($.isFunction(opts.onAddSlide)){opts.onAddSlide($s);}else{$s.hide();}};}$.fn.cycle.resetState=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssBefore=$.extend({},opts.original.cssBefore);opts.cssAfter=$.extend({},opts.original.cssAfter);opts.animIn=$.extend({},opts.original.animIn);opts.animOut=$.extend({},opts.original.animOut);opts.fxFn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isFunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){if(manual&&opts.busy&&opts.manualTrump){$(els).stop(true,true);opts.busy=false;}if(opts.busy){return;}var p=opts.$cont[0],curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual){return;}if(!manual&&!p.cyclePause&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end){opts.end(opts);}return;}if(manual||!p.cyclePause){var fx=opts.fx;curr.cycleH=curr.cycleH||$(curr).height();curr.cycleW=curr.cycleW||$(curr).width();next.cycleH=next.cycleH||$(next).height();next.cycleW=next.cycleW||$(next).width();if(opts.multiFx){if(opts.lastFx==undefined||++opts.lastFx>=opts.fxs.length){opts.lastFx=0;}fx=opts.fxs[opts.lastFx];opts.currFx=fx;}if(opts.oneTimeFx){fx=opts.oneTimeFx;opts.oneTimeFx=null;}$.fn.cycle.resetState(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){$.each(opts.after,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});};if(opts.nextSlide!=opts.currSlide){opts.busy=1;if(opts.fxFn){opts.fxFn(curr,next,opts,after,fwd);}else{if($.isFunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after);}else{$.fn.cycle.custom(curr,next,opts,after,manual&&opts.fastOnEvent);}}}opts.lastSlide=opts.currSlide;if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{var roll=(opts.nextSlide+1)==els.length;opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}if(opts.pager){$.fn.cycle.updateActivePagerLink(opts.pager,opts.currSlide);}}var ms=0;if(opts.timeout&&!opts.continuous){ms=getTimeout(curr,next,opts,fwd);}else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev);},ms);}}$.fn.cycle.updateActivePagerLink=function(pager,currSlide){$(pager).find("a").removeClass("activeSlide").filter("a:eq("+currSlide+")").addClass("activeSlide");};function getTimeout(curr,next,opts,fwd){if(opts.timeoutFn){var t=opts.timeoutFn(curr,next,opts,fwd);while((t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,opts.rev?-1:1);};$.fn.cycle.prev=function(opts){advance(opts,opts.rev?1:-1);};function advance(opts,val){var els=opts.elements;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2){opts.randomIndex=els.length-2;}else{if(opts.randomIndex==-1){opts.randomIndex=els.length-1;}}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.random){if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap){return false;}opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){if(opts.nowrap){return false;}opts.nextSlide=0;}}}}if($.isFunction(opts.prevNextClick)){opts.prevNextClick(val>0,opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,val>=0);return false;}function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});$.fn.cycle.updateActivePagerLink(opts.pager,opts.startingSlide);}$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a;if($.isFunction(opts.pagerAnchorBuilder)){a=opts.pagerAnchorBuilder(i,el);}else{a='<a href="#">'+(i+1)+"</a>";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone);});$a=$(arr);}else{$a.appendTo($p);}}$a.bind(opts.pagerEvent,function(e){e.preventDefault();opts.nextSlide=i;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if($.isFunction(opts.pagerClick)){opts.pagerClick(opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,opts.currSlide<i);return false;});if(opts.pagerEvent!="click"){$a.click(function(){return false;});}if(opts.pauseOnPagerHover){$a.hover(function(){opts.$cont[0].cyclePause++;},function(){opts.$cont[0].cyclePause--;});}};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd){hops=c>l?c-l:opts.slideCount-l;}else{hops=c<l?l-c:l+opts.slideCount-c;}return hops;};function clearTypeFix($slides){function hex(s){s=parseInt(s).toString(16);return s.length<2?"0"+s:s;}function getBg(e){for(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){var v=$.css(e,"background-color");if(v.indexOf("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getBg(this));});}$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();opts.cssBefore.opacity=1;opts.cssBefore.display="block";if(w!==false&&next.cycleW>0){opts.cssBefore.width=next.cycleW;}if(h!==false&&next.cycleH>0){opts.cssBefore.height=next.cycleH;}opts.cssAfter=opts.cssAfter||{};opts.cssAfter.display="none";$(curr).css("zIndex",opts.slideCount+(rev===true?1:0));$(next).css("zIndex",opts.slideCount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,speedOverride){var $l=$(curr),$n=$(next);var speedIn=opts.speedIn,speedOut=opts.speedOut,easeIn=opts.easeIn,easeOut=opts.easeOut;$n.css(opts.cssBefore);if(speedOverride){if(typeof speedOverride=="number"){speedIn=speedOut=speedOverride;}else{speedIn=speedOut=1;}easeIn=easeOut=null;}var fn=function(){$n.animate(opts.animIn,speedIn,easeIn,cb);};$l.animate(opts.animOut,speedOut,easeOut,function(){if(opts.cssAfter){$l.css(opts.cssAfter);}if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.opacity=0;});opts.animIn={opacity:1};opts.animOut={opacity:0};opts.cssBefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,prevNextClick:null,prevNextEvent:"click",pager:null,pagerClick:null,pagerEvent:"click",pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!$.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250};})(jQuery);(function($){$.fn.cycle.transitions.none=function($cont,$slides,opts){opts.fxFn=function(curr,next,opts,after){$(next).show();$(curr).hide();after();};};$.fn.cycle.transitions.scrollUp=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssBefore={top:h,left:0};opts.cssFirst={top:0};opts.animIn={top:0};opts.animOut={top:-h};};$.fn.cycle.transitions.scrollDown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssFirst={top:0};opts.cssBefore={top:-h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.scrollLeft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:0-w};};$.fn.cycle.transitions.scrollRight=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:-w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.scrollHorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.left=fwd?(next.cycleW-1):(1-next.cycleW);opts.animOut.left=fwd?-curr.cycleW:curr.cycleW;});opts.cssFirst={left:0};opts.cssBefore={top:0};opts.animIn={left:0};opts.animOut={top:0};};$.fn.cycle.transitions.scrollVert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.top=fwd?(1-next.cycleH):(next.cycleH-1);opts.animOut.top=fwd?curr.cycleH:-curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0};opts.animIn={top:0};opts.animOut={left:0};};$.fn.cycle.transitions.slideX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;});opts.cssBefore={left:0,top:0,width:0};opts.animIn={width:"show"};opts.animOut={width:0};};$.fn.cycle.transitions.slideY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;});opts.cssBefore={left:0,top:0,height:0};opts.animIn={height:"show"};opts.animOut={height:0};};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var i,w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);});if(!opts.speedAdjusted){opts.speed=opts.speed/2;opts.speedAdjusted=true;}opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(i=0;i<$slides.length;i++){opts.els.push($slides[i]);}for(i=0;i<opts.currSlide;i++){opts.els.push(opts.els.shift());}opts.fxFn=function(curr,next,opts,cb,fwd){var $el=fwd?$(curr):$(next);$(next).css(opts.cssBefore);var count=opts.slideCount;$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){var hops=$.fn.cycle.hopsFromLast(opts,fwd);for(var k=0;k<hops;k++){fwd?opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop());}if(fwd){for(var i=0,len=opts.els.length;i<len;i++){$(opts.els[i]).css("z-index",len-i+count);}}else{var z=$(curr).css("z-index");$el.css("z-index",parseInt(z)+1+count);}$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb){cb();}});});};opts.cssBefore={display:"block",opacity:1,top:0,left:0};};$.fn.cycle.transitions.turnUp=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=next.cycleH;opts.animIn.height=next.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,height:0};opts.animIn={top:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnDown=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,top:0,height:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnLeft=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=next.cycleW;opts.animIn.width=next.cycleW;});opts.cssBefore={top:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.turnRight=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={top:0,left:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.zoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false,true);opts.cssBefore.top=next.cycleH/2;opts.cssBefore.left=next.cycleW/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};opts.animOut={width:0,height:0,top:curr.cycleH/2,left:curr.cycleW/2};});opts.cssFirst={top:0,left:0};opts.cssBefore={width:0,height:0};};$.fn.cycle.transitions.fadeZoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false);opts.cssBefore.left=next.cycleW/2;opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};});opts.cssBefore={width:0,height:0};opts.animOut={opacity:0};};$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.blindY=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.blindZ=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();var w=$cont.width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:w};opts.animIn={top:0,left:0};opts.animOut={top:h,left:w};};$.fn.cycle.transitions.growX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=this.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:0};});opts.cssBefore={width:0,top:0};};$.fn.cycle.transitions.growY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=this.cycleH/2;opts.animIn={top:0,height:this.cycleH};opts.animOut={top:0};});opts.cssBefore={height:0,left:0};};$.fn.cycle.transitions.curtainX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true,true);opts.cssBefore.left=next.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:curr.cycleW/2,width:0};});opts.cssBefore={top:0,width:0};};$.fn.cycle.transitions.curtainY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false,true);opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,height:next.cycleH};opts.animOut={top:curr.cycleH/2,height:0};});opts.cssBefore={left:0,height:0};};$.fn.cycle.transitions.cover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);if(d=="right"){opts.cssBefore.left=-w;}else{if(d=="up"){opts.cssBefore.top=h;}else{if(d=="down"){opts.cssBefore.top=-h;}else{opts.cssBefore.left=w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.uncover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(d=="right"){opts.animOut.left=w;}else{if(d=="up"){opts.animOut.top=-h;}else{if(d=="down"){opts.animOut.top=h;}else{opts.animOut.left=-w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.toss=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(!opts.animOut.left&&!opts.animOut.top){opts.animOut={left:w*2,top:-h/2,opacity:0};}else{opts.animOut.opacity=0;}});opts.cssBefore={left:0,top:0};opts.animIn={left:0};};$.fn.cycle.transitions.wipe=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.cssBefore=opts.cssBefore||{};var clip;if(opts.clip){if(/l2r/.test(opts.clip)){clip="rect(0px 0px "+h+"px 0px)";}else{if(/r2l/.test(opts.clip)){clip="rect(0px "+w+"px "+h+"px "+w+"px)";}else{if(/t2b/.test(opts.clip)){clip="rect(0px "+w+"px 0px 0px)";}else{if(/b2t/.test(opts.clip)){clip="rect("+h+"px "+w+"px "+h+"px 0px)";}else{if(/zoom/.test(opts.clip)){var top=parseInt(h/2);var left=parseInt(w/2);clip="rect("+top+"px "+left+"px "+top+"px "+left+"px)";}}}}}}opts.cssBefore.clip=opts.cssBefore.clip||clip||"rect(0px 0px 0px 0px)";var d=opts.cssBefore.clip.match(/(\d+)/g);var t=parseInt(d[0]),r=parseInt(d[1]),b=parseInt(d[2]),l=parseInt(d[3]);opts.before.push(function(curr,next,opts){if(curr==next){return;}var $curr=$(curr),$next=$(next);$.fn.cycle.commonReset(curr,next,opts,true,true,false);opts.cssAfter.display="block";var step=1,count=parseInt((opts.speedIn/13))-1;(function f(){var tt=t?t-parseInt(step*(t/count)):0;var ll=l?l-parseInt(step*(l/count)):0;var bb=b<h?b+parseInt(step*((h-b)/count||1)):h;var rr=r<w?r+parseInt(step*((w-r)/count||1)):w;$next.css({clip:"rect("+tt+"px "+rr+"px "+bb+"px "+ll+"px)"});(step++<=count)?setTimeout(f,13):$curr.css("display","none");})();});opts.cssBefore={display:"block",opacity:1,top:0,left:0};opts.animIn={left:0};opts.animOut={left:0};};})(jQuery);(function($){$.toJSON=function(o)
{if(typeof(JSON)=='object'&&JSON.stringify)
return JSON.stringify(o);var type=typeof(o);if(o===null)
return"null";if(type=="undefined")
return undefined;if(type=="number"||type=="boolean")
return o+"";if(type=="string")
return $.quoteString(o);if(type=='object')
{if(typeof o.toJSON=="function")
return $.toJSON(o.toJSON());if(o.constructor===Date)
{var month=o.getUTCMonth()+1;if(month<10)month='0'+month;var day=o.getUTCDate();if(day<10)day='0'+day;var year=o.getUTCFullYear();var hours=o.getUTCHours();if(hours<10)hours='0'+hours;var minutes=o.getUTCMinutes();if(minutes<10)minutes='0'+minutes;var seconds=o.getUTCSeconds();if(seconds<10)seconds='0'+seconds;var milli=o.getUTCMilliseconds();if(milli<100)milli='0'+milli;if(milli<10)milli='0'+milli;return'"'+year+'-'+month+'-'+day+'T'+
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
if(o.constructor===Array)
{var ret=[];for(var i=0;i<o.length;i++)
ret.push($.toJSON(o[i])||"null");return"["+ret.join(",")+"]";}
var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number")
name='"'+k+'"';else if(type=="string")
name=$.quoteString(k);else
continue;if(typeof o[k]=="function")
continue;var val=$.toJSON(o[k]);pairs.push(name+":"+val);}
return"{"+pairs.join(", ")+"}";}};$.evalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);return eval("("+src+")");};$.secureEvalJSON=function(src)
{if(typeof(JSON)=='object'&&JSON.parse)
return JSON.parse(src);var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))
return eval("("+src+")");else
throw new SyntaxError("Error parsing JSON, source is not valid.");};$.quoteString=function(string)
{if(string.match(_escapeable))
{return'"'+string.replace(_escapeable,function(a)
{var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
return'"'+string+'"';};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};})(jQuery);function setSlideModel(currElement,nextElement,opts,isForward)
{$("#"+nextElement.id+"_img").attr('src',Models[nextElement.id]);$('#'+currElement.id+'_small').removeClass("modelbold");$('#'+nextElement.id+'_small').addClass('modelbold');}
function setNextSlideModel(currElement,nextElement,opts,isForward)
{$("#"+opts.elements[opts.nextSlide].id+"_img").attr('src',Models[nextElement.id]);}
function setSlideSite(currElement,nextElement,opts,isForward)
{$("#"+nextElement.id+"_img").attr('src',Sites[nextElement.id]);$('#'+currElement.id+'_small').removeClass("megasitebold");$('#'+nextElement.id+'_small').addClass('megasitebold');}
function setNextSlideSite(currElement,nextElement,opts,isForward)
{$("#"+opts.elements[opts.nextSlide].id+"_img").attr('src',Sites[nextElement.id]);}