










//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
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;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}
	
	alert(version);
	
	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	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;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		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, container) 
{ 
  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>';
  }

    // Modificacion para colocar el contenerdor por defecto esto facilita la parte de programacion
  if ( container == null )
	 document.write(str);
  else
	 container.innerHTML = 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, ret.container);
}

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, ret.container);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  ret.container = null;
  
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "container":
    	  ret.container = new Object();
    	  ret.container = document.getElementById(args[i+1]);
        break;
      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;
}

Require.isLoaded['AC_RunActiveContent'] = true;



/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
 * Revision: 6246
 */
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
Require.isLoaded['library.jquery'] = true;
/*
* Print Element Plugin 0.9
*
* Copyright (c) 2009 Erik Zaadi
*
* Inspired by PrintArea (http://plugins.jquery.com/project/PrintArea) and
* http://stackoverflow.com/questions/472951/how-do-i-print-an-iframe-from-javascript-in-safari-chrome
*
*  Plugin home page : http://plugins.jquery.com/project/printElement 
* Wiki : http://wiki.github.com/erikzaadi/jQueryPlugins/jqueryprintelement 
* 
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*/
(function($) {
    $.fn.printElement = function(options) {
        var mainOptions = $.extend({}, $.fn.printElement.defaults, options);

        //Remove previously printed iframe if exists
        $("[id^='printElement_']").remove();

        return this.each(function() {
            //Support Metadata Plug-in if available
            var opts = $.meta ? $.extend({}, mainOptions, $this.data()) : mainOptions;
            _printElement($(this), opts);
        });
    };
    $.fn.printElement.defaults = {
        printMode: 'iframe', //Usage : iframe / popup
        pageTitle: '', //Print Page Title
        overrideElementCSS: [], //array of paths to alternate css files (optimized for print)
        printBodyOptions:
        {
            styleToAdd: 'padding:0px;margin:0px;', //style attributes to add to the body of print document
            classNameToAdd: '' //css class to add to the body of print document
        },
        leaveOpen: false, // in case of popup, leave the print page open or not
        iframeElementOptions:
        {
            styleToAdd: 'position:absolute;width:0px;height:0px;', //style attributes to add to the iframe element
            classNameToAdd: '' //css class to add to the iframe element
        }
    };
    function _printElement(element, opts) {
        var $elementToPrint = $(element);

        //Create markup to be printed
        var html = _getMarkup($elementToPrint, opts);

        var popupOrIframe = null;
        var documentToWriteTo = null;

        if (opts.printMode.toLowerCase() == 'popup') {
            popupOrIframe = window.open('', 'printElementWindow', 'width=650,height=440,scrollbars=yes');
            documentToWriteTo = popupOrIframe.document;
        }
        else {
            var printElementID = "printElement_" + (Math.random() * 99999).toString();
            popupOrIframe = $('<iframe />').attr({ style: opts.iframeElementOptions.styleToAdd,
                id: printElementID,
                className: opts.iframeElementOptions.classNameToAdd
            }).appendTo('body')[0].contentWindow;
            documentToWriteTo = popupOrIframe.document;
        }
        window.focus();
        documentToWriteTo.open();
        documentToWriteTo.write(html);
        documentToWriteTo.close();
        popupOrIframe.focus();
    };
    function _getMarkup(element, opts) {
        var $elementToPrint = $(element);
        var html = new Array();
        html.push('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html  xmlns="http://www.w3.org/1999/xhtml"><head><title>' + opts.pageTitle + '</title>');

        if (opts.overrideElementCSS && opts.overrideElementCSS.length > 0) {
            for (var x = 0; x < opts.overrideElementCSS.length; x++) {
                html.push('<link type="text/css" rel="stylesheet" href="css/printeable.css" >');
            }
        }
        else {
            $(document).find("link ")
                .filter(function() {
                    return $(this).attr("rel").toLowerCase() == "stylesheet";
                })
                .each(function() {
                    html.push('<link type="text/css" rel="stylesheet" href="css/printeable.css" >');
                });
        }
        html.push('</head><body onload="printPage();" style="' + opts.printBodyOptions.styleToAdd + '" class="' + opts.printBodyOptions.classNameToAdd + '">');
        html.push('<div style=" margin:0; padding:0; text-align:left;" class="' + $elementToPrint.attr("class") + '">' + $elementToPrint.html() + '</div>');
        html.push('<script type="text/javascript">function printPage() { focus();print();' + (opts.leaveOpen ? '' : 'close();') + '}</script></body></html>');

        return html.join('');
    };
})(jQuery);


Require.isLoaded['library.jquery.printElement'] = true;





