/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
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?"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;

/* Ahah.js */
// ==========================================================================
// @function		Complete AHAH function
// @author		Daniele Florio
// @site		www.gizax.it
// @version		1.1.3 experimental

// @thanksTo		Andrea Paiola,Walter Wlodarski,Scott Chapman

// @updated 1.1.3 ( execJS function ) @thanks to Giovanni Zona

// (c) 2006 Daniele Florio <daniele@gizax.it>

// ==========================================================================

/* USAGE:

1) Posting data to form:
<form id="myform" action="javascript:ahahscript.likeSubmit('helloworld.php', 'post', 'myform', 'mytarget');">

									    ('comments_ajax.php', 'commentajax', '', 'GET', '', this)
2) Getting simple url

<a href="#" onclick="javascript:ahahscript.ahah('test.htm', 'mytaget', '', 'GET', '', this);">click me</a>

*/

var ahahscript = {

	//loading : 'loading...',
	loading : "<br /><img src=javascripts/loading.gif",

	ahah : function (url, target, delay, method, parameters) {

	  if ( ( method === undefined ) || ( method == "GET" ) || ( method == "get" ) ){

			this.creaDIV(target, this.loading);

			if (window.XMLHttpRequest) {
				req = new XMLHttpRequest();
			}
			else if (window.ActiveXObject) {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			if (req) {
				req.onreadystatechange = function() {
					ahahscript.ahahDone(url, target, delay, method, parameters);
				};
				req.open(method, url, true);
				req.send("");
			}
		}
		if ( (method == "POST") || (method == "post") ){

			this.creaDIV(target, this.loading);

			if (window.XMLHttpRequest) {
				req = new XMLHttpRequest();
			}
			else if (window.ActiveXObject) {
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			if (req) {
				req.onreadystatechange = function() {
					ahahscript.ahahDone(url, target, delay, method, parameters);
				};
				req.open(method, url, true);
				req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				req.send(parameters);
			 }
		}
	},

	creaDIV : function (target, html){
		if (document.body.innerHTML) {
			document.getElementById(target).innerHTML = html;
	   	}
	   	else if (document.getElementById){
			var element = document.getElementById(target);
			var range = document.createRange();
			range.selectNodeContents(element);
			range.deleteContents();
			element.appendChild(range.createContextualFragment(html));
	   }
	},

	execJS : function (node) {

		var st = node.getElementsByTagName('SCRIPT');
		var strExec;

		var bSaf = (navigator.userAgent.indexOf('Safari') != -1);
		var bOpera = (navigator.userAgent.indexOf('Opera') != -1);
		var bMoz = (navigator.appName == 'Netscape');

		for(var i=0;i<st.length; i++) {
			if (bSaf) {
			  strExec = st[i].innerHTML;
			}
			else if (bOpera) {
			  strExec = st[i].text;
			}
			else if (bMoz) {
			  strExec = st[i].textContent;
			}
			else {
			  strExec = st[i].text;
			}
			try {
			  eval(strExec);
			} catch(e) {
			  alert(e);
			}
		}

	},

	ahahDone : function (url, target, delay, method, parameters) {
		if (req.readyState == 4) {
			element = document.getElementById(target);
			if (req.status == 200) {

				//this.creaDIV(target, req.responseText);
				output = req.responseText;
				document.getElementById(target).innerHTML = output;
				var j = document.createElement("div");
				j.innerHTML = "_" + output + "_";
				this.execJS(j);

			}
			else {
				this.creaDIV(target, "ahah error:\n"+req.statusText);
			}
		}
	},

	/*

	@@ parameters :
	fileName	= name of your cgi or other
	method		= GET or POST, default is GET
	formName	= name of your form
	dynamicTarget	= name of your dynamic Target DIV or other

	@@ usage :


	*/

	likeSubmit : function ( file, method, formName, target ) {

		var the_form = document.getElementById(formName);
		var num = the_form.elements.length;
		var url = "";
		var radio_buttons = new Array();
		var nome_buttons = new Array();
		var check_buttons = new Array();
		var nome_buttons = new Array();


		// submit radio values
		var j = 0;
		var a = 0;
		for(var i=0; i<the_form.length; i++){
			var temp = the_form.elements[i].type;
			if ( (temp == "radio") && ( the_form.elements[i].checked) ) {
				nome_buttons[a] = the_form.elements[i].name;
				radio_buttons[j] = the_form.elements[i].value;
				j++;
				a++;
			}
		}
		for(var k = 0; k < radio_buttons.length; k++) {
			url += nome_buttons[k] + "=" + radio_buttons[k] + "&";
		}

		// submit checkbox values
		var j = 0;
		var a = 0;
		for(var i=0; i<the_form.length; i++){
			var temp = the_form.elements[i].type;
			if ( (temp == "checkbox") && ( the_form.elements[i].checked) ) {
				nome_buttons[a] = the_form.elements[i].name;
				check_buttons[j] = the_form.elements[i].value;
				j++;
				a++;
			}
		}
		for(var k = 0; k < check_buttons.length; k++) {
			url += nome_buttons[k] + "=" + check_buttons[k] + "&";
		}

		// submit all kind of input
		for (var i = 0; i < num; i++){

			var chiave = the_form.elements[i].name;
			var valore = the_form.elements[i].value;
			var tipo = the_form.elements[i].type;

			//var valore_2 = valore.replace(/&#160;/,"OK&nbsp;Space"));
			//alert(valore_2);

			if ( (tipo == "submit") || (tipo == "radio") || (tipo == "checkbox") ){}
			else {
				url += chiave + "=" + valore + "&";
			}
		}

		//alert(url);

		var ajax_space_fix = url;
		var intIndexOfExtraSpace = ajax_space_fix.indexOf( "&#160;" );

		while (intIndexOfExtraSpace != -1)
		{
			ajax_space_fix = ajax_space_fix.replace( "&#160;", " " );
			intIndexOfExtraSpace = ajax_space_fix.indexOf( "&#160;" );
		}

		//alert( ajax_space_fix );

		var parameters = ajax_space_fix; //url;

		url = file + "?" + url;

		if (method === undefined) {
			method = "GET";
		}
		if (method == "GET") {
			this.ahah(url, target, '', method, '');
		}
		else {
			this.ahah(file, target, '', method, parameters);
		}
	}

};



/* Text and/or Image Crawler Script ©2009 John Davenport Scheuer
   as first seen in http://www.dynamicdrive.com/forums/
   username: jscheuer1 - This Notice Must Remain for Legal Use
   */
function marqueeInit(config){if(!document.createElement)return;marqueeInit.ar.push(config);marqueeInit.run(config.uniqueid);}
(function(){if(!document.createElement)return;marqueeInit.ar=[];document.write('<style type="text/css">.marquee{white-space:nowrap;overflow:hidden;visibility:hidden;}'+'#marq_kill_marg_bord{border:none!important;margin:0!important;}<\/style>');var c=0,tTRE=[new RegExp('^\\s*$'),new RegExp('^\\s*'),new RegExp('\\s*$')],req1={'position':'relative','overflow':'hidden'},defaultconfig={style:{'margin':'0 auto'},direction:'left',inc:2,mouse:'pause'},dash,ie=false,oldie=0,ie5=false,iever=0;if(!ie5){dash=new RegExp('-(.)','g');function toHump(a,b){return b.toUpperCase();};String.prototype.encamel=function(){return this.replace(dash,toHump);};}
if(ie&&iever<8){marqueeInit.table=[];window.attachEvent('onload',function(){marqueeInit.OK=true;for(var i=0;i<marqueeInit.table.length;++i)
marqueeInit.run(marqueeInit.table[i]);});}
function intable(el){while((el=el.parentNode))
if(el.tagName&&el.tagName.toLowerCase()==='table')
return true;return false;};marqueeInit.run=function(id){if(ie&&!marqueeInit.OK&&iever<8&&intable(document.getElementById(id))){marqueeInit.table.push(id);return;}
if(!document.getElementById(id))
setTimeout(function(){marqueeInit.run(id);},300);else
new Marq(c++,document.getElementById(id));}
function trimTags(tag){var r=[],i=0,e;while((e=tag.firstChild)&&e.nodeType==3&&tTRE[0].test(e.nodeValue))
tag.removeChild(e);while((e=tag.lastChild)&&e.nodeType==3&&tTRE[0].test(e.nodeValue))
tag.removeChild(e);if((e=tag.firstChild)&&e.nodeType==3)
e.nodeValue=e.nodeValue.replace(tTRE[1],'');if((e=tag.lastChild)&&e.nodeType==3)
e.nodeValue=e.nodeValue.replace(tTRE[2],'');while((e=tag.firstChild))
r[i++]=tag.removeChild(e);return r;}
function Marq(c,tag){var p,u,s,a,ims,ic,i,marqContent,cObj=this;this.mq=marqueeInit.ar[c];for(p in defaultconfig)
if((this.mq.hasOwnProperty&&!this.mq.hasOwnProperty(p))||(!this.mq.hasOwnProperty&&!this.mq[p]))
this.mq[p]=defaultconfig[p];this.mq.style.width=!this.mq.style.width||isNaN(parseInt(this.mq.style.width))?'100%':this.mq.style.width;if(!tag.getElementsByTagName('img')[0])
this.mq.style.height=!this.mq.style.height||isNaN(parseInt(this.mq.style.height))?tag.offsetHeight+3+'px':this.mq.style.height;else
this.mq.style.height=!this.mq.style.height||isNaN(parseInt(this.mq.style.height))?'auto':this.mq.style.height;u=this.mq.style.width.split(/\d/);this.cw=this.mq.style.width?[parseInt(this.mq.style.width),u[u.length-1]]:['a'];marqContent=trimTags(tag);tag.className=tag.id='';tag.removeAttribute('class',0);tag.removeAttribute('id',0);if(ie)
tag.removeAttribute('className',0);tag.appendChild(tag.cloneNode(false));tag.className=['marquee',c].join('');tag.style.overflow='hidden';this.c=tag.firstChild;this.c.appendChild(this.c.cloneNode(false));this.c.style.visibility='hidden';a=[[req1,this.c.style],[this.mq.style,this.c.style]];for(i=a.length-1;i>-1;--i)
for(p in a[i][0])
if((a[i][0].hasOwnProperty&&a[i][0].hasOwnProperty(p))||(!a[i][0].hasOwnProperty))
a[i][1][p.encamel()]=a[i][0][p];this.m=this.c.firstChild;if(this.mq.mouse=='pause'){this.c.onmouseover=function(){cObj.mq.stopped=true;};this.c.onmouseout=function(){cObj.mq.stopped=false;};}
this.m.style.position='absolute';this.m.style.left='-10000000px';this.m.style.whiteSpace='nowrap';if(ie5)this.c.firstChild.appendChild((this.m=document.createElement('nobr')));if(!this.mq.noAddedSpace)
this.m.appendChild(document.createTextNode('\xa0'));for(i=0;marqContent[i];++i)
this.m.appendChild(marqContent[i]);if(ie5)this.m=this.c.firstChild;ims=this.m.getElementsByTagName('img');if(ims.length){for(ic=0,i=0;i<ims.length;++i){ims[i].style.display='inline';ims[i].style.verticalAlign=ims[i].style.verticalAlign||'top';if(typeof ims[i].complete=='boolean'&&ims[i].complete&&!window.opera)
ic++;else{ims[i].onload=function(){if(++ic==ims.length)
cObj.setup();};}
if(ic==ims.length)
this.setup();}}
else this.setup()}
Marq.prototype.setup=function(){if(this.mq.setup)return;this.mq.setup=this;var s,cObj=this;if(this.c.style.height==='auto')
this.c.style.height=this.m.offsetHeight+4+'px';this.c.appendChild(this.m.cloneNode(true));this.m=[this.m,this.m.nextSibling];if(this.mq.mouse=='cursor driven'){this.r=this.mq.neutral||16;this.sinc=this.mq.inc;this.c.onmousemove=function(e){cObj.mq.stopped=false;cObj.directspeed(e)};if(this.mq.moveatleast){this.mq.inc=this.mq.moveatleast;if(this.mq.savedirection){if(this.mq.savedirection=='reverse'){this.c.onmouseout=function(e){if(cObj.contains(e))return;cObj.mq.inc=cObj.mq.moveatleast;cObj.mq.direction=cObj.mq.direction=='right'?'left':'right';};}else{this.mq.savedirection=this.mq.direction;this.c.onmouseout=function(e){if(cObj.contains(e))return;cObj.mq.inc=cObj.mq.moveatleast;cObj.mq.direction=cObj.mq.savedirection;};}}else
this.c.onmouseout=function(e){if(!cObj.contains(e))cObj.mq.inc=cObj.mq.moveatleast;};}
else
this.c.onmouseout=function(e){if(!cObj.contains(e))cObj.slowdeath();};}
this.w=this.m[0].offsetWidth;this.m[0].style.left=0;this.c.id='marq_kill_marg_bord';this.m[0].style.top=this.m[1].style.top=Math.floor((this.c.offsetHeight-this.m[0].offsetHeight)/2-oldie)+'px';this.c.id='';this.c.removeAttribute('id',0);this.m[1].style.left=this.w+'px';s=this.mq.moveatleast?Math.max(this.mq.moveatleast,this.sinc):(this.sinc||this.mq.inc);while(this.c.offsetWidth>this.w-s)
this.c.style.width=isNaN(this.cw[0])?this.w-s+'px':--this.cw[0]+this.cw[1];this.c.style.visibility='visible';this.runit();}
Marq.prototype.slowdeath=function(){var cObj=this;if(this.mq.inc){this.mq.inc-=1;this.timer=setTimeout(function(){cObj.slowdeath();},100);}}
Marq.prototype.runit=function(){var cObj=this,d=this.mq.direction=='right'?1:-1;if(this.mq.stopped||this.mq.stopMarquee){setTimeout(function(){cObj.runit();},300);return;}
if(this.mq.mouse!='cursor driven')
this.mq.inc=Math.max(1,this.mq.inc);if(d*parseInt(this.m[0].style.left)>=this.w)
this.m[0].style.left=parseInt(this.m[1].style.left)-d*this.w+'px';if(d*parseInt(this.m[1].style.left)>=this.w)
this.m[1].style.left=parseInt(this.m[0].style.left)-d*this.w+'px';this.m[0].style.left=parseInt(this.m[0].style.left)+d*this.mq.inc+'px';this.m[1].style.left=parseInt(this.m[1].style.left)+d*this.mq.inc+'px';setTimeout(function(){cObj.runit();},30+(this.mq.addDelay||0));}
Marq.prototype.directspeed=function(e){e=e||window.event;if(this.timer)clearTimeout(this.timer);var c=this.c,w=c.offsetWidth,l=c.offsetLeft,mp=(typeof e.pageX=='number'?e.pageX:e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft)-l,lb=(w-this.r)/2,rb=(w+this.r)/2;while((c=c.offsetParent))mp-=c.offsetLeft;this.mq.direction=mp>rb?'left':'right';this.mq.inc=Math.round((mp>rb?(mp-rb):mp<lb?(lb-mp):0)/lb*this.sinc);}
Marq.prototype.contains=function(e){if(e&&e.relatedTarget){var c=e.relatedTarget;if(c==this.c)return true;while((c=c.parentNode))if(c==this.c)return true;}
return false;}
function resize(){for(var s,m,i=0;i<marqueeInit.ar.length;++i){if(marqueeInit.ar[i]&&marqueeInit.ar[i].setup){m=marqueeInit.ar[i].setup;s=m.mq.moveatleast?Math.max(m.mq.moveatleast,m.sinc):(m.sinc||m.mq.inc);m.c.style.width=m.mq.style.width;m.cw[0]=m.cw.length>1?parseInt(m.mq.style.width):'a';while(m.c.offsetWidth>m.w-s)
m.c.style.width=isNaN(m.cw[0])?m.w-s+'px':--m.cw[0]+m.cw[1];}}}
if(window.addEventListener)
window.addEventListener('resize',resize,false);else if(window.attachEvent)
window.attachEvent('onresize',resize);})();

/* animatedcollapse.js */
var animatedcollapse={divholders:{},divgroups:{},lastactiveingroup:{},preloadimages:[],show:function(divids){if(typeof divids=="object"){for(var i=0;i<divids.length;i++)
this.showhide(divids[i],"show")}
else
this.showhide(divids,"show")},hide:function(divids){if(typeof divids=="object"){for(var i=0;i<divids.length;i++)
this.showhide(divids[i],"hide")}
else
this.showhide(divids,"hide")},toggle:function(divid){if(typeof divid=="object")
divid=divid[0]
this.showhide(divid,"toggle")},addDiv:function(divid,attrstring){this.divholders[divid]=({id:divid,$divref:null,attrs:attrstring})
this.divholders[divid].getAttr=function(name){var attr=new RegExp(name+"=([^,]+)","i")
return(attr.test(this.attrs)&&parseInt(RegExp.$1)!=0)?RegExp.$1:null}
this.currentid=divid
return this},showhide:function(divid,action){var $divref=this.divholders[divid].$divref
if(this.divholders[divid]&&$divref.length==1){var targetgroup=this.divgroups[$divref.attr('groupname')]
if($divref.attr('groupname')&&targetgroup.count>1&&(action=="show"||action=="toggle"&&$divref.css('display')=='none')){if(targetgroup.lastactivedivid&&targetgroup.lastactivedivid!=divid)
this.slideengine(targetgroup.lastactivedivid,'hide')
this.slideengine(divid,'show')
targetgroup.lastactivedivid=divid}
else{this.slideengine(divid,action)}}},slideengine:function(divid,action){var $divref=this.divholders[divid].$divref
var $togglerimage=this.divholders[divid].$togglerimage
if(this.divholders[divid]&&$divref.length==1){var animateSetting={height:action}
if($divref.attr('fade'))
animateSetting.opacity=action
$divref.animate(animateSetting,$divref.attr('speed')?parseInt($divref.attr('speed')):500,function(){if($togglerimage){$togglerimage.attr('src',($divref.css('display')=="none")?$togglerimage.data('srcs').closed:$togglerimage.data('srcs').open)}
if(animatedcollapse.ontoggle){try{animatedcollapse.ontoggle(jQuery,$divref.get(0),$divref.css('display'))}
catch(e){alert("An error exists inside your \"ontoggle\" function:\n\n"+e+"\n\nAborting execution of function.")}}})
return false}},generatemap:function(){var map={}
for(var i=0;i<arguments.length;i++){if(arguments[i][1]!=null){map[arguments[i][0]]=arguments[i][1]}}
return map},init:function(){var ac=this
jQuery(document).ready(function($){animatedcollapse.ontoggle=animatedcollapse.ontoggle||null
var urlparamopenids=animatedcollapse.urlparamselect()
var persistopenids=ac.getCookie('acopendivids')
var groupswithpersist=ac.getCookie('acgroupswithpersist')
if(persistopenids!=null)
persistopenids=(persistopenids=='nada')?[]:persistopenids.split(',')
groupswithpersist=(groupswithpersist==null||groupswithpersist=='nada')?[]:groupswithpersist.split(',')
jQuery.each(ac.divholders,function(){this.$divref=$('#'+this.id)
if((this.getAttr('persist')||jQuery.inArray(this.getAttr('group'),groupswithpersist)!=-1)&&persistopenids!=null){var cssdisplay=(jQuery.inArray(this.id,persistopenids)!=-1)?'block':'none'}
else{var cssdisplay=this.getAttr('hide')?'none':null}
if(urlparamopenids[0]=="all"||jQuery.inArray(this.id,urlparamopenids)!=-1){cssdisplay='block'}
else if(urlparamopenids[0]=="none"){cssdisplay='none'}
this.$divref.css(ac.generatemap(['height',this.getAttr('height')],['display',cssdisplay]))
this.$divref.attr(ac.generatemap(['groupname',this.getAttr('group')],['fade',this.getAttr('fade')],['speed',this.getAttr('speed')]))
if(this.getAttr('group')){var targetgroup=ac.divgroups[this.getAttr('group')]||(ac.divgroups[this.getAttr('group')]={})
targetgroup.count=(targetgroup.count||0)+1
if(jQuery.inArray(this.id,urlparamopenids)!=-1){targetgroup.lastactivedivid=this.id
targetgroup.overridepersist=1}
if(!targetgroup.lastactivedivid&&this.$divref.css('display')!='none'||cssdisplay=="block"&&typeof targetgroup.overridepersist=="undefined")
targetgroup.lastactivedivid=this.id
this.$divref.css({display:'none'})}})
jQuery.each(ac.divgroups,function(){if(this.lastactivedivid&&urlparamopenids[0]!="none")
ac.divholders[this.lastactivedivid].$divref.show()})
if(animatedcollapse.ontoggle){jQuery.each(ac.divholders,function(){animatedcollapse.ontoggle(jQuery,this.$divref.get(0),this.$divref.css('display'))})}
var $allcontrols=$('a[rel]').filter('[rel^="collapse["], [rel^="expand["], [rel^="toggle["]')
$allcontrols.each(function(){this._divids=this.getAttribute('rel').replace(/(^\w+)|(\s+)/g,"").replace(/[\[\]']/g,"")
if(this.getElementsByTagName('img').length==1&&ac.divholders[this._divids]){animatedcollapse.preloadimage(this.getAttribute('data-openimage'),this.getAttribute('data-closedimage'))
$togglerimage=$(this).find('img').eq(0).data('srcs',{open:this.getAttribute('data-openimage'),closed:this.getAttribute('data-closedimage')})
ac.divholders[this._divids].$togglerimage=$(this).find('img').eq(0)
ac.divholders[this._divids].$togglerimage.attr('src',(ac.divholders[this._divids].$divref.css('display')=="none")?$togglerimage.data('srcs').closed:$togglerimage.data('srcs').open)}
$(this).click(function(){var relattr=this.getAttribute('rel')
var divids=(this._divids=="")?[]:this._divids.split(',')
if(divids.length>0){animatedcollapse[/expand/i.test(relattr)?'show':/collapse/i.test(relattr)?'hide':'toggle'](divids)
return false}})})
$(window).bind('unload',function(){ac.uninit()})})},uninit:function(){var opendivids='',groupswithpersist=''
jQuery.each(this.divholders,function(){if(this.$divref.css('display')!='none'){opendivids+=this.id+','}
if(this.getAttr('group')&&this.getAttr('persist'))
groupswithpersist+=this.getAttr('group')+','})
opendivids=(opendivids=='')?'nada':opendivids.replace(/,$/,'')
groupswithpersist=(groupswithpersist=='')?'nada':groupswithpersist.replace(/,$/,'')
this.setCookie('acopendivids',opendivids)
this.setCookie('acgroupswithpersist',groupswithpersist)},getCookie:function(Name){var re=new RegExp(Name+"=[^;]*","i");if(document.cookie.match(re))
return document.cookie.match(re)[0].split("=")[1]
return null},setCookie:function(name,value,days){if(typeof days!="undefined"){var expireDate=new Date()
expireDate.setDate(expireDate.getDate()+days)
document.cookie=name+"="+value+"; path=/; expires="+expireDate.toGMTString()}
else
document.cookie=name+"="+value+"; path=/"},urlparamselect:function(){window.location.search.match(/expanddiv=([\w\-_,]+)/i)
return(RegExp.$1!="")?RegExp.$1.split(","):[]},preloadimage:function(){var preloadimages=this.preloadimages
for(var i=0;i<arguments.length;i++){if(arguments[i]&&arguments[i].length>0){preloadimages[preloadimages.length]=new Image()
preloadimages[preloadimages.length-1].src=arguments[i]}}}}