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(swf,id,w,h,ver,c,useExpressInstall,quality,xiRedirectUrl,redirectUrl,detectKey){if(!document.getElementById){return;}
this.DETECT_KEY=detectKey?detectKey:'detectflash';this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(swf){this.setAttribute('swf',swf);}
if(id){this.setAttribute('id',id);}
if(w){this.setAttribute('width',w);}
if(h){this.setAttribute('height',h);}
if(ver){this.setAttribute('version',new deconcept.PlayerVersion(ver.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(c){this.addParam('bgcolor',c);}
var q=quality?quality:'high';this.addParam('quality',q);this.setAttribute('useExpressInstall',useExpressInstall);this.setAttribute('doExpressInstall',false);var xir=(xiRedirectUrl)?xiRedirectUrl:window.location;this.setAttribute('xiRedirectUrl',xir);this.setAttribute('redirectUrl','');if(redirectUrl){this.setAttribute('redirectUrl',redirectUrl);}}
deconcept.SWFObject.prototype={setAttribute:function(name,value){this.attributes[name]=value;},getAttribute:function(name){return this.attributes[name];},addParam:function(name,value){this.params[name]=value;},getParams:function(){return this.params;},addVariable:function(name,value){this.variables[name]=value;},getVariable:function(name){return this.variables[name];},getVariables:function(){return this.variables;},getVariablePairs:function(){var variablePairs=new Array();var key;var variables=this.getVariables();for(key in variables){variablePairs.push(key+"="+variables[key]);}
return variablePairs;},getSWFHTML:function(){var swfNode="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
swfNode='<embed type="application/x-shockwave-flash" src="'+this.getAttribute('swf')+'" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'"';swfNode+=' id="'+this.getAttribute('id')+'" name="'+this.getAttribute('id')+'" ';var params=this.getParams();for(var key in params){swfNode+=[key]+'="'+params[key]+'" ';}
var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='flashvars="'+pairs+'"';}
swfNode+='/>';}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
swfNode='<object id="'+this.getAttribute('id')+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute('width')+'" height="'+this.getAttribute('height')+'">';swfNode+='<param name="movie" value="'+this.getAttribute('swf')+'" />';var params=this.getParams();for(var key in params){swfNode+='<param name="'+key+'" value="'+params[key]+'" />';}
var pairs=this.getVariablePairs().join("&");if(pairs.length>0){swfNode+='<param name="flashvars" value="'+pairs+'" />';}
swfNode+="</object>";}
return swfNode;},write:function(elementId){if(this.getAttribute('useExpressInstall')){var expressInstallReqVer=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(expressInstallReqVer)&&!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 elementId=='string')?document.getElementById(elementId):elementId;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute('redirectUrl')!=""){document.location.replace(this.getAttribute('redirectUrl'));}}
return false;}}
deconcept.SWFObjectUtil.getPlayerVersion=function(){var PlayerVersion=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){PlayerVersion=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");PlayerVersion=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(PlayerVersion.major==6){return PlayerVersion;}}
try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}
if(axo!=null){PlayerVersion=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return PlayerVersion;}
deconcept.PlayerVersion=function(arrVersion){this.major=arrVersion[0]!=null?parseInt(arrVersion[0]):0;this.minor=arrVersion[1]!=null?parseInt(arrVersion[1]):0;this.rev=arrVersion[2]!=null?parseInt(arrVersion[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(param){var q=document.location.search||document.location.hash;if(q){var pairs=q.substring(1).split("&");for(var i=0;i<pairs.length;i++){if(pairs[i].substring(0,pairs[i].indexOf("="))==param){return pairs[i].substring((pairs[i].indexOf("=")+1));}}}
return"";}}
deconcept.SWFObjectUtil.cleanupSWFs=function(){var objects=document.getElementsByTagName("OBJECT");for(var i=0;i<objects.length;i++){objects[i].style.display='none';for(var x in objects[i]){if(typeof objects[i][x]=='function'){objects[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(item){this[this.length]=item;return this.length;}}
var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;;var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion()
{var version;var axo;var e;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");version=axo.GetVariable("$version");}catch(e){}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version="WIN 6,0,21,0";axo.AllowScriptAccess="always";version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version=axo.GetVariable("$version");}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");version="WIN 3,0,18,0";}catch(e){}}
if(!version)
{try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");version="WIN 2,0,0,11";}catch(e){version=-1;}}
return version;}
function GetSwfVer(){var flashVer=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;var descArray=flashDescription.split(" ");var tempArrayMajor=descArray[2].split(".");var versionMajor=tempArrayMajor[0];var versionMinor=tempArrayMajor[1];var versionRevision=descArray[3];if(versionRevision==""){versionRevision=descArray[4];}
if(versionRevision[0]=="d"){versionRevision=versionRevision.substring(1);}else if(versionRevision[0]=="r"){versionRevision=versionRevision.substring(1);if(versionRevision.indexOf("d")>0){versionRevision=versionRevision.substring(0,versionRevision.indexOf("d"));}}
var flashVer=versionMajor+"."+versionMinor+"."+versionRevision;}}
else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;else if(isIE&&isWin&&!isOpera){flashVer=ControlVersion();}
return flashVer;}
function DetectFlashVer(reqMajorVer,reqMinorVer,reqRevision)
{versionStr=GetSwfVer();if(versionStr==-1){return false;}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",");}else{versionArray=versionStr.split(".");}
var versionMajor=versionArray[0];var versionMinor=versionArray[1];var versionRevision=versionArray[2];if(versionMajor>parseFloat(reqMajorVer)){return true;}else if(versionMajor==parseFloat(reqMajorVer)){if(versionMinor>parseFloat(reqMinorVer))
return true;else if(versionMinor==parseFloat(reqMinorVer)){if(versionRevision>=parseFloat(reqRevision))
return true;}}
return false;}}
function AC_AddExtension(src,ext)
{if(src.indexOf('?')!=-1)
return src.replace(/\?/,ext+'?');else
return src+ext;}
function AC_Generateobj(objAttrs,params,embedAttrs)
{var str='';if(isIE&&isWin&&!isOpera)
{str+='<object ';for(var i in objAttrs)
{str+=i+'="'+objAttrs[i]+'" ';}
str+='>';for(var i in params)
{str+='<param name="'+i+'" value="'+params[i]+'" /> ';}
str+='</object>';}
else
{str+='<embed ';for(var i in embedAttrs)
{str+=i+'="'+embedAttrs[i]+'" ';}
str+='> </embed>';}
document.write(str);}
function AC_FL_RunContent(){var ret=AC_GetArgs
(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs);}
function AC_SW_RunContent(){var ret=AC_GetArgs
(arguments,".dcr","src","clsid:166B1BCA-3F9C-11CF-8075-444553540000",null);AC_Generateobj(ret.objAttrs,ret.params,ret.embedAttrs);}
function AC_GetArgs(args,ext,srcParamName,classid,mimeType){var ret=new Object();ret.embedAttrs=new Object();ret.params=new Object();ret.objAttrs=new Object();for(var i=0;i<args.length;i=i+2){var currArg=args[i].toLowerCase();switch(currArg){case"classid":break;case"pluginspage":ret.embedAttrs[args[i]]=args[i+1];break;case"src":case"movie":args[i+1]=AC_AddExtension(args[i+1],ext);ret.embedAttrs["src"]=args[i+1];ret.params[srcParamName]=args[i+1];break;case"onafterupdate":case"onbeforeupdate":case"onblur":case"oncellchange":case"onclick":case"ondblclick":case"ondrag":case"ondragend":case"ondragenter":case"ondragleave":case"ondragover":case"ondrop":case"onfinish":case"onfocus":case"onhelp":case"onmousedown":case"onmouseup":case"onmouseover":case"onmousemove":case"onmouseout":case"onkeypress":case"onkeydown":case"onkeyup":case"onload":case"onlosecapture":case"onpropertychange":case"onreadystatechange":case"onrowsdelete":case"onrowenter":case"onrowexit":case"onrowsinserted":case"onstart":case"onscroll":case"onbeforeeditfocus":case"onactivate":case"onbeforedeactivate":case"ondeactivate":case"type":case"codebase":case"id":ret.objAttrs[args[i]]=args[i+1];break;case"width":case"height":case"align":case"vspace":case"hspace":case"class":case"title":case"accesskey":case"name":case"tabindex":ret.embedAttrs[args[i]]=ret.objAttrs[args[i]]=args[i+1];break;default:ret.embedAttrs[args[i]]=ret.params[args[i]]=args[i+1];}}
ret.objAttrs["classid"]=classid;if(mimeType)ret.embedAttrs["type"]=mimeType;return ret;};var Autocomplete=function(el,options){this.el=$(el);this.elico=$(el+'ajaxico');this.id=this.el.identify();this.el.setAttribute('autocomplete','off');this.suggestions=[];this.image=[];this.description=[];this.data=[];this.badQueries=[];this.selectedIndex=-1;this.currentValue=this.el.value;this.intervalId=0;this.cachedResponse=[];this.instanceId=null;this.onChangeInterval=null;this.ignoreValueChange=false;this.serviceUrl=options.serviceUrl;this.options={autoSubmit:false,minChars:1,store:1,enableimage:0,enableloader:0,maxHeight:300,deferRequestBy:0,width:0,searchtext:'',container:null};if(options){Object.extend(this.options,options);}
if(Autocomplete.isDomLoaded){this.initialize();}else{Event.observe(document,'dom:loaded',this.initialize.bind(this),false);}};Autocomplete.instances=[];Autocomplete.isDomLoaded=false;Autocomplete.getInstance=function(id){var instances=Autocomplete.instances;var i=instances.length;while(i--){if(instances[i].id===id){return instances[i];}}};Autocomplete.highlight=function(value,re){return value.replace(re,function(match){return'<strong>'+match+'<\/strong>'});};Autocomplete.prototype={killerFn:null,initialize:function(){var me=this;this.killerFn=function(e){if(!$(Event.element(e)).up('.autocomplete')){me.killSuggestions();me.disableKillerFn();}}.bindAsEventListener(this);if(!this.options.width){this.options.width=this.el.getWidth();}
var div=new Element('div',{style:'position:absolute;'});div.update('<div class="autocomplete-w1"><div class="autocomplete-w2"><div class="autocomplete" id="Autocomplete_'+this.id+'" style="display:none; width:'+this.options.width+'px;"></div></div></div>');this.options.container=$(this.options.container);if(this.options.container){this.options.container.appendChild(div);this.fixPosition=function(){};}else{document.body.appendChild(div);}
this.mainContainerId=div.identify();this.container=$('Autocomplete_'+this.id);this.fixPosition();Event.observe(this.el,window.opera?'keypress':'keydown',this.onKeyPress.bind(this));Event.observe(this.el,'keyup',this.onKeyUp.bind(this));Event.observe(this.el,'blur',this.enableKillerFn.bind(this));Event.observe(this.el,'focus',this.fixPosition.bind(this));Event.observe(this.el,'click',this.fixText.bind(this));Event.observe(this.el,'blur',this.fixText.bind(this));this.container.setStyle({maxHeight:this.options.maxHeight+'px'});this.instanceId=Autocomplete.instances.push(this)-1;},fixPosition:function(){var offset=this.el.cumulativeOffset();$(this.mainContainerId).setStyle({top:(offset.top+this.el.getHeight())+'px',left:offset.left+'px'});},fixText:function(){if(this.el.value==this.options.searchtext){this.el.value='';}else if(this.el.value.length==0){this.el.value=this.options.searchtext;}else{return;};},enableKillerFn:function(){Event.observe(document.body,'click',this.killerFn);},disableKillerFn:function(){Event.stopObserving(document.body,'click',this.killerFn);},killSuggestions:function(){this.stopKillSuggestions();this.intervalId=window.setInterval(function(){this.hide();this.stopKillSuggestions();}.bind(this),300);},stopKillSuggestions:function(){window.clearInterval(this.intervalId);},onKeyPress:function(e){if(!this.enabled){return;}
switch(e.keyCode){case Event.KEY_ESC:this.el.value=this.currentValue;this.hide();break;case Event.KEY_TAB:case Event.KEY_RETURN:if(this.selectedIndex===-1){this.hide();return;}
this.select(this.selectedIndex);if(e.keyCode===Event.KEY_TAB){return;}
break;case Event.KEY_UP:this.moveUp();break;case Event.KEY_DOWN:this.moveDown();break;default:return;}
Event.stop(e);},onKeyUp:function(e){switch(e.keyCode){case Event.KEY_UP:case Event.KEY_DOWN:return;}
clearInterval(this.onChangeInterval);if(this.currentValue!==this.el.value){if(this.options.deferRequestBy>0){this.onChangeInterval=setInterval((function(){this.onValueChange();}).bind(this),this.options.deferRequestBy);}else{this.onValueChange();}}},onValueChange:function(){clearInterval(this.onChangeInterval);this.currentValue=this.el.value;this.selectedIndex=-1;if(this.ignoreValueChange){this.ignoreValueChange=false;return;}
if(this.currentValue===''||this.currentValue.length<this.options.minChars){this.hide();}else{this.getSuggestions();}},getSuggestions:function(){var cr=this.cachedResponse[this.currentValue];if(cr&&Object.isArray(cr.suggestions)){this.suggestions=cr.suggestions;this.image=cr.image;this.description=cr.description;this.data=cr.data;this.suggest();}else if(!this.isBadQuery(this.currentValue)){this.showloader();new Ajax.Request(this.serviceUrl,{parameters:{query:this.currentValue,store:this.options.store,enableimage:this.options.enableimage,enabledescription:this.options.enabledescription,descriptionchars:this.options.descriptionchars},onComplete:this.processResponse.bind(this),method:'get'});}},isBadQuery:function(q){var i=this.badQueries.length;while(i--){if(q.indexOf(this.badQueries[i])===0){return true;}}
return false;},hide:function(){this.enabled=false;this.selectedIndex=-1;this.container.hide();},suggest:function(){this.hideloader();if(this.suggestions.length===0){this.hide();return;}
var content=[];var re=new RegExp('\\b'+this.currentValue.match(/\w+/g).join('|\\b'),'gi');this.suggestions.each(function(value,i){var image=this.image[i];var description=this.description[i];content.push((this.selectedIndex===i?'<div class="selected ajaxsearchtitle"':'<div class="ajaxsearchtitle"'),' title="',value,'" onclick="Autocomplete.instances[',this.instanceId,'].select(',i,');" onmouseover="Autocomplete.instances[',this.instanceId,'].activate(',i,');">',image,'<p>',Autocomplete.highlight(value,re),'',description,'</p></div>');}.bind(this));this.enabled=true;this.container.update(content.join('')).show();},processResponse:function(xhr){var response;try{response=xhr.responseText.evalJSON();if(!Object.isArray(response.data)){response.data=[];}}catch(err){return;}
this.suggestions=response.suggestions;this.image=response.image;this.description=response.description;this.data=response.data;this.cachedResponse[response.query]=response;if(response.suggestions.length===0){this.badQueries.push(response.query);}
if(response.query===this.currentValue){this.suggest();}},activate:function(index){var divs=this.container.childNodes;var activeItem;if(this.selectedIndex!==-1&&divs.length>this.selectedIndex){divs[this.selectedIndex].className='';}
this.selectedIndex=index;if(this.selectedIndex!==-1&&divs.length>this.selectedIndex){activeItem=divs[this.selectedIndex]
activeItem.className='selected';}
return activeItem;},deactivate:function(div,index){div.className='';if(this.selectedIndex===index){this.selectedIndex=-1;}},select:function(i){var selectedValue=this.suggestions[i];if(selectedValue){this.el.value=selectedValue;if(this.options.autoSubmit&&this.el.form){this.el.form.submit();}
this.ignoreValueChange=true;this.hide();this.onSelect(i);}},moveUp:function(){if(this.selectedIndex===-1){return;}
if(this.selectedIndex===0){this.container.childNodes[0].className='';this.selectedIndex=-1;this.el.value=this.currentValue;return;}
this.adjustScroll(this.selectedIndex-1);},moveDown:function(){if(this.selectedIndex===(this.suggestions.length-1)){return;}
this.adjustScroll(this.selectedIndex+1);},showloader:function(){if(this.options.enableloader==1){this.elico.setStyle({display:'block'});}},hideloader:function(){if(this.options.enableloader==1){this.elico.setStyle({display:'none'});}},adjustScroll:function(i){var container=this.container;var activeItem=this.activate(i);var offsetTop=activeItem.offsetTop;var upperBound=container.scrollTop;var lowerBound=upperBound+this.options.maxHeight-25;if(offsetTop<upperBound){container.scrollTop=offsetTop;}else if(offsetTop>lowerBound){container.scrollTop=offsetTop-this.options.maxHeight+25;}
this.el.value=this.suggestions[i];},onSelect:function(i){(this.options.onSelect||Prototype.emptyFunction)(this.suggestions[i],this.data[i]);}};function onAutocompleteSubmit(value,data){setLocation(data)}
Event.observe(document,'dom:loaded',function(){Autocomplete.isDomLoaded=true;},false);