/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var A=YAHOO.lang,C=["toString","valueOf"],B={isArray:function(D){if(D){return A.isNumber(D.length)&&A.isFunction(D.splice);}return false;},isBoolean:function(D){return typeof D==="boolean";},isFunction:function(D){return typeof D==="function";},isNull:function(D){return D===null;},isNumber:function(D){return typeof D==="number"&&isFinite(D);},isObject:function(D){return(D&&(typeof D==="object"||A.isFunction(D)))||false;},isString:function(D){return typeof D==="string";},isUndefined:function(D){return typeof D==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(F,E){for(var D=0;D<C.length;D=D+1){var H=C[D],G=E[H];if(A.isFunction(G)&&G!=Object.prototype[H]){F[H]=G;}}}:function(){},extend:function(H,I,G){if(!I||!H){throw new Error("extend failed, please check that "+"all dependencies are included.");}var E=function(){};E.prototype=I.prototype;H.prototype=new E();H.prototype.constructor=H;H.superclass=I.prototype;if(I.prototype.constructor==Object.prototype.constructor){I.prototype.constructor=I;}if(G){for(var D in G){if(A.hasOwnProperty(G,D)){H.prototype[D]=G[D];}}A._IEEnumFix(H.prototype,G);}},augmentObject:function(H,G){if(!G||!H){throw new Error("Absorb failed, verify dependencies.");}var D=arguments,F,I,E=D[2];if(E&&E!==true){for(F=2;F<D.length;F=F+1){H[D[F]]=G[D[F]];}}else{for(I in G){if(E||!(I in H)){H[I]=G[I];}}A._IEEnumFix(H,G);}},augmentProto:function(G,F){if(!F||!G){throw new Error("Augment failed, verify dependencies.");}var D=[G.prototype,F.prototype];for(var E=2;E<arguments.length;E=E+1){D.push(arguments[E]);}A.augmentObject.apply(this,D);},dump:function(D,I){var F,H,K=[],L="{...}",E="f(){...}",J=", ",G=" => ";if(!A.isObject(D)){return D+"";}else{if(D instanceof Date||("nodeType" in D&&"tagName" in D)){return D;}else{if(A.isFunction(D)){return E;}}}I=(A.isNumber(I))?I:3;if(A.isArray(D)){K.push("[");for(F=0,H=D.length;F<H;F=F+1){if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F<D;F=F+1){A.augmentObject(G,E[F],true);}return G;},later:function(K,E,L,G,H){K=K||0;E=E||{};var F=L,J=G,I,D;if(A.isString(L)){F=E[L];}if(!F){throw new TypeError("method undefined");}if(!A.isArray(J)){J=[G];}I=function(){F.apply(E,J);};D=(H)?setInterval(I,K):setTimeout(I,K);return{interval:H,cancel:function(){if(this.interval){clearInterval(D);}else{clearTimeout(D);}}};},isValue:function(D){return(A.isObject(D)||A.isString(D)||A.isNumber(D)||A.isBoolean(D));}};A.hasOwnProperty=(Object.prototype.hasOwnProperty)?function(D,E){return D&&D.hasOwnProperty(E);}:function(D,E){return !A.isUndefined(D[E])&&D.constructor.prototype[E]!==D[E];};B.augmentObject(A,B,true);YAHOO.util.Lang=A;A.augment=A.augmentProto;YAHOO.augment=A.augmentProto;YAHOO.extend=A.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.5.2",build:"1076"});
Require.isLoaded['library.yui.yahoo.yahoo'] = true;
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
(function(){var B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var C=YAHOO.env.ua.opera,L=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i};var N=function(P){if(!E.HYPHEN.test(P)){return P;}if(J[P]){return J[P];}var Q=P;while(E.HYPHEN.exec(Q)){Q=Q.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}J[P]=Q;return Q;};var O=function(Q){var P=F[Q];if(!P){P=new RegExp("(?:^|\\s+)"+Q+"(?:\\s+|$)");F[Q]=P;}return P;};if(M.defaultView&&M.defaultView.getComputedStyle){K=function(P,S){var R=null;if(S=="float"){S="cssFloat";}var Q=P.ownerDocument.defaultView.getComputedStyle(P,"");if(Q){R=Q[N(S)];}return P.style[S]||R;};}else{if(M.documentElement.currentStyle&&G){K=function(P,R){switch(N(R)){case"opacity":var T=100;try{T=P.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(S){try{T=P.filters("alpha").opacity;}catch(S){}}return T/100;case"float":R="styleFloat";default:var Q=P.currentStyle?P.currentStyle[R]:null;return(P.style[R]||Q);}};}else{K=function(P,Q){return P.style[Q];};}}if(G){I=function(P,Q,R){switch(Q){case"opacity":if(YAHOO.lang.isString(P.style.filter)){P.style.filter="alpha(opacity="+R*100+")";if(!P.currentStyle||!P.currentStyle.hasLayout){P.style.zoom=1;}}break;case"float":Q="styleFloat";default:P.style[Q]=R;}};}else{I=function(P,Q,R){if(Q=="float"){Q="cssFloat";}P.style[Q]=R;};}var D=function(P,Q){return P&&P.nodeType==1&&(!Q||Q(P));};YAHOO.util.Dom={get:function(R){if(R&&(R.nodeType||R.item)){return R;}if(YAHOO.lang.isString(R)||!R){return M.getElementById(R);}if(R.length!==undefined){var S=[];for(var Q=0,P=R.length;Q<P;++Q){S[S.length]=B.Dom.get(R[Q]);}return S;}return R;},getStyle:function(P,R){R=N(R);var Q=function(S){return K(S,R);};return B.Dom.batch(P,Q,B.Dom,true);},setStyle:function(P,R,S){R=N(R);var Q=function(T){I(T,R,S);};B.Dom.batch(P,Q,B.Dom,true);},getXY:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}return H(R);};return B.Dom.batch(P,Q,B.Dom,true);},getX:function(P){var Q=function(R){return B.Dom.getXY(R)[0];};return B.Dom.batch(P,Q,B.Dom,true);},getY:function(P){var Q=function(R){return B.Dom.getXY(R)[1];};return B.Dom.batch(P,Q,B.Dom,true);},setXY:function(P,S,R){var Q=function(V){var U=this.getStyle(V,"position");if(U=="static"){this.setStyle(V,"position","relative");U="relative";}var X=this.getXY(V);if(X===false){return false;}var W=[parseInt(this.getStyle(V,"left"),10),parseInt(this.getStyle(V,"top"),10)];if(isNaN(W[0])){W[0]=(U=="relative")?0:V.offsetLeft;}if(isNaN(W[1])){W[1]=(U=="relative")?0:V.offsetTop;}if(S[0]!==null){V.style.left=S[0]-X[0]+W[0]+"px";}if(S[1]!==null){V.style.top=S[1]-X[1]+W[1]+"px";}if(!R){var T=this.getXY(V);if((S[0]!==null&&T[0]!=S[0])||(S[1]!==null&&T[1]!=S[1])){this.setXY(V,S,true);}}};B.Dom.batch(P,Q,B.Dom,true);},setX:function(Q,P){B.Dom.setXY(Q,[P,null]);},setY:function(P,Q){B.Dom.setXY(P,[null,Q]);},getRegion:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}var S=B.Region.getRegion(R);return S;};return B.Dom.batch(P,Q,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(T,X,U,V){X=X||"*";U=(U)?B.Dom.get(U):null||M;if(!U){return[];}var Q=[],P=U.getElementsByTagName(X),W=O(T);for(var R=0,S=P.length;R<S;++R){if(W.test(P[R].className)){Q[Q.length]=P[R];if(V){V.call(P[R],P[R]);}}}return Q;},hasClass:function(R,Q){var P=O(Q);var S=function(T){return P.test(T.className);};return B.Dom.batch(R,S,B.Dom,true);},addClass:function(Q,P){var R=function(S){if(this.hasClass(S,P)){return false;}S.className=YAHOO.lang.trim([S.className,P].join(" "));return true;};return B.Dom.batch(Q,R,B.Dom,true);},removeClass:function(R,Q){var P=O(Q);var S=function(T){if(!Q||!this.hasClass(T,Q)){return false;}var U=T.className;T.className=U.replace(P," ");if(this.hasClass(T,Q)){this.removeClass(T,Q);}T.className=YAHOO.lang.trim(T.className);return true;};return B.Dom.batch(R,S,B.Dom,true);},replaceClass:function(S,Q,P){if(!P||Q===P){return false;}var R=O(Q);var T=function(U){if(!this.hasClass(U,Q)){this.addClass(U,P);return true;}U.className=U.className.replace(R," "+P+" ");if(this.hasClass(U,Q)){this.replaceClass(U,Q,P);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},generateId:function(P,R){R=R||"yui-gen";var Q=function(S){if(S&&S.id){return S.id;}var T=R+YAHOO.env._id_counter++;if(S){S.id=T;}return T;};return B.Dom.batch(P,Q,B.Dom,true)||Q.apply(B.Dom,arguments);},isAncestor:function(P,Q){P=B.Dom.get(P);Q=B.Dom.get(Q);if(!P||!Q){return false;}if(P.contains&&Q.nodeType&&!L){return P.contains(Q);}else{if(P.compareDocumentPosition&&Q.nodeType){return !!(P.compareDocumentPosition(Q)&16);}else{if(Q.nodeType){return !!this.getAncestorBy(Q,function(R){return R==P;});}}}return false;},inDocument:function(P){return this.isAncestor(M.documentElement,P);},getElementsBy:function(W,Q,R,T){Q=Q||"*";R=(R)?B.Dom.get(R):null||M;if(!R){return[];}var S=[],V=R.getElementsByTagName(Q);for(var U=0,P=V.length;U<P;++U){if(W(V[U])){S[S.length]=V[U];if(T){T(V[U]);}}}return S;},batch:function(T,W,V,R){T=(T&&(T.tagName||T.item))?T:B.Dom.get(T);if(!T||!W){return false;}var S=(R)?V:window;if(T.tagName||T.length===undefined){return W.call(S,T,V);}var U=[];for(var Q=0,P=T.length;Q<P;++Q){U[U.length]=W.call(S,T[Q],V);}return U;},getDocumentHeight:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollHeight:M.documentElement.scrollHeight;var P=Math.max(Q,B.Dom.getViewportHeight());return P;},getDocumentWidth:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollWidth:M.documentElement.scrollWidth;var P=Math.max(Q,B.Dom.getViewportWidth());return P;},getViewportHeight:function(){var P=self.innerHeight;
var Q=M.compatMode;if((Q||G)&&!C){P=(Q=="CSS1Compat")?M.documentElement.clientHeight:M.body.clientHeight;}return P;},getViewportWidth:function(){var P=self.innerWidth;var Q=M.compatMode;if(Q||G){P=(Q=="CSS1Compat")?M.documentElement.clientWidth:M.body.clientWidth;}return P;},getAncestorBy:function(P,Q){while(P=P.parentNode){if(D(P,Q)){return P;}}return null;},getAncestorByClassName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return B.Dom.hasClass(S,P);};return B.Dom.getAncestorBy(Q,R);},getAncestorByTagName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return S.tagName&&S.tagName.toUpperCase()==P.toUpperCase();};return B.Dom.getAncestorBy(Q,R);},getPreviousSiblingBy:function(P,Q){while(P){P=P.previousSibling;if(D(P,Q)){return P;}}return null;},getPreviousSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getPreviousSiblingBy(P);},getNextSiblingBy:function(P,Q){while(P){P=P.nextSibling;if(D(P,Q)){return P;}}return null;},getNextSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getNextSiblingBy(P);},getFirstChildBy:function(P,R){var Q=(D(P.firstChild,R))?P.firstChild:null;return Q||B.Dom.getNextSiblingBy(P.firstChild,R);},getFirstChild:function(P,Q){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getFirstChildBy(P);},getLastChildBy:function(P,R){if(!P){return null;}var Q=(D(P.lastChild,R))?P.lastChild:null;return Q||B.Dom.getPreviousSiblingBy(P.lastChild,R);},getLastChild:function(P){P=B.Dom.get(P);return B.Dom.getLastChildBy(P);},getChildrenBy:function(Q,S){var R=B.Dom.getFirstChildBy(Q,S);var P=R?[R]:[];B.Dom.getNextSiblingBy(R,function(T){if(!S||S(T)){P[P.length]=T;}return false;});return P;},getChildren:function(P){P=B.Dom.get(P);if(!P){}return B.Dom.getChildrenBy(P);},getDocumentScrollLeft:function(P){P=P||M;return Math.max(P.documentElement.scrollLeft,P.body.scrollLeft);},getDocumentScrollTop:function(P){P=P||M;return Math.max(P.documentElement.scrollTop,P.body.scrollTop);},insertBefore:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}return P.parentNode.insertBefore(Q,P);},insertAfter:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}if(P.nextSibling){return P.parentNode.insertBefore(Q,P.nextSibling);}else{return P.parentNode.appendChild(Q);}},getClientRegion:function(){var R=B.Dom.getDocumentScrollTop(),Q=B.Dom.getDocumentScrollLeft(),S=B.Dom.getViewportWidth()+Q,P=B.Dom.getViewportHeight()+R;return new B.Region(R,S,P,Q);}};var H=function(){if(M.documentElement.getBoundingClientRect){return function(Q){var R=Q.getBoundingClientRect();var P=Q.ownerDocument;return[R.left+B.Dom.getDocumentScrollLeft(P),R.top+B.Dom.getDocumentScrollTop(P)];};}else{return function(R){var S=[R.offsetLeft,R.offsetTop];var Q=R.offsetParent;var P=(L&&B.Dom.getStyle(R,"position")=="absolute"&&R.offsetParent==R.ownerDocument.body);if(Q!=R){while(Q){S[0]+=Q.offsetLeft;S[1]+=Q.offsetTop;if(!P&&L&&B.Dom.getStyle(Q,"position")=="absolute"){P=true;}Q=Q.offsetParent;}}if(P){S[0]-=R.ownerDocument.body.offsetLeft;S[1]-=R.ownerDocument.body.offsetTop;}Q=R.parentNode;while(Q.tagName&&!E.ROOT_TAG.test(Q.tagName)){if(Q.scrollTop||Q.scrollLeft){if(!E.OP_SCROLL.test(B.Dom.getStyle(Q,"display"))){if(!C||B.Dom.getStyle(Q,"overflow")!=="visible"){S[0]-=Q.scrollLeft;S[1]-=Q.scrollTop;}}}Q=Q.parentNode;}return S;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.2",build:"1076"});
Require.isLoaded['library.yui.dom.dom'] = true;
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M].slice();for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return -1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=L.length-1;O>-1;O--){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=J.length-1;O>-1;O--){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J.splice(O,1);return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M.splice(O,1);break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I.splice(Q,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;
},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;M=M+1){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;clearInterval(this._interval);this._interval=null;return ;}if(this.locked){return ;}if(this.isIE){if(!this.DOMReady){this.startInterval();return ;}}this.locked=true;var Q=!H;if(!Q){Q=(C>0&&F.length>0);}var P=[];var R=function(T,U){var S=T;if(U.override){if(U.override===true){S=U.obj;}else{S=U.override;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=F.length;L<K;L=L+1){O=F[L];if(O){N=this.getEl(O.id);if(N){if(O.checkReady){if(H||N.nextSibling||!Q){M.push(O);F[L]=null;}}else{R(N,O);F[L]=null;}}else{P.push(O);}}}for(L=0,K=M.length;L<K;L=L+1){O=M[L];R(this.getEl(O.id),O);}C--;if(Q){for(L=F.length-1;L>-1;L--){O=F[L];if(!O||!O.id){F.splice(L,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(Q){var K=YAHOO.util.Event,N,M,L,P,O,R=J.slice();for(N=0,P=J.length;N<P;++N){L=R[N];if(L){var S=window;if(L[K.ADJ_SCOPE]){if(L[K.ADJ_SCOPE]===true){S=L[K.UNLOAD_OBJ];}else{S=L[K.ADJ_SCOPE];}}L[K.FN].call(S,K.getEvent(Q,L[K.EL]),L[K.UNLOAD_OBJ]);R[N]=null;L=null;S=null;}}J=null;if(I){for(M=I.length-1;M>-1;M--){L=I[M];if(L){K.removeListener(L[K.EL],L[K.TYPE],L[K.FN],M);}}L=null;}G=null;K._simpleRemove(window,"unload",K._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;
/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;
if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.5.2",build:"1076"});
Require.isLoaded['library.yui.event.event'] = true;
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(B){var A=YAHOO.util.Event.getTarget(B);if(A.nodeName.toLowerCase()=="input"&&(A.type&&A.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);YAHOO.log("ActiveX Program Id  "+A+" added to _msxml_progid.","info","Connection");},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;YAHOO.log("Default POST header set to  "+A,"info","Connection");}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;YAHOO.log("Default XHR header set to  "+A,"info","Connection");}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;YAHOO.log("Default polling interval set to "+A+"ms","info","Connection");}},createXhrObject:function(E){var D,A;try{A=new XMLHttpRequest();D={conn:A,tId:E};YAHOO.log("XHR object created for transaction "+E,"info","Connection");}catch(C){for(var B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:E};YAHOO.log("ActiveX XHR object created for transaction "+E,"info","Connection");break;}catch(C){}}}finally{return D;}},getConnectionObject:function(A){var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={};C.tId=D;C.isUpload=true;}if(C){this._transaction_id++;}}catch(B){}finally{return C;}},asyncRequest:function(F,C,E,A){var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){YAHOO.log("Unable to create connection object.","error","Connection");return null;}else{if(E&&E.customevents){this.initCustomEvents(D,E);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D;}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}D.conn.open(F,C,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);YAHOO.log("Initialize transaction header X-Request-Header to XMLHttpRequest.","info","Connection");}}if((F.toUpperCase()=="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);YAHOO.log("Initialize header Content-Type to application/x-www-form-urlencoded; UTF-8 for POST transaction.","info","Connection");}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||"");YAHOO.log("Transaction "+D.tId+" sent.","info","Connection");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B);}return D;}},initCustomEvents:function(A,C){for(var B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);YAHOO.log("Transaction-specific Custom Event "+A[this._customEvents[B][1]]+" created.","info","Connection");A[this._customEvents[B][0]].subscribe(C.customevents[B]);YAHOO.log("Transaction-specific Custom Event "+A[this._customEvents[B][1]]+" subscribed.","info","Connection");}}},handleReadyState:function(C,D){var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(F,G,A){var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status;}else{D=13030;}}catch(E){D=13030;}if(D>=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C);YAHOO.log("Success callback. HTTP code is "+D,"info","Connection");}else{G.success.apply(G.scope,[C]);YAHOO.log("Success callback with scope. HTTP code is "+D,"info","Connection");}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C);}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C);
YAHOO.log("Failure callback. Exception detected. Status code is "+D,"warn","Connection");}else{G.failure.apply(G.scope,[C]);YAHOO.log("Failure callback with scope. Exception detected. Status code is "+D,"warn","Connection");}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);YAHOO.log("Failure callback. HTTP status code is "+D,"warn","Connection");}else{G.failure.apply(G.scope,[C]);YAHOO.log("Failure callback with scope. HTTP status code is "+D,"warn","Connection");}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C);}}this.releaseObject(F);C=null;},createResponseObject:function(A,G){var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E<F.length;E++){var B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=F[E].substring(B+2);}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;}},setHeader:function(A){if(this._has_default_headers){for(var B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);YAHOO.log("Default HTTP header "+B+" set with value of "+this._default_headers[B],"info","Connection");}}}if(this._has_http_headers){for(var B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);YAHOO.log("HTTP header "+B+" set with value of "+this._http_headers[B],"info","Connection");}}delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(K,E,B){this.resetFormState();var J;if(typeof K=="string"){J=(document.getElementById(K)||document.forms[K]);}else{if(typeof K=="object"){J=K;}else{YAHOO.log("Unable to create form object "+K,"warn","Connection");return ;}}if(E){var F=this.createFrame((window.location.href.toLowerCase().indexOf("https")===0||B)?true:false);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=J;return ;}var A,I,G,L;var H=false;for(var D=0;D<J.elements.length;D++){A=J.elements[D];L=A.disabled;I=A.name;G=A.value;if(!L&&I){switch(A.type){case"select-one":case"select-multiple":for(var C=0;C<A.options.length;C++){if(A.options[C].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].attributes["value"].specified?A.options[C].value:A.options[C].text)+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].hasAttribute("value")?A.options[C].value:A.options[C].text)+"&";}}}break;case"radio":case"checkbox":if(A.checked){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(H===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}H=true;}break;default:this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);YAHOO.log("Form initialized for transaction. HTML form POST message is: "+this._sFormData,"info","Connection");this.initHeader("Content-Type",this._default_form_header);YAHOO.log("Initialize header Content-Type to application/x-www-form-urlencoded for setForm() transaction.","info","Connection");return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(A){var B="yuiIO"+this._transaction_id;var C;if(window.ActiveXObject){C=document.createElement('<iframe id="'+B+'" name="'+B+'" />');if(typeof A=="boolean"){C.src="javascript:false";}}else{C=document.createElement("iframe");C.id=B;C.name=B;}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C);YAHOO.log("File upload iframe created. Id is:"+B,"info","Connection");},appendPostData:function(A){var D=[];var B=A.split("&");for(var C=0;C<B.length;C++){var E=B[C].indexOf("=");if(E!=-1){D[C]=document.createElement("input");D[C].type="hidden";D[C].name=B[C].substring(0,E);D[C].value=B[C].substring(E+1);this._formNode.appendChild(D[C]);}}return D;},uploadFile:function(D,M,E,C){var N=this;var H="yuiIO"+D.tId;var I="multipart/form-data";var K=document.getElementById(H);var J=(M&&M.argument)?M.argument:null;var B={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",E);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",H);if(YAHOO.env.ua.ie){this._formNode.setAttribute("encoding",I);}else{this._formNode.setAttribute("enctype",I);}if(C){var L=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,J);if(D.startEvent){D.startEvent.fire(D,J);}if(M&&M.timeout){this._timeOut[D.tId]=window.setTimeout(function(){N.abort(D,M,true);},M.timeout);}if(L&&L.length>0){for(var G=0;G<L.length;G++){this._formNode.removeChild(L[G]);}}for(var A in B){if(YAHOO.lang.hasOwnProperty(B,A)){if(B[A]){this._formNode.setAttribute(A,B[A]);}else{this._formNode.removeAttribute(A);}}}this.resetFormState();var F=function(){if(M&&M.timeout){window.clearTimeout(N._timeOut[D.tId]);
delete N._timeOut[D.tId];}N.completeEvent.fire(D,J);if(D.completeEvent){D.completeEvent.fire(D,J);}var P={};P.tId=D.tId;P.argument=M.argument;try{P.responseText=K.contentWindow.document.body?K.contentWindow.document.body.innerHTML:K.contentWindow.document.documentElement.textContent;P.responseXML=K.contentWindow.document.XMLDocument?K.contentWindow.document.XMLDocument:K.contentWindow.document;}catch(O){}if(M&&M.upload){if(!M.scope){M.upload(P);YAHOO.log("Upload callback.","info","Connection");}else{M.upload.apply(M.scope,[P]);YAHOO.log("Upload callback with scope.","info","Connection");}}N.uploadEvent.fire(P);if(D.uploadEvent){D.uploadEvent.fire(P);}YAHOO.util.Event.removeListener(K,"load",F);setTimeout(function(){document.body.removeChild(K);N.releaseObject(D);YAHOO.log("File upload iframe destroyed. Id is:"+H,"info","Connection");},100);};YAHOO.util.Event.addListener(K,"load",F);},abort:function(E,G,A){var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);YAHOO.log("File upload iframe destroyed. Id is:"+C,"info","Connection");if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);YAHOO.log("Transaction "+E.tId+" aborted.","info","Connection");}return D;},isCallInProgress:function(B){if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0;}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return document.getElementById(A)?true:false;}else{return false;}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;YAHOO.log("Connection object for transaction "+A.tId+" destroyed.","info","Connection");A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.5.2",build:"1076"});
Require.isLoaded['library.yui.connection.connection'] = true;
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
(function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,E,D){if(this.patterns.noNegatives.test(C)){E=(E>0)?E:0;}B.Dom.setStyle(this.getEl(),C,E+D);},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H);};A.NAME="ColorAnim";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E;}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)];}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)];}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)];}return null;};B.getAttribute=function(E){var G=this.getEl();if(this.patterns.color.test(E)){var H=YAHOO.util.Dom.getStyle(G,E);
if(this.patterns.transparent.test(H)){var F=G.parentNode;H=C.Dom.getStyle(F,E);while(F&&this.patterns.transparent.test(H)){F=F.parentNode;H=C.Dom.getStyle(F,E);if(F.tagName.toUpperCase()=="HTML"){H="#fff";}}}}else{H=D.getAttribute.call(this,E);}return H;};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})();
/*
TERMS OF USE - EASING EQUATIONS
Open source under the BSD License.
Copyright 2001 Robert Penner All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]);}else{E.Dom.setXY(H,E.Dom.getXY(H));}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);
var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.5.2",build:"1076"});
Require.isLoaded['library.yui.animation.animation'] = true;
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(D,C){for(var E in this.ids){for(var B in this.ids[E]){var F=this.ids[E][B];if(!this.isTypeOfDD(F)){continue;}F[D].apply(F,C);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(B){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(C,B){if(!this.initialized){this.init();}if(!this.ids[B]){this.ids[B]={};}this.ids[B][C.id]=C;},removeDDFromGroup:function(D,B){if(!this.ids[B]){this.ids[B]={};}var C=this.ids[B];if(C&&C[D.id]){delete C[D.id];}},_remove:function(C){for(var B in C.groups){if(B&&this.ids[B][C.id]){delete this.ids[B][C.id];}}delete this.handleIds[C.id];},regHandle:function(C,B){if(!this.handleIds[C]){this.handleIds[C]={};}this.handleIds[C][B]=B;},isDragDrop:function(B){return(this.getDDById(B))?true:false;},getRelated:function(G,C){var F=[];for(var E in G.groups){for(var D in this.ids[E]){var B=this.ids[E][D];if(!this.isTypeOfDD(B)){continue;}if(!C||B.isTarget){F[F.length]=B;}}}return F;},isLegalTarget:function(F,E){var C=this.getRelated(F,true);for(var D=0,B=C.length;D<B;++D){if(C[D].id==E.id){return true;}}return false;},isTypeOfDD:function(B){return(B&&B.__ygDragDrop);},isHandle:function(C,B){return(this.handleIds[C]&&this.handleIds[C][B]);},getDDById:function(C){for(var B in this.ids){if(this.ids[B][C]){return this.ids[B][C];}}return null;},handleMouseDown:function(D,C){this.currentTarget=YAHOO.util.Event.getTarget(D);this.dragCurrent=C;var B=C.getEl();this.startX=YAHOO.util.Event.getPageX(D);this.startY=YAHOO.util.Event.getPageY(D);this.deltaX=this.startX-B.offsetLeft;this.deltaY=this.startY-B.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var E=YAHOO.util.DDM;E.startDrag(E.startX,E.startY);E.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(B,D){clearTimeout(this.clickTimeout);var C=this.dragCurrent;if(C&&C.events.b4StartDrag){C.b4StartDrag(B,D);C.fireEvent("b4StartDragEvent",{x:B,y:D});}if(C&&C.events.startDrag){C.startDrag(B,D);C.fireEvent("startDragEvent",{x:B,y:D});}this.dragThreshMet=true;},handleMouseUp:function(B){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(B);}this.fromTimeout=false;this.fireEvents(B,true);}else{}this.stopDrag(B);this.stopEvent(B);}},stopEvent:function(B){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(B);}if(this.preventDefault){YAHOO.util.Event.preventDefault(B);}},stopDrag:function(D,C){var B=this.dragCurrent;if(B&&!C){if(this.dragThreshMet){if(B.events.b4EndDrag){B.b4EndDrag(D);B.fireEvent("b4EndDragEvent",{e:D});}if(B.events.endDrag){B.endDrag(D);B.fireEvent("endDragEvent",{e:D});}}if(B.events.mouseUp){B.onMouseUp(D);B.fireEvent("mouseUpEvent",{e:D});}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(E){var B=this.dragCurrent;if(B){if(YAHOO.util.Event.isIE&&!E.button){this.stopEvent(E);return this.handleMouseUp(E);}else{if(E.clientX<0||E.clientY<0){}}if(!this.dragThreshMet){var D=Math.abs(this.startX-YAHOO.util.Event.getPageX(E));var C=Math.abs(this.startY-YAHOO.util.Event.getPageY(E));if(D>this.clickPixelThresh||C>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(B&&B.events.b4Drag){B.b4Drag(E);B.fireEvent("b4DragEvent",{e:E});}if(B&&B.events.drag){B.onDrag(E);B.fireEvent("dragEvent",{e:E});}if(B){this.fireEvents(E,false);}}this.stopEvent(E);}},fireEvents:function(U,K){var Z=this.dragCurrent;if(!Z||Z.isLocked()||Z.dragOnly){return ;}var M=YAHOO.util.Event.getPageX(U),L=YAHOO.util.Event.getPageY(U),O=new YAHOO.util.Point(M,L),J=Z.getTargetCoord(O.x,O.y),E=Z.getDragEl(),D=["out","over","drop","enter"],T=new YAHOO.util.Region(J.y,J.x+E.offsetWidth,J.y+E.offsetHeight,J.x),H=[],C={},P=[],a={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var R in this.dragOvers){var c=this.dragOvers[R];if(!this.isTypeOfDD(c)){continue;}if(!this.isOverTarget(O,c,this.mode,T)){a.outEvts.push(c);}H[R]=true;delete this.dragOvers[R];}for(var Q in Z.groups){if("string"!=typeof Q){continue;}for(R in this.ids[Q]){var F=this.ids[Q][R];if(!this.isTypeOfDD(F)){continue;}if(F.isTarget&&!F.isLocked()&&F!=Z){if(this.isOverTarget(O,F,this.mode,T)){C[Q]=true;if(K){a.dropEvts.push(F);}else{if(!H[F.id]){a.enterEvts.push(F);}else{a.overEvts.push(F);}this.dragOvers[F.id]=F;}}}}}this.interactionInfo={out:a.outEvts,enter:a.enterEvts,over:a.overEvts,drop:a.dropEvts,point:O,draggedRegion:T,sourceRegion:this.locationCache[Z.id],validDrop:K};for(var B in C){P.push(B);}if(K&&!a.dropEvts.length){this.interactionInfo.validDrop=false;if(Z.events.invalidDrop){Z.onInvalidDrop(U);Z.fireEvent("invalidDropEvent",{e:U});}}for(R=0;R<D.length;R++){var X=null;if(a[D[R]+"Evts"]){X=a[D[R]+"Evts"];}if(X&&X.length){var G=D[R].charAt(0).toUpperCase()+D[R].substr(1),W="onDrag"+G,I="b4Drag"+G,N="drag"+G+"Event",V="drag"+G;if(this.mode){if(Z.events[I]){Z[I](U,X,P);Z.fireEvent(I+"Event",{event:U,info:X,group:P});}if(Z.events[V]){Z[W](U,X,P);Z.fireEvent(N,{event:U,info:X,group:P});}}else{for(var Y=0,S=X.length;Y<S;++Y){if(Z.events[I]){Z[I](U,X[Y].id,P[0]);Z.fireEvent(I+"Event",{event:U,info:X[Y].id,group:P[0]});}if(Z.events[V]){Z[W](U,X[Y].id,P[0]);Z.fireEvent(N,{event:U,info:X[Y].id,group:P[0]});
}}}}}},getBestMatch:function(D){var F=null;var C=D.length;if(C==1){F=D[0];}else{for(var E=0;E<C;++E){var B=D[E];if(this.mode==this.INTERSECT&&B.cursorIsOver){F=B;break;}else{if(!F||!F.overlap||(B.overlap&&F.overlap.getArea()<B.overlap.getArea())){F=B;}}}}return F;},refreshCache:function(C){var E=C||this.ids;for(var B in E){if("string"!=typeof B){continue;}for(var D in this.ids[B]){var F=this.ids[B][D];if(this.isTypeOfDD(F)){var G=this.getLocation(F);if(G){this.locationCache[F.id]=G;}else{delete this.locationCache[F.id];}}}}},verifyEl:function(C){try{if(C){var B=C.offsetParent;if(B){return true;}}}catch(D){}return false;},getLocation:function(G){if(!this.isTypeOfDD(G)){return null;}var E=G.getEl(),J,D,C,L,K,M,B,I,F;try{J=YAHOO.util.Dom.getXY(E);}catch(H){}if(!J){return null;}D=J[0];C=D+E.offsetWidth;L=J[1];K=L+E.offsetHeight;M=L-G.padding[0];B=C+G.padding[1];I=K+G.padding[2];F=D-G.padding[3];return new YAHOO.util.Region(M,B,I,F);},isOverTarget:function(J,B,D,E){var F=this.locationCache[B.id];if(!F||!this.useCache){F=this.getLocation(B);this.locationCache[B.id]=F;}if(!F){return false;}B.cursorIsOver=F.contains(J);var I=this.dragCurrent;if(!I||(!D&&!I.constrainX&&!I.constrainY)){return B.cursorIsOver;}B.overlap=null;if(!E){var G=I.getTargetCoord(J.x,J.y);var C=I.getDragEl();E=new YAHOO.util.Region(G.y,G.x+C.offsetWidth,G.y+C.offsetHeight,G.x);}var H=E.intersect(F);if(H){B.overlap=H;return(D)?true:B.cursorIsOver;}else{return false;}},_onUnload:function(C,B){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(C){var B=this.elementCache[C];if(!B||!B.el){B=this.elementCache[C]=new this.ElementWrapper(YAHOO.util.Dom.get(C));}return B;},getElement:function(B){return YAHOO.util.Dom.get(B);},getCss:function(C){var B=YAHOO.util.Dom.get(C);return(B)?B.style:null;},ElementWrapper:function(B){this.el=B||null;this.id=this.el&&B.id;this.css=this.el&&B.style;},getPosX:function(B){return YAHOO.util.Dom.getX(B);},getPosY:function(B){return YAHOO.util.Dom.getY(B);},swapNode:function(D,B){if(D.swapNode){D.swapNode(B);}else{var E=B.parentNode;var C=B.nextSibling;if(C==D){E.insertBefore(D,B);}else{if(B==D.nextSibling){E.insertBefore(B,D);}else{D.parentNode.replaceChild(B,D);E.insertBefore(D,C);}}}},getScroll:function(){var D,B,E=document.documentElement,C=document.body;if(E&&(E.scrollTop||E.scrollLeft)){D=E.scrollTop;B=E.scrollLeft;}else{if(C){D=C.scrollTop;B=C.scrollLeft;}else{}}return{top:D,left:B};},getStyle:function(C,B){return YAHOO.util.Dom.getStyle(C,B);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(B,D){var C=YAHOO.util.Dom.getXY(D);YAHOO.util.Dom.setXY(B,C);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(C,B){return(C-B);},_timeoutCount:0,_addListeners:function(){var B=YAHOO.util.DDM;if(YAHOO.util.Event&&document){B._onLoad();}else{if(B._timeoutCount>2000){}else{setTimeout(B._addListeners,10);if(document&&document.body){B._timeoutCount+=1;}}}},handleWasClicked:function(B,D){if(this.isHandle(D,B.id)){return true;}else{var C=B.parentNode;while(C){if(this.isHandle(D,C.id)){return true;}else{C=C.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id);}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);
},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return ;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(H,G){var D=H.which||H.button;if(this.primaryButtonOnly&&D>1){return ;}if(this.isLocked()){return ;}var C=this.b4MouseDown(H);if(this.events.b4MouseDown){C=this.fireEvent("b4MouseDownEvent",H);}var E=this.onMouseDown(H);if(this.events.mouseDown){E=this.fireEvent("mouseDownEvent",H);}if((C===false)||(E===false)){return ;}this.DDM.refreshCache(this.groups);var F=new YAHOO.util.Point(A.getPageX(H),A.getPageY(H));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(F,this)){}else{if(this.clickValidator(H)){this.setStartPosition();this.DDM.handleMouseDown(H,this);this.DDM.stopEvent(H);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];
}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return ;}var G=this.getDragEl(),E=YAHOO.util.Dom;if(!G){G=document.createElement("div");G.id=this.dragElId;var D=G.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");G.appendChild(C);if(YAHOO.env.ua.ie){var F=document.createElement("iframe");F.setAttribute("src","javascript:");F.setAttribute("scrolling","no");F.setAttribute("frameborder","0");G.insertBefore(F,G.firstChild);E.setStyle(F,"height","100%");E.setStyle(F,"width","100%");E.setStyle(F,"position","absolute");E.setStyle(F,"top","0");E.setStyle(F,"left","0");E.setStyle(F,"opacity","0");E.setStyle(F,"zIndex","-1");E.setStyle(F.nextSibling,"zIndex","2");}A.insertBefore(G,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.5.2",build:"1076"});
Require.isLoaded['library.yui.dragdrop.dragdrop'] = true;
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
YAHOO.widget.Slider=function(C,A,B,D){YAHOO.widget.Slider.ANIM_AVAIL=(!YAHOO.lang.isUndefined(YAHOO.util.Anim));if(C){this.init(C,A,true);this.initSlider(D);this.initThumb(B);}};YAHOO.widget.Slider.getHorizSlider=function(B,C,E,D,A){return new YAHOO.widget.Slider(B,B,new YAHOO.widget.SliderThumb(C,B,E,D,0,0,A),"horiz");};YAHOO.widget.Slider.getVertSlider=function(C,D,A,E,B){return new YAHOO.widget.Slider(C,C,new YAHOO.widget.SliderThumb(D,C,0,0,A,E,B),"vert");};YAHOO.widget.Slider.getSliderRegion=function(C,D,F,E,A,G,B){return new YAHOO.widget.Slider(C,C,new YAHOO.widget.SliderThumb(D,C,F,E,A,G,B),"region");};YAHOO.widget.Slider.ANIM_AVAIL=false;YAHOO.extend(YAHOO.widget.Slider,YAHOO.util.DragDrop,{dragOnly:true,initSlider:function(A){this.type=A;this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);this.isTarget=false;this.animate=YAHOO.widget.Slider.ANIM_AVAIL;this.backgroundEnabled=true;this.tickPause=40;this.enableKeys=true;this.keyIncrement=20;this.moveComplete=true;this.animationDuration=0.2;this.SOURCE_UI_EVENT=1;this.SOURCE_SET_VALUE=2;this.valueChangeSource=0;this._silent=false;this.lastOffset=[0,0];},initThumb:function(B){var A=this;this.thumb=B;B.cacheBetweenDrags=true;if(B._isHoriz&&B.xTicks&&B.xTicks.length){this.tickPause=Math.round(360/B.xTicks.length);}else{if(B.yTicks&&B.yTicks.length){this.tickPause=Math.round(360/B.yTicks.length);}}B.onAvailable=function(){return A.setStartSliderState();};B.onMouseDown=function(){return A.focus();};B.startDrag=function(){A._slideStart();};B.onDrag=function(){A.fireEvents(true);};B.onMouseUp=function(){A.thumbMouseUp();};},onAvailable:function(){var A=YAHOO.util.Event;A.on(this.id,"keydown",this.handleKeyDown,this,true);A.on(this.id,"keypress",this.handleKeyPress,this,true);},handleKeyPress:function(C){if(this.enableKeys){var A=YAHOO.util.Event;var B=A.getCharCode(C);switch(B){case 37:case 38:case 39:case 40:case 36:case 35:A.preventDefault(C);break;default:}}},handleKeyDown:function(E){if(this.enableKeys){var G=YAHOO.util.Event;var C=G.getCharCode(E),I=this.thumb;var B=this.getXValue(),F=this.getYValue();var H=false;var D=true;switch(C){case 37:B-=this.keyIncrement;break;case 38:F-=this.keyIncrement;break;case 39:B+=this.keyIncrement;break;case 40:F+=this.keyIncrement;break;case 36:B=I.leftConstraint;F=I.topConstraint;break;case 35:B=I.rightConstraint;F=I.bottomConstraint;break;default:D=false;}if(D){if(I._isRegion){this.setRegionValue(B,F,true);}else{var A=(I._isHoriz)?B:F;this.setValue(A,true);}G.stopEvent(E);}}},setStartSliderState:function(){this.setThumbCenterPoint();this.baselinePos=YAHOO.util.Dom.getXY(this.getEl());this.thumb.startOffset=this.thumb.getOffsetFromParent(this.baselinePos);if(this.thumb._isRegion){if(this.deferredSetRegionValue){this.setRegionValue.apply(this,this.deferredSetRegionValue,true);this.deferredSetRegionValue=null;}else{this.setRegionValue(0,0,true,true,true);}}else{if(this.deferredSetValue){this.setValue.apply(this,this.deferredSetValue,true);this.deferredSetValue=null;}else{this.setValue(0,true,true,true);}}},setThumbCenterPoint:function(){var A=this.thumb.getEl();if(A){this.thumbCenterPoint={x:parseInt(A.offsetWidth/2,10),y:parseInt(A.offsetHeight/2,10)};}},lock:function(){this.thumb.lock();this.locked=true;},unlock:function(){this.thumb.unlock();this.locked=false;},thumbMouseUp:function(){if(!this.isLocked()&&!this.moveComplete){this.endMove();}},onMouseUp:function(){if(!this.isLocked()&&!this.moveComplete){this.endMove();}},getThumb:function(){return this.thumb;},focus:function(){this.valueChangeSource=this.SOURCE_UI_EVENT;var A=this.getEl();if(A.focus){try{A.focus();}catch(B){}}this.verifyOffset();if(this.isLocked()){return false;}else{this._slideStart();return true;}},onChange:function(A,B){},onSlideStart:function(){},onSlideEnd:function(){},getValue:function(){return this.thumb.getValue();},getXValue:function(){return this.thumb.getXValue();},getYValue:function(){return this.thumb.getYValue();},handleThumbChange:function(){},setValue:function(G,C,D,A){this._silent=A;this.valueChangeSource=this.SOURCE_SET_VALUE;if(!this.thumb.available){this.deferredSetValue=arguments;return false;}if(this.isLocked()&&!D){return false;}if(isNaN(G)){return false;}var B=this.thumb;B.lastOffset=[G,G];var F,E;this.verifyOffset(true);if(B._isRegion){return false;}else{if(B._isHoriz){this._slideStart();F=B.initPageX+G+this.thumbCenterPoint.x;this.moveThumb(F,B.initPageY,C);}else{this._slideStart();E=B.initPageY+G+this.thumbCenterPoint.y;this.moveThumb(B.initPageX,E,C);}}return true;},setRegionValue:function(H,A,D,E,B){this._silent=B;this.valueChangeSource=this.SOURCE_SET_VALUE;if(!this.thumb.available){this.deferredSetRegionValue=arguments;return false;}if(this.isLocked()&&!E){return false;}if(isNaN(H)){return false;}var C=this.thumb;C.lastOffset=[H,A];this.verifyOffset(true);if(C._isRegion){this._slideStart();var G=C.initPageX+H+this.thumbCenterPoint.x;var F=C.initPageY+A+this.thumbCenterPoint.y;this.moveThumb(G,F,D);return true;}return false;},verifyOffset:function(B){var A=YAHOO.util.Dom.getXY(this.getEl());if(A){if(A[0]!=this.baselinePos[0]||A[1]!=this.baselinePos[1]){this.thumb.resetConstraints();this.baselinePos=A;return false;}}return true;},moveThumb:function(G,F,E,D){var H=this.thumb;var I=this;if(!H.available){return ;}H.setDelta(this.thumbCenterPoint.x,this.thumbCenterPoint.y);var B=H.getTargetCoord(G,F);var C=[B.x,B.y];this._slideStart();if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&H._graduated&&!E){this.lock();this.curCoord=YAHOO.util.Dom.getXY(this.thumb.getEl());setTimeout(function(){I.moveOneTick(C);},this.tickPause);}else{if(this.animate&&YAHOO.widget.Slider.ANIM_AVAIL&&!E){this.lock();var A=new YAHOO.util.Motion(H.id,{points:{to:C}},this.animationDuration,YAHOO.util.Easing.easeOut);A.onComplete.subscribe(function(){I.endMove();});A.animate();}else{H.setDragElPos(G,F);if(!D){this.endMove();}}}},_slideStart:function(){if(!this._sliding){if(!this._silent){this.onSlideStart();
this.fireEvent("slideStart");}this._sliding=true;}},_slideEnd:function(){if(this._sliding&&this.moveComplete){if(!this._silent){this.onSlideEnd();this.fireEvent("slideEnd");}this._sliding=false;this._silent=false;this.moveComplete=false;}},moveOneTick:function(B){var E=this.thumb,D;var F=null;if(E._isRegion){F=this._getNextX(this.curCoord,B);var A=(F)?F[0]:this.curCoord[0];F=this._getNextY([A,this.curCoord[1]],B);}else{if(E._isHoriz){F=this._getNextX(this.curCoord,B);}else{F=this._getNextY(this.curCoord,B);}}if(F){this.curCoord=F;this.thumb.alignElWithMouse(E.getEl(),F[0],F[1]);if(!(F[0]==B[0]&&F[1]==B[1])){var C=this;setTimeout(function(){C.moveOneTick(B);},this.tickPause);}else{this.endMove();}}else{this.endMove();}},_getNextX:function(A,B){var D=this.thumb;var F;var C=[];var E=null;if(A[0]>B[0]){F=D.tickSize-this.thumbCenterPoint.x;C=D.getTargetCoord(A[0]-F,A[1]);E=[C.x,C.y];}else{if(A[0]<B[0]){F=D.tickSize+this.thumbCenterPoint.x;C=D.getTargetCoord(A[0]+F,A[1]);E=[C.x,C.y];}else{}}return E;},_getNextY:function(A,B){var D=this.thumb;var F;var C=[];var E=null;if(A[1]>B[1]){F=D.tickSize-this.thumbCenterPoint.y;C=D.getTargetCoord(A[0],A[1]-F);E=[C.x,C.y];}else{if(A[1]<B[1]){F=D.tickSize+this.thumbCenterPoint.y;C=D.getTargetCoord(A[0],A[1]+F);E=[C.x,C.y];}else{}}return E;},b4MouseDown:function(A){this.thumb.autoOffset();this.thumb.resetConstraints();},onMouseDown:function(B){if(!this.isLocked()&&this.backgroundEnabled){var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.focus();this.moveThumb(A,C);}},onDrag:function(B){if(!this.isLocked()){var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.moveThumb(A,C,true,true);this.fireEvents();}},endMove:function(){this.unlock();this.moveComplete=true;this.fireEvents();},fireEvents:function(C){var B=this.thumb;if(!C){B.cachePosition();}if(!this.isLocked()){if(B._isRegion){var E=B.getXValue();var D=B.getYValue();if(E!=this.previousX||D!=this.previousY){if(!this._silent){this.onChange(E,D);this.fireEvent("change",{x:E,y:D});}}this.previousX=E;this.previousY=D;}else{var A=B.getValue();if(A!=this.previousVal){if(!this._silent){this.onChange(A);this.fireEvent("change",A);}}this.previousVal=A;}this._slideEnd();}},toString:function(){return("Slider ("+this.type+") "+this.id);}});YAHOO.augment(YAHOO.widget.Slider,YAHOO.util.EventProvider);YAHOO.widget.SliderThumb=function(G,B,E,D,A,F,C){if(G){YAHOO.widget.SliderThumb.superclass.constructor.call(this,G,B);this.parentElId=B;}this.isTarget=false;this.tickSize=C;this.maintainOffset=true;this.initSlider(E,D,A,F,C);this.scroll=false;};YAHOO.extend(YAHOO.widget.SliderThumb,YAHOO.util.DD,{startOffset:null,dragOnly:true,_isHoriz:false,_prevVal:0,_graduated:false,getOffsetFromParent0:function(C){var A=YAHOO.util.Dom.getXY(this.getEl());var B=C||YAHOO.util.Dom.getXY(this.parentElId);return[(A[0]-B[0]),(A[1]-B[1])];},getOffsetFromParent:function(H){var A=this.getEl(),E;if(!this.deltaOffset){var I=YAHOO.util.Dom.getXY(A);var F=H||YAHOO.util.Dom.getXY(this.parentElId);E=[(I[0]-F[0]),(I[1]-F[1])];var B=parseInt(YAHOO.util.Dom.getStyle(A,"left"),10);var K=parseInt(YAHOO.util.Dom.getStyle(A,"top"),10);var D=B-E[0];var C=K-E[1];if(isNaN(D)||isNaN(C)){}else{this.deltaOffset=[D,C];}}else{var J=parseInt(YAHOO.util.Dom.getStyle(A,"left"),10);var G=parseInt(YAHOO.util.Dom.getStyle(A,"top"),10);E=[J+this.deltaOffset[0],G+this.deltaOffset[1]];}return E;},initSlider:function(D,C,A,E,B){this.initLeft=D;this.initRight=C;this.initUp=A;this.initDown=E;this.setXConstraint(D,C,B);this.setYConstraint(A,E,B);if(B&&B>1){this._graduated=true;}this._isHoriz=(D||C);this._isVert=(A||E);this._isRegion=(this._isHoriz&&this._isVert);},clearTicks:function(){YAHOO.widget.SliderThumb.superclass.clearTicks.call(this);this.tickSize=0;this._graduated=false;},getValue:function(){return(this._isHoriz)?this.getXValue():this.getYValue();},getXValue:function(){if(!this.available){return 0;}var A=this.getOffsetFromParent();if(YAHOO.lang.isNumber(A[0])){this.lastOffset=A;return(A[0]-this.startOffset[0]);}else{return(this.lastOffset[0]-this.startOffset[0]);}},getYValue:function(){if(!this.available){return 0;}var A=this.getOffsetFromParent();if(YAHOO.lang.isNumber(A[1])){this.lastOffset=A;return(A[1]-this.startOffset[1]);}else{return(this.lastOffset[1]-this.startOffset[1]);}},toString:function(){return"SliderThumb "+this.id;},onChange:function(A,B){}});YAHOO.widget.DualSlider=function(E,B,D,A){var C=this,G=YAHOO.lang;this.minSlider=E;this.maxSlider=B;this.activeSlider=E;this.isHoriz=E.thumb._isHoriz;A=YAHOO.lang.isArray(A)?A:[0,D];A[0]=Math.min(Math.max(parseInt(A[0],10)|0,0),D);A[1]=Math.max(Math.min(parseInt(A[1],10)|0,D),0);if(A[0]>A[1]){A.splice(0,2,A[1],A[0]);}var F={min:false,max:false};this.minSlider.thumb.onAvailable=function(){E.setStartSliderState();F.min=true;if(F.max){E.setValue(A[0],true,true,true);B.setValue(A[1],true,true,true);C.updateValue(true);C.fireEvent("ready",C);}};this.maxSlider.thumb.onAvailable=function(){B.setStartSliderState();F.max=true;if(F.min){E.setValue(A[0],true,true,true);B.setValue(A[1],true,true,true);C.updateValue(true);C.fireEvent("ready",C);}};E.onMouseDown=function(H){C._handleMouseDown(H);};B.onMouseDown=function(H){YAHOO.util.Event.stopEvent(H);};E.onDrag=B.onDrag=function(H){C._handleDrag(H);};E.subscribe("change",this._handleMinChange,E,this);E.subscribe("slideStart",this._handleSlideStart,E,this);E.subscribe("slideEnd",this._handleSlideEnd,E,this);B.subscribe("change",this._handleMaxChange,B,this);B.subscribe("slideStart",this._handleSlideStart,B,this);B.subscribe("slideEnd",this._handleSlideEnd,B,this);this.createEvent("ready",this);this.createEvent("change",this);this.createEvent("slideStart",this);this.createEvent("slideEnd",this);};YAHOO.widget.DualSlider.prototype={minVal:-1,maxVal:-1,minRange:0,_handleSlideStart:function(B,A){this.fireEvent("slideStart",A);},_handleSlideEnd:function(B,A){this.fireEvent("slideEnd",A);},_handleDrag:function(A){YAHOO.widget.Slider.prototype.onDrag.call(this.activeSlider,A);
},_handleMinChange:function(){this.activeSlider=this.minSlider;this.updateValue();},_handleMaxChange:function(){this.activeSlider=this.maxSlider;this.updateValue();},setValues:function(E,H,F,B,G){var C=this.minSlider,J=this.maxSlider,A=C.thumb,I=J.thumb,K=this,D={min:false,max:false};if(A._isHoriz){A.setXConstraint(A.leftConstraint,I.rightConstraint,A.tickSize);I.setXConstraint(A.leftConstraint,I.rightConstraint,I.tickSize);}else{A.setYConstraint(A.topConstraint,I.bottomConstraint,A.tickSize);I.setYConstraint(A.topConstraint,I.bottomConstraint,I.tickSize);}this._oneTimeCallback(C,"slideEnd",function(){D.min=true;if(D.max){K.updateValue(G);setTimeout(function(){K._cleanEvent(C,"slideEnd");K._cleanEvent(J,"slideEnd");},0);}});this._oneTimeCallback(J,"slideEnd",function(){D.max=true;if(D.min){K.updateValue(G);setTimeout(function(){K._cleanEvent(C,"slideEnd");K._cleanEvent(J,"slideEnd");},0);}});C.setValue(E,F,B,G);J.setValue(H,F,B,G);},setMinValue:function(C,E,F,B){var D=this.minSlider;this.activeSlider=D;var A=this;this._oneTimeCallback(D,"slideEnd",function(){A.updateValue(B);setTimeout(function(){A._cleanEvent(D,"slideEnd");},0);});D.setValue(C,E,F,B);},setMaxValue:function(A,E,F,C){var D=this.maxSlider;this.activeSlider=D;var B=this;this._oneTimeCallback(D,"slideEnd",function(){B.updateValue(C);setTimeout(function(){B._cleanEvent(D,"slideEnd");},0);});D.setValue(A,E,F,C);},updateValue:function(F){var B=this.minSlider.getValue(),G=this.maxSlider.getValue(),C=false;if(B!=this.minVal||G!=this.maxVal){C=true;var A=this.minSlider.thumb;var I=this.maxSlider.thumb;var D=this.minSlider.thumbCenterPoint.x+this.maxSlider.thumbCenterPoint.x;var E=Math.max(G-D-this.minRange,0);var H=Math.min(-B-D-this.minRange,0);if(this.isHoriz){E=Math.min(E,I.rightConstraint);A.setXConstraint(A.leftConstraint,E,A.tickSize);I.setXConstraint(H,I.rightConstraint,I.tickSize);}else{E=Math.min(E,I.bottomConstraint);A.setYConstraint(A.leftConstraint,E,A.tickSize);I.setYConstraint(H,I.bottomConstraint,I.tickSize);}}this.minVal=B;this.maxVal=G;if(C&&!F){this.fireEvent("change",this);}},selectActiveSlider:function(C){var B=this.minSlider.getValue(),A=this.maxSlider.getValue(),D;if(this.isHoriz){D=YAHOO.util.Event.getPageX(C)-this.minSlider.initPageX-this.minSlider.thumbCenterPoint.x;}else{D=YAHOO.util.Event.getPageY(C)-this.minSlider.initPageY-this.minSlider.thumbCenterPoint.y;}if(D<B){this.activeSlider=this.minSlider;}else{if(D>A){this.activeSlider=this.maxSlider;}else{this.activeSlider=D*2>A+B?this.maxSlider:this.minSlider;}}},_handleMouseDown:function(A){this.selectActiveSlider(A);YAHOO.widget.Slider.prototype.onMouseDown.call(this.activeSlider,A);},_oneTimeCallback:function(C,A,B){C.subscribe(A,function(){C.unsubscribe(A,arguments.callee);B.apply({},[].slice.apply(arguments));});},_cleanEvent:function(H,B){if(H.__yui_events&&H.events[B]){var G,F,A;for(F=H.__yui_events.length;F>=0;--F){if(H.__yui_events[F].type===B){G=H.__yui_events[F];break;}}if(G){var E=G.subscribers,C=[],D=0;for(F=0,A=E.length;F<A;++F){if(E[F]){C[D++]=E[F];}}G.subscribers=C;}}}};YAHOO.augment(YAHOO.widget.DualSlider,YAHOO.util.EventProvider);YAHOO.widget.Slider.getHorizDualSlider=function(F,C,K,G,H,B){var A,J;var D=YAHOO.widget,E=D.Slider,I=D.SliderThumb;A=new I(C,F,0,G,0,0,H);J=new I(K,F,0,G,0,0,H);return new D.DualSlider(new E(F,F,A,"horiz"),new E(F,F,J,"horiz"),G,B);};YAHOO.widget.Slider.getVertDualSlider=function(F,C,K,G,H,B){var A,J;var D=YAHOO.widget,E=D.Slider,I=D.SliderThumb;A=new I(C,F,0,0,0,G,H);J=new I(K,F,0,0,0,G,H);return new D.DualSlider(new E(F,F,A,"vert"),new E(F,F,J,"vert"),G,B);};YAHOO.register("slider",YAHOO.widget.Slider,{version:"2.5.2",build:"1076"});
Require.isLoaded['library.yui.slider.slider'] = true;
/*
    http://www.JSON.org/json2.js
    2009-09-29

    Public Domain.

    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.

    See http://www.JSON.org/js.html

    This file creates a global JSON object containing two methods: stringify
    and parse.

        JSON.stringify(value, replacer, space)
            value       any JavaScript value, usually an object or array.

            replacer    an optional parameter that determines how object
                        values are stringified for objects. It can be a
                        function or an array of strings.

            space       an optional parameter that specifies the indentation
                        of nested structures. If it is omitted, the text will
                        be packed without extra whitespace. If it is a number,
                        it will specify the number of spaces to indent at each
                        level. If it is a string (such as '\t' or '&nbsp;'),
                        it contains the characters used to indent at each level.

            This method produces a JSON text from a JavaScript value.

            When an object value is found, if the object contains a toJSON
            method, its toJSON method will be called and the result will be
            stringified. A toJSON method does not serialize: it returns the
            value represented by the name/value pair that should be serialized,
            or undefined if nothing should be serialized. The toJSON method
            will be passed the key associated with the value, and this will be
            bound to the value

            For example, this would serialize Dates as ISO strings.

                Date.prototype.toJSON = function (key) {
                    function f(n) {
                        // Format integers to have at least two digits.
                        return n < 10 ? '0' + n : n;
                    }

                    return this.getUTCFullYear()   + '-' +
                         f(this.getUTCMonth() + 1) + '-' +
                         f(this.getUTCDate())      + 'T' +
                         f(this.getUTCHours())     + ':' +
                         f(this.getUTCMinutes())   + ':' +
                         f(this.getUTCSeconds())   + 'Z';
                };

            You can provide an optional replacer method. It will be passed the
            key and value of each member, with this bound to the containing
            object. The value that is returned from your method will be
            serialized. If your method returns undefined, then the member will
            be excluded from the serialization.

            If the replacer parameter is an array of strings, then it will be
            used to select the members to be serialized. It filters the results
            such that only members with keys listed in the replacer array are
            stringified.

            Values that do not have JSON representations, such as undefined or
            functions, will not be serialized. Such values in objects will be
            dropped; in arrays they will be replaced with null. You can use
            a replacer function to replace those with JSON values.
            JSON.stringify(undefined) returns undefined.

            The optional space parameter produces a stringification of the
            value that is filled with line breaks and indentation to make it
            easier to read.

            If the space parameter is a non-empty string, then that string will
            be used for indentation. If the space parameter is a number, then
            the indentation will be that many spaces.

            Example:

            text = JSON.stringify(['e', {pluribus: 'unum'}]);
            // text is '["e",{"pluribus":"unum"}]'


            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'

            text = JSON.stringify([new Date()], function (key, value) {
                return this[key] instanceof Date ?
                    'Date(' + this[key] + ')' : value;
            });
            // text is '["Date(---current time---)"]'


        JSON.parse(text, reviver)
            This method parses a JSON text to produce an object or array.
            It can throw a SyntaxError exception.

            The optional reviver parameter is a function that can filter and
            transform the results. It receives each of the keys and values,
            and its return value is used instead of the original value.
            If it returns what it received, then the structure is not modified.
            If it returns undefined then the member is deleted.

            Example:

            // Parse the text. Values that look like ISO date strings will
            // be converted to Date objects.

            myData = JSON.parse(text, function (key, value) {
                var a;
                if (typeof value === 'string') {
                    a =
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
                    if (a) {
                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
                            +a[5], +a[6]));
                    }
                }
                return value;
            });

            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
                var d;
                if (typeof value === 'string' &&
                        value.slice(0, 5) === 'Date(' &&
                        value.slice(-1) === ')') {
                    d = new Date(value.slice(5, -1));
                    if (d) {
                        return d;
                    }
                }
                return value;
            });


    This is a reference implementation. You are free to copy, modify, or
    redistribute.

    This code should be minified before deployment.
    See http://javascript.crockford.com/jsmin.html

    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
    NOT CONTROL.
*/

