41FDAE89440BEF3D44EEB663B5F31528.js

41FDAE89440BEF3D44EEB663B5F31528.js


DisciplinaQuestionario III18 materiais95 seguidores
Pré-visualização16 páginas
// script.aculo.us builder.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
var Builder = {
 NODEMAP: {
 AREA: 'map',
 CAPTION: 'table',
 COL: 'table',
 COLGROUP: 'table',
 LEGEND: 'fieldset',
 OPTGROUP: 'select',
 OPTION: 'select',
 PARAM: 'object',
 TBODY: 'table',
 TD: 'table',
 TFOOT: 'table',
 TH: 'table',
 THEAD: 'table',
 TR: 'table'
 },
 // note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken,
 // due to a Firefox bug
 node: function(elementName) {
 elementName = elementName.toUpperCase();
 // try innerHTML approach
 var parentTag = this.NODEMAP[elementName] || 'div';
 var parentElement = document.createElement(parentTag);
 try { // prevent IE &quot;feature&quot;: http://dev.rubyonrails.org/ticket/2707
 parentElement.innerHTML = &quot;<&quot; + elementName + &quot;></&quot; + elementName + &quot;>&quot;;
 } catch(e) {}
 var element = parentElement.firstChild || null;
 // see if browser added wrapping tags
 if(element && (element.tagName.toUpperCase() != elementName))
 element = element.getElementsByTagName(elementName)[0];
 // fallback to createElement approach
 if(!element) element = document.createElement(elementName);
 // abort if nothing could be created
 if(!element) return;
 // attributes (or text)
 if(arguments[1])
 if(this._isStringOrNumber(arguments[1]) ||
 (arguments[1] instanceof Array) ||
 arguments[1].tagName) {
 this._children(element, arguments[1]);
 } else {
 var attrs = this._attributes(arguments[1]);
 if(attrs.length) {
 try { // prevent IE &quot;feature&quot;: http://dev.rubyonrails.org/ticket/2707
 parentElement.innerHTML = &quot;<&quot; +elementName + &quot; &quot; +
 attrs + &quot;></&quot; + elementName + &quot;>&quot;;
 } catch(e) {}
 element = parentElement.firstChild || null;
 // workaround firefox 1.0.X bug
 if(!element) {
 element = document.createElement(elementName);
 for(attr in arguments[1])
 element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
 }
 if(element.tagName.toUpperCase() != elementName)
 element = parentElement.getElementsByTagName(elementName)[0];
 }
 }
 // text, or array of children
 if(arguments[2])
 this._children(element, arguments[2]);
 return $(element);
 },
 _text: function(text) {
 return document.createTextNode(text);
 },
 ATTR_MAP: {
 'className': 'class',
 'htmlFor': 'for'
 },
 _attributes: function(attributes) {
 var attrs = [];
 for(attribute in attributes)
 attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
 '=&quot;' + attributes[attribute].toString().escapeHTML().gsub(/&quot;/,'&quot;') + '&quot;');
 return attrs.join(&quot; &quot;);
 },
 _children: function(element, children) {
 if(children.tagName) {
 element.appendChild(children);
 return;
 }
 if(typeof children=='object') { // array can hold nodes and text
 children.flatten().each( function(e) {
 if(typeof e=='object')
 element.appendChild(e);
 else
 if(Builder._isStringOrNumber(e))
 element.appendChild(Builder._text(e));
 });
 } else
 if(Builder._isStringOrNumber(children))
 element.innerHTML = children;
 },
 _isStringOrNumber: function(param) {
 return(typeof param=='string' || typeof param=='number');
 },
 build: function(html) {
 var element = this.node('div');
 $(element).update(html.strip());
 return element.down();
 },
 dump: function(scope) {
 if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
 var tags = (&quot;A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY &quot; +
 &quot;BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET &quot; +
 &quot;FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX &quot;+
 &quot;KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P &quot;+
 &quot;PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD &quot;+
 &quot;TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR&quot;).split(/\s+/);
 tags.each( function(tag){
 scope[tag] = function() {
 return Builder.node.apply(Builder, [tag].concat($A(arguments)));
 };
 });
 }
};// script.aculo.us effects.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
// Justin Palmer (http://encytemedia.com/)
// Mark Pilgrim (http://diveintomark.org/)
// Martin Bialasinki
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
// converts rgb() and #xxx to #xxxxxx format,
// returns self (or first argument) if not convertable
String.prototype.parseColor = function() {
 var color = '#';
 if (this.slice(0,4) == 'rgb(') {
 var cols = this.slice(4,this.length-1).split(',');
 var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
 } else {
 if (this.slice(0,1) == '#') {
 if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();
 if (this.length==7) color = this.toLowerCase();
 }
 }
 return (color.length==7 ? color : (arguments[0] || this));
};
/*--------------------------------------------------------------------------*/
Element.collectTextNodes = function(element) {
 return $A($(element).childNodes).collect( function(node) {
 return (node.nodeType==3 ? node.nodeValue :
 (node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
 }).flatten().join('');
};
Element.collectTextNodesIgnoreClass = function(element, className) {
 return $A($(element).childNodes).collect( function(node) {
 return (node.nodeType==3 ? node.nodeValue :
 ((node.hasChildNodes() && !Element.hasClassName(node,className)) ?
 Element.collectTextNodesIgnoreClass(node, className) : ''));
 }).flatten().join('');
};
Element.setContentZoom = function(element, percent) {
 element = $(element);
 element.setStyle({fontSize: (percent/100) + 'em'});
 if (Prototype.Browser.WebKit) window.scrollBy(0,0);
 return element;
};
Element.getInlineOpacity = function(element){
 return $(element).style.opacity || '';
};
Element.forceRerendering = function(element) {
 try {
 element = $(element);
 var n = document.createTextNode(' ');
 element.appendChild(n);
 element.removeChild(n);
 } catch(e) { }
};
/*--------------------------------------------------------------------------*/
var Effect = {
 _elementDoesNotExistError: {
 name: 'ElementDoesNotExistError',
 message: 'The specified DOM element does not exist, but is required for this effect to operate'
 },
 Transitions: {
 linear: Prototype.K,
 sinoidal: function(pos) {
 return (-Math.cos(pos*Math.PI)/2) + .5;
 },
 reverse: function(pos) {
 return 1-pos;
 },
 flicker: function(pos) {
 var pos = ((-Math.cos(pos*Math.PI)/4) + .75) + Math.random()/4;
 return pos > 1 ? 1 : pos;
 },
 wobble: function(pos) {
 return (-Math.cos(pos*Math.PI*(9*pos))/2) + .5;
 },
 pulse: function(pos, pulses) {
 return (-Math.cos((pos*((pulses||5)-.5)*2)*Math.PI)/2) + .5;
 },
 spring: function(pos) {
 return 1 - (Math.cos(pos * 4.5 * Math.PI)