/*jslint evil: true, strict: false */

/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
    lastIndex, length, parse, prototype, push, replace, slice, stringify,
    test, toJSON, toString, valueOf
*/


// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.

if (!this.JSON) {
    this.JSON = {};
}

(function () {

    function f(n) {
        // Format integers to have at least two digits.
        return n < 10 ? '0' + n : n;
    }

    if (typeof Date.prototype.toJSON !== 'function') {

        Date.prototype.toJSON = function (key) {

            return isFinite(this.valueOf()) ?
                   this.getUTCFullYear()   + '-' +
                 f(this.getUTCMonth() + 1) + '-' +
                 f(this.getUTCDate())      + 'T' +
                 f(this.getUTCHours())     + ':' +
                 f(this.getUTCMinutes())   + ':' +
                 f(this.getUTCSeconds())   + 'Z' : null;
        };

        String.prototype.toJSON =
        Number.prototype.toJSON =
        Boolean.prototype.toJSON = function (key) {
            return this.valueOf();
        };
    }

    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
        gap,
        indent,
        meta = {    // table of character substitutions
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '"' : '\\"',
            '\\': '\\\\'
        },
        rep;


    function quote(string) {

// If the string contains no control characters, no quote characters, and no
// backslash characters, then we can safely slap some quotes around it.
// Otherwise we must also replace the offending characters with safe escape
// sequences.

        escapable.lastIndex = 0;
        return escapable.test(string) ?
            '"' + string.replace(escapable, function (a) {
                var c = meta[a];
                return typeof c === 'string' ? c :
                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
            }) + '"' :
            '"' + string + '"';
    }


    function str(key, holder) {

// Produce a string from holder[key].

        var i,          // The loop counter.
            k,          // The member key.
            v,          // The member value.
            length,
            mind = gap,
            partial,
            value = holder[key];

// If the value has a toJSON method, call it to obtain a replacement value.

        if (value && typeof value === 'object' &&
                typeof value.toJSON === 'function') {
            value = value.toJSON(key);
        }

// If we were called with a replacer function, then call the replacer to
// obtain a replacement value.

        if (typeof rep === 'function') {
            value = rep.call(holder, key, value);
        }

// What happens next depends on the value's type.

        switch (typeof value) {
        case 'string':
            return quote(value);

        case 'number':

// JSON numbers must be finite. Encode non-finite numbers as null.

            return isFinite(value) ? String(value) : 'null';

        case 'boolean':
        case 'null':

// If the value is a boolean or null, convert it to a string. Note:
// typeof null does not produce 'null'. The case is included here in
// the remote chance that this gets fixed someday.

            return String(value);

// If the type is 'object', we might be dealing with an object or an array or
// null.

        case 'object':

// Due to a specification blunder in ECMAScript, typeof null is 'object',
// so watch out for that case.

            if (!value) {
                return 'null';
            }

// Make an array to hold the partial results of stringifying this object value.

            gap += indent;
            partial = [];

// Is the value an array?

            if (Object.prototype.toString.apply(value) === '[object Array]') {

// The value is an array. Stringify every element. Use null as a placeholder
// for non-JSON values.

                length = value.length;
                for (i = 0; i < length; i += 1) {
                    partial[i] = str(i, value) || 'null';
                }

// Join all of the elements together, separated with commas, and wrap them in
// brackets.

                v = partial.length === 0 ? '[]' :
                    gap ? '[\n' + gap +
                            partial.join(',\n' + gap) + '\n' +
                                mind + ']' :
                          '[' + partial.join(',') + ']';
                gap = mind;
                return v;
            }

// If the replacer is an array, use it to select the members to be stringified.

            if (rep && typeof rep === 'object') {
                length = rep.length;
                for (i = 0; i < length; i += 1) {
                    k = rep[i];
                    if (typeof k === 'string') {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            } else {

// Otherwise, iterate through all of the keys in the object.

                for (k in value) {
                    if (Object.hasOwnProperty.call(value, k)) {
                        v = str(k, value);
                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
                    }
                }
            }

// Join all of the member texts together, separated with commas,
// and wrap them in braces.

            v = partial.length === 0 ? '{}' :
                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
                        mind + '}' : '{' + partial.join(',') + '}';
            gap = mind;
            return v;
        }
    }

// If the JSON object does not yet have a stringify method, give it one.

    if (typeof JSON.stringify !== 'function') {
        JSON.stringify = function (value, replacer, space) {

// The stringify method takes a value and an optional replacer, and an optional
// space parameter, and returns a JSON text. The replacer can be a function
// that can replace values, or an array of strings that will select the keys.
// A default replacer method can be provided. Use of the space parameter can
// produce text that is more easily readable.

            var i;
            gap = '';
            indent = '';

// If the space parameter is a number, make an indent string containing that
// many spaces.

            if (typeof space === 'number') {
                for (i = 0; i < space; i += 1) {
                    indent += ' ';
                }

// If the space parameter is a string, it will be used as the indent string.

            } else if (typeof space === 'string') {
                indent = space;
            }

// If there is a replacer, it must be a function or an array.
// Otherwise, throw an error.

            rep = replacer;
            if (replacer && typeof replacer !== 'function' &&
                    (typeof replacer !== 'object' ||
                     typeof replacer.length !== 'number')) {
                throw new Error('JSON.stringify');
            }

// Make a fake root object containing our value under the key of ''.
// Return the result of stringifying the value.

            return str('', {'': value});
        };
    }


// If the JSON object does not yet have a parse method, give it one.

    if (typeof JSON.parse !== 'function') {
        JSON.parse = function (text, reviver) {

// The parse method takes a text and an optional reviver function, and returns
// a JavaScript value if the text is a valid JSON text.

            var j;

            function walk(holder, key) {

// The walk method is used to recursively walk the resulting structure so
// that modifications can be made.

                var k, v, value = holder[key];
                if (value && typeof value === 'object') {
                    for (k in value) {
                        if (Object.hasOwnProperty.call(value, k)) {
                            v = walk(value, k);
                            if (v !== undefined) {
                                value[k] = v;
                            } else {
                                delete value[k];
                            }
                        }
                    }
                }
                return reviver.call(holder, key, value);
            }


// Parsing happens in four stages. In the first stage, we replace certain
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.

            cx.lastIndex = 0;
            if (cx.test(text)) {
                text = text.replace(cx, function (a) {
                    return '\\u' +
                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
                });
            }

// In the second stage, we run the text against regular expressions that look
// for non-JSON patterns. We are especially concerned with '()' and 'new'
// because they can cause invocation, and '=' because it can cause mutation.
// But just to be safe, we want to reject all unexpected forms.

// We split the second stage into 4 regexp operations in order to work around
// crippling inefficiencies in IE's and Safari's regexp engines. First we
// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
// replace all simple value tokens with ']' characters. Third, we delete all
// open brackets that follow a colon or comma or that begin the text. Finally,
// we look to see that the remaining characters are only whitespace or ']' or
// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.

            if (/^[\],:{}\s]*$/.
test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {

// In the third stage we use the eval function to compile the text into a
// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
// in JavaScript: it can begin a block or an object literal. We wrap the text
// in parens to eliminate the ambiguity.

                j = eval('(' + text + ')');

// In the optional fourth stage, we recursively walk the new structure, passing
// each name/value pair to a reviver function for possible transformation.

                return typeof reviver === 'function' ?
                    walk({'': j}, '') : j;
            }

// If the text is not JSON parseable, then a SyntaxError is thrown.

            throw new SyntaxError('JSON.parse');
        };
    }
}());

Require.isLoaded['library.json2'] = true;








var $J = jQuery.noConflict();
var $Y = YAHOO.util;

/*
 * Some rights reserved (cc) 2006, TPI - Telefonica Publicidade e Informatica Ltda
 * @autor: Flavio Crispim dos Santos / TPI 2006
 * http://creativecommons.org/licenses/by-sa/2.5/
 */

/**
 * The TPI global namespace
 * @constructor
 */
window.TPI = window.TPI || {};
TPI.util = {};

/**
 * Class providing static helper methods.
 *
 * requires YAHOO.util.Dom Dom utility
 * requires YAHOO.util.Event Event utility
 */
TPI.util = {

	/**
	 * Always returns an array, if obj is an array, return obj.
	 * If obj isn?t an array return a new single element array.
	 * Otherwise return an empty array.
	 * 
	 * @param {Object} obj
	 * @return array
	 */
	getArray : function(obj){
		if(!obj) return [];
		if (obj.toArray) {
			return obj.toArray();
		} else {
			var ar = [];
			for (var i = 0; i < obj.length; i++) ar.push(obj[i]);
			return ar;
		}
	},
	
	getBorderWidth: function(el, pos){
		if(pos){
			pos = pos.toLowerCase();
			pos = pos.charAt(0).toUpperCase() + pos.substring(1, pos.length);
			var w = parseInt(YAHOO.util.Dom.getStyle(el, 'border' + pos + 'Width').replace('\px', ''));
			if(isNaN(w)){ w = 0; }
			return w;
		}else{
			var o = {};
			var s = ['top', 'right', 'bottom', 'left'];
			for(var i = 0; i < s.length; i++){
				o[s[i]] = TPI.util.getBorderWidth(el, s[i]);
			}
			return o;
		}
	},
	
	getStyleInt: function(el, pos){
		var w = YAHOO.util.Dom.getStyle(el, pos);
		if(w){ w = parseInt(w.replace('\px', '')) };
		if(isNaN(w)){ w = 0; }
		return w;
	},
	
	scriptRegex: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
	
	executeScripts: function(param) {
		var matchAll = new RegExp(TPI.util.scriptRegex, 'img');
		var matchOne = new RegExp(TPI.util.scriptRegex, 'im');
		var m = (param.match(matchAll) || []);
		for(var i = 0; i < m.length; i++){
			eval((m[i].match(matchOne) || ['', ''])[1]);
		}
	}
}

/**
 * Class providing static helper methods.
 *
 * requires YAHOO.util.Dom Dom utility
 * requires YAHOO.util.Event Event utility
 */
TPI.util.Class = {

	/**
	 * Create a new Object Class whose constructor is 'init()'.
	 * The init method have a reference to the arguments of the 'new' 
	 *
	 * @type number
	 * @type object
	 */
	create : function() {
		return function() {
			this.init.apply(this, arguments);
		}
	},

	/**
	 * Copies all prototype properties from src to dest.
	 * 
	 * @param {Object} dest
	 * @param {Object} src
	 * @type void
	 */
	copy : function(dest, src){
		if(!src) src = TPI.util.Class.create();
		for (var x in src) dest.prototype[x] = src[x];
		return dest;
	},

	/**
	 * Shortcut method used to obtain an object method/function.
	 * Intended for api internal use only.
	 * 
	 * @param {Object} obj
	 * @param {Object} mName
	 * @type function
	 */
	getMethod : function(obj,mName){
		if(mName){
			switch(typeof(mName)){
				case 'string':
					if(!obj[mName]) return function(){}
					return obj[mName];
				case 'function':
					return mName;
				default: // empty
					return function(){};
			}
		}else if(typeof(obj) === 'function'){
			return obj;
		}else{
			return function(){};
		}
	},

	/**
	 * Return a function scoped to the specified object
	 * 
	 * @param {Object} obj
	 * @param {Object} mName
	 * @param {Object} arguments
	 * @type function
	 */
	scopeMethod : function(obj, mName, arguments){
		var _method = this.getMethod(obj, mName);
		var args = TPI.util.getArray(arguments).slice(2);
		return function() {
			return _method.apply(obj, args.concat(TPI.util.getArray(arguments)));
		}			
	}
	
}

/**
 * Class providing static helper methods.
 *
 * requires YAHOO.util.Dom Dom utility
 * requires YAHOO.util.Event Event utility
 */
TPI.util.Event = {

	/**
	 * Helper method to add an event handler.
	 * Useful and straightforward will to add an object method as event listener.
	 * 
	 * Example:
	 * \t var anObj = function(){
	 * \t\t     this.objState = 1; 
	 * \t\t 	this.getValue = function(){ alert(this.objState); }
	 * \t }
	 * \t Use:
	 * \t TPI.util.Event.observe('divId', 'click', 'getValue', anObj);
	 * \n\t Intead of:
	 * \t TPI.util.Event.addListener('divId', 'click', anObj.getValue, anObj, true);
	 * 
	 * In both cases getValue() will cause a alert to display the number 1.
	 * 
	 * @param {string|el ref|arr el) observable
	 * @param {string} eventType
	 * @param {string|function) observer
	 * @param {object} observerContext
	 * @type void
	 */
	observe : function(observable, eventType, observer, observerContext){
		var _observer = TPI.util.Class.getMethod(observerContext, observer);
		if(eventType === 'mousewheel') this._observeMouseWheel(observable, observer, observerContext);
		else YAHOO.util.Event.addListener(observable, eventType, _observer, observerContext, true);
	},

	/**
	 * Add listener to the mouse-scroll event.
	 * Based on: http://adomas.org/javascript-mouse-wheel/
	 * 
	 * @param {Object} e
	 */
	_observeMouseWheel : function(observable, observer, observerContext){
		var _et = (document.all)?'mousewheel':'DOMMouseScroll';
		var _scrollHandler = function(e){
			var _observer = TPI.util.Class.scopeMethod(observerContext, observer);
			var delta = 0;
			if (!e) e = window.event;
			if (e.wheelDelta) {
				delta = e.wheelDelta/120;
				if (window.opera) delta = -delta;
			} else if (e.detail) delta = -e.detail/3;
			if (delta) _observer(-delta);
			YAHOO.util.Event.stopEvent(e);
		}
		YAHOO.util.Event.addListener(observable, _et, _scrollHandler);
	}

}

/**
 * 
 * @param {Object} obj
 */
TPI.util.UIUtil = function(obj){

	/*
	 * Imports
	 */
	var $Dom = YAHOO.util.Dom;

	/*
	 * Private variables
	 */
	var _name = obj.getName();
	var _styleClass = obj.getStyleClass();
	var registry = {};
	
	this.toString = function(){
		return "TPI.util.UIUtil@instance:(" + obj.getName() + ")";
	}
	
	this.getClassName = function(suffix){
		var rClass = '';
		if(typeof(_styleClass) !== 'undefined'){
			rClass += _styleClass + '_' + suffix + ' ' + suffix;
		}else{
			rClass += suffix;
		}
		return rClass;
	}

	this.setObject = function(id, objId){
		registry[id] = objId;			
	}

	this.getObjectName = function(id){
		return registry[id];
	}

	this.getObject = function(id){
		return $Dom.get(this.getObjectName(id));
	}
	this.getWH = function(el){
		var region = $Dom.getRegion(el);
		return ({w:(region.right-region.left), h:(region.bottom-region.top)});
	}

	this.getWHByNick = function(id){
		return this.getWH(this.getObjectName(id));
	}

	this.getDiv = function(id, properties, parentEl){
		var elId = _name + "_" + id;
		var el = YAHOO.util.Dom.get(elId);
		if(!el){
			el = document.createElement('div');
			el.id = elId;
			$Dom.addClass(el, this.getClassName(id))
			if(parentEl) { parentEl.appendChild(el); }
		}
		for (x in properties) { $Dom.setStyle(el, x, properties[x]); }
		this.setObject(id, el.id);
		return el;
	}

	this.setObject('root', _name);
}
Require.isLoaded['Classes.tpiUtil'] = true;
/*
 * Some rights reserved (cc) 2006, TPI - Telefonica Publicidade e Informatica Ltda
 * @autor: Flavio Crispim dos Santos / TPI 2006
 * http://creativecommons.org/licenses/by-sa/2.5/
 */

/**
 * The TPI global namespace
 * @constructor
 */
window.TPI = window.TPI || {};
TPI.scroll = {};

/*
 * TODO: Implement a consistent automatic frame-skiping alg. to the sliders onChange
 * handler.
 * 
 * TODO: Implement quick-search logic to the scroll position computation.
 */
TPI.scroll.ScrollConstraints = function(){
	var _state_ = this.state;
	if(!_state_){
		if(YAHOO && YAHOO.util && YAHOO.widget && 
		   YAHOO.util.Dom && YAHOO.util.Event &&
		   YAHOO.widget.Slider){
			_state_ = "OK";
		}else{
			throw new Error("ScrollWidget@sanityFailed: check basic YAHOO contraints: YAHOO.util.Dom, YAHOO.util.Event and YAHOO.widget.Slider");
		}
	}
}

/**
 * 
 */
TPI.scroll.Scroll = function(name, styleClass, maxSliderHeight){

	/*
	 * SANITY CHECK
	 */ 
	TPI.scroll.ScrollConstraints();

	/*
	 * Imports
	 */
	var $Event = YAHOO.util.Event;

	/*
	 * Public methods
	 */
	this.toString = function(){
		return "TPI.scroll.Scroll@instance:(" + this.getName() + ")";
	}

	/* Getters */
	this.getName = function(){ return name; }
	this.getStyleClass = function(){ return styleClass; }
	this.getUtil = function(){ return _util; }
	this.getDrawUtil = function(){ return _drawUtil; }
	this.getHandler = function(){ return _handler; }
	this.getMaxSliderHeight = function(){ return maxSliderHeight; }
	this.setIsHidden = function(pValue){ _isHidden = pValue || false; }
	this.isHidden = function(){ return _isHidden; }
	
	/*
	 * Private members
	 */
	try{
		var _util = new TPI.util.UIUtil(this);
	}catch(e){
		alert(e.message);
	}
	var _drawUtil = new TPI.scroll.ScrollDrawUtil(this);
	var _handler = new TPI.scroll.ScrollHandler(this);
	var _memento = new TPI.scroll.Memento(name);
	var _isHidden = true;

	this.fit = function (pWidth){
		_memento.override('width', pWidth);
		this.reset();
	}

	this.draw = function(){
		_memento.backup();
		var rValue = _drawUtil.draw();
		if(this.isHidden()){ _memento.restore(); }
		return rValue;
	}

	this.start = function(){
		return _handler.handle();
	}

	this.reset = function(){
		_handler.stopHandle();
		_memento.restore();
		_drawUtil.update();
		_handler.resetHandle();
		if(this.isHidden()){ _memento.restore(); }
	}

	this.destroy = function(){
		_handler.stopHandle(true);
		_drawUtil.destroy();
		_memento.restore();
	}
	
	this.getCoef = function(){
		var contentEl = _util.getObject('root');
		var contentArea = (_util.getWHByNick('sliderArea').h - _util.getWHByNick('slider').h);
		var scrollArea = (contentEl.scrollHeight - _util.getWH(contentEl).h);
		contentEl = null;
		return(contentArea / scrollArea);
	}
}

/**
 * Global scroll registry.
 * Holds a reference to every Sroll object.
 */
TPI.scroll.registry = {};

TPI.scroll.Scroll.getInstance = function(id, style){
	if(!TPI.scroll.registry[id]){
		var scroll = new TPI.scroll.Scroll(id, style)
		TPI.scroll.registry[id] = scroll;
		if(scroll.draw()){
			scroll.start();
		}
	}
	return TPI.scroll.registry[id];
}

TPI.scroll.Scroll.destroy = function(id){
	var scroll = TPI.scroll.registry[id];
	if(scroll){
		scroll.destroy();
		TPI.scroll.registry[id] = null;
	}
}

TPI.scroll.Scroll.destroyAll = function(){
	for(var x in TPI.scroll.registry){
		TPI.scroll.Scroll.destroy(x);
	}
}

TPI.scroll.resetSemaphore = {};
TPI.scroll.Scroll.reset = function(id){
	var scroll = TPI.scroll.registry[id];
	if(scroll){
		var semaphore = TPI.scroll.resetSemaphore[id];
		if(semaphore) clearTimeout(semaphore);
		var fctn = function(){
			TPI.scroll.resetSemaphore[id] = null;
			scroll.reset();
		}
		TPI.scroll.resetSemaphore[id] = setTimeout(fctn, 25);
	}
}

TPI.scroll.Scroll.newInstance = function(id, style){
    if(!TPI.scroll.registry[id]){ TPI.scroll.Scroll.destroy(id); }
	return TPI.scroll.Scroll.getInstance(id, style);
}

TPI.scroll.Scroll.fit = function(id, pWidth){
	var scroll = TPI.scroll.registry[id];
	if(scroll){
		scroll.fit(pWidth);
	}
}

TPI.scroll.Memento = function(scrollName){
	
	/*
	 * Imports
	 */
	$Dom = YAHOO.util.Dom;
	
	/*
	 * Private members
	 */
	var _styleprops = {};
	
	/*
	 * Public methods
	 */
	this.toString = function(){
		return "TPI.scroll.Memento@instance:(" + scrollName + ")";
	}

	this.backup = function(){
		_styleprops['marginRight'] = $Dom.getStyle(scrollName, 'marginRight');
		_styleprops['width'] = $Dom.getStyle(scrollName, 'width');
	}

	this.restore = function(){
		for(x in _styleprops){
			$Dom.setStyle(scrollName, x, _styleprops[x]);
		}
	}
	
	this.override = function(pName, pValue){
		_styleprops[pName] = pValue;
	}
}

/**
 * 
 * @param {Object} scroll
 */
TPI.scroll.ScrollDrawUtil = function(scroll){

	/*
	 * Imports
	 */
	var $Dom = YAHOO.util.Dom;
	var $Event = YAHOO.util.Event;
	var $TpiClass = TPI.util.Class;
	var $TpiEvent = TPI.util.Event;

	var _scroll = scroll;
	var _util = _scroll.getUtil();
	
	var _maxSliderHeight = scroll.getMaxSliderHeight();

	var _contentEl = _util.getObject('root');
	var _parentEl = _contentEl.parentNode;
	var _contentWH = _util.getWH(_contentEl);
	var _contentXY = $Dom.getXY(_contentEl);
	var _parentXY = $Dom.getXY(_parentEl);
	var _parentWH = _util.getWH(_parentEl);
	var _borderHeight = parseInt((_contentWH.h - _contentEl.clientHeight)/2);
	var _zzIndex = (_contentEl.style.zIndex?parseInt(_contentEl.style.zIndex):0);
	_contentEl = null;
	_parentEl = null;

	/*
	 * Public Methods.
	 */
	this.draw = function(){
		_getScrollDiv();
		_getScrollButtonsDiv();
		_getScrollSliderAreaDiv();
		_getScrollSliderDiv();
		return true;
	}

	this.destroy = function (){
		if(parent){
			var contentEl = _util.getObject('root');
			var parentEl = contentEl.parentNode;
			var scrollEl = _util.getObject('scroll')
			parentEl.removeChild(scrollEl);
			while(scrollEl.firstChild) scrollEl.removeChild(scrollEl.firstChild);
			contentEl.scrollTop = 0;
			contentEl = null;
			parentEl = null;
			scrollEl = null;
		}
	}

	this.update = function(){
		var _contentEl = _util.getObject('root');
		var _parentEl = _contentEl.parentNode;
		_contentXY = $Dom.getXY(_contentEl);
		_parentXY = $Dom.getXY(_parentEl);
		_contentWH = _util.getWH(_contentEl);
		_borderHeight = parseInt((_contentWH.h - _contentEl.clientHeight)/2);
		_contentEl = _parentEl = null;
		
		var _upWH = 0;
		// Redimensiona slider
		_getScrollDiv();
		_getScrollSliderAreaDiv();
		_getScrollSliderDiv();
	}

	/*
	 * Private methods
	 */
	var _getScrollDiv = function(){
try{
		var contentEl = _util.getObject('root');
		var parentEl = contentEl.parentNode;

		var contentTopBorder = 0;
		var contentLeftBorder = 0;
		var parentTopBorder = 0;
		var parentLeftBorder = 0;
		if(document.all){
			contentTopBorder = TPI.util.getBorderWidth(contentEl, 'top');
			contentLeftBorder = TPI.util.getBorderWidth(contentEl, 'left');
			parentTopBorder = TPI.util.getBorderWidth(contentEl.parentNode, 'top');
			parentLeftBorder = TPI.util.getBorderWidth(contentEl.parentNode, 'left');
		}

		var scrollProps = {
			height:(_contentWH.h - _borderHeight*2) + 'px',
			top:(_contentXY[1] - _parentXY[1] - parentTopBorder + contentTopBorder) + 'px',
			zIndex:(_zzIndex + 1),
			position:'absolute' };

		var scrollEl = _util.getDiv("scroll", scrollProps, null);
		if(!document.getElementById(_util.getObjectName('scroll'))){
			parentEl.insertBefore(scrollEl, contentEl.nextSibling);
		}

		var scrollWH = _util.getWH(scrollEl);
		var borderHeight   = (_contentWH.h - contentEl.clientHeight)/2;
		var borderWidth    = (_contentWH.w - contentEl.clientWidth)/2;
		var contentWidth   = contentEl.clientWidth - scrollWH.w;
		var contentMargin  = scrollWH.w;
 		var scrollLeft     = (_contentWH.w - scrollWH.w + _contentXY[0] - _parentXY[0]) - parentLeftBorder + contentLeftBorder;

		$Dom.setStyle(contentEl, 'marginRight', contentMargin + 'px');
		$Dom.setStyle(contentEl, 'width', contentWidth + 'px');
 		$Dom.setStyle(scrollEl, 'left', scrollLeft + 'px');

		contentEl = parentEl = scrollEl = null;
		
}catch(e) { /* flavinho, arruma por favor =) */ }
	}

	var _getScrollButtonsDiv = function(){
		// Move Up
		var scrollEl = _util.getObject('scroll');
		var zzIndex = (_zzIndex + 2);
		_util.getDiv('moveUp', {top: '0px', left:'0px', right:'0px', zIndex: zzIndex, position:'absolute'}, scrollEl);
		_util.getDiv('moveDown', {bottom: '0px', left:'0px', right:'0px', zIndex: zzIndex, position:'absolute'}, scrollEl);
		_upWH = _util.getWHByNick('moveUp');
		scrollEl = null;
	}
	
	var _getScrollSliderAreaDiv = function(){
		// Slider Area
		var scrollEl = _util.getObject('scroll');
		var areaHeight = (_contentWH.h - (_upWH.h * 2)-(2*_borderHeight));
		var areaProps = {top:_upWH.h + 'px', height: areaHeight + 'px', left: '0px', zIndex: (_zzIndex + 2), position:'absolute'};
		_util.getDiv('sliderArea', areaProps, scrollEl);
		scrollEl = null;
	}
	
	var _getScrollSliderDiv = function(){
		
		var scrollEl = _util.getObject('scroll');
		var contentEl = _util.getObject('root');
		var sliderAreaEl = _util.getObject('sliderArea');
		
		var areaHeight = (_contentWH.h - (_upWH.h * 2)-(2*_borderHeight));

		var sliderHeight = 0;
			
		sliderHeight = Math.round(areaHeight * scrollEl.scrollHeight / contentEl.scrollHeight)+2;

		if (contentEl.id == 'resultListContainer'){
			$Dom.setStyle(scrollEl, 'visibility', 'hidden');
			scroll.setIsHidden(true);
		}		
		else{
			if(sliderHeight < areaHeight){
				$Dom.setStyle(scrollEl, 'visibility', 'visible');
				scroll.setIsHidden(false);
			}else{
				$Dom.setStyle(scrollEl, 'visibility', 'hidden');
				scroll.setIsHidden(true);
			}
		}	
			
		if(sliderHeight < 14){ sliderHeight = 14; }
		
		if(_maxSliderHeight){
			sliderHeight = _maxSliderHeight;
		}
		
		var sliderProps = {height: sliderHeight + 'px', left: '0px', zIndex: (_zzIndex + 3)};
		var sliderEl = _util.getDiv("slider", sliderProps, sliderAreaEl);
		
		scrollEl = null;
		contentEl = null;
		sliderAreaEl = null;
		sliderEl = null;
	}
}

TPI.scroll.ScrollHandler = function(scroll){
	/*
	 * Imports
	 */
	var $Dom = YAHOO.util.Dom;
	var $Event = YAHOO.util.Event;
	var $CustomEvent = YAHOO.util.CustomEvent;
	var $TpiClass = TPI.util.Class;
	var $TpiEvent = TPI.util.Event;

	/*
	 * Private members
	 */
	var _util = scroll.getUtil();
	var _drawUtil = scroll.getDrawUtil();
	var _$Yslider = null;
	var _maxTop = 0;
	var _topEvent = new $CustomEvent("onTop");
	var _bottomEvent = new $CustomEvent("onBottom");
	var _changeEvent = new $CustomEvent("onChange");
	
	/*
	 * Public members.
	 */
	this.addTopListener = function(f){
		_topEvent.subscribe(f);
	}

	this.addBottomListener = function(f){
		_bottomEvent.subscribe(f);
	}

	this.addChangeListener = function(f){
		_changeEvent.subscribe(f);
	}

	this.removeTopListener = function(f){
		return _topEvent.unsubscribe(f);
	}

	this.removeBottomListener = function(f){
		return _bottomEvent.unsubscribe(f);
	}

	this.removeChangeListener = function(f){
		return _changeEvent.unsubscribe(f);
	}
	
	this.buttomUp = function(){
		_buttomUp();
	}

	this.buttomDown = function(){
		_buttomDown();
	}

	this.handle = function(){
		try{
			_setEvents();
			_setSlider();
		}catch(e){
			throw new Error("HandleError: " + scroll.getName() + ". Error while attaching event handlers. Failed with message:" + e.message);
		}
		return true;
	}

	this.resetHandle = function(){
		try{
			_checkBottom();
			_setEvents();
			_unsetSlider(true);
			_resetSlider();
			_handleMove();
		}catch(e){
			throw new Error("HandleError: " + scroll.getName() + ". Error while attaching event handlers. Failed with message:" + e.message);
		}
	}

	
	this.stopHandle = function(flag){
		var contentEl = _util.getObject('root');
		contentEl.onmouseover = '';
		var scrollId = _util.getObjectName('scroll');
		YAHOO.util.Event.purgeElement(contentEl, false, 'mousewheel');
		YAHOO.util.Event.purgeElement(contentEl, false, 'DOMMouseScroll');
		YAHOO.util.Event.purgeElement(scrollId);
		if(flag) _unsetSlider();
		contentEl = null;
	}

	/*
	 * Private functions.
	 */
	var _checkBottom = function(){
		var contentHeight = _util.getObject('root').scrollHeight;
		var parentHeight = _util.getObject('root').parentNode.scrollHeight;
		if(contentHeight <= parentHeight){
			_bottomEvent.fire(null); // onBottom
		}
	}
	
	var _setEvents = function(){
		var contentEl = _util.getObject('root');
		var scrollEl = _util.getObject('scroll');

		contentEl.onmouseover = "this.focus()";
		// $TpiEvent.observe(contentEl, 'keydown', _onKeyEvent);

		$TpiEvent.observe(contentEl, 'mousewheel', _slideUpDown);
		$TpiEvent.observe(scrollEl, 'mousewheel', _slideUpDown);
		
		var upId = _util.getObjectName('moveUp');
		$TpiEvent.observe(upId, 'mousedown', _buttomUp);

		var downId = _util.getObjectName('moveDown');
		$TpiEvent.observe(downId, 'mousedown', _buttomDown);

		contentEl = null;
		scrollEl = null;
	}
	
	var _lastYValue = 0;
	var _slideInterval = null;
	var _setSlider = function(){
		
		var areaId = _util.getObjectName('sliderArea');
		var sliderId = _util.getObjectName('slider');
		
		$Dom.setStyle(sliderId, 'top', '0px');

		var areaWH = _util.getWH(areaId);
		var sliderWH = _util.getWH(sliderId);
		_maxTop = (areaWH.h - sliderWH.h);
		_$Yslider = YAHOO.widget.Slider.getVertSlider(areaId, sliderId, 0, _maxTop);
		_handleMove();
		_$Yslider.animate = false;
	}

	var _resetSlider = function(){
		_$Yslider.lock();
		var areaWH = _util.getWHByNick('sliderArea');
		var sliderWH = _util.getWHByNick('slider');
		_maxTop = (areaWH.h - sliderWH.h);
		_$Yslider.getThumb().setYConstraint(0, _maxTop);
		
		var contentEl = _util.getObject('root');
		_$Yslider.unlock();
		_$Yslider.setValue(contentEl.scrollTop*scroll.getCoef());
		_$Yslider.animate = false;
		contentEl = null;
	}
	
	var _handleMove = function(){
		if(document.all){
			_$Yslider.onSlideStart = function(){ this._slideInterval = setInterval(_computeSlide, 30); }
			_$Yslider.onSlideEnd = function(){ clearInterval(this._slideInterval); };

			var areaId = _util.getObjectName('sliderArea');
			$Event.addListener(areaId, 'mousedown', function(){ 
				_$Yslider.onChange = $TpiClass.scopeMethod(this, _computeSlide); 
			});
			$Event.addListener(areaId, 'mouseup', function(){ 
				delete _$Yslider.onChange; 
			});
		}else{
			_$Yslider.onChange = $TpiClass.scopeMethod(this, _computeSlide);
		}
	}
	
	var _computeSlide = function(){
		var yValue = _$Yslider.getYValue();
		if(yValue != _lastYValue){
			_lastYValue = yValue;
			_moveTo(yValue/_maxTop);
		}
	}
	
	var _unsetSlider = function(flag){
		if(_$Yslider){
			_$Yslider.lock();
			var f = function(){}
			_$Yslider.onChange = f;
			_$Yslider.onSlideStart = f;
			_$Yslider.onSlideEnd = f;
		}
		if(!flag){
			_maxTop = _$Yslider = null;
		}
	}

	var _onKeyEvent = function(){

		var l_kCode;
		if (!e) var e = window.event;
		if (e.keyCode) l_kCode = e.keyCode;
		else if (e.which) l_kCode = e.which;

		switch(l_kCode){
			// Page Up/Down
			case 33: { _pageUpDown(-1); break; }
			case 34: { _pageUpDown(1); break; }
			// Arrow Up/Down
			case 38: { _slideUpDown(-1); break; }
			case 40: { _slideUpDown(1); break; }
		}
		return false;
	}

	var _slideUpDown = function(direction){
		var contentEl = _util.getObject('root');
		contentEl.scrollTop += (25 * direction); // step

		var coef = scroll.getCoef();

		var sliderId = _util.getObjectName("slider");
		
		var sliderArea = (_util.getWHByNick('sliderArea').h - _util.getWHByNick('slider').h);
		var contentArea = (contentEl.scrollHeight - _util.getWH(contentEl).h);
		
		var sliderTop = Math.round(contentEl.scrollTop * coef);
		if(contentArea < contentEl.scrollTop){
			sliderTop = sliderArea * coef;
		}

		_changeEvent.fire(null);
		if(sliderTop == 0){
			clearInterval(this.tid); this.tid = null;
			_topEvent.fire(null); // onTop
		}else if(sliderTop == sliderArea){
			clearInterval(this.tid); this.tid = null;
			_bottomEvent.fire(null); // onBottom
		}

		_$Yslider.setValue(sliderTop);
		
		contentEl = null;
	}

	var _moveTo = function(pos){
		var contentEl = _util.getObject('root');
		var t = (Math.round((contentEl.scrollHeight - contentEl.clientHeight) * pos));
		if(t != this.currentTop){
			contentEl.scrollTop = this.currentTop = t;
			if(pos == 0){ _topEvent.fire(null); } // onTop
			else if(pos == 1){ _bottomEvent.fire(null); } // onBottom
			_changeEvent.fire(null);
		}

		// TODO: fixme.
		//try{ contentEl.focus(); }catch(e){}
	}
	
	var _pageUpDown = function(direction){
		_slideUpDown(7 * direction);
	}
	
	var _buttomUp = function(event){
		_buttomUpDown(event, -1);
	}

	var _buttomDown = function(event){
		_buttomUpDown(event, 1);
	}
	
	var _buttomUpDown = function(event, direction){
		var btn = 'moveUp';
		if(direction > 0){ btn = 'moveDown'; }
		var btnId = _util.getObjectName(btn);

		if(this.tid) clearInterval(this.tid);
		var fctn = function(){ _slideUpDown(direction); }
		var _method_ = $TpiClass.scopeMethod(this, fctn);
		this.tid = setInterval(_method_, 50);

		var fctn = function(){ clearInterval(this.tid); this.tid = null; }
		$TpiEvent.observe(btnId, 'mouseup', fctn, this);
//		$TpiEvent.observe(btnId, 'mouseout', fctn, this);
		$TpiEvent.observe(document, 'mouseup', fctn, this);
	}

}

//YAHOO.util.Event.addListener(window, 'unload', TPI.scroll.Scroll.destroyAll);
Require.isLoaded['Classes.tpiScroll'] = true;
/*
 * Some rights reserved (cc) 2006, TPI - Telefonica Publicidade e Informatica Ltda
 * @autor: Flavio Crispim dos Santos / TPI 2006
 * http://creativecommons.org/licenses/by-sa/2.5/
 */

/**
 * The TPI global namespace
 * @constructor
 */
window.TPI = window.TPI || {};
TPI.live = {};

/**
 * {
 * 		url:'index.html', status: function(first, last, count){ alert(first) }, maxCount:'250', pageLenght: '15', styleClass:'style'
 * }
 * 
 * @param {Object} name
 * @param {Object} param
 */
TPI.live.Live = function(name, obj){

	/*
	 * Imports
	 */

	var _url = null;
	var _maxCount = null;
	var _pageLenght = null;
	var _styleClass = null;
	var _status = null;
	var _skipStatus = null;
	var _success = function(){};
	if(obj){
		if(obj.url){ _url = obj.url; }
		if(obj.maxCount){ _maxCount = obj.maxCount; }
		if(obj.pageLenght){ _pageLenght = obj.pageLenght; }
		<!--else{ _pageLenght = 10; }-->
		if(obj.styleClass){ _styleClass = obj.styleClass; }
		if(obj.status){ _status = obj.status; }
		if(obj.skipStatus){ _skipStatus = obj.skipStatus; }
		if(obj.success){ _success = obj.success; }
	}

	/*
	 * Public methods
	 */
	this.toString = function(){
		return "TPI.live.Live@instance:(" + this.getName() + ")";
	}

	/* Getters */
	this.getName = function(){ return name; }
	this.getStyleClass = function(){ return _styleClass; }
	this.getUtil = function(){ return _util; }
	this.getScroll = function(){ return _scroll; }
	this.getUrl = function(){ return _url; }
	this.getCount = function(){ return _maxCount; }
	this.getPageLenght = function(){ return _pageLenght; }
	this.getSkipStatus = function(){ return _skipStatus; }
	this.getSuccess = function(){ return _success; }
	this.getPageState = function(){
		return {'initial':0, 'final': (_handler.getToIndex())};
	}

	this.setPageState = function(toIndex){
		_handler.setToIndex(toIndex  + _pageLenght);
	}
	
	this.fit = function(pWidth){
		_scroll.fit(pWidth);
	}
	
	this.updateStatus = function(first, last){
		if(typeof(_status) === 'function'){
			_status(first, last, this.getCount());
		}
	}
	
	/*
	 * Private members
	 */
	var _util = new TPI.util.UIUtil(this);
	var _scroll = new TPI.scroll.Scroll(name, _styleClass, 94);
	var _drawUtil = new TPI.live.LiveDrawUtil(this);
	var _handler = new TPI.live.LiveHandler(this);
	
	this.draw = function(){
		return _drawUtil.draw();
	}

	this.start = function(){
		return _handler.handle();
	}

	this.reset = function(){
		_scroll.reset();
		_drawUtil.update();
		_handler.resetHandle();
	}

	/* cambio de pagina */
	this.page = function ( page ){
		 _handler.changePage(page);			
	}
	/* pagina actual */
	this.getPage = function()	{ 
		return _handler.getPage();
	}
	/* Total de paginas */
	this.getPageTotal = function()	{ 
		return _handler.getPageTotal();
	}
	/* Total de Registros por pagina */
	this.getRegistrosTotal = function()	{   
		return _handler.getRegxPag();		
	}
	/* Total de registros por pagina */
    this.getMaxPerPag = function()	{  	    
		return _handler.getPageLenght();
	}
	/* Maximo numero de link mostrados para pagina */
	this.maxPagLink = function (valor)	{
		_handler.maxPagLink(valor);	
	}
	/* Posicion del registro inicial por pagina */
	this.getFromIndex = function(){
		return _handler.getFromIndex();
	}

	this.destroy = function(){
		_drawUtil.destroy();
	}
}

/**
 * Global scroll registry.
 * Holds a reference to every Sroll object.
 */
TPI.live.registry = {};

TPI.live.Live.getInstance = function(id, options){
	if(!TPI.live.registry[id]){
		var live = new TPI.live.Live(id, options)
		TPI.live.registry[id] = live;
		if(live.draw()){
			live.start();
		}
	}
	return TPI.live.registry[id];
}

TPI.live.resetSemaphore = {};
TPI.live.Live.reset = function(id){
	var live = TPI.live.registry[id];
	if(live){
		var semaphore = TPI.live.resetSemaphore[id];
		if(semaphore) clearTimeout(semaphore);
		var fctn = function(){
			TPI.live.resetSemaphore[id] = null;
			live.reset();
		}
		TPI.live.resetSemaphore[id] = setTimeout(fctn, 25);
	}
}

TPI.live.Live.fit = function(id, pWidth){
	var live = TPI.live.registry[id];
	if(live){
		live.fit(pWidth);
	}
}

/**
 * 
 * @param {Object} scroll
 */
TPI.live.LiveDrawUtil = function(live){

	/*
	 * Imports
	 */
	
	var _live = live;
	var _util = _live.getUtil();
	var _scroll = _live.getScroll();

	/*
	 * Public Methods.
	 */
	this.draw = function(){
		if(_scroll.draw()){
			_getLiveTip();
			return true;
		}
		return false;
	}

	this.destroy = function (){
		if(parent){
			var contentEl = _util.getObject('root');
			contentEl.parentNode.removeChild(_util.getObject('tip'), true);
			contentEl = null;
			_scroll.destroy();
		}
	}

	this.update = function(){
		_getLiveTip();
	}

	/*
	 * Private methods
	 */
	var _getLiveTip = function(){
		/* Draw tip element.
		var contentEl = _util.getObject('root');
		var tipEl = _util.getDiv('tip', { position:'absolute', right:'15px', cursor:'pointer' }, null);
		var contentWH = _util.getWH(contentEl);
		if(!$Dom.get(_util.getObjectName('tip'))){
			contentEl.parentNode.insertBefore(tipEl, contentEl.nextSibling);	
		}
		
		var contentId = _util.getObjectName('root');
		if(_scroll.isHidden()){
			$Dom.setStyle(tipEl, 'visibility', 'hidden');
			$Dom.removeClass(contentId, 'scrollOn');
		}else{
			var contentId = _util.getObjectName('root');
			$Dom.addClass(contentId, 'scrollOn');
		}
		
		var tipWH = _util.getWH(tipEl);
		var tipTop = contentWH.h-tipWH.h;
		$Dom.setStyle(tipEl, 'top', tipTop + 'px');
		contentEl = null;*/
	}
}

TPI.live.LiveHandler = function(live){
	/*
	 * Imports
	 */
	var $Dom = YAHOO.util.Dom;
	var $TpiEvent = TPI.util.Event;

	/*
	 * Private members
	 */
	var _live = live;
	var _util = live.getUtil();
	var _scroll = live.getScroll();
	var _url = live.getUrl();
	var _pageLenght = live.getPageLenght();
	var _fromIndex = (1 + _pageLenght);
	var _toIndex   = (_fromIndex + _pageLenght -1);
	var _page =1;
	var _pagTotal = 0;
	var _maxPageLink = 0;	
	
	this.getFromIndex = function(){
		return _fromIndex;
	}

	this.getToIndex = function(){
		return _toIndex;
	}
	
	this.setToIndex = function(pValue){
		_fromIndex = pValue - _pageLenght + 1;
		_toIndex = pValue;
	}
	
	//Paginacion : Pagina actual
	this.getPage = function(){
		return _page;
	}	
	
	//Paginacion : Total de paginas
		this.getPageTotal = function(){ 
		 var count = _live.getCount();
		 var cociente = count / _pageLenght;
		 var residuo = count % _pageLenght;
		 var _pagTotal=0;

		 if (residuo==0) {		 	 
		 	_pagTotal =  cociente;
		 }else{
     		 cociente = parseFloat(cociente.toString().substring(0,cociente.toString().indexOf(".") ));
		    _pagTotal =  cociente + 1;
		 }
		 return _pagTotal;
	}
	
	//Paginacion : Total de registros consultados
	this.getCount = function(){
		 var count = _live.getCount();		 
		 return count;
	}	 
	
	//Paginacion : Total de registros por pagina
	this.getPageLenght = function(){
		 var pageLenght = _live.getPageLenght();		 
		 return pageLenght;		 
	}
	
	//Paginacion : Maximo numero de links mostrados en una pagina
	this.maxPagLink = function(valor) {		
		_maxPageLink = valor;
	}	
	
	//Paginacion : Total de registros por pagina
	this.getRegxPag = function() {   
	   var pagina = this.getPage();
	   var maxRegxPag = this.getPageLenght();
	   var paginaTotal = this.getPageTotal();	   
	   var regTotal = this.getCount();
	   var regxPag=0;
	   
	   if (pagina==paginaTotal){
	   	   regxPag = regTotal - ( (pagina - 1) * maxRegxPag );
	   }else{
	   	   regxPag = maxRegxPag;
	   }	   
	   return regxPag;		
	}
	
	this.handle = function(){
		try{
			var tipId = _util.getObjectName('tip');
			var scrollHandler = _scroll.getHandler();
			$TpiEvent.observe(tipId, 'mousedown', scrollHandler.buttomDown, scrollHandler);
			
			var changeListener = TPI.util.Class.scopeMethod(this, _computeStatus);
			scrollHandler.addChangeListener(changeListener);
			
			//var bottomListener = TPI.util.Class.scopeMethod(this, _scrollBottomListener);
			//scrollHandler.addBottomListener(bottomListener);
			
			_scroll.start();
		}catch(e){
			throw new Error("HandleError: " + live.getName() + ". Error while attaching event handlers. Failed with message:" + e.message);
		}
		return true;
	}

	this.resetHandle = function(){
		_computeStatus();
	}
	
	this.stopHandle = function(flag){
	}

	//Paginacion : Cambio de pagina
	this.changePage = function( page )
	{ 
	    _page = page;
	    _toIndex=page*_pageLenght;
	    _fromIndex=_toIndex - (_pageLenght - 1 );		 
		_scrollBottomListener();
	}

	/*
	 * Private functions.
	 */
	this._lock = false;
	var _scrollBottomListener = function(){
		//if(this._lock === false){
			this._lock = true;
			var count = _live.getCount();
			if((count > _pageLenght) && (count >= _fromIndex)){
				if(_url){
					var url = _url + '&fromIndex=' + _fromIndex + '&toIndex=' + _toIndex;
					var callback = { success:_appendCall, failure:_handleFailure, scope:this };
					YAHOO.util.Connect.asyncRequest('GET', url, callback);
					//_beforeLoad();
				}
				_fromIndex += _pageLenght;
				_toIndex += _pageLenght;
			}else{
				$Dom.setStyle(_util.getObjectName('tip'), 'visibility', 'hidden');
				this._lock = false;
			}
		//}
	}

	/**
	 * TODO: For sure, isnt the best we could do.
	 * Refactory needed.
	 */
	var _computeStatus = function(){
		var contentEl = _util.getObject('root');
		var skipStatus = live.getSkipStatus();
		var scrollTop = contentEl.scrollTop;
		var scrollHeight = contentEl.scrollHeight;
		var clientHeight = contentEl.clientHeight;
		var firstEl = 0;
		var lastEl = 0;
		var cumulativeHeight = 0;
		var advNumber = 0;
		var nodesLenght = contentEl.childNodes.length;
		loop:
			for(var i = 0; i < nodesLenght; i++){
				var childNode = contentEl.childNodes[i];
				if(!childNode.offsetHeight || childNode.offsetHeight < 2){ continue loop; }
				var nextElHeight = 0;
				for(var a = (i+1); nodesLenght != a && nextElHeight != 0; a++){
					nextElHeight = (contentEl.childNodes[i+1].offsetHeight/2);
				}
				cumulativeHeight += childNode.offsetHeight;
				if(childNode.className !== skipStatus){
					advNumber++;
					if(cumulativeHeight >= (scrollTop+(childNode.offsetHeight/2))){
						if(firstEl == 0){ firstEl = (advNumber); }
						if(cumulativeHeight >= (scrollTop+clientHeight-nextElHeight)){
							lastEl = (advNumber);
							break loop;
						}else if(scrollHeight < clientHeight){ lastEl = (advNumber); }
					}
				}
			}
		
		if(lastEl < firstEl){ lastEl = firstEl; }
		contentEl = null;
		live.updateStatus(firstEl, lastEl);
		
		if(parseInt(lastEl, 10) < live.getCount()){ 
			$Dom.setStyle(_util.getObjectName('tip'), 'visibility', 'visible');
		}
	}
	
	var _handleFailure = function(o) {
		if (o.responseText !== undefined) {
			trace('' +
				'Error: ' + 'Transaction id: ' + o.tId + '\n' +
				'HTTP status: ' + o.status + '\n' +
				'Status code message: ' + o.statusText +
			'');
		}
	}
	
	var _appendCall = function(originalRequest){
		
		var contentEl = _util.getObject('root');

		// Create a temp container.
		var tempEl = document.createElement('div');

		/* Se adicionaran registros en el contenedor sin aumentar a los que ya existen*/		
		contentEl.innerHTML = '';
		
		// Set the response as temp containers content.
		tempEl.innerHTML = originalRequest.responseText;

		// Copy each already rendered child to the real container.
		while(tempEl.firstChild){
			contentEl.appendChild(tempEl.firstChild.cloneNode(true));
			tempEl.removeChild(tempEl.firstChild);
		}

		TPI.util.executeScripts(originalRequest.responseText);

		// null out div reference.
		contentEl = tempEl = null;

		_scroll.reset();

		var fctn = function(){
			_afterLoad(); 
		}
		this._lock = false;
		var _method_ = TPI.util.Class.scopeMethod(this, fctn);
		setTimeout(_method_, 10);

		// Success
		setTimeout(live.getSuccess(), 10);
	}
	
	var _beforeLoad = function(){
		//var sliderId = _scroll.getUtil().getObjectName('slider');
		//YAHOO.util.Dom.addClass(sliderId, 'resultList_loading');
	}

	var _afterLoad = function(){
		//var sliderId = _scroll.getUtil().getObjectName('slider');
		//YAHOO.util.Dom.removeClass(sliderId, 'resultList_loading');
	}
}

Require.isLoaded['Classes.tpiLive'] = true;

/* 
  Copyright 2004 - Certifica.com 
  $Id$
*/

DEFAULT_PIVOT_NAME = 'cert_Pivot';
DEFAULT_REDIRECT_TIME = 3000;
DEFAULT_PERIODIC_REDIRECT_TIME = 60000;
DEFAULT_ORIGIN_COOKIE_NAME = 'cert_Origin';

var cert_CustomCounters = null;
var cert_CustomAttributes = null;

function cert_qVal(sValue) 
{
    var pos = String(document.location).indexOf('?');
    if (pos != -1) {
       var query = String(document.location).substring(pos+1);
       var vars = query.split("&");
       for (var i=0; i < vars.length; i++) {
          var pair = vars[i].split("=");
          if (pair[0] == sValue)
             return pair[1];
       }       
    }
    return null;  
}

function cert_getCookie(sName) {
  var dc = document.cookie;
  var prefix = sName + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function cert_setCookie(sName, sValue, dtExpires, sPath, sDomain, bSecure) {
  document.cookie = sName + "=" + escape(sValue) +
      ((dtExpires) ? "; expires=" + dtExpires.toGMTString() : "") +
      ((sPath) ? "; path=" + sPath : "") +
      ((sDomain) ? "; domain=" + sDomain : "") +
      ((bSecure) ? "; secure" : "");
}

function cert_getReferrer()
{
   var referrer = document.referrer;
   if (self.cert_getReferrer14)
      return cert_getReferrer14();
/*@cc_on
  @if(@_jscript_version >= 5 )
   try { 
      if ( self != top ) referrer = top.document.referrer;
   } catch(e) {};
  @end
  @*/
  return referrer;
}

/* Obtiene el tipo de protocolo del documento actual. */
function cert_getProtocol()
{
    if (window && window.location && window.location.protocol)
        return window.location.protocol;
    return null;
}
 
/* Crea una cookie con el contenido del referrer para evaluarlo
  en el paso final, si es necesario. */
function cert_setOrigin()
{
	var c = cert_getCookie(DEFAULT_ORIGIN_COOKIE_NAME);
	if (!c) {
		var l = cert_getReferrer();
		if (l) {
			var re = new RegExp('https?:\/\/([^\/]+)');
			var m = re.exec(l);
			if (m) {
				var m2 = re.exec(document.location);
				if (m2) {
					if (m[1] != m2[1]) {
						c = m[1];
					}
				}
			}
		}
		if (!c) {
			c = 'directo';
		}
		cert_setCookie(DEFAULT_ORIGIN_COOKIE_NAME, c);
	} 
}

function cert_getFlashVersion()
{
	var flashVersion = -1;
	if (navigator.plugins && navigator.plugins.length) {
		var objFlash = navigator.plugins["Shockwave Flash"];
		if (objFlash) {
			if (objFlash.description) {
				flashDesc = objFlash.description;
				flashVersion = flashDesc.charAt(flashDesc.indexOf('.')-1);
			}
		}

		if (navigator.plugins["Shockwave Flash 2.0"]) {
			flashVersion = 2;
		}
	} else if (navigator.mimeTypes && navigator.mimeTypes.length) {
		x = navigator.mimeTypes['application/x-shockwave-flash'];
		if (x && x.enabledPlugin) {
			flashVersion = 0; // no detectada!
		}
	}

	/*@cc_on
	for(var i = 10; i > 0; i--) {
		try {
			var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
			flashVersion = i;
			break;
		} catch(e){}
	}	
	@*/
	return flashVersion;
}

/* Crea la URL para obtener un pageview de Certifica. */
/* Solo necesita los parametros iSiteId y sPath       */
function cert_getURL(iSiteId, sPath, sAppend) 
{
    var referrer, url;
    referrer = 'otro';
    var o = cert_qVal('url_origen');
    var proto = cert_getProtocol();
    if (proto != 'https:')
        proto = 'http:';
    
    if (o != null && o != '')
       referrer = o;
    else 
       referrer = escape(cert_getReferrer());
    url = 
       proto + '//hits.e.cl/cert/hit.dll?sitio_id=' + iSiteId + '&path=' + sPath +
       '&referer=' + referrer ;
    url += '&java=' + navigator.javaEnabled() + '&flash=' + cert_getFlashVersion();
    if (sAppend)
        url += sAppend;
    return url;    
}

function cert_addCustomAttribute(sType, sValue)
{
	if (!cert_CustomAttributes) {
		cert_CustomAttributes = new Object();
	}

	cert_CustomAttributes[sType] = sValue;
}

function cert_addCustomCounter(sType, iValue)
{
	if (iValue && iValue > 0) {
		if (!cert_CustomCounters) {
			cert_CustomCounters = new Object();
		}

		if (cert_CustomCounters[sType]) {
			cert_CustomCounters[sType] += iValue;
		} else {
			cert_CustomCounters[sType] = iValue;
		}
	}
}


function cert_getCustomTags()
{
	var sRet = '';
	var ct_atrib = '', ct_acum = '';
	if (cert_CustomAttributes) {
		ct_atrib = 'ct_atrib=';
		for (var i in cert_CustomAttributes) {
			ct_atrib += i + ':' + cert_CustomAttributes[i] + ';';
		}
	}

	if (cert_CustomCounters) {
		ct_acum = 'ct_acum=';
		for (var i in cert_CustomCounters) {
			ct_acum += i + ':' + cert_CustomCounters[i] + ';';
		}
	}

	if (ct_atrib || ct_acum) {
		if (ct_atrib) {
			sRet += '&' + ct_atrib;
		}
		if (ct_acum) {
			sRet += '&' + ct_acum;
		}
	}
	return sRet;
}


/* Crea la URL para un sitio con e-Commerce. */
function cert_getURL_eCommerce(iSiteId, sPath, sAmount)
{
	var sOrigin = null;

	if ((sOrigin = cert_getCookie(DEFAULT_ORIGIN_COOKIE_NAME))) {
		cert_addCustomAttribute('origin', sOrigin);
	}

	if (sAmount) {
		cert_addCustomCounter('money', sAmount);
	}

	var sAppend = cert_getCustomTags();

	return cert_getURL(iSiteId, sPath, sAppend);
}
	
		
/* Efectua un hit en certifica usando una imagen pivote. */
function cert_registerHit(iSiteId, sPath, sPivotName) 
{
   var sAppend = '&cert_cachebuster=' + (1 + Math.floor (Math.random() * 10000));
   if ( !sPivotName )
      sPivotName = DEFAULT_PIVOT_NAME;
   if ( document.images )
      if ( document.images[sPivotName] )
         document.images[sPivotName].src = cert_getURL(iSiteId, sPath, sAppend);
}

/* Efectua una redireccion marcando la ruta de salida */
function cert_registerHitAndRedirect( sURL, iSiteId, sPath, sPivotName ) 
{
   cert_registerHit( iSiteId, sPath, sPivotName );
   setTimeout( "location.href = '" + sURL + "'", DEFAULT_REDIRECT_TIME );
}

/* Abre una nueva ventana, marcando el hit */
function cert_registerHitAndOpenWindow( sURL, iSiteId, sPath, sPivotName, sName, sFeatures, bReplace )
{
   cert_registerHit( iSiteId, sPath, sPivotName );
   if (!sName)
      sName = 'Downloads';
   if (!sFeatures)
      sFeatures = 'toolbar=no,location=no,directories=no,status=yes,menubar=no, scrollbars=no,resizable=no,width=425,height=510,screenX=20,screenY=20';
   window.open( sURL, 
      sName, 
      sFeatures, 
      bReplace 
   );
   return false;
}

/* Marca el hit y reemplaza/abre una URL en el frame 'sName' */
function cert_registerHitAndReplaceOtherFrame( sURL, sName, iSiteId, sPath, sPivotName ) 
{
   cert_registerHitAndOpenWindow( sURL, iSiteId, sPath, sPivotName, sName, 0, true );
}

/* Marca el hit y reemplaza/abre una URL en el frame 'sName' */
function cert_registerHitAndReplaceThisFrame( sURL, iSiteId, sPath, sPivotName ) 
{
   cert_registerHitAndRedirect( sURL, iSiteId, sPath, sPivotName );
}

/* Marca el hit y baja un archivo */
function cert_registerHitAndDownloadFile( sURL, iSiteId, sPath, sPivotName ) 
{
   cert_registerHitAndRedirect( sURL, iSiteId, sPath, sPivotName );
}

function cert_getAnchor(sUrl)
{
    return '<img src="' + sUrl + '" width="1" height="1" border="0" alt="Certifica.com">';
}

/* Marca un hit en la pagina actual */
function tagCertifica(iSiteId, sPath) 
{
    document.writeln(cert_getAnchor(cert_getURL(iSiteId, sPath)));
}

/* Marca un hit en la pagina actual, usando eCommerce */
function tagCertifica_eCommerce(iSiteId, sPath, iAmount) 
{
    document.writeln(cert_getAnchor(cert_getURL_eCommerce(iSiteId, sPath, iAmount)));
}

/* Marca un registro cada iTime milisegundos.  */
function cert_registerPeriodicHit( iSiteId, sPath, sPivotName, iTime ) 
{
   if ( !sPivotName )
      sPivotName = DEFAULT_PIVOT_NAME;
   if ( !iTime )
      iTime = DEFAULT_PERIODIC_REDIRECT_TIME;

   cert_registerHit( iSiteId, sPath, sPivotName );
   setTimeout( 'cert_registerPeriodicHit( ' + iSiteId + ', "' + sPath + '", "' + sPivotName + '", ' + iTime + ')', iTime );
}

cert_setOrigin();


Require.isLoaded['certifica'] = true;
/* 
  Copyright 2007 - Certifica.com 
  $Id: certifica-js14.js 1645 2007-04-03 13:54:19Z leus $
*/
function cert_getReferrer14()
{
   var referrer = document.referrer;
   try { 
      if ( self != top ) 
         referrer = top.document.referrer;
   } catch(e) {
      referrer = document.referrer;
   }
   return referrer;
}

Require.isLoaded['certifica-js14'] = true;
/**
 * Introducing Menu.js
 *
 * Menu.js is a free, small JavaScript (drop-down) menu for developers. It's
 * unobtrusive and only requires a HTML unordered list and your own CSS styles.
 * http://www.menujs.net/
 *
 * Requires Prototype JS version 1.5.0 or greater.
 * (Also supports version 1.6.0.*, avoiding all deprecated methods)
 * http://www.prototypejs.org/
 * _____________________________________________________________________________
 *
 * As of version 1.2, released under the MIT License:
 *
 * Copyright (c) 2007-2009 Charming Design, Niek Kouwenberg
 * http://www.charmingdesign.net/
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use,
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following
 * conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 * _____________________________________________________________________________
 *
 * Special thanks to CARE Internet Services B.V.
 * http://www.care.nl/
 */
Menu = {

	/* Version of the Menu class */
	Version: "1.3.1",


	/*
	* CONSTANTS
	*/

	/* Constant for a horizontal menu */
	HORIZONTAL: 1,

	/* Constant for a vertical menu */
	VERTICAL: 2,


	/*
	* MENU
	*/

	/* Hold the ID of the menu */
	_menuId: null,

	/* Hold the menu UL node */
	_menuNode: null,


	/*
	* TEMPORARY VARIABLES
	*/

	/* Hold the show timer */
	_showTimeout: null,

	/* Hold the hide timer */
	_hideTimeout: null,

	/* Will hold the link, submenu and level of the active menu node */
	_activeNodes: new Array(),


	/*
	* OPTIONS
	*/

	/* Orientation of the menu (horizontal or vertical) */
	_orientation: 1,

	/* Time in milliseconds before showing the sub menu */
	_showPause: 0,

	/* Time in milliseconds before hiding the sub menu */
	_hidePause: 1000,

	/* Opacity (0 = transparent, 1 = opaque) */
	_opacity: 1,


	/*
	* METHODS
	*/

	/**
	* Sets the time to wait before hiding the sub menu.
	*
	* @param	int		secs
	*
	* @deprecated Please use the options argument for Menu.init() instead.
	*/
	setHidePause: function(secs)
	{
		Menu._hidePause = secs * 1000;

		/* deprecation warning */
		alert("Deprecated method Menu.setHidePause() used: Please use the options argument for Menu.init().");
	}, // function setHidePause

	/**
	* Initializes the dynamic menu.
	*
	* @param	string	menuId
	* @param	object	options
	*
	* Available options:
	* - orientation (int; one of: Menu.HORIZONTAL, Menu.VERTICAL)
	* - showPause (float; in seconds; default: 0.0)
	* - hidePause (float; in seconds; default: 1.0)
	* - opacity (float; 0 = transparent, 1 = opaque; default: 1; transparency of the sub menu)
	*
	* Example usage:
	* <script type="text/javascript">
	*     Menu.init("menu", {"hidePause": 0.5});
	* </script>
	*
	* This method can be called after document load, but it is preferred to be
	* called directly from your page (HTML <head>, before document load). This
	* way the menu loads faster and can be interacted with much sooner.
	*/
	init: function(menuId, options)
	{
		/* Save menu ID (fall back to the default ID "menu") */
		Menu._menuId = (typeof menuId == "string") ? menuId : "menu";

		/* Save options */
		if (options)
		{
			/* Orientation */
			if (options.orientation != undefined)
			{
				Menu._orientation = options.orientation;
			}
			/* Show timeout in seconds */
			if (options.showPause != undefined)
			{
				Menu._showPause = options.showPause * 1000;
			}
			/* Hide timeout in seconds */
			if (options.hidePause != undefined)
			{
				Menu._hidePause = options.hidePause * 1000;
			}
			/* Sub menu opacity */
			if (options.opacity != undefined)
			{
				Menu._opacity = options.opacity;
			}
		}

		/* Check if the document is already loaded. Prototype 1.6.0 introduces
		* the document.loaded boolean, for 1.5*, check if we can retrieve an
		* element from the DOM (fails when document is not loaded).
		*/
		if (document.loaded === true || $(Menu._menuId))
		{
			Menu._doInit();
		}
		/* This is how it should work (init called before document load) */
		else
		{
			/* Do the actual initialization on document load. The "dom:loaded"
			* event is preffered, but only available since 1.6.0 (with
			* document.observe construction). Fall back to the window onload
			* when not available.
			*/
			if (document.observe)
			{
				document.observe("dom:loaded", Menu._doInit);
			}
			else
			{
				Element.observe(window, "load", Menu._doInit);
			}
		}
	}, // function init

	/**
	* Initializes the drop down menu.
	*
	* Should be called on page load.
	*/
	_doInit: function()
	{
		/* After the DOM is loaded, save the menu node */
		Menu._menuNode = $(Menu._menuId);

		/* Add events to each first level menu node (if any with a submenu). The
		* Menu._addEvents() method will add events recursively.
		*/
		Menu._addEvents(Menu._menuNode);
	}, // function _doInit

	/**
	* Recursively attaches events to the menu UL.
	*
	* @param	HTMLUListElement	ulElement
	* @param	int					level
	*/
	_addEvents: function(ulElement, level)
	{
		/* If level argument is not given, */
		if (isNaN(level))
		{
			level = 1;
		}

		/* Find all menu nodes */
		var elements = (Element.select) ? ulElement.select("li") : ulElement.getElementsBySelector("li")
		for (var i = 0; i < elements.length; i++)
		{
			/* Only use the direct descendants (we're using recursion) */
			if (elements[i].parentNode == ulElement)
			{
				/* Check if it has a sub menu (should return 1 or zero nodes) */
				var subMenus = (Element.select) ? elements[i].select("ul") : elements[i].getElementsBySelector("ul");
				if (subMenus.length > 0)
				{
					/* Add expand listener to the node */
					elements[i].observe("mouseover", Menu._showSubMenu.bindAsEventListener(elements[i], level));

					/* Add collapse listener to the node if it's the first level
					* (because the LI contains all other submenu's, therefore
					* any other listeners are over kill).
					*/
					if (level == 1)
					{
						elements[i].observe("mouseout", Menu._hideSubMenu.bindAsEventListener(elements[i], level));
					}

					/* Add "submenu" class for this node link */
					var a = (Element.select) ? elements[i].select("a")[0] : elements[i].getElementsBySelector("a")[0];
					a.addClassName("submenu");

					/* Recursion: check if the sub menu has nodes as well */
					Menu._addEvents(subMenus[0], (level + 1));
				}
				/* No sub menu */
				else
				{
					/* Only hide any expanded sub menu when hovering this node */
					elements[i].observe("mouseover", Menu._quickHideSubMenu.bindAsEventListener(elements[i], level));
				}
			}
		}
	}, // function _addEvents

	/**
	* Shows the sub menu.
	*
	* @param	Event	e
	* @param	int		level
	*/
	_showSubMenu: function(e, level)
	{
		/* Don't bubble up */
		Event.stop(e);

		/* is this the first menu node to be opened (need to check if we should apply the show timeout ) */
		var isFirst = (Menu._activeNodes.length == 0);

		/* Hide previous opened sub menu */
		Menu._quickHideSubMenu(e, level);

		/* Is this the first menu node and do we have a show delay? */
		if (isFirst && Menu._showPause > 0)
		{
			/* Show in x (mili)seconds */
			Menu._showTimeout = window.setTimeout(function() { Menu._doShowSubMenu(this, level); }.bind(this), Menu._showPause);
		}
		else
		{
			Menu._doShowSubMenu(this, level);
		}
	}, // function _showSubMenu

	/**
	* Shows the sub menu.
	*
	* @param	Event	e
	* @param	int		level
	*/
	_doShowSubMenu: function(node, level)
	{
		/* Clear possible timeout */
		if (Menu._showTimeout)
		{
			window.clearTimeout(Menu._showTimeout);
		}

		/* Get node link and sub menu */
		var a = (Element.select) ? node.select("a")[0] : node.getElementsBySelector("a")[0];
		var subMenu = (Element.select) ? node.select("ul")[0] : node.getElementsBySelector("ul")[0];

		/* Keep hover style as long as opened */
		a.addClassName("menu_open");
		/* Since 1.3, the class is also applied to the parent LI */
		a.parentNode.addClassName("menu_open");

		/* Show sub menu */
		subMenu.style.visibility = "visible";
		subMenu.style.position = "absolute";

		/* Set correct position. (Note: the horizontal/vertical properties only
		* apply to the first level nodes. All other levels are fixed vertical.
		*/
		var pos = (Element.positionedOffset) ? node.positionedOffset() : Position.positionedOffset(node);
		if (level == 1 && Menu._orientation == Menu.HORIZONTAL)
		{
			subMenu.style.left = pos[0] + "px";
			subMenu.style.top = (pos[1] + node.getHeight()) + "px";
		}
		else
		{
			subMenu.style.left = (pos[0] + node.getWidth()) + "px";
			subMenu.style.top = pos[1] + "px";
		}

		/* Apply opacity if not fully opaque. (Apply for sub menu of first level
		* only, because otherwise opacity would be doubled.)
		*/
		if (level == 1 && Menu._opacity > 0 && Menu._opacity < 1)
		{
			subMenu.setOpacity(Menu._opacity);
		}

		/* Save submenu */
		Menu._activeNodes.push({"level": level, "link": a, "subMenu": subMenu});
	}, // function _doShowSubMenu

	/**
	* Immediately hides the active menu.
	*
	* @param	Event	e
	* @param	int		level
	*/
	_quickHideSubMenu: function(e, level)
	{
		/* Don't bubble up */
		Event.stop(e);

		/* Clear possible timeout */
		if (Menu._hideTimeout)
		{
			window.clearTimeout(Menu._hideTimeout);
		}

		/* And hide the open menus from the given level up */
		Menu._doHideSubMenusFromLevel(level);
	}, // function _quickHideSubMenu

	/**
	* Method for hiding all sub menus.
	*
	* Triggered onmouseout of first sub menu (level 2).
	*
	* @param	Event	e
	* @param	int		level
	*/
	_hideSubMenu: function(e, level)
	{
		/* Don't bubble up */
		Event.stop(e);

		/* if hiding (lost focus on first level), do not show! */
		if (Menu._showTimeout)
		{
			window.clearTimeout(Menu._showTimeout);
		}

		/* No pause? Don't use the timeout */
		if (Menu._hidePause <= 0)
		{
			/* Hide all sub menus */
			Menu._doHideSubMenusFromLevel(1);
		}
		else
		{
			/* Hide in x (mili)seconds */
			Menu._hideTimeout = window.setTimeout(function() { Menu._doHideSubMenusFromLevel(1); }, Menu._hidePause);
		}
	}, // function _hideSubMenu

	/**
	* Hides all active sub menus from the given level.
	*
	* @param	int		level	(Default: 1)
	*
	* @return	boolean
	*/
	_doHideSubMenusFromLevel: function(level)
	{
		/* If level argument is not given, default to 1 */
		if (isNaN(level))
		{
			level = 1;
		}

		/* Remove these sub menus from the array */
		Menu._activeNodes = Menu._activeNodes.findAll(function(node)
		{
			/* Hide all sub menus with a level equal or higher than the given
			* level, and return false to remove these from the array.
			*/
			if (node.level >= level)
			{
				/* Remove hover style */
				if (node.link)
				{
					node.link.removeClassName("menu_open");
					node.link.parentNode.removeClassName("menu_open");
				}
				/* Hide sub menu */
				if (node.subMenu)
				{
					node.subMenu.style.visibility = "hidden";
				}
				/* Return false to remove node from the array */
				return false;
			}
			/* Return true for the other nodes, keeping them in the array */
			return true;
		});
	} // function _doHideSubMenusFromLevel

}; // class Menu

Require.isLoaded['menu'] = true;



function SuggestManager() {
	var _suggests = [];


	this.addSuggest = function(pACDS, pAutoComp) {
		var suggest = new Suggest();
		var ACDSConfig = pACDS;
		var autoCompConfig = pAutoComp;

		suggest.createACDS(ACDSConfig);

		autoCompConfig.oACDS = suggest.getACDS();
		suggest.createAutoComp(autoCompConfig);
		_suggests.push(suggest);
	}

	this.getSuggest = function(pId) {
		for (var cI = 0, lS = _suggests.length; cI < lS; cI++) {
			if (_suggests[cI].getAutoComp().toString().toLowerCase().indexOf(pId.toLowerCase()) > -1) {
				return _suggests[cI];
			}
		}

		return false;
	}
}


function Suggest() {
	var _self = this;
	var _oACDS = {}, _oAutoComp = {};
	var cont = 0;


	this.getAutoComp = function() { return _oAutoComp; }
	this.getACDS = function() { return _oACDS; }

	this.createACDS = function(pConfig) {
		var oACDS = new YAHOO.widget.DS_XHR(pConfig.uri, pConfig.schema, pConfig.config);

		for (var cA in pConfig) {
			if (cA != 'uri' && cA != 'schema' && cA != 'config' && cA != 'toJSONString') { oACDS[cA] = pConfig[cA]; }
		}

		_oACDS = oACDS;
	}

	this.createAutoComp = function(pConfig) {
		var oAutoComp = new YAHOO.widget.AutoComplete(pConfig.input, pConfig.container, pConfig.oACDS);

		for (var cA in pConfig) {
			if (cA != 'input' && cA != 'container' && cA != 'oACDS' && cA != 'toJSONString') { oAutoComp[cA] = pConfig[cA]; }
		}

		if(oAutoComp.onDataReturn){
			oAutoComp.dataReturnEvent.subscribe(oAutoComp.onDataReturn);
		}

		oAutoComp.formatResult = function(oResultItem, sQuery) {
			var sKeyWord = _self.parseToBold(oResultItem, sQuery);

			var tbl = [];
			tbl.push('<div id="s' + cont++ + '" style="position:relative;padding-left:5px;width:100%;height:14px;overflow:hidden;text-overflow:elepsis;">' + sKeyWord + '</div>');
			return tbl.join('');
		}

		oAutoComp.populateResult = function(oResultItem) { return oResultItem[0]; }

		_oAutoComp = oAutoComp;
	}

	this.parseToBold = function(pResult, pStr) {
		if (_oAutoComp.parseToBold) { return _oAutoComp.parseToBold(pResult, pStr); }
		else { return pResult[0]; }
	}
}
Require.isLoaded['Classes.SuggestManager'] = true;
TPI.suggest = new SuggestManager();

function keywordSuggest () 
{
	var _field , _container, _formName, _from, _focused, _value, count=0 ;
	
	
	function moveSuggest() {
        var pos = $Y.Dom.getXY( _field );
        var wh  = getWH( $Y.Dom.get( _field ) );
        
        if (_from == 'top')
          pos[1] += 24;
        else
          pos[1] -= 240;

        $Y.Dom.setStyle(_container, 'position','absolute');
        $Y.Dom.setXY(_container, pos);
        $Y.Dom.setStyle(_container, 'width', (wh.w-4)+'px');
        //alert(pos[0]+" "+pos[1]);
	}

	function hideSuggest() {
		$Y.Dom.get(_container).style.display = 'none';
	}

	
	function submit() 
	{
		if ( typeof( $Y.Dom.get( _formName ).onsubmit)!='undefined' && $Y.Dom.get( _formName ).onsubmit!=null )
		{
			var _submit =  $Y.Dom.get( _formName ).onsubmit ;
			_submit(_formName , _field );
		}
		
		$Y.Dom.get( _formName ).submit();
	}
	
	function submitForm(e) {
		var _e = $Y.Event.getEvent(e);
		if (_e.keyCode == 13) {
			submit() ;
		}
	}

	function _parseToBold(pResult, pStr) {
		var spanIniOdd = '<span style="background-color:#fafb58">';
		var spanIniEven= '<span style="background-color:#fdff00;">';
		var spanEnd    = '</span>';
		
		var type = pResult[1]; /* advertise, keyword, brand, see_also */
		var strResult = pResult[0];

		
		
		var charInc = spanIniOdd.length + spanEnd.length;

		for (var cI = 0, inc = 0, lR = pResult[2].length; cI < lR; cI++ ) {
			var ini = pResult[2][cI];
			var len = pResult[3][cI];

			var str1 = strResult.substr(0, (ini + inc) - 1);
			var str2 = strResult.substr(ini + inc, len);
			var str3 = strResult.substr(inc + ini + len);

			var spanIni = (type == 'advertise')? spanIniOdd : spanIniEven;

			strResult = str1 + ' ' + spanIni + str2 + spanEnd + str3;
			inc += charInc;
		}
		
		return strResult;
	}


	return {
		
		init: function( parameters ) {
		

			if ( typeof( parameters ) == 'undefined' || parameters == null )
			{
				_field 		= 'keyword';
				_container 	= 'suggestcontainer';
				_formName 	= 'searchBoxForm';
				_from		= 'top'
				_focused	= true;
				_value	    = null;
			}
			else
			{
				_field 		= parameters.field;
				_container 	= parameters.container;
				_formName 	= parameters.formName; 
				_from		= parameters.from;
				_focused	= parameters.focused;
				_value      = parameters.value;
			}

			var r = TPI.require || new Require(TPI.path); 
			r.loadFile({file: 'library.yui.autocomplete.autocomplete'});

			var ACDS = {
				maxCacheEntries			: 0,
				queryMatchContains		: true,
				scriptQueryParam		: 'keyword' ,
				scriptQueryAppend		: '',
				uri						: 'suggest.do',
				schema					: ['suggestList', 'description', 'type', 'startPosition', 'length'],
				config					: null
			};

			if (TPI.stateId != '') { ACDS.scriptQueryAppend += '&stateId=' + TPI.stateId; }
			if (TPI.cityId != '') { ACDS.scriptQueryAppend += '&cityId=' + TPI.cityId; }
			if (TPI.suburbId != '') { ACDS.scriptQueryAppend += '&suburbId=' + TPI.suburbId; }
			
			var AutoComp = {
				queryDelay			: 0.5,
				animVert			: true,
				animHoriz			: false,
				useShadow			: true,
				animSpeed			: 0.2,
				maxResultsDisplayed	: 15,
				autoHighlight		: false,
				input				: _field ,
				container			: _container,
				parseToBold			: _parseToBold,
				useIFrame			: true,
				onDataReturn		: function()
									  { 
											//TPI.Certifica('/suggest/suggestResponse/');
											//$Y.Dom.get('areas').innerHTML = ''  ;
									  }
			};
			
			TPI.suggest.addSuggest(ACDS, AutoComp);
				
			TPI.suggest.getSuggest(_field).getAutoComp().containerCollapseEvent.subscribe(this.myOnContainerCollapse);
			TPI.suggest.getSuggest(_field).getAutoComp().containerExpandEvent.subscribe(this.myOnContainerExpand);
			
			TPI.suggest.getSuggest(_field).getAutoComp().textboxKeyEvent.subscribe(this.myOnTextboxKey);
			TPI.suggest.getSuggest(_field).getAutoComp().itemSelectEvent.subscribe(this.myOnItemSelectEvent);			
			//* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
            
			moveSuggest();
			
			$Y.Dom.get(_container).style.display = 'block';

			$Y.Event.addListener(_field , 'keyup', submitForm);

			if (_focused)
				$Y.Dom.get(_field).focus();
			
			if ( typeof( _value ) != 'undefined' && _value != null )
				$Y.Dom.get(_field).value = _value ;
			
		},

        myOnContainerCollapse: function(sType, aArgs) {
			var oAutoComp = aArgs[0];

			//Parche para IE6 No me gusta pero funciona
		    if ( YAHOO.env.ua.ie > 5 && $Y.Dom.get('resultPreferred' ))
		    {
		    	$Y.Dom.setStyle( 'resultPreferred' ,'z-index', '1');
		    }
		    
		    //capa de interceptacion con la lista de anuncios no me gusta pero tambien funciona
		    if ( YAHOO.env.ua.ie > 5 )
		    {
		    	var objects = $Y.Dom.getElementsByClassName  ( 'hideInterceptor' , 'div' );
		    	if (typeof (objects)!='undefined' && objects.length > 0)
			    	$Y.Dom.replaceClass  ( objects , 'hideInterceptor', 'showInterceptor' );
		    }

        },
  
		myOnContainerExpand : function(sType, aArgs) {
			var oAutoComp = aArgs[0];
			
			//Parche para IE6 No me gusta pero funciona
		    if ( YAHOO.env.ua.ie > 5 && $Y.Dom.get('resultPreferred' ))
		    {
		    	$Y.Dom.setStyle('resultPreferred' ,'z-index', '-1');
		    }

		    //capa de interceptacion con la lista de anuncios no me gusta pero tambien funciona
		    if ( YAHOO.env.ua.ie > 5 )
		    {
		    	var objects = $Y.Dom.getElementsByClassName  ( 'showInterceptor' , 'div' );
		    	if (typeof (objects)!='undefined' && objects.length > 0)
		    		$Y.Dom.replaceClass  ( objects , 'showInterceptor', 'hideInterceptor' );
		    }
		    
		},

		myOnTextboxKey : function (sType, aArgs) {
			var oAutoComp = aArgs[0];
		}
		,
		
		myOnItemSelectEvent : function ( oSelf , elItem , oData ) 
		{
			submit();
		}
		,
		
		changeQuery: function() {
			var _s = TPI.suggest.getSuggest(_field );

			_s.getAutoComp().dataSource.scriptQueryAppend = '';
			
			if (TPI.stateId != '') { _s.getAutoComp().dataSource.scriptQueryAppend += '&stateId=' + TPI.stateId; }
			if (TPI.cityId != '') { _s.getAutoComp().dataSource.scriptQueryAppend += '&cityId=' + TPI.cityId; } 
			if (TPI.suburbId != '') { _s.getAutoComp().dataSource.scriptQueryAppend += '&suburbId=' + TPI.suburbId; }
		},

		validateForm: function() {
			// Validate form inputs here
			return false;
		}
	}
}


TPI.suggest.keyword = new  keywordSuggest ();


TPI.suggest.locality = function() {
	var _result = [];

	function _parseToBold(pResult, pStr) {
		var spanIniOdd = '<span style="background-color: #fafb58">';
		var spanIniEven = '<span style="background-color:#fdff00;color:#000;font-weight:bold;">';
		var spanEnd = '</span>';

		 

		var state = eval(pResult[0]);
		var strResult = pStr;

		if (state) {
			var str = pResult[2].toLowerCase();
			var len = pStr.length;
			var ini = str.indexOf(pStr.toLowerCase());
			var str1 = pResult[2].substr(0, ini);
			var str2 = pResult[2].substr(ini, len);
			var str3 = pResult[2].substr(ini + len);

			strResult = str1 + spanIniOdd + str2 + spanEnd + str3;
		} else {
			var str = pResult[4].toLowerCase();
			var len = pStr.length;
			var ini = str.indexOf(pStr.toLowerCase());
			var str1 = pResult[4].substr(0, ini);
			var str2 = pResult[4].substr(ini, len);
			var str3 = pResult[4].substr(ini + len);

			strResult = str1 + spanIniEven + str2 + spanEnd + str3 + ', ' + pResult[2];
		}

		_result.push({
			'stateId': pResult[1],
			'stateDesc': pResult[2],
			'cityId': pResult[3],
			'cityDesc': pResult[4],
			'suburbId': pResult[5],
			'suburbDesc': pResult[6]
		});

		return strResult;
	}

	function _onSelectItem(pItem) {
		if (TPI.localitySearch) {
			TPI.localitySearch.setResult(pItem, _result);
		}
	}


	return {
		init: function() {
			var r = TPI.require || new Require(TPI.path); 
			r.loadFile({file: 'library.yui.autocomplete.autocomplete'});

			var ACDS = {
				maxCacheEntries: 0,
				queryMatchContains: true,
				scriptQueryParam: 'keyword',
				scriptQueryAppend: '',
				uri: 'searchMarket.do',
				schema: ['suggestList', 'state', 'stateId', 'stateDesc', 'cityId', 'cityDesc', 'suburbId', 'suburbDesc'],
				config: null
			};

			if (TPI.stateId != '') { ACDS.scriptQueryAppend += '&stateId=' + TPI.stateId; }
			if (TPI.cityId != '') { ACDS.scriptQueryAppend += '&cityId=' + TPI.cityId; }
			if (TPI.suburbId != '') { ACDS.scriptQueryAppend += '&suburbId=' + TPI.suburbId; }

			var AutoComp = {
				queryDelay: 0.5,
				animVert: true,
				animHoriz: false,
				useShadow: false,
				useIFrame: false,
				animSpeed: 0.2,
				autoHighlight: true,
				input: 'txtlocation',
				container: 'localitySuggestCtd',
				parseToBold: _parseToBold,
				onSelectItem: _onSelectItem
			};
			
			TPI.suggest.addSuggest(ACDS, AutoComp);
		}
	}
}();

Require.isLoaded['suggest'] = true;


/**
 * . . . . . . . .  . . . . . . .  . . . . . . . . . . . . . .   
{
 'filer'      :false,
 'stateCombo' :'stateId',
 'cityCombo'  :'cityId', 
 'suburbCombo':'suburbId'
} 
   . . . . . . . .  . . . . . . .  . . . . . . . . . . . . . .
 **/

var EMPTYMESSAGE = 'Selecciona Dpto/Distrito';
var SUFFIXMESSGE = 'Buscar en: ';

function Locality( parameters ) 
{
	var _self = this;
	var _changeCityFlag = false, _changeSuburbFlag = false;

	this.stateCombo  = '';
	this.cityCombo   = '';
	this.suburbCombo = '';

	function _setSelectValue(pObj, pValue) {
		var obj = pObj.options;

		if (pValue != '') {
			for (var cI = 0, lO = obj.length; cI < lO; cI++) {
				if (obj[cI].value == pValue) {
					pObj.selectedIndex = cI;
					break;
				}
			}
		}
	}
	
	function _handleInitSuccess(o) {

		if (o.responseText !== undefined) {
			// var stateJSON = o.responseText.parseJSON();
			var stateJSON = JSON.parse(o.responseText);

			var $S = stateJSON.states;
			var sel = $Y.Dom.get(_self.stateCombo);

			//sel.options[0].style.width = '180px';            

			for (var cI = 0, cIo = 1,lS = $S.length; cI < lS; cI++, cIo++) {
				sel.options[cIo] = new Option($S[cI].desc, $S[cI].id);
				
				if ($S[cI].id == TPI.stateId) { sel.options[cIo].selected = true; }
			}
			
			if ($Y.Dom.get(_self.stateCombo).selectedIndex == 0)
			{
				$Y.Dom.get(_self.cityCombo).disabled = true ;
				$Y.Dom.get(_self.suburbCombo).disabled = true ;
			}
			else
			{
				$Y.Dom.get(_self.cityCombo).disabled = false ;
				$Y.Dom.get(_self.suburbCombo).disabled = false ;
			}
			
			_setEvents();

			if (TPI.suburbId != '') _changeSuburbFlag = true; 
			if (TPI.cityId != '') _changeCityFlag = true; 
			
			if (TPI.stateId != '')
			{
				_setSelectValue(sel, TPI.stateId);
				_changeState();
			}
			
		}
	}
	
	function _handleChangeState(o) {
		if (o.responseText !== undefined) {
			// var stateJSON = o.responseText.parseJSON();
			var stateJSON = JSON.parse(o.responseText);
			var $C = stateJSON.cities;
			var sel = $Y.Dom.get(_self.cityCombo);

			if (_changeCityFlag == false) {
				TPI.cityId = '';
				/* Al cambiar departamento el distrito se vac?a autom?ticamente */
				TPI.suburbId = '';
				$Y.Dom.get(_self.suburbCombo).disabled = true ;
			}

			for (var cI = 0, cIo = 1,lC = $C.length; cI < lC; cI++, cIo++) 
			{
				sel.options[cIo] = new Option($C[cI].desc, $C[cI].id);
				if ($C[cI].id == TPI.cityId) { sel.options[cIo].selected = true; }
			}

			if ( sel.options.length <= 1 ) 
				sel.disabled = true ;
			else
				sel.disabled = false;
			
			
			if ($Y.Dom.get(_self.stateCombo).selectedIndex == 0)
			{
				$Y.Dom.get(_self.cityCombo).disabled = true ;
				$Y.Dom.get(_self.suburbCombo).disabled = true ;
			}
			
			
			if (_changeCityFlag) {
				_setSelectValue($Y.Dom.get(_self.cityCombo), TPI.cityId);
				_changeCityFlag = false;
				_changeCity();
			}
		}
	}
	
	
	function _handleChangeCity(o) {
		if (o.responseText !== undefined) {
			// var stateJSON = o.responseText.parseJSON();
			var stateJSON = JSON.parse(o.responseText);
			var $S = stateJSON.suburbs;
			var sel = $Y.Dom.get(_self.suburbCombo);

			if (_changeSuburbFlag == false) {
				TPI.suburbId = '';
			}

			for (var cI = 0, cIo = 1,lS = $S.length; cI < lS; cI++, cIo++) {
				sel.options[cIo] = new Option($S[cI].desc, $S[cI].id);
				if ($S[cI].id == TPI.suburbId) { sel.options[cIo].selected = true; }
			}

			
			if ( sel.options.length <= 1 ) 
				sel.disabled = true ;
			else 
				sel.disabled = false ;
			
			if (_changeSuburbFlag) {
				_setSelectValue($Y.Dom.get(_self.suburbCombo), TPI.suburbId);
				_changeSuburbFlag = false;
			}
		}
	}
	
	function _setEvents() 
	{
		$Y.Dom.get(_self.stateCombo).onchange 	= _changeState;
		$Y.Dom.get(_self.cityCombo).onchange 	= _changeCity;
		$Y.Dom.get(_self.suburbCombo).onchange	= _changeSuburb;
	}
	
	
	function _changeCity() {

		var selS = $Y.Dom.get(_self.suburbCombo);
		selS.options.length = 0;
		selS.options[0] = new Option('Distrito', '');
		
		//selS.options[0].style.width = '180px';
		// if ( $Y.Dom.get(_self.cityCombo).selectedIndex > 0 )
		// {
		//	 $Y.Dom.get(_self.suburbCombo).disabled = false ;
		// }
		// else if ( $Y.Dom.get(_self.cityCombo).selectedIndex == 0)
		// {
		//		$Y.Dom.get(_self.suburbCombo).disabled = true ;
		// }
		
		if ($Y.Dom.get(_self.cityCombo).selectedIndex > 0) {
			TPI.cityId = $Y.Dom.get(_self.cityCombo).options[$Y.Dom.get(_self.cityCombo).selectedIndex].value;
		} else if ($Y.Dom.get(_self.stateCombo).selectedIndex > 0) {
			TPI.cityId = '';
			TPI.suburbId = '';
		} else {
			TPI.stateId = '0';
			TPI.cityId = '0';
			TPI.suburbId = '0';
		}

		var pars = '?stateId=' + TPI.stateId + '&cityId=' + TPI.cityId + '&suburbId=0';

		var url = 'locationCookie.do';
		//. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
		// Genera problemas al realizar recarga con las cookies 
		// $Y.Connect.asyncRequest('GET', url + pars);
		//. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

		url = 'searchBarLocality.do';
		$Y.Connect.asyncRequest('GET', url + pars, {success: _handleChangeCity});
	}	

	function _changeState() {

		var selC = $Y.Dom.get(_self.cityCombo);
		selC.options.length = 0;
		selC.options[0] = new Option('Localidad', '');
		//selC.options[0].style.width = '180px';
		
		var selS = $Y.Dom.get(_self.suburbCombo);
		selS.options.length = 0;
		selS.options[0] = new Option('Distrito', '');
		
		//selS.options[0].style.width = '180px';
		
		if ($Y.Dom.get(_self.stateCombo).selectedIndex > 0) {
			TPI.stateId = $Y.Dom.get(_self.stateCombo).options[$Y.Dom.get(_self.stateCombo).selectedIndex].value;
		} else {
			TPI.stateId  = '0';
			TPI.cityId 	 = '0';
			TPI.suburbId = '0';
		}

		var pars = '?stateId=' + TPI.stateId + '&cityId=0&suburbId=0';

		var url = 'locationCookie.do';
		//. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
		// Genera problemas al realizar recarga con las cookies 
		// $Y.Connect.asyncRequest('GET', url + pars);
		//. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

		url = 'searchBarLocality.do';
		$Y.Connect.asyncRequest('GET', url + pars, {success: _handleChangeState});

	}	
	
	
	function _changeSuburb() {

		if ($Y.Dom.get(_self.suburbCombo).selectedIndex > 0) 
		{
			TPI.suburbId = $Y.Dom.get(_self.suburbCombo).options[$Y.Dom.get(_self.suburbCombo).selectedIndex].value;
		} 
		else if ($Y.Dom.get(_self.cityCombo).selectedIndex > 0) 
		{
			TPI.suburbId = '0';
		}
		else if ($Y.Dom.get(_self.stateCombo).selectedIndex > 0) {
			TPI.cityId   = '0';
			TPI.suburbId = '0';
		} else {
			TPI.stateId  = '0';
			TPI.cityId   = '0';
			TPI.suburbId = '0';
		}

		var pars = '?stateId=' + TPI.stateId + '&cityId=' + TPI.cityId + '&suburbId=' + TPI.suburbId;

		var url = 'locationCookie.do';
		
		//. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
		// Genera problemas al realizar recarga con las cookies 
		// $Y.Connect.asyncRequest('GET', url + pars);
		//. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
	}
	
	
	this.init = function() 
	{
	   //recogiendo parametros
		var s_key;
		for (s_key in parameters)
			this[s_key] = parameters[s_key];
		
		var url = 'searchBarLocality.do';
		var pars = '?stateId=&cityId=&suburbId=';
		
		$Y.Connect.asyncRequest('GET', url + pars, {success: _handleInitSuccess});
	}
	
	this.setResult = function(pItem, pResult) {
		var _ind = parseInt(pItem.childNodes[0].id.substr(1));
		var _result = pResult[_ind];

	}
}
Require.isLoaded['Classes.Locality'] = true;
/**
 * 
 * 
 * 
 *  
 *  
 * Clase STAGE controla los banners en el SITE, se esta implementando para banners preferentes
 *  {                        
 *    'interval'   :6000
 *  }
 *  
 *    TPI.stage.addBanner('banner1','','keyword=&b_section=PA&b_type=BN'); 
 *    TPI.stage.addBanner('banner2','','keyword=&b_section=PA&b_type=BL'); 
 *    TPI.stage.addBanner('banner3','','keyword=&b_section=PA&b_type=BD'); 
 *
 *    TPI.stage.addBackground
 *    ({ 'container': 'fondopublicidad', 
 *       'banners'  : [{'image':'images/bannerBackground/img_car.jpg','parameter': 'Autos Desportivos?','label':'carro'},
 *                        {'image':'images/bannerBackground/mg_computer.jpg','parameter': 'Computacion?','label':'computacion'},
 *                        {'image':'images/bannerBackground/img_doctors.jpg','parameter': 'Mdicos?','label':'medicos'},
 *                        {'image':'images/bannerBackground/img_drug_store.jpg','parameter': 'Boticas y Farmacias?','label':'botica'},
 *                        {'image':'images/bannerBackground/img_music.jpg','parameter': 'Intrumentos Musicales?','label':'instrumentos+musicales'},
 *                        {'image':'images/bannerBackground/img_school.jpg','parameter': 'Colegios?','label':'colegio'}] 
 *    });
 *    
 *    TPI.stage.showBanners({'interval' : 60000});
 *
 *
 *
 * Plantilla de banners dinamico, los banner dinamicos se contruyen en memoria se consideran como subtipo de banners se debe tener 
 * en cuenta que los banners dinamicos se retornan por el servicio con el tipo HTML y contienen un subtipo de la imagen que contienen
 * 
 */

var template =	'<table border="0" bgcolor="#FFFFFF" cellpadding="1" cellspacing="0" width="100%" height="100%">'+
				'<tr><td><table bgcolor="#FFFFFF" border="0" cellpadding="2" cellspacing="0" width="100%" height="100%">'+
				'<tr> <td align="center" style="vertical-align:middle;"><div id="suplantLogo"></div></td> <td style="vertical-align:middle;">'+
				'<font face="Verdana" size="1"><b>{description}</b><br></font>'+
				'<font face="Arial" style="font-size:10px;">{content}<br></font>'+
				'<a style="font-name:Arial; font-size:10px; color:maroon; text-decoration:none;" target="_blank" href={urlclick}> {urlclick}</a>' +
				'</td></tr></table></td></tr></table>';	

/**
 * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 *  Haciendo plantillas de objetos
 *. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 */

String.prototype.supplant = function (o) { 
    return this.replace(/{([^{}]*)}/g, 
        function (a, b) {  
            var r = o[b];
            return typeof r === 'string' ? 
                r : a; 
        }
    ); 
}; 

function Stage() {
	var _self = this;

	var _loading = false;
	var _loaded = false;

	var _banners 		 = [];
	var _bannerCount 	 = 0;
	var _backgroundCount = 0;
	var _preferredCount  = 0;
	var _preferredShow   = false;
	
	var g_outBanner  = 0;
	var g_overBanner = 0;	
	var g_openBanner = 0;

	
	function _setObjectFlash (containerID, source, width,  height )
	{
		var randomName =containerID+' '+Math.floor(Math.random()*1000);
		
		 AC_FL_RunContent(
				 'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
				 'container', containerID , 
				 'width', width,
				 'height', height,
				 'src', source,
				 'quality', 'high',
				 'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
				 'align', 'middle',
				 'play', 'true',
				 'loop', 'true',
				 'scale', 'showall',
				 'wmode', 'transparent',
				 'devicefont', 'false',
				 'id', randomName,
				 'bgcolor', '#ffffff',
				 'name', randomName,
				 'menu', 'true',
				 'allowFullScreen', 'false',
				 'allowScriptAccess','sameDomain',
				 'movie', source,
				 'salign', ''
		 );
		 
		//Parche para IE6 No me gusta pero funciona
	    if ( YAHOO.env.ua.ie > 5 )
	    {
			var hackingIE ="<div style='width:"+width+"px; height:"+height+"px; float: left; position: absolute; top: 0; left: 0; z-index:-1; background-color: #ffffff;'>"+
			"<iframe scrolling='no' frameborder='0' style='width:"+width+"px; height:"+height+"px; float: left; position: absolute; top: 0; left: 0; z-index:-1; background-color: #ffffff;' tabindex='-1'></iframe></div>" ;
			var hackingIEContainer  = $Y.Dom.get(containerID);
			hackingIEContainer.innerHTML = hackingIEContainer.innerHTML +  hackingIE;
	    }
	}

	function _loadBanners() {
		var count = 0;
		if (_bannerCount == 0 && _backgroundCount == 0 && _preferredCount == 0 ) return ;
		
		// Banners por defecto
		for (count = 0; count < _banners.length; count++) 
		{
			if (_banners[count].t == 'banner') 
			{ 
				_createBanner ( count );
        }
        }

		// Banners Background
		
		var found = false;
		
		if ( _backgroundCount > 0 )
		{
			count = 0;
			while ( !found && count < _banners.length )
			{
				for (count = 0; count < _banners.length; count++) 
				{
					var randomBackground = Math.floor(Math.random()*_banners.length);
					
					if (_banners[randomBackground].t == 'background')
					{
						_createBackground ( randomBackground );
						found = true ;
						break;
					}
				}
			}
		}

		// Banners Preferentes

		if ( _preferredCount > 0 && !_preferredShow)
		{
			count = 0;
			while ( !found && count < _banners.length )
			{
				for (count = 0; count < _banners.length; count++) 
				{
					var randomPreferred = Math.floor(Math.random()*_banners.length);
					
					if (_banners[randomPreferred].t == 'preferred')
					{
						_createPreferred ( randomPreferred );
						_preferredShow = true ;
						found = true ;
						break;
					}
				}
			}
		}
		
	}

	function _createBackground ( id )
	{
		    var keyword =_banners[id].p;
			var url_page = '';
			if(keyword == 'camiones'){
				url_page = 'result.do?keyword=Camiones+(Compra-Venta)';
			}else if(keyword == 'computadoras'){
				url_page = 'result.do?keyword=computaci%F3n';		
			}else if(keyword == 'construccion'){
				url_page = 'result.do?keyword=construcci%F3n';
			}else if(keyword == 'discotecas'){
				url_page = 'result.do?keyword=discotecas';
			}else if(keyword == 'doctores'){
				url_page = 'result.do?keyword=doctor';
			}else if(keyword == 'fiestas'){
				url_page = 'result.do?keyword=karaokes';
			}else if(keyword == 'florerias'){
				url_page = 'result.do?&keyword=floreria';
			}else if(keyword == 'destino'){
				url_page = 'intipawi/';
			}else if(keyword == 'final-mundial'){
				url_page = 'pichanga/';
			}else if(keyword == 'ie8'){
				url_page = 'ie8/';				
			}else if(keyword == 'kcupon'){
				url_page = 'cupones/';
			}else if(keyword == 'arequipa'){
				url_page = 'arequipa/';
			}else{
				 url_page = 'result.do?status=P&stateId=' + TPI.stateId + '&cityId=' + TPI.cityId + '&keyword='+ _banners[id].p;			
			}	

		var randomName =' '+Math.floor(Math.random()*1000);
		
		var backgroundContainer  = $Y.Dom.get(_banners[id].b);
		backgroundContainer.style.backgroundImage = 'url('+_banners[id].u+')';
		
		var bkFrase  	= $Y.Dom.get('bkfrase');
		var bkFraselnk  = $Y.Dom.get('bkfraselnk');
			var bkFraselnk2  = $Y.Dom.get('bkfraselnk2');
			var bkImgTransparente  = $Y.Dom.get('imgTransparente');
		
		bkFrase.innerHTML = _banners[id].l;
		bkFraselnk.href   = url_page;
			bkFraselnk2.href   = url_page;
			bkImgTransparente.alt=_banners[id].l;
			bkImgTransparente.title=_banners[id].l;
	}
	
	
	function _createPreferred( id )
	{
		var url_page = 'bannerService.do?'+ _banners[id].p;
		var callback = {
				success: function(o){
						try
						{
							objBanner  = eval ( "(" + o.responseText +")");

							if ( typeof ( objBanner) !='undefined' || objBanner!=null )
							{   if (objBanner.id != '0' ) 
								{
									var contentBanner = $Y.Dom.get(_banners[id].b);

									var tempElBk_1 = document.createElement('div');
									tempElBk_1.id  = _banners[id].b+'pr_1bk';

									var tempElBk_2 = document.createElement('div');
									tempElBk_2.id  = _banners[id].b+'pr_2bk';
									
									contentBanner.innerHTML = '';
									contentBanner.appendChild(tempElBk_1);
									contentBanner.appendChild(tempElBk_2);
									
									$Y.Dom.addClass(tempElBk_1.id, 'bannerflash1');
									$Y.Dom.addClass(tempElBk_2.id, 'bannerflash2');
									
									$Y.Dom.setStyle( tempElBk_1,'display', 'block');
									$Y.Dom.setStyle( tempElBk_1,'height', '60px');

									$Y.Dom.setStyle( tempElBk_2,'display', 'none');
									
									if ( objBanner.type == "SWF" )
									{
										 _setObjectFlash (tempElBk_1.id , objBanner.urlpath+objBanner.id+'?fv_FrameID=1', objBanner.width,  60 )
										 _setObjectFlash (tempElBk_2.id , objBanner.urlpath+objBanner.id+'?fv_FrameID=2', objBanner.width,  objBanner.height )
									}
									
									$Y.Dom.setStyle(_banners[id].b + "_container", 'display', 'block');
									$Y.Dom.setStyle( _banners[id].b , 'display', 'block');
									
									$Y.Event.addListener(tempElBk_1, 'click', objBanner.click);
									$Y.Event.addListener(tempElBk_2, 'click', objBanner.click );
									
									$Y.Event.addListener(tempElBk_1, 'mouseover', function () { 
										g_overBanner= setTimeout( function () { 
													if (g_openBanner != 0 ) return;
													
													$Y.Dom.setStyle(tempElBk_1, 'display', 'none');      
												    $Y.Dom.setStyle(tempElBk_2, 'display', 'block');      
												    
												    g_openBanner = 1;

													clearTimeout(g_outBanner);
												}
												, 500);
										});

									$Y.Event.addListener(tempElBk_2, 'mouseout', function () { 
										g_outBanner = setTimeout( function () 
												{ 
													if (g_openBanner != 1) return ;
													
													$Y.Dom.setStyle(tempElBk_2, 'display', 'none');      
												    $Y.Dom.setStyle(tempElBk_1, 'display', 'block');      
													
												    g_openBanner = 0;
													
													clearTimeout(g_overBanner);
												}
												, 1000);
									});
								}    
							}
						}
						catch (e)
						{ 	
						}
				}
			}

		$Y.Connect.asyncRequest('GET', url_page , callback);
	}	
	
	
	
	function _createBanner ( id )
	{
		var url_page = 'bannerService.do?'+ _banners[id].p;
		var callback = {
				success: function(o){
						try
						{
						    //objBanner  = eval ( "(" + o.responseText +")");
							//alert('GBC: antes del eval'+o.responseText);
							objBanner  = eval ( '(' + o.responseText +')');
							//alert('GBC: '+o.responseText);
							if ( typeof ( objBanner) !='undefined' || objBanner!=null )
							{
								if (objBanner.id != '0' )
								{
									// alert('GBC: Ingreso a la construccion');
				                    // crear elemento banner y adicionarlo al objeto banner correspondiente
									// luego adicionarle al objeto creado el evento click
									// $Y.Event.addListener($Y.Dom.get('resultBanner') , 'click', objBanner.click  );
									
									var contentBanner = $Y.Dom.get(_banners[id].b);
									var tempEl		  = document.createElement('div');
									tempEl.id  		  = _banners[id].b+'_1';
									
									/* INICIO Req. S20100093 / cfveliz */
									if (objBanner.publication == "BE" || objBanner.publication == "BD") {
										$Y.Event.purgeElement(contentBanner, false, 'mouseover');
										$Y.Event.purgeElement(contentBanner, false, 'mouseout');
										$Y.Dom.setStyle(contentBanner, 'top', '0px');
										$Y.Dom.setStyle(contentBanner, 'height', '170px');
									}
									/* FIN Req. S20100093 / cfveliz */

									var tempElBk = document.createElement('div');
									tempElBk.id  = _banners[id].b+'_1bk';
									
									contentBanner.innerHTML = '';
									contentBanner.appendChild(tempEl);
									contentBanner.appendChild(tempElBk);
									
									$Y.Dom.addClass( tempEl.id , 'bannerFrame' );
									$Y.Dom.addClass( tempElBk.id , 'bannerBackFrame' );

									/* INICIO Req. M20100198 / cfveliz */
									if (objBanner.publication != "BE") {
										if ( objBanner.type == "IMG" ||  objBanner.type == "JPG" || objBanner.type == "GIF" )
										{
											contentBanner.innerHTML = '<a href="#"><img src="'+objBanner.urlfile +'" border="0"></a>';	
											$Y.Event.addListener(contentBanner, 'click', objBanner.click );
										}
										
										if ( objBanner.type == "HTML" && typeof ( objBanner.data ) !='undefined' || objBanner.data!=null  )
										{ 
			                                tempElBk.innerHTML = template.supplant(objBanner);
											if (typeof ( objBanner.data[0].urlpath ) !='undefined' || objBanner.data[0].urlpath!=null){
												tempElBk.innerHTML = template.supplant(objBanner.data[0]);	
											}	
											
											$Y.Dom.setStyle( tempElBk,'height', objBanner.height+'px');
											$Y.Dom.setStyle( tempElBk,'width' , objBanner.width+'px');
											
											if ( objBanner.data[0].type == "SWF" ) 
											{
												_setObjectFlash ('suplantLogo' , objBanner.data[0].urlpath, 160,  44 )
											}
											else
											{
												if (typeof ( objBanner.data[0].urlpath ) !='undefined' || objBanner.data[0].urlpath!=null){
													$Y.Dom.get('suplantLogo').innerHTML = '<img src="'+objBanner.data[0].urlpath+'" border="0">';
													
												}		
													
											}
										} 
	
										if ( objBanner.type == "SWF" )
										{
											_setObjectFlash (tempElBk.id , objBanner.urlpath+objBanner.id, objBanner.width,  objBanner.height )
										}
									} else {
										//Banner expandible
										var tempElBk2 = document.createElement('div');
										tempElBk2.id  = _banners[id].b+'_2bk';
										
										contentBanner.appendChild(tempElBk2);
										
										$Y.Dom.addClass( tempElBk2.id , 'bannerBackFrame' );
										
										if ( objBanner.type == "SWF" ) {
											_setObjectFlash(tempElBk.id, objBanner.urlpath+objBanner.id+'?fv_FrameID=1', objBanner.width, 168);
											//_setObjectFlash(tempElBk2.id, objBanner.urlpath+objBanner.id+'?fv_FrameID=2', objBanner.width, objBanner.height);
											_setObjectFlash(tempElBk2.id, objBanner.urlpath+objBanner.id+'?fv_FrameID=2', objBanner.width, 436);
										}
										
										$Y.Dom.setStyle(tempElBk, 'display', 'block');
										$Y.Dom.setStyle(tempElBk, 'width', objBanner.width+'px');
										$Y.Dom.setStyle(tempElBk, 'height', '168px');
										$Y.Dom.setStyle(tempElBk2, 'display', 'none');
										$Y.Dom.setStyle(tempElBk2, 'width', objBanner.width+'px');
										//$Y.Dom.setStyle(tempElBk2, 'height', objBanner.height+'px');
										$Y.Dom.setStyle(tempElBk2, 'height', '436px');
										
										$Y.Event.addListener(contentBanner, 'mouseover', function () {
												$Y.Dom.setStyle(tempElBk, 'display', 'none');
												$Y.Dom.setStyle(tempElBk2, 'display', 'block');
												//$Y.Dom.setStyle(contentBanner, 'top', '-'+String(Number(objBanner.height)+2-168)+'px'); //+2 de borde
												//$Y.Dom.setStyle(contentBanner, 'height', String(Number(objBanner.height)+2)+'px'); //+2 de borde
												$Y.Dom.setStyle(contentBanner, 'top', '-'+String(436+2-168)+'px'); //+2 de borde
												$Y.Dom.setStyle(contentBanner, 'height', String(436+2)+'px'); //+2 de borde
											});

										$Y.Event.addListener(contentBanner, 'mouseout', function () {
												$Y.Dom.setStyle(tempElBk2, 'display', 'none');
												$Y.Dom.setStyle(tempElBk, 'display', 'block');
												$Y.Dom.setStyle(contentBanner, 'top', '0px');
												$Y.Dom.setStyle(contentBanner, 'height', '168px');
											});
									}
									/* INICIO Req. M20100198 / cfveliz */

									//Mostrar el banner creado para el caso
									$Y.Dom.setStyle( tempEl,'height' , objBanner.height+'px');
									$Y.Dom.setStyle( tempEl,'width'  , objBanner.width+'px');
									$Y.Dom.setStyle( tempEl,'display', 'block');
									/* INICIO Req. S20100093 / cfveliz */
									//El alto est? harcodeado para Banner expandible
									if (objBanner.publication == "BE") {
										$Y.Dom.setStyle(tempEl, 'height', '436px');
									}
									/* FIN Req. S20100093 / cfveliz */
									
									$Y.Event.addListener(tempEl, 'click', objBanner.click );
								}    
							}
						}
						catch (e)
						{ 	//if (e.description)
							//     alert("Error detectado: " + e.description)
							//  else
							//    alert("Error detectado: " + e)
						}
				}
			}

		$Y.Connect.asyncRequest('GET', url_page , callback);
	}
	

	this.isLoading = function() { return _loading; }
	this.isLoaded = function() { return _loaded; }
	this.getBannerCount = function() { return _bannerCount; }
	this.getBackgroundCount = function() { return _backgroundCount; }
	this.getPreferredCount = function() { return _preferredCount; }
	
	this.init = function() {
		_banners = [];
		_self.loading();
	}

	this.handleFailure = function(o) {
		if (o.responseText !== undefined) 
		{
			trace('' +
				'Error: ' + 'Transaction id: ' + o.tId + '\n' +
				'HTTP status: ' + o.status + '\n' +
				'Status code message: ' + o.statusText +
			'');
		}
	}

	this.loading 	= function() { _loading = false; }
	this.loaded 	= function() { _loading = true;  }
	this.pageLoaded = function() { _loaded  = true;  }

	this.addBanner = function(banner, url, parameter) {
		_banners.push({'b': banner, 'u': url, 'p': parameter, 't' : 'banner'});
		_bannerCount ++;
	}

	function _addBackground (banner, url, label,  parameter) {
		_banners.push({'b': banner, 'u': url, 'p': parameter, 'l': label, 't' : 'background'});
		_backgroundCount ++;
	}
	
	this.addPreferred = function( banner, url, parameter) {
		_banners.push({'b': banner, 'u': url, 'p': parameter, 't' : 'preferred'});
		_preferredCount ++;
	}

	/**
	 * 
	 *    { 'container': 'name_container_objet', 
	 *      'banners'  : [{ 'image' : '', 'parameter': '', 'label' : '' },{},{},{}] 
	 *    }
	 * 
	 */
	
	this.addBackground = function( parameters ) 
	{
		var container, banners ;
		if ( typeof (parameters)=='undefined' ) return;
		container = parameters.container;
		banners	  = parameters.banners;
		for (var count = 0; count < banners.length; count++)
			_addBackground ( container, banners[count].image, banners[count].label,  banners[count].parameter);
	}

	this.showBanners = function(parameters) 
	{
		var s_key;
		
		for (s_key in parameters)
			this[s_key] = parameters[s_key];

		if (typeof(this.interval)=='undefined' || this.interval == 0)
			this.interval = 5000;

		_loadBanners ();
		setInterval(_loadBanners , this.interval);
	}
	
	
	
	this.showBanner = function(banner) 
	{
		// no implementado
	}
}
Require.isLoaded['Classes.Stage'] = true;


/*
 * Certifica Constants
 */
var CTF_SITIO = 18912;
var CTF_URL = 'http://hits.e.cl/cert/hit.dll';
var _LoadingHTML = '<div style="height:60px;margin-top:35px;vertical-align:middle;text-align:center;"><img src="images/carregando.gif" alt="" /></div>';

TPI.Certifica = function (path) {
}


function Point(p_x, p_y){
	this.x = p_x;
	this.y = p_y;
}

function getXY(aTag) {
	var pt = new Point(aTag.offsetLeft, aTag.offsetTop);
	do {
		aTag = aTag.offsetParent;
		pt.x += aTag.offsetLeft;
		pt.y += aTag.offsetTop;
	} while (aTag.tagName != "BODY" && aTag.tagName != "HTML");

	return pt;
}

function getXYOffX(aTag) {
	var pt = new Point(aTag.offsetLeft, aTag.offsetTop);
	do {
		aTag = aTag.offsetParent;
		pt.y += aTag.offsetTop;
	} while(aTag.tagName!="BODY"&& aTag.tagName!="HTML");
	return pt;
}

function Dimension(p_w, p_h){
	this.w = p_w;
	this.h = p_h;
}

function getWH(p_object) {
	return new Dimension(p_object.offsetWidth, p_object.offsetHeight);
}


function posById(p_objectIdA, p_objectIdB) {
	var l_objectA = $Y.Dom.get(p_objectIdA);
	var l_objectB = $Y.Dom.get(p_objectIdB);

	var l_point = getXY(l_objectB);
	
	l_objectA.style.left = l_point.x + 'px';
	l_objectA.style.top = l_point.y + 'px';
}

function posByIdUsingHeight(p_objectIdA, p_objectIdB) {
	var l_objectA = $Y.Dom.get(p_objectIdA);
	var l_objectB = $Y.Dom.get(p_objectIdB);

	var l_point = getXY(l_objectB);
	var l_dimension = getWH(l_objectB);
	
	l_objectA.style.left = l_point.x + 'px';
	l_objectA.style.top = (l_point.y + l_dimension.h) + 'px';
}

function showById(p_objectId) {
	var l_object = $Y.Dom.get(p_objectId);
	l_object.style.display = 'block';
}

function showHideById(p_objectId) {
	var l_object = $Y.Dom.get(p_objectId);
	if (l_object.style.display == 'none') {
		l_object.style.display = 'block';
	} else {
		l_object.style.display = 'none';
	}
}

function getMouseXY(e) {
	var point = new Point(0,0);
	if (e.pageX || e.pageY){
		point.x = e.pageX;
		point.y = e.pageY;
	}else if (e.clientX || e.clientY){
		point.x = e.clientX + document.body.scrollLeft;
		point.y = e.clientY + document.body.scrollTop;
	}
	return point;
}

function isCursorOver(elementId, e){
	var obj = $Y.Dom.get(elementId);
	var l_point = getXY(obj);
	var l_mousePoint = getMouseXY(e);
	var l_dimension = getWH(obj);

	var boundaryX = parseInt(l_mousePoint.x) - parseInt(l_point.x);
	var boundaryY = parseInt(l_mousePoint.y) - parseInt(l_point.y);

	if (boundaryX < 0) boundaryX += document.documentElement.scrollLeft;
	if (boundaryY < 0) boundaryY += document.documentElement.scrollTop;

	var moverX = (1 < boundaryX) &&  boundaryX < parseInt(l_dimension.w);
	var moverY = (1 < boundaryY) &&  boundaryY < parseInt(l_dimension.h);
	
	return (moverX && moverY);
}

function showObject(p_object_id, p_object_list_id, p_top, p_left, p_display) {
	var l_object = $Y.Dom.get(p_object_id);
	var l_objectList = $Y.Dom.get(p_object_list_id);

	var l_point = getXY(l_object);
	var l_dimension = getWH(l_object);

	l_objectList.style.display = p_display ? p_display : 'block';
	l_objectList.style.top = (l_point.y + l_dimension.h + p_top) + "px";
	l_objectList.style.left = (l_point.x + p_left) + "px";
}

function hideObject(p_object_id) {
	var l_objectList = $Y.Dom.get(p_object_id);
	l_objectList.style.display = 'none';
}

function hideOnmout(obj, e){
	
	if (!e) var e = window.event;
	var tg = (window.event) ? e.srcElement : e.target;
	if (tg.nodeName != 'DIV') return;
	var reltg = (e.relatedTarget) ? e.relatedTarget : e.toElement;
	while (reltg != null && reltg != tg && reltg.nodeName != 'BODY'){
		reltg = reltg.parentNode
	}

	if (reltg== tg) return;
	// Mouseout took place when mouse actually left layer
	// Handle event
	
	hideObject(obj.id);
}

function windowLocation(p_url, p_event) {
	if (p_event.shiftKey) {
		window.open(p_url);	
	} else {
		var f = $Y.Dom.get('windowLocationFrm');

		f.action = p_url;
		f.submit();
//		window.location.href = p_url;
	}
}


function swfFlash(pSwf, pWidth, pHeight, pNode) {
	var str = [];
        str.push('<object type="application/x-shockwave-flash" data="images/flashLoader.swf?swf=' + pSwf + '" width="' + pWidth + '" height="' + pHeight + '">');	
	str.push('<param name="movie" value="img/flashLoader.swf?swf=' + pSwf + '" />');
        str.push('<param name="wmode" value="transparent" />');
	str.push('</object>');

	if (!pNode) {
		document.write(str.join(''));
	} else {
		var sp = document.createElement('span');

		sp.innerHTML = str.join('');
		$Y.Dom.get(pNode).appendChild(sp);
	}
}


function opacity(id, opacStart, opacEnd, millisec) {

	var speed = Math.round(millisec / 100);
	var timer = 0;

	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

function changeOpac(opacity, id) {
	if ( !$Y.Dom.get(id) ) return;	
	var object = $Y.Dom.get(id).style;
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
} 	



/**
 * Funcion para mostrar los flash Intro
 * @param p_id
 * @return
 */

function showFlashIntro(p_id) 
{
	
  if (typeof(p_id) == 'undefined') return ;
  
   var _popup = new Popup ({'url':'flashIntro.do?advertiseId='+p_id, 'width' : 400, 'height' : 400,
	   						'process': function ( o ) 
	   						{
								var objflash = o;
								
								var str = [];

								//M20090478 - JABG 20100120
								str.push('<div class="ligthboxdacgContHeader2">');
								str.push('<div class="ligthboxdacgContTitle2"></div>');
								str.push('<div class="ligthboxdacgClose">');
								str.push('<a href="javascript:closePopup();" class="cerrar_plano"></a>');
								str.push('</div>');
								str.push('</div>');
								str.push('<div style="position:absolute; top:43px; width:440px; background-color:#FFFFFF;">');
								str.push('<table border="5" bordercolor="#FFFFFF" style="height:100%; width:100%; text-align:center; padding:0px; border-collapse:collapse;">');
								str.push('<tr><td align="center" style="text-align:center; vertical-align:middle; padding:0px; border-width:0px;">' +
					            		 '<object id="fiXY817" type="application/x-shockwave-flash" data="images/flashLoader.swf?swf=/dbimages/' + objflash + '" width="400" height="400">');
								str.push('<param name="movie" value="images/flashLoader.swf?swf=/dbimages/' + objflash + '"/>');
								str.push('<param name="wmode" value="transparent"/>');
					            str.push('</object></td></tr></table></div>');
					            //M20090478 - JABG 20091216
					            //M20090478 - JABG 20100120
								
								return   str.join('');
   							},
							'autoClose' : 10000	}
   						);
   
   _popup.init ();
}

function showVideoIntro(p_id,nomeHtml) 
{
  
  if (typeof(p_id) == 'undefined') return ;
  
   var _popup = new Popup ({'url':'viewMoreVideo.do?advertiseId='+p_id+'&nomeHtml='+nomeHtml, 'width' : 430, 'height' : 364,
	   						'process': function ( o ) 
	   						{
								var objflash = o;
								
								var str = [];
								str.push(objflash);
								
								return   str.join('');
   							},
							'autoClose' : 1000000	}
   						);
   
   _popup.init ();
}

function encodeJavascriptString(s) {
	 var result = '';
	 var len = s.length;
	 var i = 0;
	 for (i = 0; i < len; i++) {
		 var character = s.charAt(i);
		 /* All literals need to have backslashes doubled. */
		 if (character == '\\') {
			 result+='\\\\';
		 } else if (character == '\'') {
			 result+='\\\'';
		 } else if (character == '\"') {
			 result+='\\\"';
		 } else if (character == '&') {
			 result+='\\&';
		 } else {
			 result+=character;
		 }
	 }
	 return result;
}

function showMapResult( p_id, p_ad, titulo ) 
{
	if (typeof(p_id) == 'undefined') return ;
	if (typeof(p_ad) == 'undefined') return ;
	
	// M20100086 / cfveliz: Tracking de eventos Analytics
	pageTracker._trackEvent('Direcciones', 'Plano ver', titulo);
	
	var p1 = '&anun_id='+p_id
	var p2 = '&ende_id='+p_ad;
	
	var _popup = new Popup (
			  	{	'url'	 :'viewMoreProxyAction.do?zoomLevel=6&width=575&height=383&urlImage=2'+p1+p2, 
			  		'width'  : 575, 
			  		'height' : 426,
			  		'scrollable': true, /* Req. S20100078 / cfveliz */
					'process': function ( o ) 
					{
						var imageMap = o;
						
						var str = [];
						str.push('<div class="ligthboxdacgContHeader">');
						str.push('<div class="ligthboxdacgContTitle">Plano de ' + titulo + '</div>');
						str.push('<div class="ligthboxdacgClose">');
						str.push('<a href="javascript:printPlano(\'' + encodeJavascriptString(titulo) + '\');" class="imprime_content_texto">Imprime el plano</a>');
						str.push('<a href="javascript:closePlano(\'' + encodeJavascriptString(titulo) + '\');" class="cerrar_plano"></a>');
						str.push('</div>');
						str.push('</div>');
						str.push('<div style="position: absolute; top: 43px; width: 575px; background-color: #FFFFFF;">');
						str.push('<table style="height: 100%; width: 100%; text-align: center; padding: 0px; border-collapse: collapse;">');
						str.push('<tr><td align="center" style="text-align: center; vertical-align: middle; padding: 0px; border-width: 0px;"><img src="'+ imageMap + '" id="map"></td></tr>');
						str.push('</table>');
						str.push('</div>');
						
						return   str.join('');
					}	
				}
			);

	_popup.init ();
}

/* INICIO Req. M20100154 / cfveliz */
function showCustomMapResult( titulo, rutaImagen ) 
{
	pageTracker._trackEvent('Direcciones', 'Plano ver', titulo);
	
	var _popup = new Popup (
			  	{	'width'  : 575, 
			  		'height' : 426,
			  		'scrollable': true, /* Req. S20100078 / cfveliz */
					'process': function() 
					{
						var str = [];
						str.push('<div class="ligthboxdacgContHeader">');
						str.push('<div class="ligthboxdacgContTitle">Plano de ' + titulo + '</div>');
						str.push('<div class="ligthboxdacgClose">');
						str.push('<a href="javascript:printPlano(\'' + encodeJavascriptString(titulo) + '\');" class="imprime_content_texto">Imprime el plano</a>');
						str.push('<a href="javascript:closePlano(\'' + encodeJavascriptString(titulo) + '\');" class="cerrar_plano"></a>');
						str.push('</div>');
						str.push('</div>');
						str.push('<div style="position: absolute; top: 43px; width: 575px; background-color: #FFFFFF;">');
						str.push('<table style="height: 100%; width: 100%; text-align: center; padding: 0px; border-collapse: collapse;">');
						str.push('<tr><td align="center" style="text-align: center; vertical-align: middle; padding: 0px; border-width: 0px;"><img src="'+ rutaImagen + '" id="map"></td></tr>');
						str.push('</table>');
						str.push('</div>');
						
						return   str.join('');
					}	
				}
			);

	_popup.init ();
}
/* FIN Req. M20100154 / cfveliz */

function closePlano(titulo) {
	// M20100086 / cfveliz: Tracking de eventos Analytics
	pageTracker._trackEvent('Direcciones', 'Plano cerrar', titulo);
	
	closePopup();
}

function printPlano(titulo) {
	// M20100086 / cfveliz: Tracking de eventos Analytics
	pageTracker._trackEvent('Direcciones', 'Plano imprimir', titulo);
	
	jQuery("#popupContainer").printElement({printMode:'popup'});
}

function addFavorites( p_url, p_title )
{
	if (window.sidebar) // Mozilla Firefox 
	{ 	 
		window.sidebar.addPanel(p_title, p_url,"");
	} 
	else if( window.external ) 
	{ // IE 
		window.external.AddFavorite( p_url, p_title); }
	else if(window.opera && window.print)  // Opera Hotlist 
	{
		return true; 
	}
}

function sleep ( millis ) 
{
	var date = new Date();
	var curDate = null;
	
	do { 
		curDate = new Date(); 
	} 
	while(curDate-date < millis);
}
Require.isLoaded['functions'] = true;

Require.isLoaded['stringUtil'] = true;




