aboutsummaryrefslogtreecommitdiffstats
path: root/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js')
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/CalendarPopup.js1486
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/ajax.js214
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/ajax_dynamic_content.js97
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/cingular_button.js217
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/drupal.js1018
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/editabledropdown.js363
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/form-field-tooltip.js715
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/gmap.js634
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/jquery.js4376
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/jquery.min.js154
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/label_quantum.js5
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/nova_button.js1184
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/other_scripts.js331
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/persist_table_header.js47
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/prototype-1.6.0.3.js4320
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/raptor.js314
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/rounded-corners.js353
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/script.js482
-rw-r--r--ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/tree/ajax.js194
19 files changed, 16504 insertions, 0 deletions
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/CalendarPopup.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/CalendarPopup.js
new file mode 100644
index 000000000..07cd7ee8b
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/CalendarPopup.js
@@ -0,0 +1,1486 @@
+// ===================================================================
+// Author: Matt Kruse <matt@mattkruse.com>
+// WWW: http://www.mattkruse.com/
+//
+// NOTICE: You may use this code for any purpose, commercial or
+// private, without any further permission from the author. You may
+// remove this notice from your final code if you wish, however it is
+// appreciated by the author if at least my web site address is kept.
+//
+// You may *NOT* re-distribute this code in any way except through its
+// use. That means, you can include it in your product, or your web
+// site, or any other form where the code is actually being used. You
+// may not put the plain javascript up on your site for download or
+// include it in your javascript libraries for download.
+// If you wish to share this code with others, please just point them
+// to the URL instead.
+// Please DO NOT link directly to my .js files from your site. Copy
+// the files to your server and use them there. Thank you.
+// ===================================================================
+
+
+/* SOURCE FILE: date.js */
+
+// HISTORY
+// ------------------------------------------------------------------
+// May 17, 2003: Fixed bug in parseDate() for dates <1970
+// March 11, 2003: Added parseDate() function
+// March 11, 2003: Added "NNN" formatting option. Doesn't match up
+// perfectly with SimpleDateFormat formats, but
+// backwards-compatability was required.
+
+// ------------------------------------------------------------------
+// These functions use the same 'format' strings as the
+// java.text.SimpleDateFormat class, with minor exceptions.
+// The format string consists of the following abbreviations:
+//
+// Field | Full Form | Short Form
+// -------------+--------------------+-----------------------
+// Year | yyyy (4 digits) | yy (2 digits), y (2 or 4 digits)
+// Month | MMM (name or abbr.)| MM (2 digits), M (1 or 2 digits)
+// | NNN (abbr.) |
+// Day of Month | dd (2 digits) | d (1 or 2 digits)
+// Day of Week | EE (name) | E (abbr)
+// Hour (1-12) | hh (2 digits) | h (1 or 2 digits)
+// Hour (0-23) | HH (2 digits) | H (1 or 2 digits)
+// Hour (0-11) | KK (2 digits) | K (1 or 2 digits)
+// Hour (1-24) | kk (2 digits) | k (1 or 2 digits)
+// Minute | mm (2 digits) | m (1 or 2 digits)
+// Second | ss (2 digits) | s (1 or 2 digits)
+// AM/PM | a |
+//
+// NOTE THE DIFFERENCE BETWEEN MM and mm! Month=MM, not mm!
+// Examples:
+// "MMM d, y" matches: January 01, 2000
+// Dec 1, 1900
+// Nov 20, 00
+// "M/d/yy" matches: 01/20/00
+// 9/2/00
+// "MMM dd, yyyy hh:mm:ssa" matches: "January 01, 2000 12:30:45AM"
+// ------------------------------------------------------------------
+
+var MONTH_NAMES=new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
+var DAY_NAMES=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat');
+function LZ(x) {return(x<0||x>9?"":"0")+x}
+
+// ------------------------------------------------------------------
+// isDate ( date_string, format_string )
+// Returns true if date string matches format of format string and
+// is a valid date. Else returns false.
+// It is recommended that you trim whitespace around the value before
+// passing it to this function, as whitespace is NOT ignored!
+// ------------------------------------------------------------------
+function isDate(val,format) {
+ var date=getDateFromFormat(val,format);
+ if (date==0) { return false; }
+ return true;
+ }
+
+// -------------------------------------------------------------------
+// compareDates(date1,date1format,date2,date2format)
+// Compare two date strings to see which is greater.
+// Returns:
+// 1 if date1 is greater than date2
+// 0 if date2 is greater than date1 of if they are the same
+// -1 if either of the dates is in an invalid format
+// -------------------------------------------------------------------
+function compareDates(date1,dateformat1,date2,dateformat2) {
+ var d1=getDateFromFormat(date1,dateformat1);
+ var d2=getDateFromFormat(date2,dateformat2);
+ if (d1==0 || d2==0) {
+ return -1;
+ }
+ else if (d1 > d2) {
+ return 1;
+ }
+ return 0;
+ }
+
+// ------------------------------------------------------------------
+// formatDate (date_object, format)
+// Returns a date in the output format specified.
+// The format string uses the same abbreviations as in getDateFromFormat()
+// ------------------------------------------------------------------
+function formatDate(date,format) {
+ format=format+"";
+ var result="";
+ var i_format=0;
+ var c="";
+ var token="";
+ var y=date.getYear()+"";
+ var M=date.getMonth()+1;
+ var d=date.getDate();
+ var E=date.getDay();
+ var H=date.getHours();
+ var m=date.getMinutes();
+ var s=date.getSeconds();
+ var yyyy,yy,MMM,MM,dd,hh,h,mm,ss,ampm,HH,H,KK,K,kk,k;
+ // Convert real date parts into formatted versions
+ var value=new Object();
+ if (y.length < 4) {y=""+(y-0+1900);}
+ value["y"]=""+y;
+ value["yyyy"]=y;
+ value["yy"]=y.substring(2,4);
+ value["M"]=M;
+ value["MM"]=LZ(M);
+ value["MMM"]=MONTH_NAMES[M-1];
+ value["NNN"]=MONTH_NAMES[M+11];
+ value["d"]=d;
+ value["dd"]=LZ(d);
+ value["E"]=DAY_NAMES[E+7];
+ value["EE"]=DAY_NAMES[E];
+ value["H"]=H;
+ value["HH"]=LZ(H);
+ if (H==0){value["h"]=12;}
+ else if (H>12){value["h"]=H-12;}
+ else {value["h"]=H;}
+ value["hh"]=LZ(value["h"]);
+ if (H>11){value["K"]=H-12;} else {value["K"]=H;}
+ value["k"]=H+1;
+ value["KK"]=LZ(value["K"]);
+ value["kk"]=LZ(value["k"]);
+ if (H > 11) { value["a"]="PM"; }
+ else { value["a"]="AM"; }
+ value["m"]=m;
+ value["mm"]=LZ(m);
+ value["s"]=s;
+ value["ss"]=LZ(s);
+ while (i_format < format.length) {
+ c=format.charAt(i_format);
+ token="";
+ while ((format.charAt(i_format)==c) && (i_format < format.length)) {
+ token += format.charAt(i_format++);
+ }
+ if (value[token] != null) { result=result + value[token]; }
+ else { result=result + token; }
+ }
+ return result;
+ }
+
+// ------------------------------------------------------------------
+// Utility functions for parsing in getDateFromFormat()
+// ------------------------------------------------------------------
+function _isInteger(val) {
+ var digits="1234567890";
+ for (var i=0; i < val.length; i++) {
+ if (digits.indexOf(val.charAt(i))==-1) { return false; }
+ }
+ return true;
+ }
+function _getInt(str,i,minlength,maxlength) {
+ for (var x=maxlength; x>=minlength; x--) {
+ var token=str.substring(i,i+x);
+ if (token.length < minlength) { return null; }
+ if (_isInteger(token)) { return token; }
+ }
+ return null;
+ }
+
+// ------------------------------------------------------------------
+// getDateFromFormat( date_string , format_string )
+//
+// This function takes a date string and a format string. It matches
+// If the date string matches the format string, it returns the
+// getTime() of the date. If it does not match, it returns 0.
+// ------------------------------------------------------------------
+function getDateFromFormat(val,format) {
+ val=val+"";
+ format=format+"";
+ var i_val=0;
+ var i_format=0;
+ var c="";
+ var token="";
+ var token2="";
+ var x,y;
+ var now=new Date();
+
+ var year=now.getYear();
+ var month=now.getMonth()+1;
+ var date=1;
+ var hh=now.getHours();
+ var mm=now.getMinutes();
+ var ss=now.getSeconds();
+ var ampm="";
+
+ while (i_format < format.length) {
+ // Get next token from format string
+ c=format.charAt(i_format);
+ token="";
+ while ((format.charAt(i_format)==c) && (i_format < format.length)) {
+ token += format.charAt(i_format++);
+ }
+ // Extract contents of value based on format token
+ if (token=="yyyy" || token=="yy" || token=="y") {
+ if (token=="yyyy") { x=4;y=4; }
+ if (token=="yy") { x=2;y=2; }
+ if (token=="y") { x=2;y=4; }
+ year=_getInt(val,i_val,x,y);
+ if (year==null) { return 0; }
+ i_val += year.length;
+ if (year.length==2) {
+ if (year > 70) { year=1900+(year-0); }
+ else { year=2000+(year-0); }
+ }
+ }
+ else if (token=="MMM"||token=="NNN"){
+ month=0;
+ for (var i=0; i<MONTH_NAMES.length; i++) {
+ var month_name=MONTH_NAMES[i];
+ if (val.substring(i_val,i_val+month_name.length).toLowerCase()==month_name.toLowerCase()) {
+ if (token=="MMM"||(token=="NNN"&&i>11)) {
+ month=i+1;
+ if (month>12) { month -= 12; }
+ i_val += month_name.length;
+ break;
+ }
+ }
+ }
+ if ((month < 1)||(month>12)){return 0;}
+ }
+ else if (token=="EE"||token=="E"){
+ for (var i=0; i<DAY_NAMES.length; i++) {
+ var day_name=DAY_NAMES[i];
+ if (val.substring(i_val,i_val+day_name.length).toLowerCase()==day_name.toLowerCase()) {
+ i_val += day_name.length;
+ break;
+ }
+ }
+ }
+ else if (token=="MM"||token=="M") {
+ month=_getInt(val,i_val,token.length,2);
+ if(month==null||(month<1)||(month>12)){return 0;}
+ i_val+=month.length;}
+ else if (token=="dd"||token=="d") {
+ date=_getInt(val,i_val,token.length,2);
+ if(date==null||(date<1)||(date>31)){return 0;}
+ i_val+=date.length;}
+ else if (token=="hh"||token=="h") {
+ hh=_getInt(val,i_val,token.length,2);
+ if(hh==null||(hh<1)||(hh>12)){return 0;}
+ i_val+=hh.length;}
+ else if (token=="HH"||token=="H") {
+ hh=_getInt(val,i_val,token.length,2);
+ if(hh==null||(hh<0)||(hh>23)){return 0;}
+ i_val+=hh.length;}
+ else if (token=="KK"||token=="K") {
+ hh=_getInt(val,i_val,token.length,2);
+ if(hh==null||(hh<0)||(hh>11)){return 0;}
+ i_val+=hh.length;}
+ else if (token=="kk"||token=="k") {
+ hh=_getInt(val,i_val,token.length,2);
+ if(hh==null||(hh<1)||(hh>24)){return 0;}
+ i_val+=hh.length;hh--;}
+ else if (token=="mm"||token=="m") {
+ mm=_getInt(val,i_val,token.length,2);
+ if(mm==null||(mm<0)||(mm>59)){return 0;}
+ i_val+=mm.length;}
+ else if (token=="ss"||token=="s") {
+ ss=_getInt(val,i_val,token.length,2);
+ if(ss==null||(ss<0)||(ss>59)){return 0;}
+ i_val+=ss.length;}
+ else if (token=="a") {
+ if (val.substring(i_val,i_val+2).toLowerCase()=="am") {ampm="AM";}
+ else if (val.substring(i_val,i_val+2).toLowerCase()=="pm") {ampm="PM";}
+ else {return 0;}
+ i_val+=2;}
+ else {
+ if (val.substring(i_val,i_val+token.length)!=token) {return 0;}
+ else {i_val+=token.length;}
+ }
+ }
+ // If there are any trailing characters left in the value, it doesn't match
+ if (i_val != val.length) { return 0; }
+ // Is date valid for month?
+ if (month==2) {
+ // Check for leap year
+ if ( ( (year%4==0)&&(year%100 != 0) ) || (year%400==0) ) { // leap year
+ if (date > 29){ return 0; }
+ }
+ else { if (date > 28) { return 0; } }
+ }
+ if ((month==4)||(month==6)||(month==9)||(month==11)) {
+ if (date > 30) { return 0; }
+ }
+ // Correct hours value
+ if (hh<12 && ampm=="PM") { hh=hh-0+12; }
+ else if (hh>11 && ampm=="AM") { hh-=12; }
+ var newdate=new Date(year,month-1,date,hh,mm,ss);
+ return newdate.getTime();
+ }
+
+// ------------------------------------------------------------------
+// parseDate( date_string [, prefer_euro_format] )
+//
+// This function takes a date string and tries to match it to a
+// number of possible date formats to get the value. It will try to
+// match against the following international formats, in this order:
+// y-M-d MMM d, y MMM d,y y-MMM-d d-MMM-y MMM d
+// M/d/y M-d-y M.d.y MMM-d M/d M-d
+// d/M/y d-M-y d.M.y d-MMM d/M d-M
+// A second argument may be passed to instruct the method to search
+// for formats like d/M/y (european format) before M/d/y (American).
+// Returns a Date object or null if no patterns match.
+// ------------------------------------------------------------------
+function parseDate(val) {
+ var preferEuro=(arguments.length==2)?arguments[1]:false;
+ generalFormats=new Array('y-M-d','MMM d, y','MMM d,y','y-MMM-d','d-MMM-y','MMM d');
+ monthFirst=new Array('M/d/y','M-d-y','M.d.y','MMM-d','M/d','M-d');
+ dateFirst =new Array('d/M/y','d-M-y','d.M.y','d-MMM','d/M','d-M');
+ var checkList=new Array('generalFormats',preferEuro?'dateFirst':'monthFirst',preferEuro?'monthFirst':'dateFirst');
+ var d=null;
+ for (var i=0; i<checkList.length; i++) {
+ var l=window[checkList[i]];
+ for (var j=0; j<l.length; j++) {
+ d=getDateFromFormat(val,l[j]);
+ if (d!=0) { return new Date(d); }
+ }
+ }
+ return null;
+ }
+
+/* SOURCE FILE: PopupWindow.js */
+
+/*
+PopupWindow.js
+Author: Matt Kruse
+Last modified: 02/16/04
+
+DESCRIPTION: This object allows you to easily and quickly popup a window
+in a certain place. The window can either be a DIV or a separate browser
+window.
+
+COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
+positioning errors - usually with Window positioning - occur on the
+Macintosh platform. Due to bugs in Netscape 4.x, populating the popup
+window with <STYLE> tags may cause errors.
+
+USAGE:
+// Create an object for a WINDOW popup
+var win = new PopupWindow();
+
+// Create an object for a DIV window using the DIV named 'mydiv'
+var win = new PopupWindow('mydiv');
+
+// Set the window to automatically hide itself when the user clicks
+// anywhere else on the page except the popup
+win.autoHide();
+
+// Show the window relative to the anchor name passed in
+win.showPopup(anchorname);
+
+// Hide the popup
+win.hidePopup();
+
+// Set the size of the popup window (only applies to WINDOW popups
+win.setSize(width,height);
+
+// Populate the contents of the popup window that will be shown. If you
+// change the contents while it is displayed, you will need to refresh()
+win.populate(string);
+
+// set the URL of the window, rather than populating its contents
+// manually
+win.setUrl("http://www.site.com/");
+
+// Refresh the contents of the popup
+win.refresh();
+
+// Specify how many pixels to the right of the anchor the popup will appear
+win.offsetX = 50;
+
+// Specify how many pixels below the anchor the popup will appear
+win.offsetY = 100;
+
+NOTES:
+1) Requires the functions in AnchorPosition.js
+
+2) Your anchor tag MUST contain both NAME and ID attributes which are the
+ same. For example:
+ <A NAME="test" ID="test"> </A>
+
+3) There must be at least a space between <A> </A> for IE5.5 to see the
+ anchor tag correctly. Do not do <A></A> with no space.
+
+4) When a PopupWindow object is created, a handler for 'onmouseup' is
+ attached to any event handler you may have already defined. Do NOT define
+ an event handler for 'onmouseup' after you define a PopupWindow object or
+ the autoHide() will not work correctly.
+*/
+function getPos(e)
+{
+ var posx = 0;
+ var posy = 0;
+ var coordinates = new Object();
+ if (!e) var e = window.event;
+ if (e.pageX || e.pageY)
+ {
+ posx = e.pageX;
+ posy = e.pageY;
+ }
+ else if (e.clientX || e.clientY)
+ {
+
+ posx = e.clientX + document.body.scrollLeft
+ + document.documentElement.scrollLeft;
+ posy = e.clientY + document.body.scrollTop
+ + document.documentElement.scrollTop;
+ }
+
+ //alert("posx: " + posx + " posy: " + posy);
+ coordinates.x = posx;
+ coordinates.y = posy;
+ return coordinates;
+}
+// Set the position of the popup window based on the anchor
+function PopupWindow_getXYPosition(anchorname) {
+ var coordintes
+ if (this.type == "WINDOW") {
+ coordinates = getAnchorWindowPosition(anchorname);
+ coordinates = getPos(anchorname); // Replaced using getPost(event)
+ }
+ else {
+ //alert("envent: " + anchorname);
+ //coordinates = getAnchorPosition(anchorname);
+ coordinates = getPos(anchorname); // Replaced using getPost(event)
+ }
+
+ this.x = coordinates.x;
+ this.y = coordinates.y;
+ //alert("PopupWindow_getXYPosition x: " + this.x + " y: " + this.y);
+ }
+// Set width/height of DIV/popup window
+function PopupWindow_setSize(width,height) {
+ this.width = width;
+ this.height = height;
+ }
+// Fill the window with contents
+function PopupWindow_populate(contents) {
+ this.contents = contents;
+ this.populated = false;
+ }
+// Set the URL to go to
+function PopupWindow_setUrl(url) {
+ this.url = url;
+ }
+// Set the window popup properties
+function PopupWindow_setWindowProperties(props) {
+ this.windowProperties = props;
+ }
+// Refresh the displayed contents of the popup
+function PopupWindow_refresh() {
+ if (this.divName != null) {
+ // refresh the DIV object
+ if (this.use_gebi) {
+ document.getElementById(this.divName).innerHTML = this.contents;
+ }
+ else if (this.use_css) {
+ document.all[this.divName].innerHTML = this.contents;
+ }
+ else if (this.use_layers) {
+ var d = document.layers[this.divName];
+ d.document.open();
+ d.document.writeln(this.contents);
+ d.document.close();
+ }
+ }
+ else {
+ if (this.popupWindow != null && !this.popupWindow.closed) {
+ if (this.url!="") {
+ this.popupWindow.location.href=this.url;
+ }
+ else {
+ this.popupWindow.document.open();
+ this.popupWindow.document.writeln(this.contents);
+ this.popupWindow.document.close();
+ }
+ this.popupWindow.focus();
+ }
+ }
+ }
+
+var offsetLeft = 0;
+var offsetTop = 0;
+function parenName(ref)
+ {
+ ok=0; // it's just to start the loop, we don't use it to get out.
+ while (!ok)
+ {
+ ref = ref.parentNode;
+ if (ref.nodeType==1) //check that the node is a tag, not text (type=3)
+ {
+ if (String(ref.nodeName)=="DIV")
+ {
+ offsetLeft = ref.offsetLeft;
+ offsetTop = ref.offsetTop;
+
+ return ;
+ }
+ if (String(ref.nodeName)=="BODY")
+ {
+ return ;
+ }
+ }
+ }
+ }
+
+// Position and show the popup, relative to an anchor object
+function PopupWindow_showPopup(anchorname) {
+ this.getXYPosition(anchorname);
+ this.x += this.offsetX - 125;
+ this.y += this.offsetY;
+ if (!this.populated && (this.contents != "")) {
+ this.populated = true;
+ this.refresh();
+ }
+ if (this.divName != null) {
+ // Show the DIV object
+ var oDiv = document.getElementById(this.divName);
+ parenName(oDiv);
+ if (this.use_gebi) {
+ document.getElementById(this.divName).style.left = this.x - offsetLeft + "px";
+ document.getElementById(this.divName).style.top = this.y - offsetTop + "px";
+ document.getElementById(this.divName).style.visibility = "visible";
+ }
+ else if (this.use_css) {
+ document.all[this.divName].style.left = this.x;
+ document.all[this.divName].style.top = this.y;
+ document.all[this.divName].style.visibility = "visible";
+ }
+ else if (this.use_layers) {
+ document.layers[this.divName].left = this.x;
+ document.layers[this.divName].top = this.y;
+ document.layers[this.divName].visibility = "visible";
+ }
+ }
+ else {
+ if (this.popupWindow == null || this.popupWindow.closed) {
+ // If the popup window will go off-screen, move it so it doesn't
+ if (this.x<0) { this.x=0; }
+ if (this.y<0) { this.y=0; }
+ if (screen && screen.availHeight) {
+ if ((this.y + this.height) > screen.availHeight) {
+ this.y = screen.availHeight - this.height;
+ }
+ }
+ if (screen && screen.availWidth) {
+ if ((this.x + this.width) > screen.availWidth) {
+ this.x = screen.availWidth - this.width;
+ }
+ }
+ var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled );
+ this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+"");
+ }
+ this.refresh();
+ }
+
+ //added for IE6 issue
+ ///////////////////////
+ showFrame(this.divName, this.frameName);
+ /*var oIfr = document.getElementById(this.frameName);
+ var oCal = document.getElementById(this.divName);
+ oIfr.style.display='block';
+ oIfr.style.top=oCal.style.top;
+ oIfr.style.left=oCal.style.left;*/
+
+
+ }
+// Hide the popup
+function PopupWindow_hidePopup() {
+ if (this.divName != null) {
+ if (this.use_gebi) {
+
+ document.getElementById(this.divName).style.visibility = "hidden";
+ }
+ else if (this.use_css) {
+ document.all[this.divName].style.visibility = "hidden";
+ }
+ else if (this.use_layers) {
+ document.layers[this.divName].visibility = "hidden";
+ }
+ }
+ else {
+ if (this.popupWindow && !this.popupWindow.closed) {
+ this.popupWindow.close();
+ this.popupWindow = null;
+ }
+ }
+
+
+ //added for IE6 issue
+ //////////////
+ hideFrame(this.divName, this.frameName);
+ /*var oIfr = document.getElementById(this.frameName);
+ oIfr.style.display='none'; */
+ }
+// Pass an event and return whether or not it was the popup DIV that was clicked
+function PopupWindow_isClicked(e) {
+ if (this.divName != null) {
+ if (this.use_layers) {
+ var clickX = e.pageX;
+ var clickY = e.pageY;
+ var t = document.layers[this.divName];
+ if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) {
+ window.calendarAction='Y';
+ return true;
+ }
+ else { return false; }
+ }
+ else if (document.all) { // Need to hard-code this to trap IE for error-handling
+ var t = window.event.srcElement;
+ while (t.parentElement != null) {
+ if (t.id==this.divName) {
+ window.calendarAction='Y';
+ return true;
+ }
+ t = t.parentElement;
+ }
+ return false;
+ }
+ else if (this.use_gebi && e) {
+ var t = e.originalTarget;
+ //console.log(t);
+ while (t && t.parentNode != null) {
+ if (t.id==this.divName) {
+ window.calendarAction='Y';
+ return true;
+ }
+ t = t.parentNode;
+ }
+ return false;
+ }
+ return false;
+ }
+ return false;
+ }
+
+// Check an onMouseDown event to see if we should hide
+function PopupWindow_hideIfNotClicked(e) {
+ if (this.autoHideEnabled && !this.isClicked(e)) {
+
+ this.hidePopup();
+ }
+ }
+// Call this to make the DIV disable automatically when mouse is clicked outside it
+function PopupWindow_autoHide() {
+ this.autoHideEnabled = true;
+ }
+// This global function checks all PopupWindow objects onmouseup to see if they should be hidden
+function PopupWindow_hidePopupWindows(e) {
+ for (var i=0; i<popupWindowObjects.length; i++) {
+ if (popupWindowObjects[i] != null) {
+ var p = popupWindowObjects[i];
+ p.hideIfNotClicked(e);
+ }
+ }
+ }
+// Run this immediately to attach the event listener
+function PopupWindow_attachListener() {
+ if (document.layers) {
+ document.captureEvents(Event.MOUSEUP);
+ }
+ window.popupWindowOldEventListener = document.onmouseup;
+ if (window.popupWindowOldEventListener != null) {
+ document.onmouseup = new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();");
+ }
+ else {
+ document.onmouseup = PopupWindow_hidePopupWindows;
+ }
+ }
+
+// Reset the calendar DIV realted to another DIV
+function PopupWindow_resetPosition(relatedDiv) {
+ //var calendarDiv = document.getElementById("calendarDiv");
+ var calendarDiv = document.getElementById(this.divName);
+ var popupDiv = document.getElementById(relatedDiv);
+ var left = calendarDiv.offsetLeft - popupDiv.offsetLeft;
+ var top = calendarDiv.offsetTop - popupDiv.offsetTop;
+ //alert("left: " + left + " top: " + top);
+
+ calendarDiv.style.left = left + "px";
+ calendarDiv.style.top = top + "px";
+
+ var calendarDivFrame = document.getElementById(this.divName + "frame");
+ var popupDivFrame = document.getElementById(relatedDiv + "frame");
+ var leftFrame = calendarDivFrame.offsetLeft - popupDivFrame.offsetLeft;
+ var topFrame = calendarDivFrame.offsetTop - popupDivFrame.offsetTop;
+ //alert("left: " + left + " top: " + top);
+
+ calendarDivFrame.style.left = leftFrame + "px";
+ calendarDivFrame.style.top = leftFrame + "px";
+}
+
+// CONSTRUCTOR for the PopupWindow object
+// Pass it a DIV name to use a DHTML popup, otherwise will default to window popup
+function PopupWindow() {
+ if (!window.popupWindowIndex) { window.popupWindowIndex = 0; }
+ if (!window.popupWindowObjects) { window.popupWindowObjects = new Array(); }
+ if (!window.listenerAttached) {
+ window.listenerAttached = true;
+ PopupWindow_attachListener();
+ }
+
+ this.index = popupWindowIndex++;
+ popupWindowObjects[this.index] = this;
+ this.divName = null;
+ //added for IE6 issue
+ this.frameName = null
+ this.popupWindow = null;
+ this.width=0;
+ this.height=0;
+ this.populated = false;
+ this.visible = false;
+ this.autoHideEnabled = false;
+
+ this.contents = "";
+ this.url="";
+ this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no";
+ if (arguments.length>0) {
+ this.type="DIV";
+ this.divName = arguments[0];
+ //added for IE6 issue
+
+ if (arguments.length>1)
+ this.frameName = arguments[1];
+ }
+ else {
+ this.type="WINDOW";
+ }
+ this.use_gebi = false;
+ this.use_css = false;
+ this.use_layers = false;
+ if (document.getElementById) { this.use_gebi = true; }
+ else if (document.all) { this.use_css = true; }
+ else if (document.layers) { this.use_layers = true; }
+ else { this.type = "WINDOW"; }
+ this.offsetX = 0;
+ this.offsetY = 0;
+ // Method mappings
+ this.getXYPosition = PopupWindow_getXYPosition;
+ this.populate = PopupWindow_populate;
+ this.setUrl = PopupWindow_setUrl;
+ this.setWindowProperties = PopupWindow_setWindowProperties;
+ this.refresh = PopupWindow_refresh;
+ this.showPopup = PopupWindow_showPopup;
+ this.hidePopup = PopupWindow_hidePopup;
+ this.setSize = PopupWindow_setSize;
+ this.isClicked = PopupWindow_isClicked;
+ this.autoHide = PopupWindow_autoHide;
+ this.hideIfNotClicked = PopupWindow_hideIfNotClicked;
+
+ // Added to reset the Calendar DIV when it related with another DIV
+ this.resetPosition = PopupWindow_resetPosition;
+ }
+
+/* SOURCE FILE: CalendarPopup.js */
+
+// HISTORY
+// ------------------------------------------------------------------
+// Feb 7, 2005: Fixed a CSS styles to use px unit
+// March 29, 2004: Added check in select() method for the form field
+// being disabled. If it is, just return and don't do anything.
+// March 24, 2004: Fixed bug - when month name and abbreviations were
+// changed, date format still used original values.
+// January 26, 2004: Added support for drop-down month and year
+// navigation (Thanks to Chris Reid for the idea)
+// September 22, 2003: Fixed a minor problem in YEAR calendar with
+// CSS prefix.
+// August 19, 2003: Renamed the function to get styles, and made it
+// work correctly without an object reference
+// August 18, 2003: Changed showYearNavigation and
+// showYearNavigationInput to optionally take an argument of
+// true or false
+// July 31, 2003: Added text input option for year navigation.
+// Added a per-calendar CSS prefix option to optionally use
+// different styles for different calendars.
+// July 29, 2003: Fixed bug causing the Today link to be clickable
+// even though today falls in a disabled date range.
+// Changed formatting to use pure CSS, allowing greater control
+// over look-and-feel options.
+// June 11, 2003: Fixed bug causing the Today link to be unselectable
+// under certain cases when some days of week are disabled
+// March 14, 2003: Added ability to disable individual dates or date
+// ranges, display as light gray and strike-through
+// March 14, 2003: Removed dependency on graypixel.gif and instead
+/// use table border coloring
+// March 12, 2003: Modified showCalendar() function to allow optional
+// start-date parameter
+// March 11, 2003: Modified select() function to allow optional
+// start-date parameter
+/*
+DESCRIPTION: This object implements a popup calendar to allow the user to
+select a date, month, quarter, or year.
+
+COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small
+positioning errors - usually with Window positioning - occur on the
+Macintosh platform.
+The calendar can be modified to work for any location in the world by
+changing which weekday is displayed as the first column, changing the month
+names, and changing the column headers for each day.
+
+USAGE:
+// Create a new CalendarPopup object of type WINDOW
+var cal = new CalendarPopup();
+
+// Create a new CalendarPopup object of type DIV using the DIV named 'mydiv'
+var cal = new CalendarPopup('mydiv');
+
+// Easy method to link the popup calendar with an input box.
+cal.select(inputObject, anchorname, dateFormat);
+// Same method, but passing a default date other than the field's current value
+cal.select(inputObject, anchorname, dateFormat, '01/02/2000');
+// This is an example call to the popup calendar from a link to populate an
+// input box. Note that to use this, date.js must also be included!!
+<A HREF="#" onClick="cal.select(document.forms[0].date,'anchorname','MM/dd/yyyy'); return false;">Select</A>
+
+// Set the type of date select to be used. By default it is 'date'.
+cal.setDisplayType(type);
+
+// When a date, month, quarter, or year is clicked, a function is called and
+// passed the details. You must write this function, and tell the calendar
+// popup what the function name is.
+// Function to be called for 'date' select receives y, m, d
+cal.setReturnFunction(functionname);
+// Function to be called for 'month' select receives y, m
+cal.setReturnMonthFunction(functionname);
+// Function to be called for 'quarter' select receives y, q
+cal.setReturnQuarterFunction(functionname);
+// Function to be called for 'year' select receives y
+cal.setReturnYearFunction(functionname);
+
+// Show the calendar relative to a given anchor
+cal.showCalendar(anchorname);
+
+// Hide the calendar. The calendar is set to autoHide automatically
+cal.hideCalendar();
+
+// Set the month names to be used. Default are English month names
+cal.setMonthNames("January","February","March",...);
+
+// Set the month abbreviations to be used. Default are English month abbreviations
+cal.setMonthAbbreviations("Jan","Feb","Mar",...);
+
+// Show navigation for changing by the year, not just one month at a time
+cal.showYearNavigation();
+
+// Show month and year dropdowns, for quicker selection of month of dates
+cal.showNavigationDropdowns();
+
+// Set the text to be used above each day column. The days start with
+// sunday regardless of the value of WeekStartDay
+cal.setDayHeaders("S","M","T",...);
+
+// Set the day for the first column in the calendar grid. By default this
+// is Sunday (0) but it may be changed to fit the conventions of other
+// countries.
+cal.setWeekStartDay(1); // week is Monday - Sunday
+
+// Set the weekdays which should be disabled in the 'date' select popup. You can
+// then allow someone to only select week end dates, or Tuedays, for example
+cal.setDisabledWeekDays(0,1); // To disable selecting the 1st or 2nd days of the week
+
+// Selectively disable individual days or date ranges. Disabled days will not
+// be clickable, and show as strike-through text on current browsers.
+// Date format is any format recognized by parseDate() in date.js
+// Pass a single date to disable:
+cal.addDisabledDates("2003-01-01");
+// Pass null as the first parameter to mean "anything up to and including" the
+// passed date:
+cal.addDisabledDates(null, "01/02/03");
+// Pass null as the second parameter to mean "including the passed date and
+// anything after it:
+cal.addDisabledDates("Jan 01, 2003", null);
+// Pass two dates to disable all dates inbetween and including the two
+cal.addDisabledDates("January 01, 2003", "Dec 31, 2003");
+
+// When the 'year' select is displayed, set the number of years back from the
+// current year to start listing years. Default is 2.
+// This is also used for year drop-down, to decide how many years +/- to display
+cal.setYearSelectStartOffset(2);
+
+// Text for the word "Today" appearing on the calendar
+cal.setTodayText("Today");
+
+// The calendar uses CSS classes for formatting. If you want your calendar to
+// have unique styles, you can set the prefix that will be added to all the
+// classes in the output.
+// For example, normal output may have this:
+// <SPAN CLASS="cpTodayTextDisabled">Today<SPAN>
+// But if you set the prefix like this:
+cal.setCssPrefix("Test");
+// The output will then look like:
+// <SPAN CLASS="TestcpTodayTextDisabled">Today<SPAN>
+// And you can define that style somewhere in your page.
+
+// When using Year navigation, you can make the year be an input box, so
+// the user can manually change it and jump to any year
+cal.showYearNavigationInput();
+
+// Set the calendar offset to be different than the default. By default it
+// will appear just below and to the right of the anchorname. So if you have
+// a text box where the date will go and and anchor immediately after the
+// text box, the calendar will display immediately under the text box.
+cal.offsetX = 20;
+cal.offsetY = 20;
+
+NOTES:
+1) Requires the functions in AnchorPosition.js and PopupWindow.js
+
+2) Your anchor tag MUST contain both NAME and ID attributes which are the
+ same. For example:
+ <A NAME="test" ID="test"> </A>
+
+3) There must be at least a space between <A> </A> for IE5.5 to see the
+ anchor tag correctly. Do not do <A></A> with no space.
+
+4) When a CalendarPopup object is created, a handler for 'onmouseup' is
+ attached to any event handler you may have already defined. Do NOT define
+ an event handler for 'onmouseup' after you define a CalendarPopup object
+ or the autoHide() will not work correctly.
+
+5) The calendar popup display uses style sheets to make it look nice.
+
+*/
+
+// CONSTRUCTOR for the CalendarPopup Object
+function CalendarPopup() {
+ var c;
+ //added for IE6 issue
+ if (arguments.length>1) {
+ c = new PopupWindow(arguments[0], arguments[1]);
+ }
+ else if (arguments.length>0) {
+ c = new PopupWindow(arguments[0]);
+ }
+ else {
+ c = new PopupWindow();
+ c.setSize(150,175);
+ }
+ c.offsetX = 20;
+ c.offsetY = 0;
+ c.autoHide();
+ // Calendar-specific properties
+ c.monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
+ c.monthAbbreviations = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
+ c.dayHeaders = new Array("S","M","T","W","T","F","S");
+ c.returnFunction = "CP_tmpReturnFunction";
+ c.returnMonthFunction = "CP_tmpReturnMonthFunction";
+ c.returnQuarterFunction = "CP_tmpReturnQuarterFunction";
+ c.returnYearFunction = "CP_tmpReturnYearFunction";
+ c.weekStartDay = 0;
+ c.isShowYearNavigation = false;
+ c.displayType = "date";
+ c.disabledWeekDays = new Object();
+ c.disabledDatesExpression = "";
+ c.yearSelectStartOffset = 2;
+ c.currentDate = null;
+ c.todayText="Today";
+ c.cssPrefix="";
+ c.isShowNavigationDropdowns=false;
+ c.isShowYearNavigationInput=false;
+ window.CP_calendarObject = null;
+ window.CP_targetInput = null;
+ window.CP_dateFormat = "MM/dd/yyyy";
+ // Method mappings
+ c.copyMonthNamesToWindow = CP_copyMonthNamesToWindow;
+ c.setReturnFunction = CP_setReturnFunction;
+ c.setReturnMonthFunction = CP_setReturnMonthFunction;
+ c.setReturnQuarterFunction = CP_setReturnQuarterFunction;
+ c.setReturnYearFunction = CP_setReturnYearFunction;
+ c.setMonthNames = CP_setMonthNames;
+ c.setMonthAbbreviations = CP_setMonthAbbreviations;
+ c.setDayHeaders = CP_setDayHeaders;
+ c.setWeekStartDay = CP_setWeekStartDay;
+ c.setDisplayType = CP_setDisplayType;
+ c.setDisabledWeekDays = CP_setDisabledWeekDays;
+ c.addDisabledDates = CP_addDisabledDates;
+ c.setYearSelectStartOffset = CP_setYearSelectStartOffset;
+ c.setTodayText = CP_setTodayText;
+ c.showYearNavigation = CP_showYearNavigation;
+ c.showCalendar = CP_showCalendar;
+ c.hideCalendar = CP_hideCalendar;
+ c.getStyles = getCalendarStyles;
+ c.refreshCalendar = CP_refreshCalendar;
+ c.getCalendar = CP_getCalendar;
+ c.select = CP_select;
+ c.setCssPrefix = CP_setCssPrefix;
+ c.showNavigationDropdowns = CP_showNavigationDropdowns;
+ c.showYearNavigationInput = CP_showYearNavigationInput;
+ c.copyMonthNamesToWindow();
+ // Return the object
+ return c;
+ }
+function CP_copyMonthNamesToWindow() {
+ // Copy these values over to the date.js
+ if (typeof(window.MONTH_NAMES)!="undefined" && window.MONTH_NAMES!=null) {
+ window.MONTH_NAMES = new Array();
+ for (var i=0; i<this.monthNames.length; i++) {
+ window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthNames[i];
+ }
+ for (var i=0; i<this.monthAbbreviations.length; i++) {
+ window.MONTH_NAMES[window.MONTH_NAMES.length] = this.monthAbbreviations[i];
+ }
+ }
+}
+// Temporary default functions to be called when items clicked, so no error is thrown
+function CP_tmpReturnFunction(y,m,d) {
+ if (window.CP_targetInput!=null) {
+ var dt = new Date(y,m-1,d,0,0,0);
+ if (window.CP_calendarObject!=null) { window.CP_calendarObject.copyMonthNamesToWindow(); }
+ window.CP_targetInput.value = formatDate(dt,window.CP_dateFormat);
+ /////////
+ if (window.CP_targetInput.onchange){
+ window.CP_targetInput.onchange();
+ }
+ }
+ else {
+ alert('Use setReturnFunction() to define which function will get the clicked results!');
+ }
+ }
+function CP_tmpReturnMonthFunction(y,m) {
+ alert('Use setReturnMonthFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , month='+m);
+ }
+function CP_tmpReturnQuarterFunction(y,q) {
+ alert('Use setReturnQuarterFunction() to define which function will get the clicked results!\nYou clicked: year='+y+' , quarter='+q);
+ }
+function CP_tmpReturnYearFunction(y) {
+ alert('Use setReturnYearFunction() to define which function will get the clicked results!\nYou clicked: year='+y);
+ }
+
+// Set the name of the functions to call to get the clicked item
+function CP_setReturnFunction(name) { this.returnFunction = name; }
+function CP_setReturnMonthFunction(name) { this.returnMonthFunction = name; }
+function CP_setReturnQuarterFunction(name) { this.returnQuarterFunction = name; }
+function CP_setReturnYearFunction(name) { this.returnYearFunction = name; }
+
+// Over-ride the built-in month names
+function CP_setMonthNames() {
+ for (var i=0; i<arguments.length; i++) { this.monthNames[i] = arguments[i]; }
+ this.copyMonthNamesToWindow();
+ }
+
+// Over-ride the built-in month abbreviations
+function CP_setMonthAbbreviations() {
+ for (var i=0; i<arguments.length; i++) { this.monthAbbreviations[i] = arguments[i]; }
+ this.copyMonthNamesToWindow();
+ }
+
+// Over-ride the built-in column headers for each day
+function CP_setDayHeaders() {
+ for (var i=0; i<arguments.length; i++) { this.dayHeaders[i] = arguments[i]; }
+ }
+
+// Set the day of the week (0-7) that the calendar display starts on
+// This is for countries other than the US whose calendar displays start on Monday(1), for example
+function CP_setWeekStartDay(day) { this.weekStartDay = day; }
+
+// Show next/last year navigation links
+function CP_showYearNavigation() { this.isShowYearNavigation = (arguments.length>0)?arguments[0]:true; }
+
+// Which type of calendar to display
+function CP_setDisplayType(type) {
+ if (type!="date"&&type!="week-end"&&type!="month"&&type!="quarter"&&type!="year") { alert("Invalid display type! Must be one of: date,week-end,month,quarter,year"); return false; }
+ this.displayType=type;
+ }
+
+// How many years back to start by default for year display
+function CP_setYearSelectStartOffset(num) { this.yearSelectStartOffset=num; }
+
+// Set which weekdays should not be clickable
+function CP_setDisabledWeekDays() {
+ this.disabledWeekDays = new Object();
+ for (var i=0; i<arguments.length; i++) { this.disabledWeekDays[arguments[i]] = true; }
+ }
+
+// Disable individual dates or ranges
+// Builds an internal logical test which is run via eval() for efficiency
+function CP_addDisabledDates(start, end) {
+ if (arguments.length==1) { end=start; }
+ if (start==null && end==null) { return; }
+ if (this.disabledDatesExpression!="") { this.disabledDatesExpression+= "||"; }
+ if (start!=null) { start = parseDate(start); start=""+start.getFullYear()+LZ(start.getMonth()+1)+LZ(start.getDate());}
+ if (end!=null) { end=parseDate(end); end=""+end.getFullYear()+LZ(end.getMonth()+1)+LZ(end.getDate());}
+ if (start==null) { this.disabledDatesExpression+="(ds<="+end+")"; }
+ else if (end ==null) { this.disabledDatesExpression+="(ds>="+start+")"; }
+ else { this.disabledDatesExpression+="(ds>="+start+"&&ds<="+end+")"; }
+ }
+
+// Set the text to use for the "Today" link
+function CP_setTodayText(text) {
+ this.todayText = text;
+ }
+
+// Set the prefix to be added to all CSS classes when writing output
+function CP_setCssPrefix(val) {
+ this.cssPrefix = val;
+ }
+
+// Show the navigation as an dropdowns that can be manually changed
+function CP_showNavigationDropdowns() { this.isShowNavigationDropdowns = (arguments.length>0)?arguments[0]:true; }
+
+// Show the year navigation as an input box that can be manually changed
+function CP_showYearNavigationInput() { this.isShowYearNavigationInput = (arguments.length>0)?arguments[0]:true; }
+
+// Hide a calendar object
+function CP_hideCalendar() {
+ if (arguments.length > 0) { window.popupWindowObjects[arguments[0]].hidePopup(); }
+ else { this.hidePopup(); }
+ }
+
+
+// Refresh the contents of the calendar display
+function CP_refreshCalendar(index) {
+ var calObject = window.popupWindowObjects[index];
+ if (arguments.length>1) {
+ calObject.populate(calObject.getCalendar(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]));
+ }
+ else {
+ calObject.populate(calObject.getCalendar());
+ }
+ calObject.refresh();
+ }
+
+// Populate the calendar and display it
+function CP_showCalendar(anchorname) {
+
+ if (arguments.length>1) {
+ if (arguments[1]==null||arguments[1]=="") {
+ //var dd = parseDate();
+ this.currentDate=new Date();
+ //this.currentDate = dd;
+
+ }
+ else {
+ this.currentDate=new Date(parseDate(arguments[1]));
+ }
+ }
+ this.populate(this.getCalendar());
+ this.showPopup(anchorname);
+ }
+
+// Simple method to interface popup calendar with a text-entry box
+function CP_select(inputobj, linkname, format) {
+ var selectedDate=(arguments.length>3)?arguments[3]:null;
+ if (!window.getDateFromFormat) {
+ alert("calendar.select: To use this method you must also include 'date.js' for date formatting");
+ return;
+ }
+ if (this.displayType!="date"&&this.displayType!="week-end") {
+ alert("calendar.select: This function can only be used with displayType 'date' or 'week-end'");
+ return;
+ }
+ if (inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea") {
+ alert("calendar.select: Input object passed is not a valid form input object");
+ window.CP_targetInput=null;
+ return;
+ }
+ if (inputobj.disabled) { return; } // Can't use calendar input on disabled form input!
+ window.CP_targetInput = inputobj;
+ window.CP_calendarObject = this;
+ this.currentDate=null;
+ var time=0;
+ if (selectedDate!=null) {
+ time = getDateFromFormat(selectedDate,format)
+ }
+ else if (inputobj.value!="") {
+ time = getDateFromFormat(inputobj.value,format);
+ }
+ if (selectedDate!=null || inputobj.value!="") {
+ if (time==0) { this.currentDate=null; }
+ else { this.currentDate=new Date(time); }
+ }
+ window.CP_dateFormat = format;
+ this.showCalendar(linkname);
+ }
+
+// Get style block needed to display the calendar correctly
+function getCalendarStyles() {
+ var result = "";
+ var p = "";
+ if (this!=null && typeof(this.cssPrefix)!="undefined" && this.cssPrefix!=null && this.cssPrefix!="") { p=this.cssPrefix; }
+ result += "<STYLE>\n";
+ result += "."+p+"cpYearNavigation,."+p+"cpMonthNavigation { background-color:#C0C0C0; text-align:center; vertical-align:center; text-decoration:none; color:#000000; font-weight:bold; }\n";
+ result += "."+p+"cpDayColumnHeader, ."+p+"cpYearNavigation,."+p+"cpMonthNavigation,."+p+"cpCurrentMonthDate,."+p+"cpCurrentMonthDateDisabled,."+p+"cpOtherMonthDate,."+p+"cpOtherMonthDateDisabled,."+p+"cpCurrentDate,."+p+"cpCurrentDateDisabled,."+p+"cpTodayText,."+p+"cpTodayTextDisabled,."+p+"cpText { font-family:arial; font-size:8pt; }\n";
+ result += "TD."+p+"cpDayColumnHeader { text-align:right; border:solid thin #C0C0C0;border-width:0px 0px 1px 0px; }\n";
+ result += "."+p+"cpCurrentMonthDate, ."+p+"cpOtherMonthDate, ."+p+"cpCurrentDate { text-align:right; text-decoration:none; }\n";
+ result += "."+p+"cpCurrentMonthDateDisabled, ."+p+"cpOtherMonthDateDisabled, ."+p+"cpCurrentDateDisabled { color:#D0D0D0; text-align:right; text-decoration:line-through; }\n";
+ result += "."+p+"cpCurrentMonthDate, .cpCurrentDate { color:#000000; }\n";
+ result += "."+p+"cpOtherMonthDate { color:#808080; }\n";
+ result += "TD."+p+"cpCurrentDate { color:white; background-color: #C0C0C0; border-width:1px; border:solid thin #800000; }\n";
+ result += "TD."+p+"cpCurrentDateDisabled { border-width:1px; border:solid thin #FFAAAA; }\n";
+ result += "TD."+p+"cpTodayText, TD."+p+"cpTodayTextDisabled { border:solid thin #C0C0C0; border-width:1px 0px 0px 0px;}\n";
+ result += "A."+p+"cpTodayText, SPAN."+p+"cpTodayTextDisabled { height:20px; }\n";
+ result += "A."+p+"cpTodayText { color:black; }\n";
+ result += "."+p+"cpTodayTextDisabled { color:#D0D0D0; }\n";
+ result += "."+p+"cpBorder { border:solid thin #808080; }\n";
+ result += "</STYLE>\n";
+ return result;
+ }
+
+// Return a string containing all the calendar code to be displayed
+function CP_getCalendar() {
+ var now = new Date();
+ if (typeof oracleDateString == 'function'){
+ now = parseDate(oracleDateString());
+ }else if (typeof parent.oracleDateString == 'function'){
+ now = parseDate(parent.oracleDateString());
+ }
+ // Reference to window
+ if (this.type == "WINDOW") { var windowref = "window.opener."; }
+ else { var windowref = ""; }
+ var result = "";
+ // If POPUP, write entire HTML document
+ if (this.type == "WINDOW") {
+ result += "<HTML><HEAD><TITLE>Calendar</TITLE>"+this.getStyles()+"</HEAD><BODY MARGINWIDTH=0 MARGINHEIGHT=0 TOPMARGIN=0 RIGHTMARGIN=0 LEFTMARGIN=0>\n";
+ result += '<CENTER><TABLE WIDTH=100% BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>\n';
+ }
+ else {
+ result += '<TABLE CLASS="'+this.cssPrefix+'cpBorder" WIDTH=144 BORDER=1 BORDERWIDTH=1 CELLSPACING=0 CELLPADDING=1>\n';
+ result += '<TR><TD ALIGN=CENTER>\n';
+ result += '<CENTER>\n';
+ }
+ // Code for DATE display (default)
+ // -------------------------------
+ if (this.displayType=="date" || this.displayType=="week-end") {
+ if (this.currentDate==null) { this.currentDate = now; }
+ if (arguments.length > 0) { var month = arguments[0]; }
+ else { var month = this.currentDate.getMonth()+1; }
+ if (arguments.length > 1 && arguments[1]>0 && arguments[1]-0==arguments[1]) { var year = arguments[1]; }
+ else { var year = this.currentDate.getFullYear(); }
+ var daysinmonth= new Array(0,31,28,31,30,31,30,31,31,30,31,30,31);
+ if ( ( (year%4 == 0)&&(year%100 != 0) ) || (year%400 == 0) ) {
+ daysinmonth[2] = 29;
+ }
+ var current_month = new Date(year,month-1,1);
+ var display_year = year;
+ var display_month = month;
+ var display_date = 1;
+ var weekday= current_month.getDay();
+ var offset = 0;
+
+ offset = (weekday >= this.weekStartDay) ? weekday-this.weekStartDay : 7-this.weekStartDay+weekday ;
+ if (offset > 0) {
+ display_month--;
+ if (display_month < 1) { display_month = 12; display_year--; }
+ display_date = daysinmonth[display_month]-offset+1;
+ }
+ var next_month = month+1;
+ var next_month_year = year;
+ if (next_month > 12) { next_month=1; next_month_year++; }
+ var last_month = month-1;
+ var last_month_year = year;
+ if (last_month < 1) { last_month=12; last_month_year--; }
+ var date_class;
+ if (this.type!="WINDOW") {
+ result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
+ }
+ result += '<TR>\n';
+ var refresh = windowref+'CP_refreshCalendar';
+ var refreshLink = 'javascript:' + refresh;
+ if (this.isShowNavigationDropdowns) {
+ result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="78" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpMonthNavigation" name="cpMonth" onChange="'+refresh+'('+this.index+',this.options[this.selectedIndex].value-0,'+(year-0)+');">';
+ for( var monthCounter=1; monthCounter<=12; monthCounter++ ) {
+ var selected = (monthCounter==month) ? 'SELECTED' : '';
+ result += '<option value="'+monthCounter+'" '+selected+'>'+this.monthNames[monthCounter-1]+'</option>';
+ }
+ result += '</select></TD>';
+ result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';
+
+ result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="56" COLSPAN="3"><select CLASS="'+this.cssPrefix+'cpYearNavigation" name="cpYear" onChange="'+refresh+'('+this.index+','+month+',this.options[this.selectedIndex].value-0);">';
+ for( var yearCounter=year-this.yearSelectStartOffset; yearCounter<=year+this.yearSelectStartOffset; yearCounter++ ) {
+ var selected = (yearCounter==year) ? 'SELECTED' : '';
+ result += '<option value="'+yearCounter+'" '+selected+'>'+yearCounter+'</option>';
+ }
+ result += '</select></TD>';
+ }
+ else {
+ if (this.isShowYearNavigation) {
+ result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');">&lt;</A></TD>';
+ result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="58"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+'</SPAN></TD>';
+ result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">&gt;</A></TD>';
+ result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="10">&nbsp;</TD>';
+
+ result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year-1)+');">&lt;</A></TD>';
+ if (this.isShowYearNavigationInput) {
+ result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><INPUT NAME="cpYear" CLASS="'+this.cssPrefix+'cpYearNavigation" SIZE="4" MAXLENGTH="4" VALUE="'+year+'" onBlur="'+refresh+'('+this.index+','+month+',this.value-0);"></TD>';
+ }
+ else {
+ result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="36"><SPAN CLASS="'+this.cssPrefix+'cpYearNavigation">'+year+'</SPAN></TD>';
+ }
+ result += '<TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="10"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="'+refreshLink+'('+this.index+','+month+','+(year+1)+');">&gt;</A></TD>';
+ }
+ else {
+ result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+last_month+','+last_month_year+');">&lt;&lt;</A></TD>\n';
+ result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="100"><SPAN CLASS="'+this.cssPrefix+'cpMonthNavigation">'+this.monthNames[month-1]+' '+year+'</SPAN></TD>\n';
+ result += '<TD CLASS="'+this.cssPrefix+'cpMonthNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpMonthNavigation" HREF="'+refreshLink+'('+this.index+','+next_month+','+next_month_year+');">&gt;&gt;</A></TD>\n';
+ }
+ }
+ result += '</TR></TABLE>\n';
+ result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=0 CELLPADDING=1 ALIGN=CENTER>\n';
+ result += '<TR>\n';
+ for (var j=0; j<7; j++) {
+
+ result += '<TD CLASS="'+this.cssPrefix+'cpDayColumnHeader" WIDTH="14%"><SPAN CLASS="'+this.cssPrefix+'cpDayColumnHeader">'+this.dayHeaders[(this.weekStartDay+j)%7]+'</TD>\n';
+ }
+ result += '</TR>\n';
+ for (var row=1; row<=6; row++) {
+ result += '<TR>\n';
+ for (var col=1; col<=7; col++) {
+ var disabled=false;
+ if (this.disabledDatesExpression!="") {
+ var ds=""+display_year+LZ(display_month)+LZ(display_date);
+ eval("disabled=("+this.disabledDatesExpression+")");
+ }
+ var dateClass = "";
+ if ((display_month == this.currentDate.getMonth()+1) && (display_date==this.currentDate.getDate()) && (display_year==this.currentDate.getFullYear())) {
+ dateClass = "cpCurrentDate";
+ }
+ else if (display_month == month) {
+ dateClass = "cpCurrentMonthDate";
+ }
+ else {
+ dateClass = "cpOtherMonthDate";
+ }
+ if (disabled || this.disabledWeekDays[col-1]) {
+ result += ' <TD CLASS="'+this.cssPrefix+dateClass+'"><SPAN CLASS="'+this.cssPrefix+dateClass+'Disabled">'+display_date+'</SPAN></TD>\n';
+ }
+ else {
+ var selected_date = display_date;
+ var selected_month = display_month;
+ var selected_year = display_year;
+ if (this.displayType=="week-end") {
+ var d = new Date(selected_year,selected_month-1,selected_date,0,0,0,0);
+ d.setDate(d.getDate() + (7-col));
+ selected_year = d.getYear();
+ if (selected_year < 1000) { selected_year += 1900; }
+ selected_month = d.getMonth()+1;
+ selected_date = d.getDate();
+ }
+ result += ' <TD CLASS="'+this.cssPrefix+dateClass+'"><A HREF="javascript:'+windowref+this.returnFunction+'('+selected_year+','+selected_month+','+selected_date+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+this.cssPrefix+dateClass+'">'+display_date+'</A></TD>\n';
+ }
+ display_date++;
+ if (display_date > daysinmonth[display_month]) {
+ display_date=1;
+ display_month++;
+ }
+ if (display_month > 12) {
+ display_month=1;
+ display_year++;
+ }
+ }
+ result += '</TR>';
+ }
+ var current_weekday = now.getDay() - this.weekStartDay;
+ if (current_weekday < 0) {
+ current_weekday += 7;
+ }
+ result += '<TR>\n';
+ result += ' <TD COLSPAN=7 ALIGN=CENTER CLASS="'+this.cssPrefix+'cpTodayText">\n';
+ if (this.disabledDatesExpression!="") {
+ var ds=""+now.getFullYear()+LZ(now.getMonth()+1)+LZ(now.getDate());
+ eval("disabled=("+this.disabledDatesExpression+")");
+ }
+ if (disabled || this.disabledWeekDays[current_weekday+1]) {
+ result += ' <SPAN CLASS="'+this.cssPrefix+'cpTodayTextDisabled">'+this.todayText+'</SPAN>\n';
+ }
+ else {
+ result += ' <A CLASS="'+this.cssPrefix+'cpTodayText" HREF="javascript:'+windowref+this.returnFunction+'(\''+now.getFullYear()+'\',\''+(now.getMonth()+1)+'\',\''+now.getDate()+'\');'+windowref+'CP_hideCalendar(\''+this.index+'\');">'+this.todayText+'</A>\n';
+ }
+ result += ' <BR>\n';
+ result += ' </TD></TR></TABLE></CENTER></TD></TR></TABLE>\n';
+ }
+
+ // Code common for MONTH, QUARTER, YEAR
+ // ------------------------------------
+ if (this.displayType=="month" || this.displayType=="quarter" || this.displayType=="year") {
+ if (arguments.length > 0) { var year = arguments[0]; }
+ else {
+ if (this.displayType=="year") { var year = now.getFullYear()-this.yearSelectStartOffset; }
+ else { var year = now.getFullYear(); }
+ }
+ if (this.displayType!="year" && this.isShowYearNavigation) {
+ result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
+ result += '<TR>\n';
+ result += ' <TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year-1)+');">&lt;&lt;</A></TD>\n';
+ result += ' <TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="100">'+year+'</TD>\n';
+ result += ' <TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="22"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year+1)+');">&gt;&gt;</A></TD>\n';
+ result += '</TR></TABLE>\n';
+ }
+ }
+
+ // Code for MONTH display
+ // ----------------------
+ if (this.displayType=="month") {
+ // If POPUP, write entire HTML document
+ result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n';
+ for (var i=0; i<4; i++) {
+ result += '<TR>';
+ for (var j=0; j<3; j++) {
+ var monthindex = ((i*3)+j);
+ result += '<TD WIDTH=33% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnMonthFunction+'('+year+','+(monthindex+1)+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">'+this.monthAbbreviations[monthindex]+'</A></TD>';
+ }
+ result += '</TR>';
+ }
+ result += '</TABLE></CENTER></TD></TR></TABLE>\n';
+ }
+
+ // Code for QUARTER display
+ // ------------------------
+ if (this.displayType=="quarter") {
+ result += '<BR><TABLE WIDTH=120 BORDER=1 CELLSPACING=0 CELLPADDING=0 ALIGN=CENTER>\n';
+ for (var i=0; i<2; i++) {
+ result += '<TR>';
+ for (var j=0; j<2; j++) {
+ var quarter = ((i*2)+j+1);
+ result += '<TD WIDTH=50% ALIGN=CENTER><BR><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnQuarterFunction+'('+year+','+quarter+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">Q'+quarter+'</A><BR><BR></TD>';
+ }
+ result += '</TR>';
+ }
+ result += '</TABLE></CENTER></TD></TR></TABLE>\n';
+ }
+
+ // Code for YEAR display
+ // ---------------------
+ if (this.displayType=="year") {
+ var yearColumnSize = 4;
+ result += "<TABLE WIDTH=144 BORDER=0 BORDERWIDTH=0 CELLSPACING=0 CELLPADDING=0>";
+ result += '<TR>\n';
+ result += ' <TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year-(yearColumnSize*2))+');">&lt;&lt;</A></TD>\n';
+ result += ' <TD CLASS="'+this.cssPrefix+'cpYearNavigation" WIDTH="50%"><A CLASS="'+this.cssPrefix+'cpYearNavigation" HREF="javascript:'+windowref+'CP_refreshCalendar('+this.index+','+(year+(yearColumnSize*2))+');">&gt;&gt;</A></TD>\n';
+ result += '</TR></TABLE>\n';
+ result += '<TABLE WIDTH=120 BORDER=0 CELLSPACING=1 CELLPADDING=0 ALIGN=CENTER>\n';
+ for (var i=0; i<yearColumnSize; i++) {
+ for (var j=0; j<2; j++) {
+ var currentyear = year+(j*yearColumnSize)+i;
+ result += '<TD WIDTH=50% ALIGN=CENTER><A CLASS="'+this.cssPrefix+'cpText" HREF="javascript:'+windowref+this.returnYearFunction+'('+currentyear+');'+windowref+'CP_hideCalendar(\''+this.index+'\');" CLASS="'+date_class+'">'+currentyear+'</A></TD>';
+ }
+ result += '</TR>';
+ }
+ result += '</TABLE></CENTER></TD></TR></TABLE>\n';
+ }
+ // Common
+ if (this.type == "WINDOW") {
+ result += "</BODY></HTML>\n";
+ }
+ return result;
+ }
+
+//added for IE6 issue
+
+function showFrame(divName, frameName){
+
+ // added to show Iframe behind calender
+ var oIfr = document.getElementById(frameName);
+ var oCal = document.getElementById(divName);
+ if (oIfr != null){
+ oIfr.style.display='block';
+ oIfr.style.top=oCal.style.top;
+ oIfr.style.left=oCal.style.left;
+ }
+
+}
+function hideFrame(divName, frameName){
+ var oIfr = document.getElementById(frameName);
+ if (oIfr != null){
+ oIfr.style.display='none';
+ }
+}
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/ajax.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/ajax.js
new file mode 100644
index 000000000..c24c26886
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/ajax.js
@@ -0,0 +1,214 @@
+/* Simple AJAX Code-Kit (SACK) v1.6.1 */
+/* ©2005 Gregory Wild-Smith */
+/* www.twilightuniverse.com */
+/* Software licenced under a modified X11 licence,
+ see documentation or authors website for more details */
+
+function sack(file) {
+ this.xmlhttp = null;
+
+ this.resetData = function() {
+ this.method = "POST";
+ this.queryStringSeparator = "?";
+ this.argumentSeparator = "&";
+ this.URLString = "";
+ this.encodeURIString = true;
+ this.execute = false;
+ this.element = null;
+ this.elementObj = null;
+ this.requestFile = file;
+ this.vars = new Object();
+ this.responseStatus = new Array(2);
+ };
+
+ this.resetFunctions = function() {
+ this.onLoading = function() { };
+ this.onLoaded = function() { };
+ this.onInteractive = function() { };
+ this.onCompletion = function() { };
+ this.onError = function() { };
+ this.onFail = function() { };
+ };
+
+ this.reset = function() {
+ this.resetFunctions();
+ this.resetData();
+ };
+
+ this.createAJAX = function() {
+ try {
+ this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e1) {
+ try {
+ this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (e2) {
+ this.xmlhttp = null;
+ }
+ }
+
+ if (! this.xmlhttp) {
+ if (typeof XMLHttpRequest != "undefined") {
+ this.xmlhttp = new XMLHttpRequest();
+ } else {
+ this.failed = true;
+ }
+ }
+ };
+
+ /*Modified by Sundar: to accept POST request*/
+ this.setVar = function(name, value, index){
+ if(index)
+ this.vars[name+'~'+index] = Array(value, false);
+ else
+ this.vars[name+'~'+0] = Array(value, false);
+ };
+
+ this.encVar = function(name, value, returnvars) {
+ if (true == returnvars) {
+ return Array(encodeURIComponent(name), encodeURIComponent(value));
+ } else {
+ this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
+ }
+ }
+
+ this.processURLString = function(string, encode) {
+ encoded = encodeURIComponent(this.argumentSeparator);
+ regexp = new RegExp(this.argumentSeparator + "|" + encoded);
+ varArray = string.split(regexp);
+ for (i = 0; i < varArray.length; i++){
+ urlVars = varArray[i].split("=");
+ if (true == encode){
+ this.encVar(urlVars[0], urlVars[1]);
+ } else {
+ this.setVar(urlVars[0], urlVars[1]);
+ }
+ }
+ }
+
+ this.createURLString = function(urlstring) {
+ if (this.encodeURIString && this.URLString.length) {
+ this.processURLString(this.URLString, true);
+ }
+
+ if (urlstring) {
+ if (this.URLString.length) {
+ this.URLString += this.argumentSeparator + urlstring;
+ } else {
+ this.URLString = urlstring;
+ }
+ }
+
+ // prevents caching of URLString
+ this.setVar("rndval", new Date().getTime());
+
+ urlstringtemp = new Array();
+ /*Modified by Sundar: to accept POST request*/
+ var key1 = "";
+ for (key in this.vars) {
+ if (false == this.vars[key][1] && true == this.encodeURIString) {
+ encoded = this.encVar(key, this.vars[key][0], true);
+ delete this.vars[key];
+ this.vars[encoded[0]] = Array(encoded[1], true);
+ key = encoded[0];
+ }
+ key1 = key.substr(0,key.indexOf('~'));
+ //alert("Key " + key1);
+ urlstringtemp[urlstringtemp.length] = key1 + "=" + this.vars[key][0];
+ }
+ if (urlstring){
+ this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
+ } else {
+ this.URLString += urlstringtemp.join(this.argumentSeparator);
+ }
+ //alert("URLString " + this.URLString);
+
+ }
+
+ this.runResponse = function() {
+ eval(this.response);
+ }
+
+
+ this.runAJAX = function(urlstring,noWaitForResponse,timeOut) {
+
+ if(noWaitForResponse == null){
+ noWaitForResponse = true;
+ }
+
+ if (this.failed) {
+ this.onFail();
+ } else {
+ this.createURLString(urlstring);
+ if (this.element) {
+ this.elementObj = document.getElementById(this.element);
+ }
+ if (this.xmlhttp) {
+ var self = this;
+ //SUNDAR: Added timeout for synchronous AJAX
+ if(!noWaitForResponse && timeOut != null && !isNaN(timeOut)){
+ window.setTimeout("dummyFunction()",timeOut);
+ }
+ if (this.method == "GET") {
+ totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
+ this.xmlhttp.open(this.method, totalurlstring, noWaitForResponse);
+ } else {
+
+ this.xmlhttp.open(this.method, this.requestFile, noWaitForResponse);
+ try {
+ this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
+ } catch (e) { }
+ }
+
+ this.xmlhttp.onreadystatechange = function() {
+ //alert("AJAX READY " + self.xmlhttp.readyState);
+ switch (self.xmlhttp.readyState) {
+ case 1:
+ self.onLoading();
+ break;
+ case 2:
+ self.onLoaded();
+ break;
+ case 3:
+ self.onInteractive();
+ break;
+ case 4:
+ self.response = self.xmlhttp.responseText;
+ self.responseXML = self.xmlhttp.responseXML;
+ self.responseStatus[0] = self.xmlhttp.status;
+ self.responseStatus[1] = self.xmlhttp.statusText;
+
+ if (self.execute) {
+ self.runResponse();
+ }
+
+ if (self.elementObj) {
+ elemNodeName = self.elementObj.nodeName;
+ elemNodeName.toLowerCase();
+ if (elemNodeName == "input"
+ || elemNodeName == "select"
+ || elemNodeName == "option"
+ || elemNodeName == "textarea") {
+ self.elementObj.value = self.response;
+ } else {
+ self.elementObj.innerHTML = self.response;
+ }
+ }
+ if (self.responseStatus[0] == "200") {
+ self.onCompletion();
+ } else {
+ self.onError();
+ }
+
+ self.URLString = "";
+ break;
+ }
+ };
+
+ this.xmlhttp.send(this.URLString);
+ }
+ }
+ };
+
+ this.reset();
+ this.createAJAX();
+}
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/ajax_dynamic_content.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/ajax_dynamic_content.js
new file mode 100644
index 000000000..077932e1a
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/ajax_dynamic_content.js
@@ -0,0 +1,97 @@
+
+/***********************************************
+* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
+* This notice MUST stay intact for legal use
+* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
+***********************************************/
+
+var loadedobjects=""
+var rootdomain="http://"+window.location.hostname
+
+function ajaxpage(url, containerid){
+
+var page_request = false;
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
+ } catch (e) {
+ //alert("Permission UniversalBrowserRead denied.");
+ }
+if (window.XMLHttpRequest) // if Mozilla, Safari etc
+page_request = new XMLHttpRequest()
+else if (window.ActiveXObject){ // if IE
+try {
+page_request = new ActiveXObject("Msxml2.XMLHTTP")
+}
+catch (e1){
+try{
+page_request = new ActiveXObject("Microsoft.XMLHTTP")
+}
+catch (e1){ page_request = null; alert('permission denied');
+}
+}
+}
+else
+return false
+page_request.onreadystatechange=function(){
+loadpage(page_request, containerid)
+}
+// This is a fix made since IE doesn't refresh the page
+var ajaxRightNow = new Date();
+var noCacheAjaxurl = url + ((/\?/.test(url)) ? "&" : "?") + "ajaxRandomTimestamp=" + ajaxRightNow.getTime();
+page_request.open('GET', noCacheAjaxurl, true)
+page_request.send(null)
+}
+
+function loadpage(page_request, containerid){
+var div = document.getElementById(containerid);
+if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
+ div.innerHTML=page_request.responseText;
+ var x = div.getElementsByTagName("script");
+ for(var i=0;i<x.length;i++)
+ {
+ if(x[i].text.indexOf("resizeDivScrollbar")>=0)
+ eval(x[i].text);
+ }
+}
+
+function resizeDivScrollbar(){
+ var frame = document.getElementById("scrollableTableResult");
+ var parentBody = window.parent.document.body;
+ var parentMenu = window.parent.document.getElementById("application");
+ if(frame!=null) {
+ //alert(frame.clientHeight + " " + window.parent.document.body.clientHeight);
+ if (frame.clientHeight > window.parent.document.body.clientHeight) {
+ frame.style.height = window.parent.document.body.clientHeight-350;
+ } else
+ frame.style.height = window.parent.document.body.clientHeight;
+ parentMenu.style.width = frame.clientWidth+200;
+ }
+}
+
+
+function loadobjs(){
+if (!document.getElementById)
+return
+for (i=0; i<arguments.length; i++){
+var file=arguments[i]
+var fileref=""
+if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
+if (file.indexOf(".js")!=-1){ //If object is a js file
+fileref=document.createElement('script')
+fileref.setAttribute("type","text/javascript");
+fileref.setAttribute("src", file);
+}
+else if (file.indexOf(".css")!=-1){ //If object is a css file
+fileref=document.createElement("link")
+fileref.setAttribute("rel", "stylesheet");
+fileref.setAttribute("type", "text/css");
+fileref.setAttribute("href", file);
+}
+}
+if (fileref!=""){
+document.getElementsByTagName("head").item(0).appendChild(fileref)
+loadedobjects+=file+" " //Remember this object as being already added to page
+}
+}
+}
+
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/cingular_button.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/cingular_button.js
new file mode 100644
index 000000000..9a0531830
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/cingular_button.js
@@ -0,0 +1,217 @@
+function CingularButton() {
+}
+
+CingularButton.prototype = new GControl();
+
+CingularButton.globals = {
+ listOptionContainer: null,
+ listOptionVisible: false
+};
+
+CingularButton.prototype.initialize = function(map) {
+ var globals = CingularButton.globals;
+ var cbContainer;
+ var listOptionContainer;
+ var button;
+ var buttonText;
+
+ cbContainer = document.createElement("div");
+ cbContainer.style.zIndex = "150";
+
+ listOptionContainer = document.createElement("div");
+ this.setMenuContainerStyle(listOptionContainer);
+ this.initializeMonthListMenu(listOptionContainer);
+
+ //create button
+ var gmwButtonContainer = document.createElement("div");
+
+ button = document.createElement("div");
+ button.appendChild(document.createTextNode("Previous"));
+ gmwButtonContainer.appendChild(button);
+ NovaButton.prototype.setButtonStyle(button, true);
+ GEvent.addDomListener(button, "click", previousMonthClickEvent);
+
+ button = document.createElement("div");
+ button.appendChild(document.createTextNode("2008/01"));
+ button.id = "currentMonthDiv";
+ gmwButtonContainer.appendChild(button);
+ NovaButton.prototype.setButtonStyle(button, true);
+ GEvent.addDomListener(button, "click", currentMonthClickEvent);
+
+ button = document.createElement("div");
+ button.appendChild(document.createTextNode("Next"));
+ gmwButtonContainer.appendChild(button);
+ NovaButton.prototype.setButtonStyle(button, true);
+ GEvent.addDomListener(button, "click", nextMonthClickEvent);
+
+ cbContainer.appendChild(gmwButtonContainer);
+ cbContainer.appendChild(listOptionContainer);
+
+ map.getContainer().appendChild(cbContainer);
+
+ //set global variables
+ globals.listOptionContainer = listOptionContainer;
+ return cbContainer;
+}
+
+CingularButton.prototype.getDefaultPosition = function() {
+ return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(5, 30));
+}
+
+CingularButton.prototype.initializeMonthListMenu = function(container) {
+ var menuUL = container.appendChild(document.createElement("ul"));
+ this.setMenuStyle(menuUL);
+
+ var minMonth = 1;
+ var minYear = 2008;
+
+ var maxMonth = 12;
+ var maxYear = 2010;
+
+ for (currentYear = minYear; currentYear <= maxYear; currentYear++) {
+ for (currentMonth = minMonth; currentMonth <= maxMonth; currentMonth++) {
+ var menuItem = document.createElement("li");
+ this.setMenuItemStyle(menuItem);
+
+ if (currentMonth < 10) {
+ menuItem.appendChild(document.createTextNode(currentYear + "/0" + currentMonth));
+ menuItem.id = currentYear + "/0" + currentMonth;
+ }
+ else {
+ menuItem.appendChild(document.createTextNode(currentYear + "/" + currentMonth));
+ menuItem.id = currentYear + "/" + currentMonth;
+ }
+
+ GEvent.addDomListener(menuItem, "click", menuItemOnClick);
+ GEvent.addDomListener(menuItem, "mouseover", menuItemOnMouseOver);
+ GEvent.addDomListener(menuItem, "mouseout", menuItemOnMouseOut);
+ menuUL.appendChild(menuItem);
+ }
+ }
+}
+
+CingularButton.prototype.showListOption = function(posX, posY) {
+ var global = CingularButton.globals;
+
+ //position the menu at the given location
+ if(typeof posX == "number") {
+ global.listOptionContainer.style.left = posX + "px";
+ }
+
+ if(typeof posY == "number") {
+ global.listOptionContainer.style.top = posY + "px";
+ }
+
+ //display the menu
+ global.listOptionContainer.style.display = "block";
+}
+
+CingularButton.prototype.setButtonStyle = function(button) {
+ button.style.color = "black";
+ button.style.backgroundColor = "white";
+ button.style.fontFamily = "Verdana";
+ button.style.fontSize = "12px";
+ button.style.fontWeight= "normal";
+ button.style.border = "1px solid gray";
+ button.style.padding = "0px";
+ button.style.marginBottom = "0px";
+ button.style.textAlign = "center";
+ button.style.width = "7em";
+ button.style.height = "15px";
+ button.style.cursor = "pointer";
+
+ if(button.addEventListener) {
+ button.style.cssFloat = "left";
+ }
+ else {
+ button.style.styleFloat = "left";
+ }
+}
+
+CingularButton.prototype.setMenuContainerStyle = function(menuContainer) {
+ menuContainer.style.position = "absolute";
+ menuContainer.style.overflow = "auto";
+ menuContainer.style.height = "200px";
+ menuContainer.style.display = "none";
+ menuContainer.style.background = "#FFFFF0";
+}
+
+CingularButton.prototype.setMenuStyle = function(menu) {
+ menu.style.margin = "2";
+ menu.style.width = "100px";
+ menu.style.padding = "0px 30px 0px 0px";
+ menu.style.listStyleType= "none";
+ menu.style.background = "#FFFFF0";
+}
+
+CingularButton.prototype.setMenuItemStyle = function(menuItem) {
+ menuItem.style.padding = "4px 3px 4px 33px";
+ menuItem.style.fontFamily = "Vardana, Arial, Helvetica, sans-serif";
+ menuItem.style.fontSize = "10pt";
+ menuItem.style.color = "#333";
+ menuItem.style.cursor = "default";
+ menuItem.style.background = "no-repeat left center";
+}
+
+var previousMonthClickEvent = function() {
+ updateImage(-1);
+ NovaButton.prototype.initializeLayerDiv(NovaButton.globals.layerOptionContainer);
+}
+
+var nextMonthClickEvent = function() {
+ updateImage(1);
+ NovaButton.prototype.initializeLayerDiv(NovaButton.globals.layerOptionContainer);
+}
+
+function currentMonthClickEvent(e) {
+ if (CingularButton.globals.listOptionVisible) {
+ CingularButton.globals.listOptionVisible = false;
+ CingularButton.globals.listOptionContainer.style.display = "none";
+ return;
+ }
+
+ if (NovaButton.globals.layerOptionContainer.style.display != "none"){
+ NovaButton.prototype.showLayerClickEvent();
+ }
+ if (NovaButton.globals.searchOptionContainer.style.display != "none"){
+ NovaButton.prototype.searchClickEvent();
+ }
+
+ if (!e) {
+ e = window.event;
+ }
+
+ e.cancelBubble = true;
+
+ if (e.stopPropagation) {
+ e.stopPropagation();
+ }
+
+ var posX = this.offsetLeft;
+ var posY = this.offsetTop;
+
+ CingularButton.prototype.showListOption(posX, posY + this.offsetHeight);
+ CingularButton.globals.listOptionVisible = true;
+}
+
+function menuItemOnClick() {
+ updateImage(this.id);
+ CingularButton.globals.listOptionVisible = false;
+ CingularButton.globals.listOptionContainer.style.display = "none";
+ NovaButton.prototype.initializeLayerDiv(NovaButton.globals.layerOptionContainer);
+}
+
+
+function menuItemOnMouseOver() {
+ this.style.padding = "3px 2px 3px 32px";
+ this.style.color = "#000";
+ this.style.border = "1px solid #06C";
+ this.style.backgroundColor = "#fec";
+}
+
+function menuItemOnMouseOut() {
+ this.style.padding = "4px 3px 4px 33px";
+ this.style.color = "#333";
+ this.style.border = "none";
+ this.style.backgroundColor = "";
+}
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/drupal.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/drupal.js
new file mode 100644
index 000000000..cb605f9b9
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/drupal.js
@@ -0,0 +1,1018 @@
+// $Id: jquery.js,v 1.12.2.3 2008/06/25 09:38:39 goba Exp $
+
+/*
+ * jQuery 1.2.6 - New Wave Javascript
+ *
+ * Copyright (c) 2008 John Resig (jquery.com)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008)
+ * Rev: 5685
+ */
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(H(){J w=1b.4M,3m$=1b.$;J D=1b.4M=1b.$=H(a,b){I 2B D.17.5j(a,b)};J u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/,62=/^.[^:#\\[\\.]*$/,12;D.17=D.44={5j:H(d,b){d=d||S;G(d.16){7[0]=d;7.K=1;I 7}G(1j d=="23"){J c=u.2D(d);G(c&&(c[1]||!b)){G(c[1])d=D.4h([c[1]],b);N{J a=S.61(c[3]);G(a){G(a.2v!=c[3])I D().2q(d);I D(a)}d=[]}}N I D(b).2q(d)}N G(D.1D(d))I D(S)[D.17.27?"27":"43"](d);I 7.6Y(D.2d(d))},5w:"1.2.6",8G:H(){I 7.K},K:0,3p:H(a){I a==12?D.2d(7):7[a]},2I:H(b){J a=D(b);a.5n=7;I a},6Y:H(a){7.K=0;2p.44.1p.1w(7,a);I 7},P:H(a,b){I D.P(7,a,b)},5i:H(b){J a=-1;I D.2L(b&&b.5w?b[0]:b,7)},1K:H(c,a,b){J d=c;G(c.1q==56)G(a===12)I 7[0]&&D[b||"1K"](7[0],c);N{d={};d[c]=a}I 7.P(H(i){R(c 1n d)D.1K(b?7.V:7,c,D.1i(7,d[c],b,i,c))})},1g:H(b,a){G((b==\'2h\'||b==\'1Z\')&&3d(a)<0)a=12;I 7.1K(b,a,"2a")},1r:H(b){G(1j b!="49"&&b!=U)I 7.4E().3v((7[0]&&7[0].2z||S).5F(b));J a="";D.P(b||7,H(){D.P(7.3t,H(){G(7.16!=8)a+=7.16!=1?7.76:D.17.1r([7])})});I a},5z:H(b){G(7[0])D(b,7[0].2z).5y().39(7[0]).2l(H(){J a=7;1B(a.1x)a=a.1x;I a}).3v(7);I 7},8Y:H(a){I 7.P(H(){D(7).6Q().5z(a)})},8R:H(a){I 7.P(H(){D(7).5z(a)})},3v:H(){I 7.3W(19,M,Q,H(a){G(7.16==1)7.3U(a)})},6F:H(){I 7.3W(19,M,M,H(a){G(7.16==1)7.39(a,7.1x)})},6E:H(){I 7.3W(19,Q,Q,H(a){7.1d.39(a,7)})},5q:H(){I 7.3W(19,Q,M,H(a){7.1d.39(a,7.2H)})},3l:H(){I 7.5n||D([])},2q:H(b){J c=D.2l(7,H(a){I D.2q(b,a)});I 7.2I(/[^+>] [^+>]/.11(b)||b.1h("..")>-1?D.4r(c):c)},5y:H(e){J f=7.2l(H(){G(D.14.1f&&!D.4n(7)){J a=7.6o(M),5h=S.3h("1v");5h.3U(a);I D.4h([5h.4H])[0]}N I 7.6o(M)});J d=f.2q("*").5c().P(H(){G(7[E]!=12)7[E]=U});G(e===M)7.2q("*").5c().P(H(i){G(7.16==3)I;J c=D.L(7,"3w");R(J a 1n c)R(J b 1n c[a])D.W.1e(d[i],a,c[a][b],c[a][b].L)});I f},1E:H(b){I 7.2I(D.1D(b)&&D.3C(7,H(a,i){I b.1k(a,i)})||D.3g(b,7))},4Y:H(b){G(b.1q==56)G(62.11(b))I 7.2I(D.3g(b,7,M));N b=D.3g(b,7);J a=b.K&&b[b.K-1]!==12&&!b.16;I 7.1E(H(){I a?D.2L(7,b)<0:7!=b})},1e:H(a){I 7.2I(D.4r(D.2R(7.3p(),1j a==\'23\'?D(a):D.2d(a))))},3F:H(a){I!!a&&D.3g(a,7).K>0},7T:H(a){I 7.3F("."+a)},6e:H(b){G(b==12){G(7.K){J c=7[0];G(D.Y(c,"2A")){J e=c.64,63=[],15=c.15,2V=c.O=="2A-2V";G(e<0)I U;R(J i=2V?e:0,2f=2V?e+1:15.K;i<2f;i++){J d=15[i];G(d.2W){b=D.14.1f&&!d.at.2x.an?d.1r:d.2x;G(2V)I b;63.1p(b)}}I 63}N I(7[0].2x||"").1o(/\\r/g,"")}I 12}G(b.1q==4L)b+=\'\';I 7.P(H(){G(7.16!=1)I;G(b.1q==2p&&/5O|5L/.11(7.O))7.4J=(D.2L(7.2x,b)>=0||D.2L(7.34,b)>=0);N G(D.Y(7,"2A")){J a=D.2d(b);D("9R",7).P(H(){7.2W=(D.2L(7.2x,a)>=0||D.2L(7.1r,a)>=0)});G(!a.K)7.64=-1}N 7.2x=b})},2K:H(a){I a==12?(7[0]?7[0].4H:U):7.4E().3v(a)},7b:H(a){I 7.5q(a).21()},79:H(i){I 7.3s(i,i+1)},3s:H(){I 7.2I(2p.44.3s.1w(7,19))},2l:H(b){I 7.2I(D.2l(7,H(a,i){I b.1k(a,i,a)}))},5c:H(){I 7.1e(7.5n)},L:H(d,b){J a=d.1R(".");a[1]=a[1]?"."+a[1]:"";G(b===12){J c=7.5C("9z"+a[1]+"!",[a[0]]);G(c===12&&7.K)c=D.L(7[0],d);I c===12&&a[1]?7.L(a[0]):c}N I 7.1P("9u"+a[1]+"!",[a[0],b]).P(H(){D.L(7,d,b)})},3b:H(a){I 7.P(H(){D.3b(7,a)})},3W:H(g,f,h,d){J e=7.K>1,3x;I 7.P(H(){G(!3x){3x=D.4h(g,7.2z);G(h)3x.9o()}J b=7;G(f&&D.Y(7,"1T")&&D.Y(3x[0],"4F"))b=7.3H("22")[0]||7.3U(7.2z.3h("22"));J c=D([]);D.P(3x,H(){J a=e?D(7).5y(M)[0]:7;G(D.Y(a,"1m"))c=c.1e(a);N{G(a.16==1)c=c.1e(D("1m",a).21());d.1k(b,a)}});c.P(6T)})}};D.17.5j.44=D.17;H 6T(i,a){G(a.4d)D.3Y({1a:a.4d,31:Q,1O:"1m"});N D.5u(a.1r||a.6O||a.4H||"");G(a.1d)a.1d.37(a)}H 1z(){I+2B 8J}D.1l=D.17.1l=H(){J b=19[0]||{},i=1,K=19.K,4x=Q,15;G(b.1q==8I){4x=b;b=19[1]||{};i=2}G(1j b!="49"&&1j b!="H")b={};G(K==i){b=7;--i}R(;i<K;i++)G((15=19[i])!=U)R(J c 1n 15){J a=b[c],2w=15[c];G(b===2w)6M;G(4x&&2w&&1j 2w=="49"&&!2w.16)b[c]=D.1l(4x,a||(2w.K!=U?[]:{}),2w);N G(2w!==12)b[c]=2w}I b};J E="4M"+1z(),6K=0,5r={},6G=/z-?5i|8B-?8A|1y|6B|8v-?1Z/i,3P=S.3P||{};D.1l({8u:H(a){1b.$=3m$;G(a)1b.4M=w;I D},1D:H(a){I!!a&&1j a!="23"&&!a.Y&&a.1q!=2p&&/^[\\s[]?H/.11(a+"")},4n:H(a){I a.1C&&!a.1c||a.2j&&a.2z&&!a.2z.1c},5u:H(a){a=D.3k(a);G(a){J b=S.3H("6w")[0]||S.1C,1m=S.3h("1m");1m.O="1r/4t";G(D.14.1f)1m.1r=a;N 1m.3U(S.5F(a));b.39(1m,b.1x);b.37(1m)}},Y:H(b,a){I b.Y&&b.Y.2r()==a.2r()},1Y:{},L:H(c,d,b){c=c==1b?5r:c;J a=c[E];G(!a)a=c[E]=++6K;G(d&&!D.1Y[a])D.1Y[a]={};G(b!==12)D.1Y[a][d]=b;I d?D.1Y[a][d]:a},3b:H(c,b){c=c==1b?5r:c;J a=c[E];G(b){G(D.1Y[a]){2U D.1Y[a][b];b="";R(b 1n D.1Y[a])1X;G(!b)D.3b(c)}}N{1U{2U c[E]}1V(e){G(c.5l)c.5l(E)}2U D.1Y[a]}},P:H(d,a,c){J e,i=0,K=d.K;G(c){G(K==12){R(e 1n d)G(a.1w(d[e],c)===Q)1X}N R(;i<K;)G(a.1w(d[i++],c)===Q)1X}N{G(K==12){R(e 1n d)G(a.1k(d[e],e,d[e])===Q)1X}N R(J b=d[0];i<K&&a.1k(b,i,b)!==Q;b=d[++i]){}}I d},1i:H(b,a,c,i,d){G(D.1D(a))a=a.1k(b,i);I a&&a.1q==4L&&c=="2a"&&!6G.11(d)?a+"2X":a},1F:{1e:H(c,b){D.P((b||"").1R(/\\s+/),H(i,a){G(c.16==1&&!D.1F.3T(c.1F,a))c.1F+=(c.1F?" ":"")+a})},21:H(c,b){G(c.16==1)c.1F=b!=12?D.3C(c.1F.1R(/\\s+/),H(a){I!D.1F.3T(b,a)}).6s(" "):""},3T:H(b,a){I D.2L(a,(b.1F||b).6r().1R(/\\s+/))>-1}},6q:H(b,c,a){J e={};R(J d 1n c){e[d]=b.V[d];b.V[d]=c[d]}a.1k(b);R(J d 1n c)b.V[d]=e[d]},1g:H(d,e,c){G(e=="2h"||e=="1Z"){J b,3X={30:"5x",5g:"1G",18:"3I"},35=e=="2h"?["5e","6k"]:["5G","6i"];H 5b(){b=e=="2h"?d.8f:d.8c;J a=0,2C=0;D.P(35,H(){a+=3d(D.2a(d,"57"+7,M))||0;2C+=3d(D.2a(d,"2C"+7+"4b",M))||0});b-=29.83(a+2C)}G(D(d).3F(":4j"))5b();N D.6q(d,3X,5b);I 29.2f(0,b)}I D.2a(d,e,c)},2a:H(f,l,k){J e,V=f.V;H 3E(b){G(!D.14.2k)I Q;J a=3P.54(b,U);I!a||a.52("3E")==""}G(l=="1y"&&D.14.1f){e=D.1K(V,"1y");I e==""?"1":e}G(D.14.2G&&l=="18"){J d=V.50;V.50="0 7Y 7W";V.50=d}G(l.1I(/4i/i))l=y;G(!k&&V&&V[l])e=V[l];N G(3P.54){G(l.1I(/4i/i))l="4i";l=l.1o(/([A-Z])/g,"-$1").3y();J c=3P.54(f,U);G(c&&!3E(f))e=c.52(l);N{J g=[],2E=[],a=f,i=0;R(;a&&3E(a);a=a.1d)2E.6h(a);R(;i<2E.K;i++)G(3E(2E[i])){g[i]=2E[i].V.18;2E[i].V.18="3I"}e=l=="18"&&g[2E.K-1]!=U?"2F":(c&&c.52(l))||"";R(i=0;i<g.K;i++)G(g[i]!=U)2E[i].V.18=g[i]}G(l=="1y"&&e=="")e="1"}N G(f.4g){J h=l.1o(/\\-(\\w)/g,H(a,b){I b.2r()});e=f.4g[l]||f.4g[h];G(!/^\\d+(2X)?$/i.11(e)&&/^\\d/.11(e)){J j=V.1A,66=f.65.1A;f.65.1A=f.4g.1A;V.1A=e||0;e=V.aM+"2X";V.1A=j;f.65.1A=66}}I e},4h:H(l,h){J k=[];h=h||S;G(1j h.3h==\'12\')h=h.2z||h[0]&&h[0].2z||S;D.P(l,H(i,d){G(!d)I;G(d.1q==4L)d+=\'\';G(1j d=="23"){d=d.1o(/(<(\\w+)[^>]*?)\\/>/g,H(b,a,c){I c.1I(/^(aK|4f|7E|aG|4T|7A|aB|3n|az|ay|av)$/i)?b:a+"></"+c+">"});J f=D.3k(d).3y(),1v=h.3h("1v");J e=!f.1h("<au")&&[1,"<2A 7w=\'7w\'>","</2A>"]||!f.1h("<ar")&&[1,"<7v>","</7v>"]||f.1I(/^<(aq|22|am|ak|ai)/)&&[1,"<1T>","</1T>"]||!f.1h("<4F")&&[2,"<1T><22>","</22></1T>"]||(!f.1h("<af")||!f.1h("<ad"))&&[3,"<1T><22><4F>","</4F></22></1T>"]||!f.1h("<7E")&&[2,"<1T><22></22><7q>","</7q></1T>"]||D.14.1f&&[1,"1v<1v>","</1v>"]||[0,"",""];1v.4H=e[1]+d+e[2];1B(e[0]--)1v=1v.5T;G(D.14.1f){J g=!f.1h("<1T")&&f.1h("<22")<0?1v.1x&&1v.1x.3t:e[1]=="<1T>"&&f.1h("<22")<0?1v.3t:[];R(J j=g.K-1;j>=0;--j)G(D.Y(g[j],"22")&&!g[j].3t.K)g[j].1d.37(g[j]);G(/^\\s/.11(d))1v.39(h.5F(d.1I(/^\\s*/)[0]),1v.1x)}d=D.2d(1v.3t)}G(d.K===0&&(!D.Y(d,"3V")&&!D.Y(d,"2A")))I;G(d[0]==12||D.Y(d,"3V")||d.15)k.1p(d);N k=D.2R(k,d)});I k},1K:H(d,f,c){G(!d||d.16==3||d.16==8)I 12;J e=!D.4n(d),40=c!==12,1f=D.14.1f;f=e&&D.3X[f]||f;G(d.2j){J g=/5Q|4d|V/.11(f);G(f=="2W"&&D.14.2k)d.1d.64;G(f 1n d&&e&&!g){G(40){G(f=="O"&&D.Y(d,"4T")&&d.1d)7p"O a3 a1\'t 9V 9U";d[f]=c}G(D.Y(d,"3V")&&d.7i(f))I d.7i(f).76;I d[f]}G(1f&&e&&f=="V")I D.1K(d.V,"9T",c);G(40)d.9Q(f,""+c);J h=1f&&e&&g?d.4G(f,2):d.4G(f);I h===U?12:h}G(1f&&f=="1y"){G(40){d.6B=1;d.1E=(d.1E||"").1o(/7f\\([^)]*\\)/,"")+(3r(c)+\'\'=="9L"?"":"7f(1y="+c*7a+")")}I d.1E&&d.1E.1h("1y=")>=0?(3d(d.1E.1I(/1y=([^)]*)/)[1])/7a)+\'\':""}f=f.1o(/-([a-z])/9H,H(a,b){I b.2r()});G(40)d[f]=c;I d[f]},3k:H(a){I(a||"").1o(/^\\s+|\\s+$/g,"")},2d:H(b){J a=[];G(b!=U){J i=b.K;G(i==U||b.1R||b.4I||b.1k)a[0]=b;N 1B(i)a[--i]=b[i]}I a},2L:H(b,a){R(J i=0,K=a.K;i<K;i++)G(a[i]===b)I i;I-1},2R:H(a,b){J i=0,T,2S=a.K;G(D.14.1f){1B(T=b[i++])G(T.16!=8)a[2S++]=T}N 1B(T=b[i++])a[2S++]=T;I a},4r:H(a){J c=[],2o={};1U{R(J i=0,K=a.K;i<K;i++){J b=D.L(a[i]);G(!2o[b]){2o[b]=M;c.1p(a[i])}}}1V(e){c=a}I c},3C:H(c,a,d){J b=[];R(J i=0,K=c.K;i<K;i++)G(!d!=!a(c[i],i))b.1p(c[i]);I b},2l:H(d,a){J c=[];R(J i=0,K=d.K;i<K;i++){J b=a(d[i],i);G(b!=U)c[c.K]=b}I c.7d.1w([],c)}});J v=9B.9A.3y();D.14={5B:(v.1I(/.+(?:9y|9x|9w|9v)[\\/: ]([\\d.]+)/)||[])[1],2k:/75/.11(v),2G:/2G/.11(v),1f:/1f/.11(v)&&!/2G/.11(v),42:/42/.11(v)&&!/(9s|75)/.11(v)};J y=D.14.1f?"7o":"72";D.1l({71:!D.14.1f||S.70=="6Z",3X:{"R":"9n","9k":"1F","4i":y,72:y,7o:y,9h:"9f",9e:"9d",9b:"99"}});D.P({6W:H(a){I a.1d},97:H(a){I D.4S(a,"1d")},95:H(a){I D.3a(a,2,"2H")},91:H(a){I D.3a(a,2,"4l")},8Z:H(a){I D.4S(a,"2H")},8X:H(a){I D.4S(a,"4l")},8W:H(a){I D.5v(a.1d.1x,a)},8V:H(a){I D.5v(a.1x)},6Q:H(a){I D.Y(a,"8U")?a.8T||a.8S.S:D.2d(a.3t)}},H(c,d){D.17[c]=H(b){J a=D.2l(7,d);G(b&&1j b=="23")a=D.3g(b,a);I 7.2I(D.4r(a))}});D.P({6P:"3v",8Q:"6F",39:"6E",8P:"5q",8O:"7b"},H(c,b){D.17[c]=H(){J a=19;I 7.P(H(){R(J i=0,K=a.K;i<K;i++)D(a[i])[b](7)})}});D.P({8N:H(a){D.1K(7,a,"");G(7.16==1)7.5l(a)},8M:H(a){D.1F.1e(7,a)},8L:H(a){D.1F.21(7,a)},8K:H(a){D.1F[D.1F.3T(7,a)?"21":"1e"](7,a)},21:H(a){G(!a||D.1E(a,[7]).r.K){D("*",7).1e(7).P(H(){D.W.21(7);D.3b(7)});G(7.1d)7.1d.37(7)}},4E:H(){D(">*",7).21();1B(7.1x)7.37(7.1x)}},H(a,b){D.17[a]=H(){I 7.P(b,19)}});D.P(["6N","4b"],H(i,c){J b=c.3y();D.17[b]=H(a){I 7[0]==1b?D.14.2G&&S.1c["5t"+c]||D.14.2k&&1b["5s"+c]||S.70=="6Z"&&S.1C["5t"+c]||S.1c["5t"+c]:7[0]==S?29.2f(29.2f(S.1c["4y"+c],S.1C["4y"+c]),29.2f(S.1c["2i"+c],S.1C["2i"+c])):a==12?(7.K?D.1g(7[0],b):U):7.1g(b,a.1q==56?a:a+"2X")}});H 25(a,b){I a[0]&&3r(D.2a(a[0],b,M),10)||0}J C=D.14.2k&&3r(D.14.5B)<8H?"(?:[\\\\w*3m-]|\\\\\\\\.)":"(?:[\\\\w\\8F-\\8E*3m-]|\\\\\\\\.)",6L=2B 4v("^>\\\\s*("+C+"+)"),6J=2B 4v("^("+C+"+)(#)("+C+"+)"),6I=2B 4v("^([#.]?)("+C+"*)");D.1l({6H:{"":H(a,i,m){I m[2]=="*"||D.Y(a,m[2])},"#":H(a,i,m){I a.4G("2v")==m[2]},":":{8D:H(a,i,m){I i<m[3]-0},8C:H(a,i,m){I i>m[3]-0},3a:H(a,i,m){I m[3]-0==i},79:H(a,i,m){I m[3]-0==i},3o:H(a,i){I i==0},3S:H(a,i,m,r){I i==r.K-1},6D:H(a,i){I i%2==0},6C:H(a,i){I i%2},"3o-4u":H(a){I a.1d.3H("*")[0]==a},"3S-4u":H(a){I D.3a(a.1d.5T,1,"4l")==a},"8z-4u":H(a){I!D.3a(a.1d.5T,2,"4l")},6W:H(a){I a.1x},4E:H(a){I!a.1x},8y:H(a,i,m){I(a.6O||a.8x||D(a).1r()||"").1h(m[3])>=0},4j:H(a){I"1G"!=a.O&&D.1g(a,"18")!="2F"&&D.1g(a,"5g")!="1G"},1G:H(a){I"1G"==a.O||D.1g(a,"18")=="2F"||D.1g(a,"5g")=="1G"},8w:H(a){I!a.3R},3R:H(a){I a.3R},4J:H(a){I a.4J},2W:H(a){I a.2W||D.1K(a,"2W")},1r:H(a){I"1r"==a.O},5O:H(a){I"5O"==a.O},5L:H(a){I"5L"==a.O},5p:H(a){I"5p"==a.O},3Q:H(a){I"3Q"==a.O},5o:H(a){I"5o"==a.O},6A:H(a){I"6A"==a.O},6z:H(a){I"6z"==a.O},2s:H(a){I"2s"==a.O||D.Y(a,"2s")},4T:H(a){I/4T|2A|6y|2s/i.11(a.Y)},3T:H(a,i,m){I D.2q(m[3],a).K},8t:H(a){I/h\\d/i.11(a.Y)},8s:H(a){I D.3C(D.3O,H(b){I a==b.T}).K}}},6x:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,2B 4v("^([:.#]*)("+C+"+)")],3g:H(a,c,b){J d,1t=[];1B(a&&a!=d){d=a;J f=D.1E(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1t=b?c=f.r:D.2R(1t,f.r)}I 1t},2q:H(t,o){G(1j t!="23")I[t];G(o&&o.16!=1&&o.16!=9)I[];o=o||S;J d=[o],2o=[],3S,Y;1B(t&&3S!=t){J r=[];3S=t;t=D.3k(t);J l=Q,3j=6L,m=3j.2D(t);G(m){Y=m[1].2r();R(J i=0;d[i];i++)R(J c=d[i].1x;c;c=c.2H)G(c.16==1&&(Y=="*"||c.Y.2r()==Y))r.1p(c);d=r;t=t.1o(3j,"");G(t.1h(" ")==0)6M;l=M}N{3j=/^([>+~])\\s*(\\w*)/i;G((m=3j.2D(t))!=U){r=[];J k={};Y=m[2].2r();m=m[1];R(J j=0,3i=d.K;j<3i;j++){J n=m=="~"||m=="+"?d[j].2H:d[j].1x;R(;n;n=n.2H)G(n.16==1){J g=D.L(n);G(m=="~"&&k[g])1X;G(!Y||n.Y.2r()==Y){G(m=="~")k[g]=M;r.1p(n)}G(m=="+")1X}}d=r;t=D.3k(t.1o(3j,""));l=M}}G(t&&!l){G(!t.1h(",")){G(o==d[0])d.4s();2o=D.2R(2o,d);r=d=[o];t=" "+t.6v(1,t.K)}N{J h=6J;J m=h.2D(t);G(m){m=[0,m[2],m[3],m[1]]}N{h=6I;m=h.2D(t)}m[2]=m[2].1o(/\\\\/g,"");J f=d[d.K-1];G(m[1]=="#"&&f&&f.61&&!D.4n(f)){J p=f.61(m[2]);G((D.14.1f||D.14.2G)&&p&&1j p.2v=="23"&&p.2v!=m[2])p=D(\'[@2v="\'+m[2]+\'"]\',f)[0];d=r=p&&(!m[3]||D.Y(p,m[3]))?[p]:[]}N{R(J i=0;d[i];i++){J a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];G(a=="*"&&d[i].Y.3y()=="49")a="3n";r=D.2R(r,d[i].3H(a))}G(m[1]==".")r=D.5m(r,m[2]);G(m[1]=="#"){J e=[];R(J i=0;r[i];i++)G(r[i].4G("2v")==m[2]){e=[r[i]];1X}r=e}d=r}t=t.1o(h,"")}}G(t){J b=D.1E(t,r);d=r=b.r;t=D.3k(b.t)}}G(t)d=[];G(d&&o==d[0])d.4s();2o=D.2R(2o,d);I 2o},5m:H(r,m,a){m=" "+m+" ";J c=[];R(J i=0;r[i];i++){J b=(" "+r[i].1F+" ").1h(m)>=0;G(!a&&b||a&&!b)c.1p(r[i])}I c},1E:H(t,r,h){J d;1B(t&&t!=d){d=t;J p=D.6x,m;R(J i=0;p[i];i++){m=p[i].2D(t);G(m){t=t.8r(m[0].K);m[2]=m[2].1o(/\\\\/g,"");1X}}G(!m)1X;G(m[1]==":"&&m[2]=="4Y")r=62.11(m[3])?D.1E(m[3],r,M).r:D(r).4Y(m[3]);N G(m[1]==".")r=D.5m(r,m[2],h);N G(m[1]=="["){J g=[],O=m[3];R(J i=0,3i=r.K;i<3i;i++){J a=r[i],z=a[D.3X[m[2]]||m[2]];G(z==U||/5Q|4d|2W/.11(m[2]))z=D.1K(a,m[2])||\'\';G((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1h(m[5])||O=="$="&&z.6v(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1h(m[5])>=0)^h)g.1p(a)}r=g}N G(m[1]==":"&&m[2]=="3a-4u"){J e={},g=[],11=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2D(m[3]=="6D"&&"2n"||m[3]=="6C"&&"2n+1"||!/\\D/.11(m[3])&&"8q+"+m[3]||m[3]),3o=(11[1]+(11[2]||1))-0,d=11[3]-0;R(J i=0,3i=r.K;i<3i;i++){J j=r[i],1d=j.1d,2v=D.L(1d);G(!e[2v]){J c=1;R(J n=1d.1x;n;n=n.2H)G(n.16==1)n.4q=c++;e[2v]=M}J b=Q;G(3o==0){G(j.4q==d)b=M}N G((j.4q-d)%3o==0&&(j.4q-d)/3o>=0)b=M;G(b^h)g.1p(j)}r=g}N{J f=D.6H[m[1]];G(1j f=="49")f=f[m[2]];G(1j f=="23")f=6u("Q||H(a,i){I "+f+";}");r=D.3C(r,H(a,i){I f(a,i,m,r)},h)}}I{r:r,t:t}},4S:H(b,c){J a=[],1t=b[c];1B(1t&&1t!=S){G(1t.16==1)a.1p(1t);1t=1t[c]}I a},3a:H(a,e,c,b){e=e||1;J d=0;R(;a;a=a[c])G(a.16==1&&++d==e)1X;I a},5v:H(n,a){J r=[];R(;n;n=n.2H){G(n.16==1&&n!=a)r.1p(n)}I r}});D.W={1e:H(f,i,g,e){G(f.16==3||f.16==8)I;G(D.14.1f&&f.4I)f=1b;G(!g.24)g.24=7.24++;G(e!=12){J h=g;g=7.3M(h,H(){I h.1w(7,19)});g.L=e}J j=D.L(f,"3w")||D.L(f,"3w",{}),1H=D.L(f,"1H")||D.L(f,"1H",H(){G(1j D!="12"&&!D.W.5k)I D.W.1H.1w(19.3L.T,19)});1H.T=f;D.P(i.1R(/\\s+/),H(c,b){J a=b.1R(".");b=a[0];g.O=a[1];J d=j[b];G(!d){d=j[b]={};G(!D.W.2t[b]||D.W.2t[b].4p.1k(f)===Q){G(f.3K)f.3K(b,1H,Q);N G(f.6t)f.6t("4o"+b,1H)}}d[g.24]=g;D.W.26[b]=M});f=U},24:1,26:{},21:H(e,h,f){G(e.16==3||e.16==8)I;J i=D.L(e,"3w"),1L,5i;G(i){G(h==12||(1j h=="23"&&h.8p(0)=="."))R(J g 1n i)7.21(e,g+(h||""));N{G(h.O){f=h.2y;h=h.O}D.P(h.1R(/\\s+/),H(b,a){J c=a.1R(".");a=c[0];G(i[a]){G(f)2U i[a][f.24];N R(f 1n i[a])G(!c[1]||i[a][f].O==c[1])2U i[a][f];R(1L 1n i[a])1X;G(!1L){G(!D.W.2t[a]||D.W.2t[a].4A.1k(e)===Q){G(e.6p)e.6p(a,D.L(e,"1H"),Q);N G(e.6n)e.6n("4o"+a,D.L(e,"1H"))}1L=U;2U i[a]}}})}R(1L 1n i)1X;G(!1L){J d=D.L(e,"1H");G(d)d.T=U;D.3b(e,"3w");D.3b(e,"1H")}}},1P:H(h,c,f,g,i){c=D.2d(c);G(h.1h("!")>=0){h=h.3s(0,-1);J a=M}G(!f){G(7.26[h])D("*").1e([1b,S]).1P(h,c)}N{G(f.16==3||f.16==8)I 12;J b,1L,17=D.1D(f[h]||U),W=!c[0]||!c[0].32;G(W){c.6h({O:h,2J:f,32:H(){},3J:H(){},4C:1z()});c[0][E]=M}c[0].O=h;G(a)c[0].6m=M;J d=D.L(f,"1H");G(d)b=d.1w(f,c);G((!17||(D.Y(f,\'a\')&&h=="4V"))&&f["4o"+h]&&f["4o"+h].1w(f,c)===Q)b=Q;G(W)c.4s();G(i&&D.1D(i)){1L=i.1w(f,b==U?c:c.7d(b));G(1L!==12)b=1L}G(17&&g!==Q&&b!==Q&&!(D.Y(f,\'a\')&&h=="4V")){7.5k=M;1U{f[h]()}1V(e){}}7.5k=Q}I b},1H:H(b){J a,1L,38,5f,4m;b=19[0]=D.W.6l(b||1b.W);38=b.O.1R(".");b.O=38[0];38=38[1];5f=!38&&!b.6m;4m=(D.L(7,"3w")||{})[b.O];R(J j 1n 4m){J c=4m[j];G(5f||c.O==38){b.2y=c;b.L=c.L;1L=c.1w(7,19);G(a!==Q)a=1L;G(1L===Q){b.32();b.3J()}}}I a},6l:H(b){G(b[E]==M)I b;J d=b;b={8o:d};J c="8n 8m 8l 8k 2s 8j 47 5d 6j 5E 8i L 8h 8g 4K 2y 5a 59 8e 8b 58 6f 8a 88 4k 87 86 84 6d 2J 4C 6c O 82 81 35".1R(" ");R(J i=c.K;i;i--)b[c[i]]=d[c[i]];b[E]=M;b.32=H(){G(d.32)d.32();d.80=Q};b.3J=H(){G(d.3J)d.3J();d.7Z=M};b.4C=b.4C||1z();G(!b.2J)b.2J=b.6d||S;G(b.2J.16==3)b.2J=b.2J.1d;G(!b.4k&&b.4K)b.4k=b.4K==b.2J?b.6c:b.4K;G(b.58==U&&b.5d!=U){J a=S.1C,1c=S.1c;b.58=b.5d+(a&&a.2e||1c&&1c.2e||0)-(a.6b||0);b.6f=b.6j+(a&&a.2c||1c&&1c.2c||0)-(a.6a||0)}G(!b.35&&((b.47||b.47===0)?b.47:b.5a))b.35=b.47||b.5a;G(!b.59&&b.5E)b.59=b.5E;G(!b.35&&b.2s)b.35=(b.2s&1?1:(b.2s&2?3:(b.2s&4?2:0)));I b},3M:H(a,b){b.24=a.24=a.24||b.24||7.24++;I b},2t:{27:{4p:H(){55();I},4A:H(){I}},3D:{4p:H(){G(D.14.1f)I Q;D(7).2O("53",D.W.2t.3D.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("53",D.W.2t.3D.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3D";I D.W.1H.1w(7,19)}},3N:{4p:H(){G(D.14.1f)I Q;D(7).2O("51",D.W.2t.3N.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("51",D.W.2t.3N.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3N";I D.W.1H.1w(7,19)}}}};D.17.1l({2O:H(c,a,b){I c=="4X"?7.2V(c,a,b):7.P(H(){D.W.1e(7,c,b||a,b&&a)})},2V:H(d,b,c){J e=D.W.3M(c||b,H(a){D(7).4e(a,e);I(c||b).1w(7,19)});I 7.P(H(){D.W.1e(7,d,e,c&&b)})},4e:H(a,b){I 7.P(H(){D.W.21(7,a,b)})},1P:H(c,a,b){I 7.P(H(){D.W.1P(c,a,7,M,b)})},5C:H(c,a,b){I 7[0]&&D.W.1P(c,a,7[0],Q,b)},2m:H(b){J c=19,i=1;1B(i<c.K)D.W.3M(b,c[i++]);I 7.4V(D.W.3M(b,H(a){7.4Z=(7.4Z||0)%i;a.32();I c[7.4Z++].1w(7,19)||Q}))},7X:H(a,b){I 7.2O(\'3D\',a).2O(\'3N\',b)},27:H(a){55();G(D.2Q)a.1k(S,D);N D.3A.1p(H(){I a.1k(7,D)});I 7}});D.1l({2Q:Q,3A:[],27:H(){G(!D.2Q){D.2Q=M;G(D.3A){D.P(D.3A,H(){7.1k(S)});D.3A=U}D(S).5C("27")}}});J x=Q;H 55(){G(x)I;x=M;G(S.3K&&!D.14.2G)S.3K("69",D.27,Q);G(D.14.1f&&1b==1S)(H(){G(D.2Q)I;1U{S.1C.7V("1A")}1V(3e){3B(19.3L,0);I}D.27()})();G(D.14.2G)S.3K("69",H(){G(D.2Q)I;R(J i=0;i<S.4W.K;i++)G(S.4W[i].3R){3B(19.3L,0);I}D.27()},Q);G(D.14.2k){J a;(H(){G(D.2Q)I;G(S.3f!="68"&&S.3f!="1J"){3B(19.3L,0);I}G(a===12)a=D("V, 7A[7U=7S]").K;G(S.4W.K!=a){3B(19.3L,0);I}D.27()})()}D.W.1e(1b,"43",D.27)}D.P(("7R,7Q,43,85,4y,4X,4V,7P,"+"7O,7N,89,53,51,7M,2A,"+"5o,7L,7K,8d,3e").1R(","),H(i,b){D.17[b]=H(a){I a?7.2O(b,a):7.1P(b)}});J F=H(a,c){J b=a.4k;1B(b&&b!=c)1U{b=b.1d}1V(3e){b=c}I b==c};D(1b).2O("4X",H(){D("*").1e(S).4e()});D.17.1l({67:D.17.43,43:H(g,d,c){G(1j g!=\'23\')I 7.67(g);J e=g.1h(" ");G(e>=0){J i=g.3s(e,g.K);g=g.3s(0,e)}c=c||H(){};J f="2P";G(d)G(D.1D(d)){c=d;d=U}N{d=D.3n(d);f="6g"}J h=7;D.3Y({1a:g,O:f,1O:"2K",L:d,1J:H(a,b){G(b=="1W"||b=="7J")h.2K(i?D("<1v/>").3v(a.4U.1o(/<1m(.|\\s)*?\\/1m>/g,"")).2q(i):a.4U);h.P(c,[a.4U,b,a])}});I 7},aL:H(){I D.3n(7.7I())},7I:H(){I 7.2l(H(){I D.Y(7,"3V")?D.2d(7.aH):7}).1E(H(){I 7.34&&!7.3R&&(7.4J||/2A|6y/i.11(7.Y)||/1r|1G|3Q/i.11(7.O))}).2l(H(i,c){J b=D(7).6e();I b==U?U:b.1q==2p?D.2l(b,H(a,i){I{34:c.34,2x:a}}):{34:c.34,2x:b}}).3p()}});D.P("7H,7G,7F,7D,7C,7B".1R(","),H(i,o){D.17[o]=H(f){I 7.2O(o,f)}});J B=1z();D.1l({3p:H(d,b,a,c){G(D.1D(b)){a=b;b=U}I D.3Y({O:"2P",1a:d,L:b,1W:a,1O:c})},aE:H(b,a){I D.3p(b,U,a,"1m")},aD:H(c,b,a){I D.3p(c,b,a,"3z")},aC:H(d,b,a,c){G(D.1D(b)){a=b;b={}}I D.3Y({O:"6g",1a:d,L:b,1W:a,1O:c})},aA:H(a){D.1l(D.60,a)},60:{1a:5Z.5Q,26:M,O:"2P",2T:0,7z:"4R/x-ax-3V-aw",7x:M,31:M,L:U,5Y:U,3Q:U,4Q:{2N:"4R/2N, 1r/2N",2K:"1r/2K",1m:"1r/4t, 4R/4t",3z:"4R/3z, 1r/4t",1r:"1r/as",4w:"*/*"}},4z:{},3Y:H(s){s=D.1l(M,s,D.1l(M,{},D.60,s));J g,2Z=/=\\?(&|$)/g,1u,L,O=s.O.2r();G(s.L&&s.7x&&1j s.L!="23")s.L=D.3n(s.L);G(s.1O=="4P"){G(O=="2P"){G(!s.1a.1I(2Z))s.1a+=(s.1a.1I(/\\?/)?"&":"?")+(s.4P||"7u")+"=?"}N G(!s.L||!s.L.1I(2Z))s.L=(s.L?s.L+"&":"")+(s.4P||"7u")+"=?";s.1O="3z"}G(s.1O=="3z"&&(s.L&&s.L.1I(2Z)||s.1a.1I(2Z))){g="4P"+B++;G(s.L)s.L=(s.L+"").1o(2Z,"="+g+"$1");s.1a=s.1a.1o(2Z,"="+g+"$1");s.1O="1m";1b[g]=H(a){L=a;1W();1J();1b[g]=12;1U{2U 1b[g]}1V(e){}G(i)i.37(h)}}G(s.1O=="1m"&&s.1Y==U)s.1Y=Q;G(s.1Y===Q&&O=="2P"){J j=1z();J k=s.1a.1o(/(\\?|&)3m=.*?(&|$)/,"$ap="+j+"$2");s.1a=k+((k==s.1a)?(s.1a.1I(/\\?/)?"&":"?")+"3m="+j:"")}G(s.L&&O=="2P"){s.1a+=(s.1a.1I(/\\?/)?"&":"?")+s.L;s.L=U}G(s.26&&!D.4O++)D.W.1P("7H");J n=/^(?:\\w+:)?\\/\\/([^\\/?#]+)/;G(s.1O=="1m"&&O=="2P"&&n.11(s.1a)&&n.2D(s.1a)[1]!=5Z.al){J i=S.3H("6w")[0];J h=S.3h("1m");h.4d=s.1a;G(s.7t)h.aj=s.7t;G(!g){J l=Q;h.ah=h.ag=H(){G(!l&&(!7.3f||7.3f=="68"||7.3f=="1J")){l=M;1W();1J();i.37(h)}}}i.3U(h);I 12}J m=Q;J c=1b.7s?2B 7s("ae.ac"):2B 7r();G(s.5Y)c.6R(O,s.1a,s.31,s.5Y,s.3Q);N c.6R(O,s.1a,s.31);1U{G(s.L)c.4B("ab-aa",s.7z);G(s.5S)c.4B("a9-5R-a8",D.4z[s.1a]||"a7, a6 a5 a4 5N:5N:5N a2");c.4B("X-9Z-9Y","7r");c.4B("9W",s.1O&&s.4Q[s.1O]?s.4Q[s.1O]+", */*":s.4Q.4w)}1V(e){}G(s.7m&&s.7m(c,s)===Q){s.26&&D.4O--;c.7l();I Q}G(s.26)D.W.1P("7B",[c,s]);J d=H(a){G(!m&&c&&(c.3f==4||a=="2T")){m=M;G(f){7k(f);f=U}1u=a=="2T"&&"2T"||!D.7j(c)&&"3e"||s.5S&&D.7h(c,s.1a)&&"7J"||"1W";G(1u=="1W"){1U{L=D.6X(c,s.1O,s.9S)}1V(e){1u="5J"}}G(1u=="1W"){J b;1U{b=c.5I("7g-5R")}1V(e){}G(s.5S&&b)D.4z[s.1a]=b;G(!g)1W()}N D.5H(s,c,1u);1J();G(s.31)c=U}};G(s.31){J f=4I(d,13);G(s.2T>0)3B(H(){G(c){c.7l();G(!m)d("2T")}},s.2T)}1U{c.9P(s.L)}1V(e){D.5H(s,c,U,e)}G(!s.31)d();H 1W(){G(s.1W)s.1W(L,1u);G(s.26)D.W.1P("7C",[c,s])}H 1J(){G(s.1J)s.1J(c,1u);G(s.26)D.W.1P("7F",[c,s]);G(s.26&&!--D.4O)D.W.1P("7G")}I c},5H:H(s,a,b,e){G(s.3e)s.3e(a,b,e);G(s.26)D.W.1P("7D",[a,s,e])},4O:0,7j:H(a){1U{I!a.1u&&5Z.9O=="5p:"||(a.1u>=7e&&a.1u<9N)||a.1u==7c||a.1u==9K||D.14.2k&&a.1u==12}1V(e){}I Q},7h:H(a,c){1U{J b=a.5I("7g-5R");I a.1u==7c||b==D.4z[c]||D.14.2k&&a.1u==12}1V(e){}I Q},6X:H(a,c,b){J d=a.5I("9J-O"),2N=c=="2N"||!c&&d&&d.1h("2N")>=0,L=2N?a.9I:a.4U;G(2N&&L.1C.2j=="5J")7p"5J";G(b)L=b(L,c);G(c=="1m")D.5u(L);G(c=="3z")L=6u("("+L+")");I L},3n:H(a){J s=[];G(a.1q==2p||a.5w)D.P(a,H(){s.1p(3u(7.34)+"="+3u(7.2x))});N R(J j 1n a)G(a[j]&&a[j].1q==2p)D.P(a[j],H(){s.1p(3u(j)+"="+3u(7))});N s.1p(3u(j)+"="+3u(D.1D(a[j])?a[j]():a[j]));I s.6s("&").1o(/%20/g,"+")}});D.17.1l({1N:H(c,b){I c?7.2g({1Z:"1N",2h:"1N",1y:"1N"},c,b):7.1E(":1G").P(H(){7.V.18=7.5D||"";G(D.1g(7,"18")=="2F"){J a=D("<"+7.2j+" />").6P("1c");7.V.18=a.1g("18");G(7.V.18=="2F")7.V.18="3I";a.21()}}).3l()},1M:H(b,a){I b?7.2g({1Z:"1M",2h:"1M",1y:"1M"},b,a):7.1E(":4j").P(H(){7.5D=7.5D||D.1g(7,"18");7.V.18="2F"}).3l()},78:D.17.2m,2m:H(a,b){I D.1D(a)&&D.1D(b)?7.78.1w(7,19):a?7.2g({1Z:"2m",2h:"2m",1y:"2m"},a,b):7.P(H(){D(7)[D(7).3F(":1G")?"1N":"1M"]()})},9G:H(b,a){I 7.2g({1Z:"1N"},b,a)},9F:H(b,a){I 7.2g({1Z:"1M"},b,a)},9E:H(b,a){I 7.2g({1Z:"2m"},b,a)},9D:H(b,a){I 7.2g({1y:"1N"},b,a)},9M:H(b,a){I 7.2g({1y:"1M"},b,a)},9C:H(c,a,b){I 7.2g({1y:a},c,b)},2g:H(k,j,i,g){J h=D.77(j,i,g);I 7[h.36===Q?"P":"36"](H(){G(7.16!=1)I Q;J f=D.1l({},h),p,1G=D(7).3F(":1G"),46=7;R(p 1n k){G(k[p]=="1M"&&1G||k[p]=="1N"&&!1G)I f.1J.1k(7);G(p=="1Z"||p=="2h"){f.18=D.1g(7,"18");f.33=7.V.33}}G(f.33!=U)7.V.33="1G";f.45=D.1l({},k);D.P(k,H(c,a){J e=2B D.28(46,f,c);G(/2m|1N|1M/.11(a))e[a=="2m"?1G?"1N":"1M":a](k);N{J b=a.6r().1I(/^([+-]=)?([\\d+-.]+)(.*)$/),2b=e.1t(M)||0;G(b){J d=3d(b[2]),2M=b[3]||"2X";G(2M!="2X"){46.V[c]=(d||1)+2M;2b=((d||1)/e.1t(M))*2b;46.V[c]=2b+2M}G(b[1])d=((b[1]=="-="?-1:1)*d)+2b;e.3G(2b,d,2M)}N e.3G(2b,a,"")}});I M})},36:H(a,b){G(D.1D(a)||(a&&a.1q==2p)){b=a;a="28"}G(!a||(1j a=="23"&&!b))I A(7[0],a);I 7.P(H(){G(b.1q==2p)A(7,a,b);N{A(7,a).1p(b);G(A(7,a).K==1)b.1k(7)}})},9X:H(b,c){J a=D.3O;G(b)7.36([]);7.P(H(){R(J i=a.K-1;i>=0;i--)G(a[i].T==7){G(c)a[i](M);a.7n(i,1)}});G(!c)7.5A();I 7}});J A=H(b,c,a){G(b){c=c||"28";J q=D.L(b,c+"36");G(!q||a)q=D.L(b,c+"36",D.2d(a))}I q};D.17.5A=H(a){a=a||"28";I 7.P(H(){J q=A(7,a);q.4s();G(q.K)q[0].1k(7)})};D.1l({77:H(b,a,c){J d=b&&b.1q==a0?b:{1J:c||!c&&a||D.1D(b)&&b,2u:b,41:c&&a||a&&a.1q!=9t&&a};d.2u=(d.2u&&d.2u.1q==4L?d.2u:D.28.5K[d.2u])||D.28.5K.74;d.5M=d.1J;d.1J=H(){G(d.36!==Q)D(7).5A();G(D.1D(d.5M))d.5M.1k(7)};I d},41:{73:H(p,n,b,a){I b+a*p},5P:H(p,n,b,a){I((-29.9r(p*29.9q)/2)+0.5)*a+b}},3O:[],48:U,28:H(b,c,a){7.15=c;7.T=b;7.1i=a;G(!c.3Z)c.3Z={}}});D.28.44={4D:H(){G(7.15.2Y)7.15.2Y.1k(7.T,7.1z,7);(D.28.2Y[7.1i]||D.28.2Y.4w)(7);G(7.1i=="1Z"||7.1i=="2h")7.T.V.18="3I"},1t:H(a){G(7.T[7.1i]!=U&&7.T.V[7.1i]==U)I 7.T[7.1i];J r=3d(D.1g(7.T,7.1i,a));I r&&r>-9p?r:3d(D.2a(7.T,7.1i))||0},3G:H(c,b,d){7.5V=1z();7.2b=c;7.3l=b;7.2M=d||7.2M||"2X";7.1z=7.2b;7.2S=7.4N=0;7.4D();J e=7;H t(a){I e.2Y(a)}t.T=7.T;D.3O.1p(t);G(D.48==U){D.48=4I(H(){J a=D.3O;R(J i=0;i<a.K;i++)G(!a[i]())a.7n(i--,1);G(!a.K){7k(D.48);D.48=U}},13)}},1N:H(){7.15.3Z[7.1i]=D.1K(7.T.V,7.1i);7.15.1N=M;7.3G(0,7.1t());G(7.1i=="2h"||7.1i=="1Z")7.T.V[7.1i]="9m";D(7.T).1N()},1M:H(){7.15.3Z[7.1i]=D.1K(7.T.V,7.1i);7.15.1M=M;7.3G(7.1t(),0)},2Y:H(a){J t=1z();G(a||t>7.15.2u+7.5V){7.1z=7.3l;7.2S=7.4N=1;7.4D();7.15.45[7.1i]=M;J b=M;R(J i 1n 7.15.45)G(7.15.45[i]!==M)b=Q;G(b){G(7.15.18!=U){7.T.V.33=7.15.33;7.T.V.18=7.15.18;G(D.1g(7.T,"18")=="2F")7.T.V.18="3I"}G(7.15.1M)7.T.V.18="2F";G(7.15.1M||7.15.1N)R(J p 1n 7.15.45)D.1K(7.T.V,p,7.15.3Z[p])}G(b)7.15.1J.1k(7.T);I Q}N{J n=t-7.5V;7.4N=n/7.15.2u;7.2S=D.41[7.15.41||(D.41.5P?"5P":"73")](7.4N,n,0,1,7.15.2u);7.1z=7.2b+((7.3l-7.2b)*7.2S);7.4D()}I M}};D.1l(D.28,{5K:{9l:9j,9i:7e,74:9g},2Y:{2e:H(a){a.T.2e=a.1z},2c:H(a){a.T.2c=a.1z},1y:H(a){D.1K(a.T.V,"1y",a.1z)},4w:H(a){a.T.V[a.1i]=a.1z+a.2M}}});D.17.2i=H(){J b=0,1S=0,T=7[0],3q;G(T)ao(D.14){J d=T.1d,4a=T,1s=T.1s,1Q=T.2z,5U=2k&&3r(5B)<9c&&!/9a/i.11(v),1g=D.2a,3c=1g(T,"30")=="3c";G(T.7y){J c=T.7y();1e(c.1A+29.2f(1Q.1C.2e,1Q.1c.2e),c.1S+29.2f(1Q.1C.2c,1Q.1c.2c));1e(-1Q.1C.6b,-1Q.1C.6a)}N{1e(T.5X,T.5W);1B(1s){1e(1s.5X,1s.5W);G(42&&!/^t(98|d|h)$/i.11(1s.2j)||2k&&!5U)2C(1s);G(!3c&&1g(1s,"30")=="3c")3c=M;4a=/^1c$/i.11(1s.2j)?4a:1s;1s=1s.1s}1B(d&&d.2j&&!/^1c|2K$/i.11(d.2j)){G(!/^96|1T.*$/i.11(1g(d,"18")))1e(-d.2e,-d.2c);G(42&&1g(d,"33")!="4j")2C(d);d=d.1d}G((5U&&(3c||1g(4a,"30")=="5x"))||(42&&1g(4a,"30")!="5x"))1e(-1Q.1c.5X,-1Q.1c.5W);G(3c)1e(29.2f(1Q.1C.2e,1Q.1c.2e),29.2f(1Q.1C.2c,1Q.1c.2c))}3q={1S:1S,1A:b}}H 2C(a){1e(D.2a(a,"6V",M),D.2a(a,"6U",M))}H 1e(l,t){b+=3r(l,10)||0;1S+=3r(t,10)||0}I 3q};D.17.1l({30:H(){J a=0,1S=0,3q;G(7[0]){J b=7.1s(),2i=7.2i(),4c=/^1c|2K$/i.11(b[0].2j)?{1S:0,1A:0}:b.2i();2i.1S-=25(7,\'94\');2i.1A-=25(7,\'aF\');4c.1S+=25(b,\'6U\');4c.1A+=25(b,\'6V\');3q={1S:2i.1S-4c.1S,1A:2i.1A-4c.1A}}I 3q},1s:H(){J a=7[0].1s;1B(a&&(!/^1c|2K$/i.11(a.2j)&&D.1g(a,\'30\')==\'93\'))a=a.1s;I D(a)}});D.P([\'5e\',\'5G\'],H(i,b){J c=\'4y\'+b;D.17[c]=H(a){G(!7[0])I;I a!=12?7.P(H(){7==1b||7==S?1b.92(!i?a:D(1b).2e(),i?a:D(1b).2c()):7[c]=a}):7[0]==1b||7[0]==S?46[i?\'aI\':\'aJ\']||D.71&&S.1C[c]||S.1c[c]:7[0][c]}});D.P(["6N","4b"],H(i,b){J c=i?"5e":"5G",4f=i?"6k":"6i";D.17["5s"+b]=H(){I 7[b.3y()]()+25(7,"57"+c)+25(7,"57"+4f)};D.17["90"+b]=H(a){I 7["5s"+b]()+25(7,"2C"+c+"4b")+25(7,"2C"+4f+"4b")+(a?25(7,"6S"+c)+25(7,"6S"+4f):0)}})})();',62,669,'|||||||this|||||||||||||||||||||||||||||||||||if|function|return|var|length|data|true|else|type|each|false|for|document|elem|null|style|event||nodeName|||test|undefined||browser|options|nodeType|fn|display|arguments|url|window|body|parentNode|add|msie|css|indexOf|prop|typeof|call|extend|script|in|replace|push|constructor|text|offsetParent|cur|status|div|apply|firstChild|opacity|now|left|while|documentElement|isFunction|filter|className|hidden|handle|match|complete|attr|ret|hide|show|dataType|trigger|doc|split|top|table|try|catch|success|break|cache|height||remove|tbody|string|guid|num|global|ready|fx|Math|curCSS|start|scrollTop|makeArray|scrollLeft|max|animate|width|offset|tagName|safari|map|toggle||done|Array|find|toUpperCase|button|special|duration|id|copy|value|handler|ownerDocument|select|new|border|exec|stack|none|opera|nextSibling|pushStack|target|html|inArray|unit|xml|bind|GET|isReady|merge|pos|timeout|delete|one|selected|px|step|jsre|position|async|preventDefault|overflow|name|which|queue|removeChild|namespace|insertBefore|nth|removeData|fixed|parseFloat|error|readyState|multiFilter|createElement|rl|re|trim|end|_|param|first|get|results|parseInt|slice|childNodes|encodeURIComponent|append|events|elems|toLowerCase|json|readyList|setTimeout|grep|mouseenter|color|is|custom|getElementsByTagName|block|stopPropagation|addEventListener|callee|proxy|mouseleave|timers|defaultView|password|disabled|last|has|appendChild|form|domManip|props|ajax|orig|set|easing|mozilla|load|prototype|curAnim|self|charCode|timerId|object|offsetChild|Width|parentOffset|src|unbind|br|currentStyle|clean|float|visible|relatedTarget|previousSibling|handlers|isXMLDoc|on|setup|nodeIndex|unique|shift|javascript|child|RegExp|_default|deep|scroll|lastModified|teardown|setRequestHeader|timeStamp|update|empty|tr|getAttribute|innerHTML|setInterval|checked|fromElement|Number|jQuery|state|active|jsonp|accepts|application|dir|input|responseText|click|styleSheets|unload|not|lastToggle|outline|mouseout|getPropertyValue|mouseover|getComputedStyle|bindReady|String|padding|pageX|metaKey|keyCode|getWH|andSelf|clientX|Left|all|visibility|container|index|init|triggered|removeAttribute|classFilter|prevObject|submit|file|after|windowData|inner|client|globalEval|sibling|jquery|absolute|clone|wrapAll|dequeue|version|triggerHandler|oldblock|ctrlKey|createTextNode|Top|handleError|getResponseHeader|parsererror|speeds|checkbox|old|00|radio|swing|href|Modified|ifModified|lastChild|safari2|startTime|offsetTop|offsetLeft|username|location|ajaxSettings|getElementById|isSimple|values|selectedIndex|runtimeStyle|rsLeft|_load|loaded|DOMContentLoaded|clientTop|clientLeft|toElement|srcElement|val|pageY|POST|unshift|Bottom|clientY|Right|fix|exclusive|detachEvent|cloneNode|removeEventListener|swap|toString|join|attachEvent|eval|substr|head|parse|textarea|reset|image|zoom|odd|even|before|prepend|exclude|expr|quickClass|quickID|uuid|quickChild|continue|Height|textContent|appendTo|contents|open|margin|evalScript|borderTopWidth|borderLeftWidth|parent|httpData|setArray|CSS1Compat|compatMode|boxModel|cssFloat|linear|def|webkit|nodeValue|speed|_toggle|eq|100|replaceWith|304|concat|200|alpha|Last|httpNotModified|getAttributeNode|httpSuccess|clearInterval|abort|beforeSend|splice|styleFloat|throw|colgroup|XMLHttpRequest|ActiveXObject|scriptCharset|callback|fieldset|multiple|processData|getBoundingClientRect|contentType|link|ajaxSend|ajaxSuccess|ajaxError|col|ajaxComplete|ajaxStop|ajaxStart|serializeArray|notmodified|keypress|keydown|change|mouseup|mousedown|dblclick|focus|blur|stylesheet|hasClass|rel|doScroll|black|hover|solid|cancelBubble|returnValue|wheelDelta|view|round|shiftKey|resize|screenY|screenX|relatedNode|mousemove|prevValue|originalTarget|offsetHeight|keyup|newValue|offsetWidth|eventPhase|detail|currentTarget|cancelable|bubbles|attrName|attrChange|altKey|originalEvent|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|font|gt|lt|uFFFF|u0128|size|417|Boolean|Date|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|wrap|contentWindow|contentDocument|iframe|children|siblings|prevAll|wrapInner|nextAll|outer|prev|scrollTo|static|marginTop|next|inline|parents|able|cellSpacing|adobeair|cellspacing|522|maxLength|maxlength|readOnly|400|readonly|fast|600|class|slow|1px|htmlFor|reverse|10000|PI|cos|compatible|Function|setData|ie|ra|it|rv|getData|userAgent|navigator|fadeTo|fadeIn|slideToggle|slideUp|slideDown|ig|responseXML|content|1223|NaN|fadeOut|300|protocol|send|setAttribute|option|dataFilter|cssText|changed|be|Accept|stop|With|Requested|Object|can|GMT|property|1970|Jan|01|Thu|Since|If|Type|Content|XMLHTTP|th|Microsoft|td|onreadystatechange|onload|cap|charset|colg|host|tfoot|specified|with|1_|thead|leg|plain|attributes|opt|embed|urlencoded|www|area|hr|ajaxSetup|meta|post|getJSON|getScript|marginLeft|img|elements|pageYOffset|pageXOffset|abbr|serialize|pixelLeft'.split('|'),0,{}));
+// $Id: drupal.js,v 1.41.2.4 2009/07/21 08:59:10 goba Exp $
+
+var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} };
+
+/**
+ * Set the variable that indicates if JavaScript behaviors should be applied
+ */
+Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById;
+
+/**
+ * Attach all registered behaviors to a page element.
+ *
+ * Behaviors are event-triggered actions that attach to page elements, enhancing
+ * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors
+ * object as follows:
+ * @code
+ * Drupal.behaviors.behaviorName = function () {
+ * ...
+ * };
+ * @endcode
+ *
+ * Drupal.attachBehaviors is added below to the jQuery ready event and so
+ * runs on initial page load. Developers implementing AHAH/AJAX in their
+ * solutions should also call this function after new page content has been
+ * loaded, feeding in an element to be processed, in order to attach all
+ * behaviors to the new content.
+ *
+ * Behaviors should use a class in the form behaviorName-processed to ensure
+ * the behavior is attached only once to a given element. (Doing so enables
+ * the reprocessing of given elements, which may be needed on occasion despite
+ * the ability to limit behavior attachment to a particular element.)
+ *
+ * @param context
+ * An element to attach behaviors to. If none is given, the document element
+ * is used.
+ */
+Drupal.attachBehaviors = function(context) {
+ context = context || document;
+ if (Drupal.jsEnabled) {
+ // Execute all of them.
+ jQuery.each(Drupal.behaviors, function() {
+ this(context);
+ });
+ }
+};
+
+/**
+ * Encode special characters in a plain-text string for display as HTML.
+ */
+Drupal.checkPlain = function(str) {
+ str = String(str);
+ var replace = { '&': '&amp;', '"': '&quot;', '<': '&lt;', '>': '&gt;' };
+ for (var character in replace) {
+ var regex = new RegExp(character, 'g');
+ str = str.replace(regex, replace[character]);
+ }
+ return str;
+};
+
+/**
+ * Translate strings to the page language or a given language.
+ *
+ * See the documentation of the server-side t() function for further details.
+ *
+ * @param str
+ * A string containing the English string to translate.
+ * @param args
+ * An object of replacements pairs to make after translation. Incidences
+ * of any key in this array are replaced with the corresponding value.
+ * Based on the first character of the key, the value is escaped and/or themed:
+ * - !variable: inserted as is
+ * - @variable: escape plain text to HTML (Drupal.checkPlain)
+ * - %variable: escape text and theme as a placeholder for user-submitted
+ * content (checkPlain + Drupal.theme('placeholder'))
+ * @return
+ * The translated string.
+ */
+Drupal.t = function(str, args) {
+ // Fetch the localized version of the string.
+ if (Drupal.locale.strings && Drupal.locale.strings[str]) {
+ str = Drupal.locale.strings[str];
+ }
+
+ if (args) {
+ // Transform arguments before inserting them
+ for (var key in args) {
+ switch (key.charAt(0)) {
+ // Escaped only
+ case '@':
+ args[key] = Drupal.checkPlain(args[key]);
+ break;
+ // Pass-through
+ case '!':
+ break;
+ // Escaped and placeholder
+ case '%':
+ default:
+ args[key] = Drupal.theme('placeholder', args[key]);
+ break;
+ }
+ str = str.replace(key, args[key]);
+ }
+ }
+ return str;
+};
+
+/**
+ * Format a string containing a count of items.
+ *
+ * This function ensures that the string is pluralized correctly. Since Drupal.t() is
+ * called by this function, make sure not to pass already-localized strings to it.
+ *
+ * See the documentation of the server-side format_plural() function for further details.
+ *
+ * @param count
+ * The item count to display.
+ * @param singular
+ * The string for the singular case. Please make sure it is clear this is
+ * singular, to ease translation (e.g. use "1 new comment" instead of "1 new").
+ * Do not use @count in the singular string.
+ * @param plural
+ * The string for the plural case. Please make sure it is clear this is plural,
+ * to ease translation. Use @count in place of the item count, as in "@count
+ * new comments".
+ * @param args
+ * An object of replacements pairs to make after translation. Incidences
+ * of any key in this array are replaced with the corresponding value.
+ * Based on the first character of the key, the value is escaped and/or themed:
+ * - !variable: inserted as is
+ * - @variable: escape plain text to HTML (Drupal.checkPlain)
+ * - %variable: escape text and theme as a placeholder for user-submitted
+ * content (checkPlain + Drupal.theme('placeholder'))
+ * Note that you do not need to include @count in this array.
+ * This replacement is done automatically for the plural case.
+ * @return
+ * A translated string.
+ */
+Drupal.formatPlural = function(count, singular, plural, args) {
+ var args = args || {};
+ args['@count'] = count;
+ // Determine the index of the plural form.
+ var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1);
+
+ if (index == 0) {
+ return Drupal.t(singular, args);
+ }
+ else if (index == 1) {
+ return Drupal.t(plural, args);
+ }
+ else {
+ args['@count['+ index +']'] = args['@count'];
+ delete args['@count'];
+ return Drupal.t(plural.replace('@count', '@count['+ index +']'));
+ }
+};
+
+/**
+ * Generate the themed representation of a Drupal object.
+ *
+ * All requests for themed output must go through this function. It examines
+ * the request and routes it to the appropriate theme function. If the current
+ * theme does not provide an override function, the generic theme function is
+ * called.
+ *
+ * For example, to retrieve the HTML that is output by theme_placeholder(text),
+ * call Drupal.theme('placeholder', text).
+ *
+ * @param func
+ * The name of the theme function to call.
+ * @param ...
+ * Additional arguments to pass along to the theme function.
+ * @return
+ * Any data the theme function returns. This could be a plain HTML string,
+ * but also a complex object.
+ */
+Drupal.theme = function(func) {
+ for (var i = 1, args = []; i < arguments.length; i++) {
+ args.push(arguments[i]);
+ }
+
+ return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args);
+};
+
+/**
+ * Parse a JSON response.
+ *
+ * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message.
+ */
+Drupal.parseJson = function (data) {
+ if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) {
+ return { status: 0, data: data.length ? data : Drupal.t('Unspecified error') };
+ }
+ return eval('(' + data + ');');
+};
+
+/**
+ * Freeze the current body height (as minimum height). Used to prevent
+ * unnecessary upwards scrolling when doing DOM manipulations.
+ */
+Drupal.freezeHeight = function () {
+ Drupal.unfreezeHeight();
+ var div = document.createElement('div');
+ $(div).css({
+ position: 'absolute',
+ top: '0px',
+ left: '0px',
+ width: '1px',
+ height: $('body').css('height')
+ }).attr('id', 'freeze-height');
+ $('body').append(div);
+};
+
+/**
+ * Unfreeze the body height
+ */
+Drupal.unfreezeHeight = function () {
+ $('#freeze-height').remove();
+};
+
+/**
+ * Wrapper around encodeURIComponent() which avoids Apache quirks (equivalent of
+ * drupal_urlencode() in PHP). This function should only be used on paths, not
+ * on query string arguments.
+ */
+Drupal.encodeURIComponent = function (item, uri) {
+ uri = uri || location.href;
+ item = encodeURIComponent(item).replace(/%2F/g, '/');
+ return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F');
+};
+
+/**
+ * Get the text selection in a textarea.
+ */
+Drupal.getSelection = function (element) {
+ if (typeof(element.selectionStart) != 'number' && document.selection) {
+ // The current selection
+ var range1 = document.selection.createRange();
+ var range2 = range1.duplicate();
+ // Select all text.
+ range2.moveToElementText(element);
+ // Now move 'dummy' end point to end point of original range.
+ range2.setEndPoint('EndToEnd', range1);
+ // Now we can calculate start and end points.
+ var start = range2.text.length - range1.text.length;
+ var end = start + range1.text.length;
+ return { 'start': start, 'end': end };
+ }
+ return { 'start': element.selectionStart, 'end': element.selectionEnd };
+};
+
+/**
+ * Build an error message from ahah response.
+ */
+Drupal.ahahError = function(xmlhttp, uri) {
+ if (xmlhttp.status == 200) {
+ if (jQuery.trim($(xmlhttp.responseText).text())) {
+ var message = Drupal.t("An error occurred. \n@uri\n@text", {'@uri': uri, '@text': xmlhttp.responseText });
+ }
+ else {
+ var message = Drupal.t("An error occurred. \n@uri\n(no information available).", {'@uri': uri, '@text': xmlhttp.responseText });
+ }
+ }
+ else {
+ var message = Drupal.t("An HTTP error @status occurred. \n@uri", {'@uri': uri, '@status': xmlhttp.status });
+ }
+ return message;
+}
+
+// Global Killswitch on the <html> element
+if (Drupal.jsEnabled) {
+ // Global Killswitch on the <html> element
+ $(document.documentElement).addClass('js');
+ // 'js enabled' cookie
+ document.cookie = 'has_js=1; path=/';
+ // Attach all behaviors.
+ $(document).ready(function() {
+ Drupal.attachBehaviors(this);
+ });
+}
+
+/**
+ * The default themes.
+ */
+Drupal.theme.prototype = {
+
+ /**
+ * Formats text for emphasized display in a placeholder inside a sentence.
+ *
+ * @param str
+ * The text to format (plain-text).
+ * @return
+ * The formatted text (html).
+ */
+ placeholder: function(str) {
+ return '<em>' + Drupal.checkPlain(str) + '</em>';
+ }
+};
+;
+// $Id: googleanalytics.js,v 1.9.2.4 2010/09/19 11:39:20 hass Exp $
+
+$(document).ready(function() {
+
+ // Attach onclick event to document only and catch clicks on all elements.
+ $(document.body).click(function(event) {
+ // Catch only the first parent link of a clicked element.
+ $(event.target).parents("a:first,area:first").andSelf().filter("a,area").each(function() {
+
+ var ga = Drupal.settings.googleanalytics;
+ // Expression to check for absolute internal links.
+ var isInternal = new RegExp("^(https?):\/\/" + window.location.host, "i");
+ // Expression to check for special links like gotwo.module /go/* links.
+ var isInternalSpecial = new RegExp("(\/go\/.*)$", "i");
+ // Expression to check for download links.
+ var isDownload = new RegExp("\\.(" + ga.trackDownloadExtensions + ")$", "i");
+
+ // Is the clicked URL internal?
+ if (isInternal.test(this.href)) {
+ // Is download tracking activated and the file extension configured for download tracking?
+ if (ga.trackDownload && isDownload.test(this.href)) {
+ // Download link clicked.
+ var extension = isDownload.exec(this.href);
+ _gaq.push(["_trackEvent", "Downloads", extension[1].toUpperCase(), this.href.replace(isInternal, '')]);
+ }
+ else if (isInternalSpecial.test(this.href)) {
+ // Keep the internal URL for Google Analytics website overlay intact.
+ _gaq.push(["_trackPageview", this.href.replace(isInternal, '')]);
+ }
+ }
+ else {
+ if (ga.trackMailto && $(this).is("a[href^=mailto:],area[href^=mailto:]")) {
+ // Mailto link clicked.
+ _gaq.push(["_trackEvent", "Mails", "Click", this.href.substring(7)]);
+ }
+ else if (ga.trackOutgoing && this.href) {
+ // External link clicked.
+ _gaq.push(["_trackEvent", "Outgoing links", "Click", this.href]);
+ }
+ }
+
+ });
+ });
+});
+;
+(function () {
+ function latitudeToMercator(latitude) {
+ return Math.log(Math.tan(latitude * Math.PI / 180) + 1 / Math.cos(latitude * Math.PI / 180));
+ }
+
+ Drupal.html5UserGeolocationLongitudeToPx = function (longitude, leftLongitude, width) {
+ return (longitude - leftLongitude + 360) / 360 % 1 * width;
+ }
+
+ Drupal.html5UserGeolocationLatitudeToPx = function (latitude, topLatitude, bottomLatitude, height) {
+ return (latitudeToMercator(latitude) - latitudeToMercator(bottomLatitude))
+ / (latitudeToMercator(topLatitude) - latitudeToMercator(bottomLatitude))
+ * height;
+ }
+
+ function plot() {
+ var $map = $('#html5-user-geolocation-map'),
+ latitude = $('#edit-html5-user-geolocation-latitude').attr('value'),
+ longitude = $('#edit-html5-user-geolocation-longitude').attr('value');
+
+ if (latitude == 0 && longitude == 0) {
+ return;
+ }
+
+ // Plot coords
+ $('#html5-user-geolocation-map .dot').css({
+ left: '' + Drupal.html5UserGeolocationLongitudeToPx(longitude, -168, $map.width()) + 'px',
+ bottom: '' + Drupal.html5UserGeolocationLatitudeToPx(latitude, 78, -58, $map.height()) + 'px'
+ }).show();
+
+ // Show precision
+ $map.siblings('.description').find('span').html(
+ (Math.acos(
+ Math.sin(latitude * Math.PI / 180)
+ * Math.sin((latitude) * Math.PI / 180)
+ + Math.cos(latitude * Math.PI / 180)
+ * Math.cos((latitude) * Math.PI / 180)
+ * Math.cos(Math.pow(10, -1 * Drupal.settings.html5UserGeolocationPrecision) * Math.PI / 180)
+ ) * 6371).toPrecision(3)
+ );
+ }
+
+ function getLocation() {
+ if ($('#edit-html5-user-geolocation-save').attr('checked')) {
+ var $busy = $('#html5-user-geolocation-messages-wrapper .geolocating');
+ $('#html5-user-geolocation-map-wrapper').slideDown('fast');
+
+ // Get position
+ $busy.show();
+ navigator.geolocation.getCurrentPosition(function (position) {
+ // Save coords
+ $('#edit-html5-user-geolocation-latitude').attr('value', position.coords.latitude);
+ $('#edit-html5-user-geolocation-longitude').attr('value', position.coords.longitude);
+
+ plot();
+ $busy.hide();
+ }, function () { // getCurrentPosition error callback
+ $('#edit-html5-user-geolocation-save').attr('checked', false).change();
+ },
+ {
+ maximumAge: Infinity
+ });
+ }
+ else { // Location not checked
+ $('#html5-user-geolocation-map-wrapper').slideUp('fast');
+ }
+ }
+
+ Drupal.behaviors.html5UserGeolocation = function (context) {
+ if (navigator.geolocation) {
+ $('#user-profile-form #edit-html5-user-geolocation-save:not(.html5-user-geolocation-processed)', context)
+ .addClass('html5-user-geolocation-processed')
+ .change(function () {
+ getLocation();
+ })
+ .each(function () {
+ $('#html5-user-geolocation-messages-wrapper .not-supported').hide();
+ if ($('#edit-html5-user-geolocation-save').attr('checked')) {
+ $('#html5-user-geolocation-map-wrapper').slideDown('fast');
+ plot();
+ }
+ getLocation();
+ });
+ }
+ else { // HTML5 Geolocation not supported
+ $('#edit-html5-user-geolocation-save').attr('disabled', true);
+ }
+ };
+}());
+;
+Drupal.behaviors.drupalorgSetHome = function () {
+ $('#drupalorg-set-home:not(.drupalorg-set-home-processed)')
+ .addClass('drupalorg-set-home-processed')
+ .each(function () {
+ var $this = $(this);
+ // Click triggers form submit
+ $('a', $this).click(function () {
+ $('input[type=submit]', $this).click();
+ return false;
+ });
+ });
+};
+
+Drupal.behaviors.drupalorgSearch = function () {
+ $('body.page-search #content-top-region form:not(.drupalorgSearch-processed)').addClass('drupalorgSearch-processed').each(function () {
+ var $this = $(this);
+ $this.find('select').change(function () {
+ $this.submit();
+ });
+ });
+};
+;
+// $Id: base.js,v 1.11.2.1 2010/03/10 20:08:58 merlinofchaos Exp $
+/**
+ * @file base.js
+ *
+ * Some basic behaviors and utility functions for Views.
+ */
+
+Drupal.Views = {};
+
+/**
+ * jQuery UI tabs, Views integration component
+ */
+Drupal.behaviors.viewsTabs = function (context) {
+ $('#views-tabset:not(.views-processed)').addClass('views-processed').each(function() {
+ new Drupal.Views.Tabs($(this), {selectedClass: 'active'});
+ });
+
+ $('a.views-remove-link')
+ .addClass('views-processed')
+ .click(function() {
+ var id = $(this).attr('id').replace('views-remove-link-', '');
+ $('#views-row-' + id).hide();
+ $('#views-removed-' + id).attr('checked', true);
+ return false;
+ });
+}
+
+/**
+ * For IE, attach some javascript so that our hovers do what they're supposed
+ * to do.
+ */
+Drupal.behaviors.viewsHoverlinks = function() {
+ if ($.browser.msie) {
+ // If IE, attach a hover event so we can see our admin links.
+ $("div.view:not(.views-hover-processed)").addClass('views-hover-processed').hover(
+ function() {
+ $('div.views-hide', this).addClass("views-hide-hover"); return true;
+ },
+ function(){
+ $('div.views-hide', this).removeClass("views-hide-hover"); return true;
+ }
+ );
+ $("div.views-admin-links:not(.views-hover-processed)")
+ .addClass('views-hover-processed')
+ .hover(
+ function() {
+ $(this).addClass("views-admin-links-hover"); return true;
+ },
+ function(){
+ $(this).removeClass("views-admin-links-hover"); return true;
+ }
+ );
+ }
+}
+
+/**
+ * Helper function to parse a querystring.
+ */
+Drupal.Views.parseQueryString = function (query) {
+ var args = {};
+ var pos = query.indexOf('?');
+ if (pos != -1) {
+ query = query.substring(pos + 1);
+ }
+ var pairs = query.split('&');
+ for(var i in pairs) {
+ var pair = pairs[i].split('=');
+ // Ignore the 'q' path argument, if present.
+ if (pair[0] != 'q' && pair[1]) {
+ args[pair[0]] = decodeURIComponent(pair[1].replace(/\+/g, ' '));
+ }
+ }
+ return args;
+};
+
+/**
+ * Helper function to return a view's arguments based on a path.
+ */
+Drupal.Views.parseViewArgs = function (href, viewPath) {
+ var returnObj = {};
+ var path = Drupal.Views.getPath(href);
+ // Ensure we have a correct path.
+ if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') {
+ var args = decodeURIComponent(path.substring(viewPath.length + 1, path.length));
+ returnObj.view_args = args;
+ returnObj.view_path = path;
+ }
+ return returnObj;
+};
+
+/**
+ * Strip off the protocol plus domain from an href.
+ */
+Drupal.Views.pathPortion = function (href) {
+ // Remove e.g. http://example.com if present.
+ var protocol = window.location.protocol;
+ if (href.substring(0, protocol.length) == protocol) {
+ // 2 is the length of the '//' that normally follows the protocol
+ href = href.substring(href.indexOf('/', protocol.length + 2));
+ }
+ return href;
+};
+
+/**
+ * Return the Drupal path portion of an href.
+ */
+Drupal.Views.getPath = function (href) {
+ href = Drupal.Views.pathPortion(href);
+ href = href.substring(Drupal.settings.basePath.length, href.length);
+ // 3 is the length of the '?q=' added to the url without clean urls.
+ if (href.substring(0, 3) == '?q=') {
+ href = href.substring(3, href.length);
+ }
+ var chars = ['#', '?', '&'];
+ for (i in chars) {
+ if (href.indexOf(chars[i]) > -1) {
+ href = href.substr(0, href.indexOf(chars[i]));
+ }
+ }
+ return href;
+};
+;
+// $Id: dependent.js,v 1.9.2.1 2009/11/18 02:43:47 merlinofchaos Exp $
+/**
+ * @file dependent.js
+ *
+ * Written by dmitrig01 (Dmitri Gaskin) for Views; this provides dependent
+ * visibility for form items in Views' ajax forms.
+ *
+ * To your $form item definition add:
+ * - '#process' => array('views_process_dependency'),
+ * - Add '#dependency' => array('id-of-form-item' => array(list, of, values, that,
+ make, this, item, show),
+ *
+ * Special considerations:
+ * - radios are harder. Because Drupal doesn't give radio groups individual ids,
+ * use 'radio:name-of-radio'
+ *
+ * - Checkboxes don't have their own id, so you need to add one in a div
+ * around the checkboxes via #prefix and #suffix. You actually need to add TWO
+ * divs because it's the parent that gets hidden. Also be sure to retain the
+ * 'expand_checkboxes' in the #process array, because the views process will
+ * override it.
+ */
+
+Drupal.Views = Drupal.Views || {};
+
+Drupal.Views.dependent = { bindings: {}, activeBindings: {}, activeTriggers: [] };
+
+Drupal.Views.dependent.inArray = function(array, search_term) {
+ var i = array.length;
+ if (i > 0) {
+ do {
+ if (array[i] == search_term) {
+ return true;
+ }
+ } while (i--);
+ }
+ return false;
+}
+
+
+Drupal.Views.dependent.autoAttach = function() {
+ // Clear active bindings and triggers.
+ for (i in Drupal.Views.dependent.activeTriggers) {
+ jQuery(Drupal.Views.dependent.activeTriggers[i]).unbind('change');
+ }
+ Drupal.Views.dependent.activeTriggers = [];
+ Drupal.Views.dependent.activeBindings = {};
+ Drupal.Views.dependent.bindings = {};
+
+ if (!Drupal.settings.viewsAjax) {
+ return;
+ }
+
+ // Iterate through all relationships
+ for (id in Drupal.settings.viewsAjax.formRelationships) {
+
+ // Drupal.Views.dependent.activeBindings[id] is a boolean,
+ // whether the binding is active or not. Defaults to no.
+ Drupal.Views.dependent.activeBindings[id] = 0;
+ // Iterate through all possible values
+ for(bind_id in Drupal.settings.viewsAjax.formRelationships[id].values) {
+ // This creates a backward relationship. The bind_id is the ID
+ // of the element which needs to change in order for the id to hide or become shown.
+ // The id is the ID of the item which will be conditionally hidden or shown.
+ // Here we're setting the bindings for the bind
+ // id to be an empty array if it doesn't already have bindings to it
+ if (!Drupal.Views.dependent.bindings[bind_id]) {
+ Drupal.Views.dependent.bindings[bind_id] = [];
+ }
+ // Add this ID
+ Drupal.Views.dependent.bindings[bind_id].push(id);
+ // Big long if statement.
+ // Drupal.settings.viewsAjax.formRelationships[id].values[bind_id] holds the possible values
+
+ if (bind_id.substring(0, 6) == 'radio:') {
+ var trigger_id = "input[name='" + bind_id.substring(6) + "']";
+ }
+ else {
+ var trigger_id = '#' + bind_id;
+ }
+
+ Drupal.Views.dependent.activeTriggers.push(trigger_id);
+
+ if (jQuery(trigger_id).attr('type') == 'checkbox') {
+ $(trigger_id).parent().addClass('hidden-options');
+ }
+
+ var getValue = function(item, trigger) {
+ if (item.substring(0, 6) == 'radio:') {
+ var val = jQuery(trigger + ':checked').val();
+ }
+ else {
+ switch (jQuery(trigger).attr('type')) {
+ case 'checkbox':
+ var val = jQuery(trigger).attr('checked') || 0;
+
+ if (val) {
+ $(trigger).parent().removeClass('hidden-options').addClass('expanded-options');
+ }
+ else {
+ $(trigger).parent().removeClass('expanded-options').addClass('hidden-options');
+ }
+
+ break;
+ default:
+ var val = jQuery(trigger).val();
+ }
+ }
+ return val;
+ }
+
+ var setChangeTrigger = function(trigger_id, bind_id) {
+ // Triggered when change() is clicked.
+ var changeTrigger = function() {
+ var val = getValue(bind_id, trigger_id);
+
+ for (i in Drupal.Views.dependent.bindings[bind_id]) {
+ var id = Drupal.Views.dependent.bindings[bind_id][i];
+
+ // Fix numerous errors
+ if (typeof id != 'string') {
+ continue;
+ }
+
+ // This bit had to be rewritten a bit because two properties on the
+ // same set caused the counter to go up and up and up.
+ if (!Drupal.Views.dependent.activeBindings[id]) {
+ Drupal.Views.dependent.activeBindings[id] = {};
+ }
+
+ if (Drupal.Views.dependent.inArray(Drupal.settings.viewsAjax.formRelationships[id].values[bind_id], val)) {
+ Drupal.Views.dependent.activeBindings[id][bind_id] = 'bind';
+ }
+ else {
+ delete Drupal.Views.dependent.activeBindings[id][bind_id];
+ }
+
+ var len = 0;
+ for (i in Drupal.Views.dependent.activeBindings[id]) {
+ len++;
+ }
+
+ var object = jQuery('#' + id + '-wrapper');
+ if (!object.size()) {
+ object = jQuery('#' + id).parent();
+ }
+
+ var rel_num = Drupal.settings.viewsAjax.formRelationships[id].num;
+ if (typeof rel_num === 'object') {
+ rel_num = Drupal.settings.viewsAjax.formRelationships[id].num[0];
+ }
+
+ if (rel_num <= len) {
+ // Show if the element if criteria is matched
+ object.show(0);
+ object.addClass('dependent-options');
+ }
+ else {
+ // Otherwise hide
+ object.hide(0);
+ }
+ }
+ }
+
+ jQuery(trigger_id).change(function() {
+ // Trigger the internal change function
+ // the attr('id') is used because closures are more confusing
+ changeTrigger(trigger_id, bind_id);
+ });
+ // Trigger initial reaction
+ changeTrigger(trigger_id, bind_id);
+ }
+ setChangeTrigger(trigger_id, bind_id);
+ }
+ }
+}
+
+Drupal.behaviors.viewsDependent = function (context) {
+ Drupal.Views.dependent.autoAttach();
+
+ // Really large sets of fields are too slow with the above method, so this
+ // is a sort of hacked one that's faster but much less flexible.
+ $("select.views-master-dependent:not(.views-processed)")
+ .addClass('views-processed')
+ .change(function() {
+ var val = $(this).val();
+ if (val == 'all') {
+ $('.views-dependent-all').show(0);
+ }
+ else {
+ $('.views-dependent-all').hide(0);
+ $('.views-dependent-' + val).show(0);
+ }
+ })
+ .trigger('change');
+}
+;
+// $Id: tableheader.js,v 1.16.2.2 2009/03/30 12:48:09 goba Exp $
+
+Drupal.tableHeaderDoScroll = function() {
+ if (typeof(Drupal.tableHeaderOnScroll)=='function') {
+ Drupal.tableHeaderOnScroll();
+ }
+};
+
+Drupal.behaviors.tableHeader = function (context) {
+ // This breaks in anything less than IE 7. Prevent it from running.
+ if (jQuery.browser.msie && parseInt(jQuery.browser.version, 10) < 7) {
+ return;
+ }
+
+ // Keep track of all cloned table headers.
+ var headers = [];
+
+ $('table.sticky-enabled thead:not(.tableHeader-processed)', context).each(function () {
+ // Clone thead so it inherits original jQuery properties.
+ var headerClone = $(this).clone(true).insertBefore(this.parentNode).wrap('<table class="sticky-header"></table>').parent().css({
+ position: 'fixed',
+ top: '0px'
+ });
+
+ headerClone = $(headerClone)[0];
+ headers.push(headerClone);
+
+ // Store parent table.
+ var table = $(this).parent('table')[0];
+ headerClone.table = table;
+ // Finish initialzing header positioning.
+ tracker(headerClone);
+
+ $(table).addClass('sticky-table');
+ $(this).addClass('tableHeader-processed');
+ });
+
+ // Define the anchor holding var.
+ var prevAnchor = '';
+
+ // Track positioning and visibility.
+ function tracker(e) {
+ // Save positioning data.
+ var viewHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
+ if (e.viewHeight != viewHeight) {
+ e.viewHeight = viewHeight;
+ e.vPosition = $(e.table).offset().top - 4;
+ e.hPosition = $(e.table).offset().left;
+ e.vLength = e.table.clientHeight - 100;
+ // Resize header and its cell widths.
+ var parentCell = $('th', e.table);
+ $('th', e).each(function(index) {
+ var cellWidth = parentCell.eq(index).css('width');
+ // Exception for IE7.
+ if (cellWidth == 'auto') {
+ cellWidth = parentCell.get(index).clientWidth +'px';
+ }
+ $(this).css('width', cellWidth);
+ });
+ $(e).css('width', $(e.table).css('width'));
+ }
+
+ // Track horizontal positioning relative to the viewport and set visibility.
+ var hScroll = document.documentElement.scrollLeft || document.body.scrollLeft;
+ var vOffset = (document.documentElement.scrollTop || document.body.scrollTop) - e.vPosition;
+ var visState = (vOffset > 0 && vOffset < e.vLength) ? 'visible' : 'hidden';
+ $(e).css({left: -hScroll + e.hPosition +'px', visibility: visState});
+
+ // Check the previous anchor to see if we need to scroll to make room for the header.
+ // Get the height of the header table and scroll up that amount.
+ if (prevAnchor != location.hash) {
+ if (location.hash != '') {
+ var offset = $('td' + location.hash).offset();
+ if (offset) {
+ var top = offset.top;
+ var scrollLocation = top - $(e).height();
+ $('body, html').scrollTop(scrollLocation);
+ }
+ }
+ prevAnchor = location.hash;
+ }
+ }
+
+ // Only attach to scrollbars once, even if Drupal.attachBehaviors is called
+ // multiple times.
+ if (!$('body').hasClass('tableHeader-processed')) {
+ $('body').addClass('tableHeader-processed');
+ $(window).scroll(Drupal.tableHeaderDoScroll);
+ $(document.documentElement).scroll(Drupal.tableHeaderDoScroll);
+ }
+
+ // Track scrolling.
+ Drupal.tableHeaderOnScroll = function() {
+ $(headers).each(function () {
+ tracker(this);
+ });
+ };
+
+ // Track resizing.
+ var time = null;
+ var resize = function () {
+ // Ensure minimum time between adjustments.
+ if (time) {
+ return;
+ }
+ time = setTimeout(function () {
+ $('table.sticky-header').each(function () {
+ // Force cell width calculation.
+ this.viewHeight = 0;
+ tracker(this);
+ });
+ // Reset timer
+ time = null;
+ }, 250);
+ };
+ $(window).resize(resize);
+};
+;
+// $Id: collapse.js,v 1.17 2008/01/29 10:58:25 goba Exp $
+
+/**
+ * Toggle the visibility of a fieldset using smooth animations
+ */
+Drupal.toggleFieldset = function(fieldset) {
+ if ($(fieldset).is('.collapsed')) {
+ // Action div containers are processed separately because of a IE bug
+ // that alters the default submit button behavior.
+ var content = $('> div:not(.action)', fieldset);
+ $(fieldset).removeClass('collapsed');
+ content.hide();
+ content.slideDown( {
+ duration: 'fast',
+ easing: 'linear',
+ complete: function() {
+ Drupal.collapseScrollIntoView(this.parentNode);
+ this.parentNode.animating = false;
+ $('div.action', fieldset).show();
+ },
+ step: function() {
+ // Scroll the fieldset into view
+ Drupal.collapseScrollIntoView(this.parentNode);
+ }
+ });
+ }
+ else {
+ $('div.action', fieldset).hide();
+ var content = $('> div:not(.action)', fieldset).slideUp('fast', function() {
+ $(this.parentNode).addClass('collapsed');
+ this.parentNode.animating = false;
+ });
+ }
+};
+
+/**
+ * Scroll a given fieldset into view as much as possible.
+ */
+Drupal.collapseScrollIntoView = function (node) {
+ var h = self.innerHeight || document.documentElement.clientHeight || $('body')[0].clientHeight || 0;
+ var offset = self.pageYOffset || document.documentElement.scrollTop || $('body')[0].scrollTop || 0;
+ var posY = $(node).offset().top;
+ var fudge = 55;
+ if (posY + node.offsetHeight + fudge > h + offset) {
+ if (node.offsetHeight > h) {
+ window.scrollTo(0, posY);
+ } else {
+ window.scrollTo(0, posY + node.offsetHeight - h + fudge);
+ }
+ }
+};
+
+Drupal.behaviors.collapse = function (context) {
+ $('fieldset.collapsible > legend:not(.collapse-processed)', context).each(function() {
+ var fieldset = $(this.parentNode);
+ // Expand if there are errors inside
+ if ($('input.error, textarea.error, select.error', fieldset).size() > 0) {
+ fieldset.removeClass('collapsed');
+ }
+
+ // Turn the legend into a clickable link and wrap the contents of the fieldset
+ // in a div for easier animation
+ var text = this.innerHTML;
+ $(this).empty().append($('<a href="#">'+ text +'</a>').click(function() {
+ var fieldset = $(this).parents('fieldset:first')[0];
+ // Don't animate multiple times
+ if (!fieldset.animating) {
+ fieldset.animating = true;
+ Drupal.toggleFieldset(fieldset);
+ }
+ return false;
+ }))
+ .after($('<div class="fieldset-wrapper"></div>')
+ .append(fieldset.children(':not(legend):not(.action)')))
+ .addClass('collapse-processed');
+ });
+};
+;
+Drupal.behaviors.Drupalorg = function () {
+ var $element = $('body:not(.drupalorg-front) #edit-search-theme-form-1'),
+ value = Drupal.t('Search Drupal.org');
+
+ // Add focus/blur label behavior to search box.
+ $element.bind('focus', function () {
+ if ($element.val() === value) {
+ $element.val('').addClass('has-value');
+ }
+ });
+ $element.bind('blur', function () {
+ if ($element.val() === '' || $element.val() === value) {
+ $element.val(value).removeClass('has-value');
+ }
+ else {
+ $element.addClass('has-value');
+ }
+ });
+ $element.trigger('blur');
+
+ // Move right column out of the way of wide tables used on API.drupal.org and
+ // forums.
+ if ($('#column-left.grid-8').length === 1) {
+ var delta = 0;
+ $('#column-left table').each(function() {
+ delta = Math.max(delta, $(this).width());
+ });
+ delta -= $('#column-left').width();
+ if (delta > 0) {
+ $('#page-inner').width($('#page-inner').width() + delta);
+ $('#column-left').width($('#column-left').width() + delta);
+ }
+ }
+};
+;
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/editabledropdown.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/editabledropdown.js
new file mode 100644
index 000000000..6511d8a0d
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/editabledropdown.js
@@ -0,0 +1,363 @@
+//Common functions for all dropdowns
+ /*----------------------------------------------
+ The Common function used for all dropdowns are:
+ -----------------------------------------------
+ -- function fnKeyDownHandler(getdropdown, e)
+ -- function fnLeftToRight(getdropdown)
+ -- function fnRightToLeft(getdropdown)
+ -- function fnDelete(getdropdown)
+ -- function FindKeyCode(e)
+ -- function FindKeyChar(e)
+ -- function fnSanityCheck(getdropdown)
+
+ --------------------------- */
+
+ function fnKeyDownHandler(getdropdown, e) {
+
+ fnSanityCheck(getdropdown);
+
+ // Press [ <- ] and [ -> ] arrow keys on the keyboard to change alignment/flow.
+ // ...go to Start : Press [ <- ] Arrow Key
+ // ...go to End : Press [ -> ] Arrow Key
+ // (this is useful when the edited-text content exceeds the ListBox-fixed-width)
+ // This works best on Internet Explorer, and not on Netscape
+
+ var vEventKeyCode = FindKeyCode(e);
+ // Press left/right arrow keys
+ if(vEventKeyCode == 37) {
+ fnLeftToRight(getdropdown);
+ }
+ if(vEventKeyCode == 39) {
+ fnRightToLeft(getdropdown);
+ }
+
+ // Delete key pressed
+ if(vEventKeyCode == 46) {
+ fnDelete(getdropdown);
+ }
+
+ // backspace key pressed
+ if(vEventKeyCode == 8 || vEventKeyCode==127) {
+ if(e.which) { //Netscape
+ //e.which = ''; //this property has only a getter.
+ } else { //Internet Explorer
+ //To prevent backspace from activating the -Back- button of the browser
+ e.keyCode = '';
+ if(window.event.keyCode) {
+ window.event.keyCode = '';
+ }
+ }
+ return true;
+ }
+ // Tab key pressed, use code below to reorient to Left-To-Right flow, if needed
+ //if(vEventKeyCode == 9)
+ //{
+ // fnLeftToRight(getdropdown);
+ //}
+ } // function fnKeyDownHandler
+
+ function fnLeftToRight(getdropdown) {
+ getdropdown.style.direction = "ltr";
+ } //function fnLeftToRight
+
+ function fnRightToLeft(getdropdown) {
+ getdropdown.style.direction = "rtl";
+ } //function fnRightToLeft
+
+ function fnDelete(getdropdown) {
+ if(getdropdown.options.length != 0) { // if dropdown is not empty
+ if (getdropdown.options.selectedIndex == vEditableOptionIndex_A) { // if option the Editable field
+ getdropdown.options[getdropdown.options.selectedIndex].text = '';
+ //getdropdown.options[getdropdown.options.selectedIndex].value = ''; //Use this line only if want to change the internal value too; else this line is not required.
+ }
+ }
+ } // function fnDelete
+
+
+ /*
+ Since Internet Explorer and Netscape have different
+ ways of returning the key code, displaying keys
+ browser-independently is a bit harder.
+ However, you can create a script that displays keys
+ for either browser.
+ The following function will display each key
+ in the status line:
+
+ The "FindKey.." function receives the "event" object
+ from the event handler and stores it in the variable "e".
+ It checks whether the "e.which" property exists (for Netscape),
+ and stores it in the "keycode" variable if present.
+ Otherwise, it assumes the browser is Internet Explorer
+ and assigns to keycode the "e.keyCode" property.
+ */
+
+ function FindKeyCode(e) {
+ if(e.which) {
+ keycode=e.which; //Netscape
+ } else {
+ keycode=e.keyCode; //Internet Explorer
+ }
+ //alert("FindKeyCode"+ keycode);
+ return keycode;
+ } // function FindKeyCode
+
+ function FindKeyChar(e) {
+ keycode = FindKeyCode(e);
+ if((keycode==8)||(keycode==127)) {
+ character="backspace"
+ }
+ else if((keycode==46)) {
+ character="delete"
+ }
+ else {
+ character=String.fromCharCode(keycode);
+ }
+ //alert("FindKey"+ character);
+ return character;
+ } // function FindKeyChar
+
+ function fnSanityCheck(getdropdown) {
+ if(vEditableOptionIndex_A>(getdropdown.options.length-1)) {
+ alert("PROGRAMMING ERROR: The value of variable vEditableOptionIndex_... cannot be greater than (length of dropdown - 1)");
+ return false;
+ }
+ }
+
+ //Dropdown specific functions, which manipulate dropdown specific global variables
+
+ /*----------------------------------------------
+ Dropdown specific global variables are:
+ -----------------------------------------------
+ 1) vEditableOptionIndex_A --> this needs to be set by Programmer!! See explanation.
+ 2) vEditableOptionText_A --> this needs to be set by Programmer!! See explanation.
+ 3) vPreviousSelectIndex_A
+ 4) vSelectIndex_A
+ 5) vSelectChange_A
+
+ --------------------------- */
+
+ /*----------------------------------------------
+ The dropdown specific functions
+ (which manipulate dropdown specific global variables)
+ used by all dropdowns are:
+ -----------------------------------------------
+ 1) function fnChangeHandler_A(getdropdown)
+ 2) function fnKeyPressHandler_A(getdropdown, e)
+ 3) function fnKeyUpHandler_A(getdropdown, e)
+
+ --------------------------- */
+
+ /*------------------------------------------------
+ IMPORTANT: Global Variable required to be SET by programmer
+ -------------------------- */
+
+ var vEditableOptionIndex_A = 0;
+
+ // Give Index of Editable option in the dropdown.
+ // For eg.
+ // if first option is editable then vEditableOptionIndex_A = 0;
+ // if second option is editable then vEditableOptionIndex_A = 1;
+ // if third option is editable then vEditableOptionIndex_A = 2;
+ // if last option is editable then vEditableOptionIndex_A = (length of dropdown - 1).
+ // Note: the value of vEditableOptionIndex_A cannot be greater than (length of dropdown - 1)
+
+ var vEditableOptionText_A = "Custom";
+
+ // Give the default text of the Editable option in the dropdown.
+ // For eg.
+ // if the editable option is <option ...>--?--</option>,
+ // then set vEditableOptionText_A = "--?--";
+
+ /*------------------------------------------------
+ Global Variables required for
+ fnChangeHandler_A(), fnKeyPressHandler_A() and fnKeyUpHandler_A()
+ for Editable Dropdowns
+ -------------------------- */
+
+ var vPreviousSelectIndex_A = 0;
+ // Contains the Previously Selected Index, set to 0 by default
+
+ var vSelectIndex_A = 0;
+ // Contains the Currently Selected Index, set to 0 by default
+
+ var vSelectChange_A = 'MANUAL_CLICK';
+ // Indicates whether Change in dropdown selected option
+ // was due to a Manual Click
+ // or due to System properties of dropdown.
+
+ // vSelectChange_A = 'MANUAL_CLICK' indicates that
+ // the jump to a non-editable option in the dropdown was due
+ // to a Manual click (i.e.,changed on purpose by user).
+
+ // vSelectChange_A = 'AUTO_SYSTEM' indicates that
+ // the jump to a non-editable option was due to System properties of dropdown
+ // (i.e.,user did not change the option in the dropdown;
+ // instead an automatic jump happened due to inbuilt
+ // dropdown properties of browser on typing of a character )
+
+ /*------------------------------------------------
+ Functions required for Editable Dropdowns
+ -------------------------- */
+
+ function fnChangeHandler_A(getdropdown, e) {
+ fnSanityCheck(getdropdown);
+
+ vPreviousSelectIndex_A = vSelectIndex_A;
+ // Contains the Previously Selected Index
+
+ vSelectIndex_A = getdropdown.options.selectedIndex;
+ // Contains the Currently Selected Index
+
+ if ((vPreviousSelectIndex_A == (vEditableOptionIndex_A)) && (vSelectIndex_A != (vEditableOptionIndex_A))&&(vSelectChange_A != 'MANUAL_CLICK')) { // To Set value of Index variables -
+ getdropdown[(vEditableOptionIndex_A)].selected=true;
+ vPreviousSelectIndex_A = vSelectIndex_A;
+ vSelectIndex_A = getdropdown.options.selectedIndex;
+ vSelectChange_A = 'MANUAL_CLICK';
+ // Indicates that the Change in dropdown selected
+ // option was due to a Manual Click
+ }
+ } // function fnChangeHandler_A
+
+ function fnKeyPressHandler_A(getdropdown, e) {
+ fnSanityCheck(getdropdown);
+
+ keycode = FindKeyCode(e);
+ keychar = FindKeyChar(e);
+
+ // Check for allowable Characters
+ // The various characters allowable for entry into Editable option..
+ // may be customized by minor modifications in the code (if condition below)
+ // (you need to know the keycode/ASCII value of the character to be allowed/disallowed.
+ // -
+
+ if ((keycode>47 && keycode<59)||(keycode>62 && keycode<127) ||(keycode==32)) {
+ var vAllowableCharacter = "yes";
+ }
+ else {
+ var vAllowableCharacter = "no";
+ }
+
+ //alert(window); alert(window.event);
+
+ if(getdropdown.options.length != 0) {
+ // if dropdown is not empty
+ if (getdropdown.options.selectedIndex == (vEditableOptionIndex_A)) {
+ // if selected option the Editable option of the dropdown
+
+ var vEditString = getdropdown[vEditableOptionIndex_A].text;
+
+ // make Editable option Null if it is being edited for the first time
+ if((vAllowableCharacter == "yes")||(keychar=="backspace")) {
+ if (vEditString == vEditableOptionText_A)
+ vEditString = "";
+ }
+ if (keychar=="backspace") {
+ // To handle backspace -
+ vEditString = vEditString.substring(0,vEditString.length-1);
+ // Decrease length of string by one from right
+
+ vSelectChange_A = 'MANUAL_CLICK';
+ // Indicates that the Change in dropdown selected
+ // option was due to a Manual Click
+
+ }
+ //alert("EditString2:"+vEditString);
+
+ if (vAllowableCharacter == "yes") {
+ // To handle addition of a character -
+ vEditString+=String.fromCharCode(keycode);
+ // Concatenate Enter character to Editable string
+
+ // The following portion handles the "automatic Jump" bug
+ // The "automatic Jump" bug (Description):
+ // If a alphabet is entered (while editing)
+ // ...which is contained as a first character in one of the read-only options
+ // ..the focus automatically "jumps" to the read-only option
+ // (-- this is a common property of normal dropdowns
+ // ..but..is undesirable while editing).
+
+ var i=0;
+ var vEnteredChar = String.fromCharCode(keycode);
+ var vUpperCaseEnteredChar = vEnteredChar;
+ var vLowerCaseEnteredChar = vEnteredChar;
+
+
+ if(((keycode)>=97)&&((keycode)<=122))
+ // if vEnteredChar lowercase
+ vUpperCaseEnteredChar = String.fromCharCode(keycode - 32);
+ // This is UpperCase
+
+
+ if(((keycode)>=65)&&((keycode)<=90))
+ // if vEnteredChar is UpperCase
+ vLowerCaseEnteredChar = String.fromCharCode(keycode + 32);
+ // This is lowercase
+
+ if(e.which) { //For Netscape
+ // Compare the typed character (into the editable option)
+ // with the first character of all the other
+ // options (non-editable).
+
+ // To note if the jump to the non-editable option was due
+ // to a Manual click (i.e.,changed on purpose by user)
+ // or due to System properties of dropdown
+ // (i.e.,user did not change the option in the dropdown;
+ // instead an automatic jump happened due to inbuilt
+ // dropdown properties of browser on typing of a character )
+
+ for (i=0;i<=(getdropdown.options.length-1);i++)
+ {
+ if(i!=vEditableOptionIndex_A)
+ {
+ var vReadOnlyString = getdropdown[i].text;
+ var vFirstChar = vReadOnlyString.substring(0,1);
+ if((vFirstChar == vUpperCaseEnteredChar)||(vFirstChar == vLowerCaseEnteredChar))
+ {
+ vSelectChange_A = 'AUTO_SYSTEM';
+ // Indicates that the Change in dropdown selected
+ // option was due to System properties of dropdown
+ break;
+ }
+ else
+ {
+ vSelectChange_A = 'MANUAL_CLICK';
+ // Indicates that the Change in dropdown selected
+ // option was due to a Manual Click
+ }
+ }
+ }
+ }
+ }
+
+ // Set the new edited string into the Editable option
+ getdropdown.options[vEditableOptionIndex_A].text = vEditString;
+ //getdropdown.options[vEditableOptionIndex_A].value = vEditString; //Use this line only if want to change the internal value too; else this line is not required.
+
+ return false;
+ }
+ }
+ return true;
+ }
+
+ function fnKeyUpHandler_A(getdropdown, e) {
+ fnSanityCheck(getdropdown);
+
+ if(e.which) { // Netscape
+ if(vSelectChange_A == 'AUTO_SYSTEM') {
+ // if editable dropdown option jumped while editing
+ // (due to typing of a character which is the first character of some other option)
+ // then go back to the editable option.
+ getdropdown[(vEditableOptionIndex_A)].selected=true;
+ }
+
+ var vEventKeyCode = FindKeyCode(e);
+ // if [ <- ] or [ -> ] arrow keys are pressed, select the editable option
+ if((vEventKeyCode == 37)||(vEventKeyCode == 39)) {
+ getdropdown[vEditableOptionIndex_A].selected=true;
+ }
+ }
+ }
+
+/*-------------------------------------------------------------------------------------------- */
+
+<!--end of script for dropdown lstDropDown_A --> \ No newline at end of file
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/form-field-tooltip.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/form-field-tooltip.js
new file mode 100644
index 000000000..b499ca084
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/form-field-tooltip.js
@@ -0,0 +1,715 @@
+/************************************************************************************************************
+
+ Form field tooltip
+ (C) www.dhtmlgoodies.com, September 2006
+
+ This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.
+
+ Terms of use:
+ Look at the terms of use at http://www.dhtmlgoodies.com/index.html?page=termsOfUse
+
+ Thank you!
+
+ www.dhtmlgoodies.com
+ Alf Magne Kalleland
+
+************************************************************************************************************/
+
+var DHTMLgoodies_globalTooltipObj;
+
+
+/**
+Constructor
+**/
+function DHTMLgoodies_formTooltip()
+{
+ var tooltipDiv;
+ var tooltipText;
+ var tooltipContentDiv; // Reference to inner div with tooltip content
+ var imagePath; // Relative path to images
+ var arrowImageFile; // Name of arrow image
+ var arrowImageFileRight; // Name of arrow image
+ var arrowRightWidth;
+ var arrowTopHeight;
+ var tooltipWidth; // Width of tooltip
+ var roundedCornerObj; // Reference to object of class DHTMLgoodies_roundedCorners
+ var tooltipBgColor;
+ var closeMessage; // Close message
+ var activeInput; // Reference to currently active input
+ var tooltipPosition; // Tooltip position, possible values: "below" or "right"
+ var tooltipCornerSize; // Size of rounded corners
+ var displayArrow; // Display arrow above or at the left of the tooltip?
+ var cookieName; // Name of cookie
+ var disableTooltipPossibility; // Possibility of disabling tooltip
+ var disableTooltipByCookie; // If tooltip has been disabled, save the settings in cookie, i.e. for other pages with the same cookie name.
+ var disableTooltipMessage;
+ var tooltipDisabled;
+ var isMSIE;
+ var tooltipIframeObj;
+ var pageBgColor; // Color of background - used in ie when applying iframe which covers select boxes
+ var currentTooltipObj; // Reference to form field which tooltip is currently showing for
+
+ this.currentTooltipObj = false,
+ this.tooltipDiv = false,
+ this.tooltipText = false;
+ this.imagePath = 'static/fusion/raptor/images/';
+ this.arrowImageFile = 'green-arrow.gif';
+ this.arrowImageFileRight = 'green-arrow-right.gif';
+ this.tooltipWidth = 200;
+ this.tooltipBgColor = '#317082';
+ this.closeMessage = 'Close';
+ this.disableTooltipMessage = 'Don\'t show this message again';
+ this.activeInput = false;
+ this.tooltipPosition = 'right';
+ this.arrowRightWidth = 16; // Default width of arrow when the tooltip is on the right side of the inputs.
+ this.arrowTopHeight = 13; // Default height of arrow at the top of tooltip
+ this.tooltipCornerSize = 10;
+ this.displayArrow = true;
+ this.cookieName = 'DHTMLgoodies_tooltipVisibility';
+ this.disableTooltipByCookie = false;
+ this.tooltipDisabled = false;
+ this.disableTooltipPossibility = true;
+ this.tooltipIframeObj = false;
+ this.pageBgColor = '#FFFFFF';
+
+ DHTMLgoodies_globalTooltipObj = this;
+
+ if(navigator.userAgent.indexOf('MSIE')>=0)this.isMSIE = true; else this.isMSIE = false;
+}
+
+
+DHTMLgoodies_formTooltip.prototype = {
+ // {{{ initFormFieldTooltip()
+ /**
+ *
+ *
+ * Initializes the tooltip script. Most set methods needs to be executed before you call this method.
+ *
+ * @public
+ */
+ initFormFieldTooltip : function()
+ {
+ var formElements = new Array();
+ var inputs = document.getElementsByTagName('IMG');
+ for(var no=0;no<inputs.length;no++){
+ var attr = inputs[no].getAttribute('tooltipText');
+ if(!attr)attr = inputs[no].tooltipText;
+ if(attr)formElements[formElements.length] = inputs[no];
+ }
+
+ var inputs = document.getElementsByTagName('INPUT');
+ for(var no=0;no<inputs.length;no++){
+ var attr = inputs[no].getAttribute('tooltipText');
+ if(!attr)attr = inputs[no].tooltipText;
+ if(attr)formElements[formElements.length] = inputs[no];
+ }
+
+ var inputs = document.getElementsByTagName('TEXTAREA');
+ for(var no=0;no<inputs.length;no++){
+ var attr = inputs[no].getAttribute('tooltipText');
+ if(!attr)attr = inputs[no].tooltipText;
+ if(attr)formElements[formElements.length] = inputs[no];
+ }
+ var inputs = document.getElementsByTagName('SELECT');
+ for(var no=0;no<inputs.length;no++){
+ var attr = inputs[no].getAttribute('tooltipText');
+ if(!attr)attr = inputs[no].tooltipText;
+ if(attr)formElements[formElements.length] = inputs[no];
+ }
+
+ window.refToFormTooltip = this;
+
+ for(var no=0;no<formElements.length;no++){
+ formElements[no].onfocus = this.__displayTooltip;
+ }
+ this.addEvent(window,'resize',function(){ window.refToFormTooltip.__positionCurrentToolTipObj(); });
+
+ this.addEvent(document.documentElement,'click',function(e){ window.refToFormTooltip.__autoHideTooltip(e); });
+ }
+
+ // }}}
+ ,
+ // {{{ setTooltipPosition()
+ /**
+ *
+ *
+ * Specify position of tooltip(below or right)
+ * @param String newPosition (Possible values: "below" or "right")
+ *
+ * @public
+ */
+ setTooltipPosition : function(newPosition)
+ {
+ this.tooltipPosition = newPosition;
+ }
+ // }}}
+ ,
+ // {{{ setCloseMessage()
+ /**
+ *
+ *
+ * Specify "Close" message
+ * @param String closeMessage
+ *
+ * @public
+ */
+ setCloseMessage : function(closeMessage)
+ {
+ this.closeMessage = closeMessage;
+ }
+ // }}}
+ ,
+ // {{{ setDisableTooltipMessage()
+ /**
+ *
+ *
+ * Specify disable tooltip message at the bottom of the tooltip
+ * @param String disableTooltipMessage
+ *
+ * @public
+ */
+ setDisableTooltipMessage : function(disableTooltipMessage)
+ {
+ this.disableTooltipMessage = disableTooltipMessage;
+ }
+ // }}}
+ ,
+ // {{{ setTooltipDisablePossibility()
+ /**
+ *
+ *
+ * Specify whether you want the disable link to appear or not.
+ * @param Boolean disableTooltipPossibility
+ *
+ * @public
+ */
+ setTooltipDisablePossibility : function(disableTooltipPossibility)
+ {
+ this.disableTooltipPossibility = disableTooltipPossibility;
+ }
+ // }}}
+ ,
+ // {{{ setCookieName()
+ /**
+ *
+ *
+ * Specify name of cookie. Useful if you're using this script on several pages.
+ * @param String newCookieName
+ *
+ * @public
+ */
+ setCookieName : function(newCookieName)
+ {
+ this.cookieName = newCookieName;
+ }
+ // }}}
+ ,
+ // {{{ setTooltipWidth()
+ /**
+ *
+ *
+ * Specify width of tooltip
+ * @param Int newWidth
+ *
+ * @public
+ */
+ setTooltipWidth : function(newWidth)
+ {
+ this.tooltipWidth = newWidth;
+ }
+
+ // }}}
+ ,
+ // {{{ setArrowVisibility()
+ /**
+ *
+ *
+ * Display arrow at the top or at the left of the tooltip?
+ * @param Boolean displayArrow
+ *
+ * @public
+ */
+
+ setArrowVisibility : function(displayArrow)
+ {
+ this.displayArrow = displayArrow;
+ }
+
+ // }}}
+ ,
+ // {{{ setTooltipBgColor()
+ /**
+ *
+ *
+ * Send true to this method if you want to be able to save tooltip visibility in cookie. If it's set to true,
+ * It means that when someone returns to the page, the tooltips won't show.
+ *
+ * @param Boolean disableTooltipByCookie
+ *
+ * @public
+ */
+ setDisableTooltipByCookie : function(disableTooltipByCookie)
+ {
+ this.disableTooltipByCookie = disableTooltipByCookie;
+ }
+ // }}}
+ ,
+ // {{{ setTooltipBgColor()
+ /**
+ *
+ *
+ * This method specifies background color of tooltip
+ * @param String newBgColor
+ *
+ * @public
+ */
+ setTooltipBgColor : function(newBgColor)
+ {
+ this.tooltipBgColor = newBgColor;
+ }
+
+ // }}}
+ ,
+ // {{{ setTooltipCornerSize()
+ /**
+ *
+ *
+ * Size of rounded corners around tooltip
+ * @param Int newSize (0 = no rounded corners)
+ *
+ * @public
+ */
+ setTooltipCornerSize : function(tooltipCornerSize)
+ {
+ this.tooltipCornerSize = tooltipCornerSize;
+ }
+
+ // }}}
+ ,
+ // {{{ setTopArrowHeight()
+ /**
+ *
+ *
+ * Size height of arrow at the top of tooltip
+ * @param Int arrowTopHeight
+ *
+ * @public
+ */
+ setTopArrowHeight : function(arrowTopHeight)
+ {
+ this.arrowTopHeight = arrowTopHeight;
+ }
+
+ // }}}
+ ,
+ // {{{ setRightArrowWidth()
+ /**
+ *
+ *
+ * Size width of arrow when the tooltip is on the right side of inputs
+ * @param Int arrowTopHeight
+ *
+ * @public
+ */
+ setRightArrowWidth : function(arrowRightWidth)
+ {
+ this.arrowRightWidth = arrowRightWidth;
+ }
+
+ // }}}
+ ,
+ // {{{ setPageBgColor()
+ /**
+ *
+ *
+ * Specify background color of page.
+ * @param String pageBgColor
+ *
+ * @public
+ */
+ setPageBgColor : function(pageBgColor)
+ {
+ this.pageBgColor = pageBgColor;
+ }
+
+ // }}}
+ ,
+ // {{{ __hideTooltip()
+ /**
+ *
+ *
+ * This method displays the tooltip
+ *
+ *
+ * @private
+ */
+ __displayTooltip : function()
+ {
+ if(DHTMLgoodies_globalTooltipObj.disableTooltipByCookie){
+ var cookieValue = DHTMLgoodies_globalTooltipObj.getCookie(DHTMLgoodies_globalTooltipObj.cookieName) + '';
+ if(cookieValue=='1')DHTMLgoodies_globalTooltipObj.tooltipDisabled = true;
+ }
+
+ if(DHTMLgoodies_globalTooltipObj.tooltipDisabled)return; // Tooltip disabled
+ var tooltipText = this.getAttribute('tooltipText');
+ DHTMLgoodies_globalTooltipObj.activeInput = this;
+
+ if(!tooltipText)tooltipText = this.tooltipText;
+ DHTMLgoodies_globalTooltipObj.tooltipText = tooltipText;
+
+
+ if(!DHTMLgoodies_globalTooltipObj.tooltipDiv)DHTMLgoodies_globalTooltipObj.__createTooltip();
+
+ DHTMLgoodies_globalTooltipObj.__positionTooltip(this);
+
+
+
+
+ DHTMLgoodies_globalTooltipObj.tooltipContentDiv.innerHTML = tooltipText;
+ DHTMLgoodies_globalTooltipObj.tooltipDiv.style.display='block';
+
+ if(DHTMLgoodies_globalTooltipObj.isMSIE){
+ if(DHTMLgoodies_globalTooltipObj.tooltipPosition == 'below'){
+ DHTMLgoodies_globalTooltipObj.tooltipIframeObj.style.height = (DHTMLgoodies_globalTooltipObj.tooltipDiv.clientHeight - DHTMLgoodies_globalTooltipObj.arrowTopHeight);
+ }else{
+ DHTMLgoodies_globalTooltipObj.tooltipIframeObj.style.height = (DHTMLgoodies_globalTooltipObj.tooltipDiv.clientHeight);
+ }
+ }
+
+ }
+ // }}}
+ ,
+ // {{{ __hideTooltip()
+ /**
+ *
+ *
+ * This function hides the tooltip
+ *
+ *
+ * @private
+ */
+ __hideTooltip : function()
+ {
+ try{
+ DHTMLgoodies_globalTooltipObj.tooltipDiv.style.display='none';
+ }catch(e){
+ }
+
+ }
+ // }}}
+ ,
+ // {{{ getSrcElement()
+ /**
+ *
+ *
+ * Return the source of an event.
+ *
+ *
+ * @private
+ */
+ getSrcElement : function(e)
+ {
+ var el;
+ if (e.target) el = e.target;
+ else if (e.srcElement) el = e.srcElement;
+ if (el.nodeType == 3) // defeat Safari bug
+ el = el.parentNode;
+ return el;
+ }
+ // }}}
+ ,
+ __autoHideTooltip : function(e)
+ {
+ if(document.all)e = event;
+ var src = this.getSrcElement(e);
+ if(src.tagName.toLowerCase()!='input' && src.tagName.toLowerCase().toLowerCase()!='textarea' && src.tagName.toLowerCase().toLowerCase()!='select')this.__hideTooltip();
+
+ var attr = src.getAttribute('tooltipText');
+ if(!attr)attr = src.tooltipText;
+ if(!attr){
+ this.__hideTooltip();
+ }
+
+ }
+ // }}}
+ ,
+ // {{{ __hideTooltipFromLink()
+ /**
+ *
+ *
+ * This function hides the tooltip
+ *
+ *
+ * @private
+ */
+ __hideTooltipFromLink : function()
+ {
+
+ this.activeInput.focus();
+ window.refToThis = this;
+ setTimeout('window.refToThis.__hideTooltip()',10);
+ }
+ // }}}
+ ,
+ // {{{ disableTooltip()
+ /**
+ *
+ *
+ * Hide tooltip and disable it
+ *
+ *
+ * @public
+ */
+ disableTooltip : function()
+ {
+ this.__hideTooltipFromLink();
+ if(this.disableTooltipByCookie)this.setCookie(this.cookieName,'1',500);
+ this.tooltipDisabled = true;
+ }
+ // }}}
+ ,
+ // {{{ __positionTooltip()
+ /**
+ *
+ *
+ * This function creates the tooltip elements
+ *
+ *
+ * @private
+ */
+ __createTooltip : function()
+ {
+ this.tooltipDiv = document.createElement('DIV');
+ this.tooltipDiv.style.position = 'absolute';
+
+ if(this.displayArrow){
+ var topDiv = document.createElement('DIV');
+
+ if(this.tooltipPosition=='below'){
+
+ topDiv.style.marginLeft = '20px';
+ var arrowDiv = document.createElement('IMG');
+ arrowDiv.src = this.imagePath + this.arrowImageFile + '?rand='+ Math.random();
+ arrowDiv.style.display='block';
+ topDiv.appendChild(arrowDiv);
+
+ }else{
+ topDiv.style.marginTop = '5px';
+ var arrowDiv = document.createElement('IMG');
+ arrowDiv.src = this.imagePath + this.arrowImageFileRight + '?rand='+ Math.random();
+ arrowDiv.style.display='block';
+ topDiv.appendChild(arrowDiv);
+ topDiv.style.position = 'absolute';
+ }
+
+ this.tooltipDiv.appendChild(topDiv);
+ }
+
+ var outerDiv = document.createElement('DIV');
+ outerDiv.style.position = 'relative';
+ outerDiv.style.zIndex = 1000;
+ if(this.tooltipPosition!='below' && this.displayArrow){
+ outerDiv.style.left = this.arrowRightWidth + 'px';
+ }
+
+ outerDiv.id = 'DHTMLgoodies_formTooltipDiv';
+ outerDiv.className = 'DHTMLgoodies_formTooltipDiv';
+ outerDiv.style.backgroundColor = this.tooltipBgColor;
+ this.tooltipDiv.appendChild(outerDiv);
+
+ if(this.isMSIE){
+ this.tooltipIframeObj = document.createElement('<IFRAME name="tooltipIframeObj" width="' + this.tooltipWidth + '" frameborder="no" src="about:blank"></IFRAME>');
+ this.tooltipIframeObj.style.position = 'absolute';
+ this.tooltipIframeObj.style.top = '0px';
+ this.tooltipIframeObj.style.left = '0px';
+ this.tooltipIframeObj.style.width = (this.tooltipWidth) + 'px';
+ this.tooltipIframeObj.style.zIndex = 100;
+ this.tooltipIframeObj.background = this.pageBgColor;
+ this.tooltipIframeObj.style.backgroundColor= this.pageBgColor;
+ this.tooltipDiv.appendChild(this.tooltipIframeObj);
+ if(this.tooltipPosition!='below' && this.displayArrow){
+ this.tooltipIframeObj.style.left = (this.arrowRightWidth) + 'px';
+ }else{
+ this.tooltipIframeObj.style.top = this.arrowTopHeight + 'px';
+ }
+
+ setTimeout("self.frames['tooltipIframeObj'].document.documentElement.style.backgroundColor='" + this.pageBgColor + "'",500);
+
+ }
+
+ this.tooltipContentDiv = document.createElement('DIV');
+ this.tooltipContentDiv.style.position = 'relative';
+ this.tooltipContentDiv.id = 'DHTMLgoodies_formTooltipContent';
+ outerDiv.appendChild(this.tooltipContentDiv);
+
+ var closeDiv = document.createElement('DIV');
+ closeDiv.style.textAlign = 'center';
+
+ closeDiv.innerHTML = '<A class="DHTMLgoodies_formTooltip_closeMessage" href="#" onclick="DHTMLgoodies_globalTooltipObj.__hideTooltipFromLink();return false">' + this.closeMessage + '</A>';
+
+ if(this.disableTooltipPossibility){
+ var tmpHTML = closeDiv.innerHTML;
+ tmpHTML = tmpHTML + ' | <A class="DHTMLgoodies_formTooltip_closeMessage" href="#" onclick="DHTMLgoodies_globalTooltipObj.disableTooltip();return false">' + this.disableTooltipMessage + '</A>';
+ closeDiv.innerHTML = tmpHTML;
+ }
+
+ outerDiv.appendChild(closeDiv);
+
+ document.body.appendChild(this.tooltipDiv);
+
+
+
+ if(this.tooltipCornerSize>0){
+ this.roundedCornerObj = new DHTMLgoodies_roundedCorners();
+ // (divId,xRadius,yRadius,color,backgroundColor,padding,heightOfContent,whichCorners)
+ this.roundedCornerObj.addTarget('DHTMLgoodies_formTooltipDiv',this.tooltipCornerSize,this.tooltipCornerSize,this.tooltipBgColor,this.pageBgColor,5);
+ this.roundedCornerObj.init();
+ }
+
+
+ this.tooltipContentDiv = document.getElementById('DHTMLgoodies_formTooltipContent');
+ }
+ // }}}
+ ,
+ addEvent : function(whichObject,eventType,functionName)
+ {
+ if(whichObject.attachEvent){
+ whichObject['e'+eventType+functionName] = functionName;
+ whichObject[eventType+functionName] = function(){whichObject['e'+eventType+functionName]( window.event );}
+ whichObject.attachEvent( 'on'+eventType, whichObject[eventType+functionName] );
+ } else
+ whichObject.addEventListener(eventType,functionName,false);
+ }
+ // }}}
+ ,
+ __positionCurrentToolTipObj : function()
+ {
+ if(DHTMLgoodies_globalTooltipObj.activeInput)this.__positionTooltip(DHTMLgoodies_globalTooltipObj.activeInput);
+
+ }
+ // }}}
+ ,
+ // {{{ __positionTooltip()
+ /**
+ *
+ *
+ * This function positions the tooltip
+ *
+ * @param Obj inputObj = Reference to text input
+ *
+ * @private
+ */
+ __positionTooltip : function(inputObj)
+ {
+ var offset = 0;
+ if(!this.displayArrow)offset = 3;
+ if(this.tooltipPosition=='below'){
+ this.tooltipDiv.style.left = this.getLeftPos(inputObj)+ 'px';
+ this.tooltipDiv.style.top = (this.getTopPos(inputObj) + inputObj.offsetHeight + offset) + 'px';
+ }else{
+
+ this.tooltipDiv.style.left = (this.getLeftPos(inputObj) + inputObj.offsetWidth + offset)+ 'px';
+ this.tooltipDiv.style.top = this.getTopPos(inputObj) + 'px';
+ }
+ this.tooltipDiv.style.width=this.tooltipWidth + 'px';
+
+ }
+ ,
+ // {{{ getTopPos()
+ /**
+ * This method will return the top coordinate(pixel) of an object
+ *
+ * @param Object inputObj = Reference to HTML element
+ * @public
+ */
+ getTopPos : function(inputObj)
+ {
+ var returnValue = inputObj.offsetTop;
+ while((inputObj = inputObj.offsetParent) != null){
+ if(inputObj.tagName!='HTML'){
+ returnValue += inputObj.offsetTop;
+ if(document.all)returnValue+=inputObj.clientTop;
+ }
+ }
+ return returnValue;
+ }
+ // }}}
+
+ ,
+ // {{{ getLeftPos()
+ /**
+ * This method will return the left coordinate(pixel) of an object
+ *
+ * @param Object inputObj = Reference to HTML element
+ * @public
+ */
+ getLeftPos : function(inputObj)
+ {
+ var returnValue = inputObj.offsetLeft;
+ while((inputObj = inputObj.offsetParent) != null){
+ if(inputObj.tagName!='HTML'){
+ returnValue += inputObj.offsetLeft;
+ if(document.all)returnValue+=inputObj.clientLeft;
+ }
+ }
+ return returnValue;
+ }
+
+ ,
+
+ // {{{ getCookie()
+ /**
+ *
+ * These cookie functions are downloaded from
+ * http://www.mach5.com/support/analyzer/manual/html/General/CookiesJavaScript.htm
+ *
+ * This function returns the value of a cookie
+ *
+ * @param String name = Name of cookie
+ * @param Object inputObj = Reference to HTML element
+ * @public
+ */
+ getCookie : function(name) {
+ var start = document.cookie.indexOf(name+"=");
+ var len = start+name.length+1;
+ if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
+ if (start == -1) return null;
+ var end = document.cookie.indexOf(";",len);
+ if (end == -1) end = document.cookie.length;
+ return unescape(document.cookie.substring(len,end));
+ }
+ // }}}
+ ,
+
+ // {{{ setCookie()
+ /**
+ *
+ * These cookie functions are downloaded from
+ * http://www.mach5.com/support/analyzer/manual/html/General/CookiesJavaScript.htm
+ *
+ * This function creates a cookie. (This method has been slighhtly modified)
+ *
+ * @param String name = Name of cookie
+ * @param String value = Value of cookie
+ * @param Int expires = Timestamp - days
+ * @param String path = Path for cookie (Usually left empty)
+ * @param String domain = Cookie domain
+ * @param Boolean secure = Secure cookie(SSL)
+ *
+ * @public
+ */
+ setCookie : function(name,value,expires,path,domain,secure) {
+ expires = expires * 60*60*24*1000;
+ var today = new Date();
+ var expires_date = new Date( today.getTime() + (expires) );
+ var cookieString = name + "=" +escape(value) +
+ ( (expires) ? ";expires=" + expires_date.toGMTString() : "") +
+ ( (path) ? ";path=" + path : "") +
+ ( (domain) ? ";domain=" + domain : "") +
+ ( (secure) ? ";secure" : "");
+ document.cookie = cookieString;
+ }
+ // }}}
+
+
+} \ No newline at end of file
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/gmap.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/gmap.js
new file mode 100644
index 000000000..ba214f61e
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/gmap.js
@@ -0,0 +1,634 @@
+var map;
+var popupTable;
+var networkOverlay;
+var selectedNetworkOverlay;
+var flashTimeout;
+//var infoDiv;
+var mainInfoDiv;
+var locationInfoDiv;
+var loadingAnimationDiv;
+var geocoder;
+var addressMarker;
+var popupDiv;
+//var novaButton;
+
+function novaMapInit() {
+ if (GBrowserIsCompatible()) {
+ var dmap = document.getElementById("map");
+ map = new GMap2(dmap);
+ var defaultCenterLongitude = document.getElementById("defaultCenterLongitude").value;
+ var defaultCenterLatitude = document.getElementById("defaultCenterLatitude").value;
+ var defaultZoomLevel = document.getElementById("defaultZoomLevel").value * 1;
+
+ map.setCenter(new GLatLng(defaultCenterLatitude, defaultCenterLongitude), defaultZoomLevel);
+
+ map.enableScrollWheelZoom();
+ map.enableContinuousZoom();
+ map.addControl(new GLargeMapControl());
+ map.addControl(new GMapTypeControl());
+
+ geocoder = new GClientGeocoder();
+
+ GEvent.addListener(map, "dragend", mapDragEnd);
+ GEvent.addListener(map, "zoomend", mapZoomChanged);
+ GEvent.addListener(map, "click", mapClicked);
+ GEvent.addListener(map, "moveend", mapMoveEnd)
+ GEvent.addListener(map, "singlerightclick", mapRightClicked);
+ GEvent.addListener(map, "mousemove", function(latlng) {
+ locationInfoDiv.innerHTML = latlng.lng().toFixed(3) + ", " + latlng.lat().toFixed(3);
+ });
+
+ var n = document.getElementById("popupmenudiv2");
+ popupDiv = n.cloneNode(true);
+ map.getContainer().appendChild(popupDiv);
+
+ popupTable = document.getElementById("popupmenudivtb");
+
+ // detail info div
+ /*infoDiv = document.createElement("div");
+ infoDiv.style.display = "none";
+ infoDiv.style.position = "absolute";
+ infoDiv.style.overflow = "auto";
+ infoDiv.style.top = "0px";
+ infoDiv.style.left = "0px";
+ infoDiv.style.zIndex = "1001";
+ infoDiv.style.border = "1px outset #000";
+ infoDiv.style.background = "#C6DEFF";
+ infoDiv.style.height = "150px";
+ infoDiv.style.width = "300px";
+ infoDiv.align = "center";*/
+
+ mainInfoDiv = document.createElement("div");
+ mainInfoDiv.style.display = "none";
+ mainInfoDiv.style.position = "absolute";
+ mainInfoDiv.style.overflow = "auto";
+ mainInfoDiv.style.top = "0px";
+ mainInfoDiv.style.left = "0px";
+ mainInfoDiv.style.zIndex = "1001";
+ mainInfoDiv.style.border = "1px outset #000";
+ mainInfoDiv.style.background = "#C6DEFF";
+ mainInfoDiv.style.height = "150px";
+ mainInfoDiv.style.width = "300px";
+ mainInfoDiv.align = "center";
+
+ //mainInfoDiv = infoDiv.appendChild(document.createElement("div"));
+ mainInfoDiv.style.overflow = "auto";
+ mainInfoDiv.style.height = "150px";
+ mainInfoDiv.style.width = "300px";
+ //mainInfoDiv.align = "center";
+
+ /*var closeInfoDiv = infoDiv.appendChild(document.createElement("div"));
+ closeInfoDiv.appendChild(document.createTextNode("Close"));
+
+ closeInfoDiv.style.background = "#FFFFF0";
+ closeInfoDiv.style.color = "black";
+ closeInfoDiv.style.fontFamily = "Verdana";
+ closeInfoDiv.style.fontSize = "12px";
+ closeInfoDiv.style.fontWeight= "bold";
+ closeInfoDiv.style.border = "2px solid black";
+ closeInfoDiv.style.padding = "0px";
+ closeInfoDiv.style.marginBottom = "0px";
+ closeInfoDiv.style.textAlign = "center";
+ closeInfoDiv.style.width = "80px";
+ closeInfoDiv.style.height = "15px";
+ closeInfoDiv.style.cursor = "pointer";
+
+ GEvent.addDomListener(closeInfoDiv, "click", function() {
+ infoDiv.style.display = "none";
+ }); */
+
+ // longitude latitude div
+ var locationInfoWidth = 200;
+ var locationInfoHeight = 15;
+ locationInfoDiv = document.createElement("div");
+ locationInfoDiv.style.display = "inline";
+ locationInfoDiv.style.position = "absolute";
+ locationInfoDiv.style.zIndex = "1";
+ locationInfoDiv.style.height = locationInfoHeight + "px";
+ locationInfoDiv.style.width = locationInfoWidth + "px";
+ locationInfoDiv.align = "center";
+ locationInfoDiv.style.color = "#4CC417";
+ locationInfoDiv.style.fontWeight = "bold";
+ locationInfoDiv.appendChild(document.createTextNode("Longitude Latitude"));
+
+ var mapWidth = map.getSize().width;
+ var mapHeight = map.getSize().height;
+
+ locationInfoDiv.style.top = (mapHeight - locationInfoHeight - 5) + "px";
+ locationInfoDiv.style.left = (mapWidth / 2 - locationInfoWidth / 2) + "px";
+
+ // loading image animation
+ loadingAnimationDiv = document.createElement("div");
+ loadingAnimationDiv.style.position = "absolute";
+ loadingAnimationDiv.style.zIndex = "100000";
+ loadingAnimationDiv.style.display = "none";
+ loadingAnimationDiv.style.width = "50px";
+ loadingAnimationDiv.style.height = "50px";
+ loadingAnimationDiv.style.top = (mapHeight / 2 - 50 / 2) + "px";
+ loadingAnimationDiv.style.left = (mapWidth / 2 - 50 / 2) + "px";
+ var imgDiv = loadingAnimationDiv.appendChild(document.createElement("img"));
+ imgDiv.src = document.getElementById("imgFolder").value + "loading.gif";
+
+
+ //map.getContainer().appendChild(infoDiv);
+ map.getContainer().appendChild(mainInfoDiv);
+ map.getContainer().appendChild(locationInfoDiv);
+ map.getContainer().appendChild(loadingAnimationDiv);
+ updateImage(0);
+ }
+}
+
+function mapRightClicked(point, src) {
+ var latlng = map.fromContainerPixelToLatLng(new GPoint(point.x , point.y));
+ alert(latlng.lng() + ", " + latlng.lat());
+}
+/*
+function searchObject(searchInput, searchType, exactMatch, clickX, clickY) {
+ loadingAnimationDiv.style.display = "inline";
+ var baseURL = document.getElementById("baseURL").value;
+ //var url = baseURL + "/gmap_controller.htm?action=searchObject";
+ //var url = baseURL + "report.gmap.search_object";
+ var url = baseURL + "/gmapservlet?action=searchObject&nextpage=report.gmap.search_object";
+ url += "&search_input=" + searchInput;
+ url += "&search_type=" + searchType;
+ url += "&exact_match=" + exactMatch;
+ url += "&object_type=CELLSITE";
+
+ if (clickX == null || clickY == null) {
+ var mapWidth = map.getSize().width;
+ var mapHeight = map.getSize().height;
+ clickX = mapWidth / 2;
+ clickY = mapHeight / 2;
+ }
+
+ url += "&client_x=" + clickX;
+ url += "&client_y=" + clickY;
+
+ new Ajax.Request(url, {
+ method: 'get',
+ onSuccess: function(transport) {
+ loadingAnimationDiv.style.display = "none";
+ var jsonData = transport.responseText.evalJSON();
+ var list = jsonData.list;
+
+ if (list == null) {
+ alert("Not found");
+ }
+ else {
+ if (list.length == 1) {
+ var longitude = list[0].longitude;
+ var latitude = list[0].latitude;
+ map.setCenter(new GLatLng(latitude, longitude));
+ updateImage(0);
+ }
+ else {
+ for (var i = popupTable.childNodes.length - 1; i >= 0; i--) {
+ popupTable.removeChild(popupTable.lastChild);
+ }
+
+ for (var i = 0; i < list.length; i++) {
+ var tr = popupTable.appendChild(document.createElement("tr"));
+ var td = tr.appendChild(document.createElement("td"));
+ td.appendChild(document.createTextNode(list[i].type + "(" + list[i].numberOfT1 +
+ "): " + list[i].id));
+ td.style.border = "solid";
+ td.style.borderWidth = "thin";
+ td.style.borderRight = "none";
+ td.style.borderLeft = "none";
+
+ if (i == 0) {
+ td.style.borderTop = "none";
+ }
+
+ if (i == list.length - 1) {
+ td.style.borderBottom = "none";
+ }
+
+ td.style.color = "#0000FF";
+ td.style.background = "#FFFFF0";
+ td.style.fontSize = "12px";
+ td.font = "Arial,Helvetica,sans-serif";
+ td.id = list[i].latitude + ">>" + list[i].longitude;
+
+ td.onmouseover = function(e) {
+ this.style.background = "#0000FF";
+ this.style.color = "#FFFFF0";
+ }
+
+ td.onmouseout = function(e) {
+ this.style.background = "#FFFFF0";
+ this.style.color = "#0000FF";
+ }
+
+ td.onclick = function(e) {
+ //var popupDiv = document.getElementById("popupmenudiv");
+ popupDiv.style.display = "none";
+ var latitudeLongitude = this.id.split(">>");
+ var latlng = new GLatLng(latitudeLongitude[0], latitudeLongitude[1]);
+ map.setCenter(latlng);
+ updateImage(0);
+ }
+ }
+
+ //var popupDiv = document.getElementById("popupmenudiv");
+ popupDiv.style.display = "";
+
+ var textWidth = popupDiv.offsetWidth;
+ var textHeight = popupDiv.offsetHeight;
+
+ if (textHeight >= 200) {
+ popupDiv.style.overflow = "auto";
+ popupDiv.style.height = "200px";
+ textHeight = 200;
+ }
+
+ if (textWidth >= 250) {
+ popupDiv.style.width = "250px";
+ //textWidth = 250;
+ }
+
+ var clientX = jsonData.clientX;
+ var clientY = jsonData.clientY;
+
+ if ((clientX * 1 + textWidth + 20) >= screen.availWidth) {
+ clientX = clientX - textWidth - 20;
+ }
+
+ if ((clientY * 1 + textHeight) >= document.getElementById("map").offsetHeight) {
+ clientY = document.getElementById("map").offsetHeight - textHeight;
+
+ }
+
+ popupDiv.style.top = clientY + "px";
+ popupDiv.style.left = clientX + "px";
+ }
+ }
+ }
+ });
+}
+*/
+function getInfo(info, x, y) {
+ var baseURL = document.getElementById("baseURL").value;
+ //var url = baseURL + "/gmap_controller.htm?action=getInfo";
+ //var url = baseURL + "report.gmap.get_info";
+ var url = baseURL + "/gmapservlet?action=getInfo&nextpage=report.gmap.get_info";
+ url += "&info=" + info;
+ url += "&client_x=" + x;
+ url += "&client_y=" + y;
+
+ new Ajax.Request(url, {
+ method: 'get',
+ onSuccess: function(transport) {
+ var jsonData = transport.responseText.evalJSON();
+ var clientX = jsonData.clientX;
+ var clientY = jsonData.clientY;
+ var attributes = jsonData.attributes;
+
+ for (var i = mainInfoDiv.childNodes.length - 1; i >= 0; i--) {
+ mainInfoDiv.removeChild(mainInfoDiv.lastChild);
+ }
+
+ mainInfoDiv.align="left";
+ var menuUL = mainInfoDiv.appendChild(document.createElement("ul"));
+ var menuItem = document.createElement("li");
+ menuItem.appendChild(document.createTextNode("Row : " + jsonData.id));
+ menuUL.appendChild(menuItem);
+
+ menuItem = document.createElement("li");
+ menuItem.appendChild(document.createTextNode("Longitude: " + jsonData.longitude));
+ menuUL.appendChild(menuItem);
+
+ menuItem = document.createElement("li");
+ menuItem.appendChild(document.createTextNode("Latitude: " + jsonData.latitude));
+ menuUL.appendChild(menuItem);
+
+ var table = mainInfoDiv.appendChild(document.createElement("table"));
+ table.width="100%";
+ table.align="left";
+ var tbody = table.appendChild(document.createElement("tbody"));
+ //tbody.style.borderCollapse = "collapse";
+ //var tr = tbody.appendChild(document.createElement("tr"));
+ var td;
+ for (var i = 0; i < attributes.length ; i++) {
+ tr = tbody.appendChild(document.createElement("tr"));
+ td = tr.appendChild(document.createElement("td"));
+ td.align="left";
+ td.width="25%"
+ td.style.padding = "2px";
+ td.appendChild(document.createTextNode(attributes[i].key));
+ td = tr.appendChild(document.createElement("td"));
+ td.style.padding = "2px";
+ td.appendChild(document.createTextNode(attributes[i].value));
+ }
+
+ var textWidth = 300;
+ var textHeight = 150 + 15;
+
+ if ((clientX * 1 + textWidth + 20) >= screen.availWidth) {
+ clientX = clientX - textWidth - 20;
+ }
+
+ if ((clientY * 1 + textHeight) >= document.getElementById("map").offsetHeight) {
+ clientY = document.getElementById("map").offsetHeight - textHeight;
+ }
+
+ mainInfoDiv.style.top = clientY + "px";
+ mainInfoDiv.style.left = clientX + "px";
+ mainInfoDiv.style.display = "inline";
+ }
+ });
+}
+
+function mapClicked(overlay, latlng, overlaylatlng) {
+ var baseURL = document.getElementById("baseURL").value;
+ //var url = baseURL + "/gmap_controller.htm?action=singleLeftClick";
+ //var url = baseURL + "report.gmap.single_left_click";
+ var url = baseURL + "/gmapservlet?action=singleLeftClick&nextpage=report.gmap.single_left_click";
+ var mapSize = map.getSize();
+ var mapBounds = map.getBounds();
+ var pointSW = mapBounds.getSouthWest();
+ var pointNE = mapBounds.getNorthEast();
+ url += "&click_longitude=" + latlng.lng();
+ url += "&click_latitude=" + latlng.lat();
+ url += "&zoom_level=" + map.getZoom();
+ url += "&map_size=" + mapSize.width + "," + mapSize.height;
+ url += "&map_bounds=" + pointSW.lng() + "," + pointSW.lat() + "," + pointNE.lng() + "," + pointNE.lat();
+ var point = map.fromLatLngToContainerPixel(latlng);
+ var clickX = point.x;
+ var clickY = point.y;
+ url += "&client_x=" + clickX;
+ url += "&client_y=" + clickY;
+
+ //document.getElementById("popupmenudiv").style.display = "none";
+ popupDiv.style.display="none";
+ mainInfoDiv.style.display="none";
+ new Ajax.Request(url, {
+ method: 'get',
+ onSuccess: function(transport) {
+ var jsonData = transport.responseText.evalJSON();
+ var list = jsonData.list;
+ var selectedImageURL = jsonData.selectedImageURL;
+ var legendImageURL = jsonData.legendImageURL;
+ //alert(legendImageURL);
+ if (legendImageURL != null) {
+ repaintLegend(legendImageURL);
+ }
+
+ if (list != null) {
+ for (var i = popupTable.childNodes.length - 1; i >= 0; i--) {
+ popupTable.removeChild(popupTable.lastChild);
+ }
+
+ for (var i = 0; i < list.length; i++) {
+ var tr = popupTable.appendChild(document.createElement("tr"));
+ var td = tr.appendChild(document.createElement("td"));
+ td.appendChild(document.createTextNode("Row : " + list[i].id));
+ td.style.border = "solid";
+ td.style.borderWidth = "thin";
+ td.style.borderRight = "none";
+ td.style.borderLeft = "none";
+
+ if (i == 0) {
+ td.style.borderTop = "none";
+ }
+
+ if (i == list.length - 1) {
+ td.style.borderBottom = "none";
+ }
+
+ td.style.color = "#0000FF";
+ td.style.background = "#FFFFF0";
+ td.style.fontSize = "12px";
+ td.font = "Arial,Helvetica,sans-serif";
+ td.id = jsonData.type + ">>" + list[i].id + ">>" + list[i].type;
+
+ td.onmouseover = function(e) {
+ this.style.background = "#0000FF";
+ this.style.color = "#FFFFF0";
+ }
+
+ td.onmouseout = function(e) {
+ this.style.background = "#FFFFF0";
+ this.style.color = "#0000FF";
+ }
+
+ td.onclick = function(e) {
+ //var popupDiv = document.getElementById("popupmenudiv");
+ getInfo(this.id, clickX, clickY);
+
+ popupDiv.style.display = "none";
+ }
+ }
+
+ //var popupDiv = document.getElementById("popupmenudiv");
+ popupDiv.style.display = "";
+
+ var textWidth = popupDiv.offsetWidth;
+ var textHeight = popupDiv.offsetHeight;
+
+ if (textHeight >= 200) {
+ popupDiv.style.overflow = "auto";
+ popupDiv.style.height = "200px";
+ textHeight = 200;
+ }
+
+ if (textWidth >= 250) {
+ popupDiv.style.width = "250px";
+ //textWidth = 250;
+ }
+
+ var clientX = jsonData.clientX;
+ var clientY = jsonData.clientY;
+
+ if ((clientX * 1 + textWidth + 20) >= screen.availWidth) {
+ clientX = clientX - textWidth - 20;
+ }
+
+ if ((clientY * 1 + textHeight) >= document.getElementById("map").offsetHeight) {
+ clientY = document.getElementById("map").offsetHeight - textHeight;
+
+ }
+
+ popupDiv.style.top = clientY + "px";
+ popupDiv.style.left = clientX + "px";
+ }
+ else if (selectedImageURL != null) {
+ repaintSelected(selectedImageURL);
+ }
+ }
+ });
+}
+
+//new changes
+
+function mapMoveEnd() {
+ if (networkOverlay != null) {
+ map.removeOverlay(networkOverlay);
+ networkOverlay = null;
+ }
+
+
+ updateImage(0);
+}
+
+function mapDragEnd() {
+}
+
+function mapZoomChanged(oldZoomLevel, newZoomLevel) {
+}
+/*
+function updateSelectedImage() {
+ var baseURL = document.getElementById("baseURL").value;
+ var url = baseURL + "/gmap_controller.htm?action=nova.gmap.fetch.selected.image";
+ var mapSize = map.getSize();
+ var mapBounds = map.getBounds();
+ var pointSW = mapBounds.getSouthWest();
+ var pointNE = mapBounds.getNorthEast();
+ url += "&zoomLevel=" + map.getZoom();
+ url += "&mapSize=" + mapSize.width + "," + mapSize.height;
+ url += "&mapBounds=" + pointSW.lng() + "," + pointSW.lat() + "," + pointNE.lng() + "," + pointNE.lat();
+
+ new Ajax.Request(url, {
+ method: 'get',
+ asynchronous: false,
+ onSuccess: function(transport) {
+ var url = transport.responseXML.getElementsByTagName("image-url")[0].childNodes[0].nodeValue;
+
+ if (url != null) {
+ repaintSelected(url);
+ }
+ }
+ });
+}
+*/
+
+function updateImage(incDecValue) {
+ //alert();
+ loadingAnimationDiv.style.display = "inline";
+ var baseURL = document.getElementById("baseURL").value;
+ //var url = baseURL + "/gmap_controller.htm?action=getImage";
+ //var url = baseURL + "report.gmap.get_image";
+ var url = baseURL + "/gmapservlet?action=getImage&nextpage=report.gmap.get_image";
+ var mapSize = map.getSize();
+ var mapBounds = map.getBounds();
+ var pointSW = mapBounds.getSouthWest();
+ var pointNE = mapBounds.getNorthEast();
+ url += "&zoom_level=" + map.getZoom();
+ url += "&map_size=" + mapSize.width + "," + mapSize.height;
+ url += "&map_bounds=" + pointSW.lng() + "," + pointSW.lat() + "," + pointNE.lng() + "," + pointNE.lat();
+ url += "&increment_decrement_value=" + incDecValue;
+ url += "&selected_layer_list=" + document.getElementById("selectedLayerList").value;
+ url += "&color_list=" + document.getElementById("colorList").value;
+ var randomNumber = Math.floor(Math.random() * 5000000)
+ url += "&dummy=" + randomNumber;
+
+ //disableUserInput();
+ new Ajax.Request(url, {
+ method: 'get',
+ onSuccess: function(transport) {
+
+ loadingAnimationDiv.style.display = "none";
+ var jsonData = transport.responseText.evalJSON();
+ var imageURL = jsonData.imageURL;
+ var legendImageURL = jsonData.legendImageURL;
+ var selectedImageURL = jsonData.selectedImageURL;
+ var currentMonth = jsonData.currentMonth;
+ var colorList = jsonData.colorList;
+ var selectedLayerList = jsonData.selectedLayerList;
+
+ if (legendImageURL != null) {
+ repaintLegend(legendImageURL);
+ }
+ if (imageURL != null) {
+ repaint(imageURL);
+ }
+
+ if (selectedImageURL != null) {
+ repaintSelected(selectedImageURL);
+ }
+
+ if (currentMonth != null) {
+ document.getElementById("currentMonthDiv").innerHTML = currentMonth;
+ }
+
+ if (colorList != null) {
+ document.getElementById("colorList").value = colorList;
+ document.getElementById("selectedLayerList").value = selectedLayerList;
+ NovaButton.prototype.initializeLayerDiv(NovaButton.globals.layerOptionContainer);
+ }
+
+
+ }
+ });
+}
+
+ function repaintLegend(url) {
+ var mapLegend = document.getElementById("mapLegend");
+ var legendImg = document.getElementById("legendImg");
+
+ mapLegend.removeChild(legendImg);
+ var newpic=document.createElement('img');
+ newpic.src=url;
+ newpic.id="legendImg";
+ //alert(url);
+ mapLegend.appendChild(newpic);
+
+ }
+
+
+function repaint(url) {
+ if (networkOverlay != null) {
+ map.removeOverlay(networkOverlay);
+ }
+
+ networkOverlay = new ProjectedOverlay(url, map.getBounds()) ;
+ map.addOverlay(networkOverlay);
+}
+
+function repaintSelected(url) {
+ var mapBounds = map.getBounds();
+ var pointSW = mapBounds.getSouthWest();
+ var pointNE = mapBounds.getNorthEast();
+
+ if (selectedNetworkOverlay != null) {
+ map.removeOverlay(selectedNetworkOverlay);
+ }
+
+ selectedNetworkOverlay = new GGroundOverlay(url, new GLatLngBounds(pointSW, pointNE)) ;
+ map.addOverlay(selectedNetworkOverlay);
+
+ if (flashTimeout != null) {
+ clearTimeout(flashTimeout);
+ }
+
+ flashImage();
+}
+
+function flashImage() {
+ if (selectedNetworkOverlay.isHidden()) {
+ selectedNetworkOverlay.show();
+ }
+ else {
+ selectedNetworkOverlay.hide();
+ }
+
+ flashTimeout = setTimeout(flashImage, 500);
+}
+
+function disableUserInput() {
+ map.disableDragging();
+ map.disableDoubleClickZoom();
+ map.disableScrollWheelZoom();
+ map.disableContinuousZoom();
+}
+
+function enableUserInput() {
+ map.enableDragging();
+ map.enableDoubleClickZoom();
+ map.enableScrollWheelZoom();
+ map.enableContinuousZoom();
+}
+
+String.prototype.trim = function() {
+ return this.replace(/^\s+|\s+$/g, "");
+} \ No newline at end of file
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/jquery.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/jquery.js
new file mode 100644
index 000000000..462cde56c
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/jquery.js
@@ -0,0 +1,4376 @@
+/*!
+ * 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
+ // Will speed up references to window, and allows munging its name.
+ window = this,
+ // Will speed up references to undefined, and allows munging its name.
+ undefined,
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ jQuery = window.jQuery = window.$ = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // A simple way to check for HTML strings or ID strings
+ // (both of which we optimize for)
+ quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,
+ // Is it a simple selector
+ isSimple = /^.[^:#\[\.,]*$/;
+
+jQuery.fn = jQuery.prototype = {
+ init: function( selector, context ) {
+ // Make sure that a selection was provided
+ selector = selector || document;
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this[0] = selector;
+ this.length = 1;
+ this.context = selector;
+ return this;
+ }
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ // Are we dealing with HTML string or an ID?
+ var match = quickExpr.exec( selector );
+
+ // Verify a match, and that no context was specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] )
+ selector = jQuery.clean( [ match[1] ], context );
+
+ // HANDLE: $("#id")
+ else {
+ var elem = document.getElementById( match[3] );
+
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem && elem.id != match[3] )
+ return jQuery().find( selector );
+
+ // Otherwise, we inject the element directly into the jQuery object
+ var ret = jQuery( elem || [] );
+ ret.context = document;
+ ret.selector = selector;
+ return ret;
+ }
+
+ // HANDLE: $(expr, [context])
+ // (which is just equivalent to: $(content).find(expr)
+ } else
+ return jQuery( context ).find( selector );
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) )
+ return jQuery( document ).ready( selector );
+
+ // Make sure that old selector state is passed along
+ if ( selector.selector && selector.context ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return this.setArray(jQuery.isArray( selector ) ?
+ selector :
+ jQuery.makeArray(selector));
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.3.2",
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num === undefined ?
+
+ // Return a 'clean' array
+ Array.prototype.slice.call( this ) :
+
+ // Return just the object
+ this[ num ];
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+ // Build a new jQuery matched element set
+ var ret = jQuery( elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" )
+ ret.selector = this.selector + (this.selector ? " " : "") + selector;
+ else if ( name )
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Force the current matched set of elements to become
+ // the specified array of elements (destroying the stack in the process)
+ // You should use pushStack() in order to do this, but maintain the stack
+ setArray: function( elems ) {
+ // Resetting the length to 0, then using the native Array push
+ // is a super-fast way to populate an object with array-like properties
+ this.length = 0;
+ Array.prototype.push.apply( this, elems );
+
+ return this;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem && elem.jquery ? elem[0] : elem
+ , this );
+ },
+
+ attr: function( name, value, type ) {
+ var options = name;
+
+ // Look for the case where we're accessing a style value
+ if ( typeof name === "string" )
+ if ( value === undefined )
+ return this[0] && jQuery[ type || "attr" ]( this[0], name );
+
+ else {
+ options = {};
+ options[ name ] = value;
+ }
+
+ // Check to see if we're setting style values
+ return this.each(function(i){
+ // Set all the styles
+ for ( name in options )
+ jQuery.attr(
+ type ?
+ this.style :
+ this,
+ name, jQuery.prop( this, options[ name ], type, i, name )
+ );
+ });
+ },
+
+ css: function( key, value ) {
+ // ignore negative width and height values
+ if ( (key == 'width' || key == 'height') && parseFloat(value) < 0 )
+ value = undefined;
+ return this.attr( key, value, "curCSS" );
+ },
+
+ text: function( text ) {
+ if ( typeof text !== "object" && text != null )
+ return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
+
+ var ret = "";
+
+ jQuery.each( text || this, function(){
+ jQuery.each( this.childNodes, function(){
+ if ( this.nodeType != 8 )
+ ret += this.nodeType != 1 ?
+ this.nodeValue :
+ jQuery.fn.text( [ this ] );
+ });
+ });
+
+ return ret;
+ },
+
+ wrapAll: function( html ) {
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).clone();
+
+ if ( this[0].parentNode )
+ wrap.insertBefore( this[0] );
+
+ wrap.map(function(){
+ var elem = this;
+
+ while ( elem.firstChild )
+ elem = elem.firstChild;
+
+ return elem;
+ }).append(this);
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ return this.each(function(){
+ jQuery( this ).contents().wrapAll( html );
+ });
+ },
+
+ wrap: function( html ) {
+ return this.each(function(){
+ jQuery( this ).wrapAll( html );
+ });
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function(elem){
+ if (this.nodeType == 1)
+ this.appendChild( elem );
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function(elem){
+ if (this.nodeType == 1)
+ this.insertBefore( elem, this.firstChild );
+ });
+ },
+
+ before: function() {
+ return this.domManip(arguments, false, function(elem){
+ this.parentNode.insertBefore( elem, this );
+ });
+ },
+
+ after: function() {
+ return this.domManip(arguments, false, function(elem){
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ },
+
+ end: function() {
+ return this.prevObject || jQuery( [] );
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: [].push,
+ sort: [].sort,
+ splice: [].splice,
+
+ find: function( selector ) {
+ if ( this.length === 1 ) {
+ var ret = this.pushStack( [], "find", selector );
+ ret.length = 0;
+ jQuery.find( selector, this[0], ret );
+ return ret;
+ } else {
+ return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){
+ return jQuery.find( selector, elem );
+ })), "find", selector );
+ }
+ },
+
+ clone: function( events ) {
+ // Do the clone
+ var ret = this.map(function(){
+ if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
+ // IE copies events bound via attachEvent when
+ // using cloneNode. Calling detachEvent on the
+ // clone will also remove the events from the orignal
+ // In order to get around this, we use innerHTML.
+ // Unfortunately, this means some modifications to
+ // attributes in IE that are actually only stored
+ // as properties will not be copied (such as the
+ // the name attribute on an input).
+ var html = this.outerHTML;
+ if ( !html ) {
+ var div = this.ownerDocument.createElement("div");
+ div.appendChild( this.cloneNode(true) );
+ html = div.innerHTML;
+ }
+
+ return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g, "").replace(/^\s*/, "")])[0];
+ } else
+ return this.cloneNode(true);
+ });
+
+ // Copy the events from the original to the clone
+ if ( events === true ) {
+ var orig = this.find("*").andSelf(), i = 0;
+
+ ret.find("*").andSelf().each(function(){
+ if ( this.nodeName !== orig[i].nodeName )
+ return;
+
+ var events = jQuery.data( orig[i], "events" );
+
+ for ( var type in events ) {
+ for ( var handler in events[ type ] ) {
+ jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
+ }
+ }
+
+ i++;
+ });
+ }
+
+ // Return the cloned set
+ return ret;
+ },
+
+ filter: function( selector ) {
+ return this.pushStack(
+ jQuery.isFunction( selector ) &&
+ jQuery.grep(this, function(elem, i){
+ return selector.call( elem, i );
+ }) ||
+
+ jQuery.multiFilter( selector, jQuery.grep(this, function(elem){
+ return elem.nodeType === 1;
+ }) ), "filter", selector );
+ },
+
+ closest: function( selector ) {
+ var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null,
+ closer = 0;
+
+ return this.map(function(){
+ var cur = this;
+ while ( cur && cur.ownerDocument ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) {
+ jQuery.data(cur, "closest", closer);
+ return cur;
+ }
+ cur = cur.parentNode;
+ closer++;
+ }
+ });
+ },
+
+ not: function( selector ) {
+ if ( typeof selector === "string" )
+ // test special case where just one selector is passed in
+ if ( isSimple.test( selector ) )
+ return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector );
+ else
+ selector = jQuery.multiFilter( selector, this );
+
+ var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
+ return this.filter(function() {
+ return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
+ });
+ },
+
+ add: function( selector ) {
+ return this.pushStack( jQuery.unique( jQuery.merge(
+ this.get(),
+ typeof selector === "string" ?
+ jQuery( selector ) :
+ jQuery.makeArray( selector )
+ )));
+ },
+
+ is: function( selector ) {
+ return !!selector && jQuery.multiFilter( selector, this ).length > 0;
+ },
+
+ hasClass: function( selector ) {
+ return !!selector && this.is( "." + selector );
+ },
+
+ val: function( value ) {
+ if ( value === undefined ) {
+ var elem = this[0];
+
+ if ( elem ) {
+ if( jQuery.nodeName( elem, 'option' ) )
+ return (elem.attributes.value || {}).specified ? elem.value : elem.text;
+
+ // We need to handle select boxes special
+ if ( jQuery.nodeName( elem, "select" ) ) {
+ var index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type == "select-one";
+
+ // Nothing was selected
+ if ( index < 0 )
+ return null;
+
+ // Loop through all the selected options
+ for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+ var option = options[ i ];
+
+ if ( option.selected ) {
+ // Get the specifc value for the option
+ value = jQuery(option).val();
+
+ // We don't need an array for one selects
+ if ( one )
+ return value;
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ }
+
+ // Everything else, we just grab the value
+ return (elem.value || "").replace(/\r/g, "");
+
+ }
+
+ return undefined;
+ }
+
+ if ( typeof value === "number" )
+ value += '';
+
+ return this.each(function(){
+ if ( this.nodeType != 1 )
+ return;
+
+ if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) )
+ this.checked = (jQuery.inArray(this.value, value) >= 0 ||
+ jQuery.inArray(this.name, value) >= 0);
+
+ else if ( jQuery.nodeName( this, "select" ) ) {
+ var values = jQuery.makeArray(value);
+
+ jQuery( "option", this ).each(function(){
+ this.selected = (jQuery.inArray( this.value, values ) >= 0 ||
+ jQuery.inArray( this.text, values ) >= 0);
+ });
+
+ if ( !values.length )
+ this.selectedIndex = -1;
+
+ } else
+ this.value = value;
+ });
+ },
+
+ html: function( value ) {
+ return value === undefined ?
+ (this[0] ?
+ this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g, "") :
+ null) :
+ this.empty().append( value );
+ },
+
+ replaceWith: function( value ) {
+ return this.after( value ).remove();
+ },
+
+ eq: function( i ) {
+ return this.slice( i, +i + 1 );
+ },
+
+ slice: function() {
+ return this.pushStack( Array.prototype.slice.apply( this, arguments ),
+ "slice", Array.prototype.slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function(elem, i){
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ andSelf: function() {
+ return this.add( this.prevObject );
+ },
+
+ domManip: function( args, table, callback ) {
+ if ( this[0] ) {
+ var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
+ scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),
+ first = fragment.firstChild;
+
+ if ( first )
+ for ( var i = 0, l = this.length; i < l; i++ )
+ callback.call( root(this[i], first), this.length > 1 || i > 0 ?
+ fragment.cloneNode(true) : fragment );
+
+ if ( scripts )
+ jQuery.each( scripts, evalScript );
+ }
+
+ return this;
+
+ function root( elem, cur ) {
+ return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ?
+ (elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+ elem;
+ }
+ }
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+function evalScript( i, elem ) {
+ if ( elem.src )
+ jQuery.ajax({
+ url: elem.src,
+ async: false,
+ dataType: "script"
+ });
+
+ else
+ jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
+
+ if ( elem.parentNode )
+ elem.parentNode.removeChild( elem );
+}
+
+function now(){
+ return +new Date;
+}
+
+jQuery.extend = jQuery.fn.extend = function() {
+ // copy reference to target object
+ var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) )
+ target = {};
+
+ // extend jQuery itself if only one argument is passed
+ if ( length == i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ )
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null )
+ // Extend the base object
+ for ( var name in options ) {
+ var src = target[ name ], copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy )
+ continue;
+
+ // Recurse if we're merging object values
+ if ( deep && copy && typeof copy === "object" && !copy.nodeType )
+ target[ name ] = jQuery.extend( deep,
+ // Never move original objects, clone them
+ src || ( copy.length != null ? [ ] : { } )
+ , copy );
+
+ // Don't bring in undefined values
+ else if ( copy !== undefined )
+ target[ name ] = copy;
+
+ }
+
+ // Return the modified object
+ return target;
+};
+
+// exclude the following css properties to add px
+var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
+ // cache defaultView
+ defaultView = document.defaultView || {},
+ toString = Object.prototype.toString;
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ window.$ = _$;
+
+ if ( deep )
+ window.jQuery = _jQuery;
+
+ return jQuery;
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return toString.call(obj) === "[object Function]";
+ },
+
+ isArray: function( obj ) {
+ return toString.call(obj) === "[object Array]";
+ },
+
+ // check if an element is in a (or is an) XML document
+ isXMLDoc: function( elem ) {
+ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
+ !!elem.ownerDocument && jQuery.isXMLDoc( elem.ownerDocument );
+ },
+
+ // Evalulates a script in a global context
+ globalEval: function( data ) {
+ if ( data && /\S/.test(data) ) {
+ // Inspired by code by Andrea Giammarchi
+ // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
+ var head = document.getElementsByTagName("head")[0] || document.documentElement,
+ script = document.createElement("script");
+
+ script.type = "text/javascript";
+ if ( jQuery.support.scriptEval )
+ script.appendChild( document.createTextNode( data ) );
+ else
+ script.text = data;
+
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709).
+ head.insertBefore( script, head.firstChild );
+ head.removeChild( script );
+ }
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
+ },
+
+ // args is for internal usage only
+ each: function( object, callback, args ) {
+ var name, i = 0, length = object.length;
+
+ if ( args ) {
+ if ( length === undefined ) {
+ for ( name in object )
+ if ( callback.apply( object[ name ], args ) === false )
+ break;
+ } else
+ for ( ; i < length; )
+ if ( callback.apply( object[ i++ ], args ) === false )
+ break;
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( length === undefined ) {
+ for ( name in object )
+ if ( callback.call( object[ name ], name, object[ name ] ) === false )
+ break;
+ } else
+ for ( var value = object[0];
+ i < length && callback.call( value, i, value ) !== false; value = object[++i] ){}
+ }
+
+ return object;
+ },
+
+ prop: function( elem, value, type, i, name ) {
+ // Handle executable functions
+ if ( jQuery.isFunction( value ) )
+ value = value.call( elem, i );
+
+ // Handle passing in a number to a CSS property
+ return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ?
+ value + "px" :
+ value;
+ },
+
+ className: {
+ // internal only, use addClass("class")
+ add: function( elem, classNames ) {
+ jQuery.each((classNames || "").split(/\s+/), function(i, className){
+ if ( elem.nodeType == 1 && !jQuery.className.has( elem.className, className ) )
+ elem.className += (elem.className ? " " : "") + className;
+ });
+ },
+
+ // internal only, use removeClass("class")
+ remove: function( elem, classNames ) {
+ if (elem.nodeType == 1)
+ elem.className = classNames !== undefined ?
+ jQuery.grep(elem.className.split(/\s+/), function(className){
+ return !jQuery.className.has( classNames, className );
+ }).join(" ") :
+ "";
+ },
+
+ // internal only, use hasClass("class")
+ has: function( elem, className ) {
+ return elem && jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1;
+ }
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var old = {};
+ // Remember the old values, and insert the new ones
+ for ( var name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ callback.call( elem );
+
+ // Revert the old values
+ for ( var name in options )
+ elem.style[ name ] = old[ name ];
+ },
+
+ css: function( elem, name, force, extra ) {
+ if ( name == "width" || name == "height" ) {
+ var val, props = { position: "absolute", visibility: "hidden", display:"block" }, which = name == "width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ];
+
+ function getWH() {
+ val = name == "width" ? elem.offsetWidth : elem.offsetHeight;
+
+ if ( extra === "border" )
+ return;
+
+ jQuery.each( which, function() {
+ if ( !extra )
+ val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
+ if ( extra === "margin" )
+ val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
+ else
+ val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
+ });
+ }
+
+ if ( elem.offsetWidth !== 0 )
+ getWH();
+ else
+ jQuery.swap( elem, props, getWH );
+
+ return Math.max(0, Math.round(val));
+ }
+
+ return jQuery.curCSS( elem, name, force );
+ },
+
+ curCSS: function( elem, name, force ) {
+ var ret, style = elem.style;
+
+ // We need to handle opacity special in IE
+ if ( name == "opacity" && !jQuery.support.opacity ) {
+ ret = jQuery.attr( style, "opacity" );
+
+ return ret == "" ?
+ "1" :
+ ret;
+ }
+
+ // Make sure we're using the right name for getting the float value
+ if ( name.match( /float/i ) )
+ name = styleFloat;
+
+ if ( !force && style && style[ name ] )
+ ret = style[ name ];
+
+ else if ( defaultView.getComputedStyle ) {
+
+ // Only "float" is needed here
+ if ( name.match( /float/i ) )
+ name = "float";
+
+ name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase();
+
+ var computedStyle = defaultView.getComputedStyle( elem, null );
+
+ if ( computedStyle )
+ ret = computedStyle.getPropertyValue( name );
+
+ // We should always get a number back from opacity
+ if ( name == "opacity" && ret == "" )
+ ret = "1";
+
+ } else if ( elem.currentStyle ) {
+ var camelCase = name.replace(/\-(\w)/g, function(all, letter){
+ return letter.toUpperCase();
+ });
+
+ ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) {
+ // Remember the original values
+ var left = style.left, rsLeft = elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ style.left = ret || 0;
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret;
+ },
+
+ clean: function( elems, context, fragment ) {
+ context = context || document;
+
+ // !context.createElement fails in IE with an error but returns typeof 'object'
+ if ( typeof context.createElement === "undefined" )
+ context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+
+ // If a single string is passed in and it's a single tag
+ // just do a createElement and skip the rest
+ if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) {
+ var match = /^<(\w+)\s*\/?>$/.exec(elems[0]);
+ if ( match )
+ return [ context.createElement( match[1] ) ];
+ }
+
+ var ret = [], scripts = [], div = context.createElement("div");
+
+ jQuery.each(elems, function(i, elem){
+ if ( typeof elem === "number" )
+ elem += '';
+
+ if ( !elem )
+ return;
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" ) {
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){
+ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
+ all :
+ front + "></" + tag + ">";
+ });
+
+ // Trim whitespace, otherwise indexOf won't work as expected
+ var tags = elem.replace(/^\s+/, "").substring(0, 10).toLowerCase();
+
+ var wrap =
+ // option or optgroup
+ !tags.indexOf("<opt") &&
+ [ 1, "<select multiple='multiple'>", "</select>" ] ||
+
+ !tags.indexOf("<leg") &&
+ [ 1, "<fieldset>", "</fieldset>" ] ||
+
+ tags.match(/^<(thead|tbody|tfoot|colg|cap)/) &&
+ [ 1, "<table>", "</table>" ] ||
+
+ !tags.indexOf("<tr") &&
+ [ 2, "<table><tbody>", "</tbody></table>" ] ||
+
+ // <thead> matched above
+ (!tags.indexOf("<td") || !tags.indexOf("<th")) &&
+ [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ] ||
+
+ !tags.indexOf("<col") &&
+ [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ] ||
+
+ // IE can't serialize <link> and <script> tags normally
+ !jQuery.support.htmlSerialize &&
+ [ 1, "div<div>", "</div>" ] ||
+
+ [ 0, "", "" ];
+
+ // Go to html and back, then peel off extra wrappers
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( wrap[0]-- )
+ div = div.lastChild;
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ var hasBody = /<tbody/i.test(elem),
+ tbody = !tags.indexOf("<table") && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] == "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( var j = tbody.length - 1; j >= 0 ; --j )
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length )
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && /^\s/.test( elem ) )
+ div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
+
+ elem = jQuery.makeArray( div.childNodes );
+ }
+
+ if ( elem.nodeType )
+ ret.push( elem );
+ else
+ ret = jQuery.merge( ret, elem );
+
+ });
+
+ if ( fragment ) {
+ for ( var i = 0; ret[i]; i++ ) {
+ if ( jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
+ scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+ } else {
+ if ( ret[i].nodeType === 1 )
+ ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
+ fragment.appendChild( ret[i] );
+ }
+ }
+
+ return scripts;
+ }
+
+ return ret;
+ },
+
+ attr: function( elem, name, value ) {
+ // don't set attributes on text and comment nodes
+ if (!elem || elem.nodeType == 3 || elem.nodeType == 8)
+ return undefined;
+
+ var notxml = !jQuery.isXMLDoc( elem ),
+ // Whether we are setting (or getting)
+ set = value !== undefined;
+
+ // Try to normalize/fix the name
+ name = notxml && jQuery.props[ name ] || name;
+
+ // Only do all the following if this is a node (faster for style)
+ // IE elem.getAttribute passes even for style
+ if ( elem.tagName ) {
+
+ // These attributes require special treatment
+ var special = /href|src|style/.test( name );
+
+ // Safari mis-reports the default selected property of a hidden option
+ // Accessing the parent's selectedIndex property fixes it
+ if ( name == "selected" && elem.parentNode )
+ elem.parentNode.selectedIndex;
+
+ // If applicable, access the attribute via the DOM 0 way
+ if ( name in elem && notxml && !special ) {
+ if ( set ){
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( name == "type" && jQuery.nodeName( elem, "input" ) && elem.parentNode )
+ throw "type property can't be changed";
+
+ elem[ name ] = value;
+ }
+
+ // browsers index elements by id/name on forms, give priority to attributes.
+ if( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) )
+ return elem.getAttributeNode( name ).nodeValue;
+
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ if ( name == "tabIndex" ) {
+ var attributeNode = elem.getAttributeNode( "tabIndex" );
+ return attributeNode && attributeNode.specified
+ ? attributeNode.value
+ : elem.nodeName.match(/(button|input|object|select|textarea)/i)
+ ? 0
+ : elem.nodeName.match(/^(a|area)$/i) && elem.href
+ ? 0
+ : undefined;
+ }
+
+ return elem[ name ];
+ }
+
+ if ( !jQuery.support.style && notxml && name == "style" )
+ return jQuery.attr( elem.style, "cssText", value );
+
+ if ( set )
+ // convert the value to a string (all browsers do this but IE) see #1070
+ elem.setAttribute( name, "" + value );
+
+ var attr = !jQuery.support.hrefNormalized && notxml && special
+ // Some attributes require a special call on IE
+ ? elem.getAttribute( name, 2 )
+ : elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return attr === null ? undefined : attr;
+ }
+
+ // elem is actually elem.style ... set the style
+
+ // IE uses filters for opacity
+ if ( !jQuery.support.opacity && name == "opacity" ) {
+ if ( set ) {
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ elem.zoom = 1;
+
+ // Set the alpha filter to set the opacity
+ elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
+ (parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
+ }
+
+ return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
+ (parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
+ "";
+ }
+
+ name = name.replace(/-([a-z])/ig, function(all, letter){
+ return letter.toUpperCase();
+ });
+
+ if ( set )
+ elem[ name ] = value;
+
+ return elem[ name ];
+ },
+
+ trim: function( text ) {
+ return (text || "").replace( /^\s+|\s+$/g, "" );
+ },
+
+ makeArray: function( array ) {
+ var ret = [];
+
+ if( array != null ){
+ var i = array.length;
+ // The window, strings (and functions) also have 'length'
+ if( i == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval )
+ ret[0] = array;
+ else
+ while( i )
+ ret[--i] = array[i];
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, array ) {
+ for ( var i = 0, length = array.length; i < length; i++ )
+ // Use === because on IE, window == document
+ if ( array[ i ] === elem )
+ return i;
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ // We have to loop this way because IE & Opera overwrite the length
+ // expando of getElementsByTagName
+ var i = 0, elem, pos = first.length;
+ // Also, we need to make sure that the correct elements are being returned
+ // (IE returns comment nodes in a '*' query)
+ if ( !jQuery.support.getAll ) {
+ while ( (elem = second[ i++ ]) != null )
+ if ( elem.nodeType != 8 )
+ first[ pos++ ] = elem;
+
+ } else
+ while ( (elem = second[ i++ ]) != null )
+ first[ pos++ ] = elem;
+
+ return first;
+ },
+
+ unique: function( array ) {
+ var ret = [], done = {};
+
+ try {
+
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ var id = jQuery.data( array[ i ] );
+
+ if ( !done[ id ] ) {
+ done[ id ] = true;
+ ret.push( array[ i ] );
+ }
+ }
+
+ } catch( e ) {
+ ret = array;
+ }
+
+ return ret;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var ret = [];
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( var i = 0, length = elems.length; i < length; i++ )
+ if ( !inv != !callback( elems[ i ], i ) )
+ ret.push( elems[ i ] );
+
+ return ret;
+ },
+
+ map: function( elems, callback ) {
+ var ret = [];
+
+ // Go through the array, translating each of the items to their
+ // new value (or values).
+ for ( var i = 0, length = elems.length; i < length; i++ ) {
+ var value = callback( elems[ i ], i );
+
+ if ( value != null )
+ ret[ ret.length ] = value;
+ }
+
+ return ret.concat.apply( [], ret );
+ }
+});
+
+// Use of jQuery.browser is deprecated.
+// It's included for backwards compatibility and plugins,
+// although they should work to migrate away.
+
+var userAgent = navigator.userAgent.toLowerCase();
+
+// Figure out what browser is being used
+jQuery.browser = {
+ version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
+ safari: /webkit/.test( userAgent ),
+ opera: /opera/.test( userAgent ),
+ msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
+ mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
+};
+
+jQuery.each({
+ parent: function(elem){return elem.parentNode;},
+ parents: function(elem){return jQuery.dir(elem,"parentNode");},
+ next: function(elem){return jQuery.nth(elem,2,"nextSibling");},
+ prev: function(elem){return jQuery.nth(elem,2,"previousSibling");},
+ nextAll: function(elem){return jQuery.dir(elem,"nextSibling");},
+ prevAll: function(elem){return jQuery.dir(elem,"previousSibling");},
+ siblings: function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);},
+ children: function(elem){return jQuery.sibling(elem.firstChild);},
+ contents: function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);}
+}, function(name, fn){
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = jQuery.map( this, fn );
+
+ if ( selector && typeof selector == "string" )
+ ret = jQuery.multiFilter( selector, ret );
+
+ return this.pushStack( jQuery.unique( ret ), name, selector );
+ };
+});
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function(name, original){
+ jQuery.fn[ name ] = function( selector ) {
+ var ret = [], insert = jQuery( selector );
+
+ for ( var i = 0, l = insert.length; i < l; i++ ) {
+ var elems = (i > 0 ? this.clone(true) : this).get();
+ jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, selector );
+ };
+});
+
+jQuery.each({
+ removeAttr: function( name ) {
+ jQuery.attr( this, name, "" );
+ if (this.nodeType == 1)
+ this.removeAttribute( name );
+ },
+
+ addClass: function( classNames ) {
+ jQuery.className.add( this, classNames );
+ },
+
+ removeClass: function( classNames ) {
+ jQuery.className.remove( this, classNames );
+ },
+
+ toggleClass: function( classNames, state ) {
+ if( typeof state !== "boolean" )
+ state = !jQuery.className.has( this, classNames );
+ jQuery.className[ state ? "add" : "remove" ]( this, classNames );
+ },
+
+ remove: function( selector ) {
+ if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
+ // Prevent memory leaks
+ jQuery( "*", this ).add([this]).each(function(){
+ jQuery.event.remove(this);
+ jQuery.removeData(this);
+ });
+ if (this.parentNode)
+ this.parentNode.removeChild( this );
+ }
+ },
+
+ empty: function() {
+ // Remove element nodes and prevent memory leaks
+ jQuery(this).children().remove();
+
+ // Remove any remaining nodes
+ while ( this.firstChild )
+ this.removeChild( this.firstChild );
+ }
+}, function(name, fn){
+ jQuery.fn[ name ] = function(){
+ return this.each( fn, arguments );
+ };
+});
+
+// Helper function used by the dimensions and offset modules
+function num(elem, prop) {
+ return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
+}
+var expando = "jQuery" + now(), uuid = 0, windowData = {};
+
+jQuery.extend({
+ cache: {},
+
+ data: function( elem, name, data ) {
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ];
+
+ // Compute a unique ID for the element
+ if ( !id )
+ id = elem[ expando ] = ++uuid;
+
+ // Only generate the data cache if we're
+ // trying to access or manipulate it
+ if ( name && !jQuery.cache[ id ] )
+ jQuery.cache[ id ] = {};
+
+ // Prevent overriding the named cache with undefined values
+ if ( data !== undefined )
+ jQuery.cache[ id ][ name ] = data;
+
+ // Return the named cache data, or the ID for the element
+ return name ?
+ jQuery.cache[ id ][ name ] :
+ id;
+ },
+
+ removeData: function( elem, name ) {
+ elem = elem == window ?
+ windowData :
+ elem;
+
+ var id = elem[ expando ];
+
+ // If we want to remove a specific section of the element's data
+ if ( name ) {
+ if ( jQuery.cache[ id ] ) {
+ // Remove the section of cache data
+ delete jQuery.cache[ id ][ name ];
+
+ // If we've removed all the data, remove the element's cache
+ name = "";
+
+ for ( name in jQuery.cache[ id ] )
+ break;
+
+ if ( !name )
+ jQuery.removeData( elem );
+ }
+
+ // Otherwise, we want to remove all of the element's data
+ } else {
+ // Clean up the element expando
+ try {
+ delete elem[ expando ];
+ } catch(e){
+ // IE has trouble directly removing the expando
+ // but it's ok with using removeAttribute
+ if ( elem.removeAttribute )
+ elem.removeAttribute( expando );
+ }
+
+ // Completely remove the data cache
+ delete jQuery.cache[ id ];
+ }
+ },
+ queue: function( elem, type, data ) {
+ if ( elem ){
+
+ type = (type || "fx") + "queue";
+
+ var q = jQuery.data( elem, type );
+
+ if ( !q || jQuery.isArray(data) )
+ q = jQuery.data( elem, type, jQuery.makeArray(data) );
+ else if( data )
+ q.push( data );
+
+ }
+ return q;
+ },
+
+ dequeue: function( elem, type ){
+ var queue = jQuery.queue( elem, type ),
+ fn = queue.shift();
+
+ if( !type || type === "fx" )
+ fn = queue[0];
+
+ if( fn !== undefined )
+ fn.call(elem);
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ){
+ var parts = key.split(".");
+ parts[1] = parts[1] ? "." + parts[1] : "";
+
+ if ( value === undefined ) {
+ var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+ if ( data === undefined && this.length )
+ data = jQuery.data( this[0], key );
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ } else
+ return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){
+ jQuery.data( this, key, value );
+ });
+ },
+
+ removeData: function( key ){
+ return this.each(function(){
+ jQuery.removeData( this, key );
+ });
+ },
+ queue: function(type, data){
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ }
+
+ if ( data === undefined )
+ return jQuery.queue( this[0], type );
+
+ return this.each(function(){
+ var queue = jQuery.queue( this, type, data );
+
+ if( type == "fx" && queue.length == 1 )
+ queue[0].call(this);
+ });
+ },
+ dequeue: function(type){
+ return this.each(function(){
+ jQuery.dequeue( this, type );
+ });
+ }
+});/*!
+ * 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 chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,
+ done = 0,
+ toString = Object.prototype.toString;
+
+var Sizzle = function(selector, context, results, seed) {
+ results = results || [];
+ context = context || document;
+
+ if ( context.nodeType !== 1 && context.nodeType !== 9 )
+ return [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ var parts = [], m, set, checkSet, check, mode, extra, prune = true;
+
+ // Reset the position of the chunker regexp (start from head)
+ chunker.lastIndex = 0;
+
+ while ( (m = chunker.exec(selector)) !== null ) {
+ parts.push( m[1] );
+
+ if ( m[2] ) {
+ extra = RegExp.rightContext;
+ break;
+ }
+ }
+
+ if ( parts.length > 1 && origPOS.exec( selector ) ) {
+ if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
+ set = posProcess( parts[0] + parts[1], context );
+ } else {
+ set = Expr.relative[ parts[0] ] ?
+ [ context ] :
+ Sizzle( parts.shift(), context );
+
+ while ( parts.length ) {
+ selector = parts.shift();
+
+ if ( Expr.relative[ selector ] )
+ selector += parts.shift();
+
+ set = posProcess( selector, set );
+ }
+ }
+ } else {
+ var ret = seed ?
+ { expr: parts.pop(), set: makeArray(seed) } :
+ Sizzle.find( parts.pop(), parts.length === 1 && context.parentNode ? context.parentNode : context, isXML(context) );
+ set = Sizzle.filter( ret.expr, ret.set );
+
+ if ( parts.length > 0 ) {
+ checkSet = makeArray(set);
+ } else {
+ prune = false;
+ }
+
+ while ( parts.length ) {
+ var cur = parts.pop(), pop = cur;
+
+ if ( !Expr.relative[ cur ] ) {
+ cur = "";
+ } else {
+ pop = parts.pop();
+ }
+
+ if ( pop == null ) {
+ pop = context;
+ }
+
+ Expr.relative[ cur ]( checkSet, pop, isXML(context) );
+ }
+ }
+
+ if ( !checkSet ) {
+ checkSet = set;
+ }
+
+ if ( !checkSet ) {
+ throw "Syntax error, unrecognized expression: " + (cur || selector);
+ }
+
+ if ( toString.call(checkSet) === "[object Array]" ) {
+ if ( !prune ) {
+ results.push.apply( results, checkSet );
+ } else if ( context.nodeType === 1 ) {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
+ results.push( set[i] );
+ }
+ }
+ } else {
+ for ( var i = 0; checkSet[i] != null; i++ ) {
+ if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
+ results.push( set[i] );
+ }
+ }
+ }
+ } else {
+ makeArray( checkSet, results );
+ }
+
+ if ( extra ) {
+ Sizzle( extra, context, results, seed );
+
+ if ( sortOrder ) {
+ hasDuplicate = false;
+ results.sort(sortOrder);
+
+ if ( hasDuplicate ) {
+ for ( var i = 1; i < results.length; i++ ) {
+ if ( results[i] === results[i-1] ) {
+ results.splice(i--, 1);
+ }
+ }
+ }
+ }
+ }
+
+ return results;
+};
+
+Sizzle.matches = function(expr, set){
+ return Sizzle(expr, null, null, set);
+};
+
+Sizzle.find = function(expr, context, isXML){
+ var set, match;
+
+ if ( !expr ) {
+ return [];
+ }
+
+ for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
+ var type = Expr.order[i], match;
+
+ if ( (match = Expr.match[ type ].exec( expr )) ) {
+ var left = RegExp.leftContext;
+
+ if ( left.substr( left.length - 1 ) !== "\\" ) {
+ match[1] = (match[1] || "").replace(/\\/g, "");
+ set = Expr.find[ type ]( match, context, isXML );
+ if ( set != null ) {
+ expr = expr.replace( Expr.match[ type ], "" );
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !set ) {
+ set = context.getElementsByTagName("*");
+ }
+
+ return {set: set, expr: expr};
+};
+
+Sizzle.filter = function(expr, set, inplace, not){
+ var old = expr, result = [], curLoop = set, match, anyFound,
+ isXMLFilter = set && set[0] && isXML(set[0]);
+
+ while ( expr && set.length ) {
+ for ( var type in Expr.filter ) {
+ if ( (match = Expr.match[ type ].exec( expr )) != null ) {
+ var filter = Expr.filter[ type ], found, item;
+ anyFound = false;
+
+ if ( curLoop == result ) {
+ result = [];
+ }
+
+ if ( Expr.preFilter[ type ] ) {
+ match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+ if ( !match ) {
+ anyFound = found = true;
+ } else if ( match === true ) {
+ continue;
+ }
+ }
+
+ if ( match ) {
+ for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+ if ( item ) {
+ found = filter( item, match, i, curLoop );
+ var pass = not ^ !!found;
+
+ if ( inplace && found != null ) {
+ if ( pass ) {
+ anyFound = true;
+ } else {
+ curLoop[i] = false;
+ }
+ } else if ( pass ) {
+ result.push( item );
+ anyFound = true;
+ }
+ }
+ }
+ }
+
+ if ( found !== undefined ) {
+ if ( !inplace ) {
+ curLoop = result;
+ }
+
+ expr = expr.replace( Expr.match[ type ], "" );
+
+ if ( !anyFound ) {
+ return [];
+ }
+
+ break;
+ }
+ }
+ }
+
+ // Improper expression
+ if ( expr == old ) {
+ if ( anyFound == null ) {
+ throw "Syntax error, unrecognized expression: " + expr;
+ } else {
+ break;
+ }
+ }
+
+ old = expr;
+ }
+
+ return curLoop;
+};
+
+var Expr = Sizzle.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(elem){
+ return elem.getAttribute("href");
+ }
+ },
+ relative: {
+ "+": function(checkSet, part, isXML){
+ var isPartStr = typeof part === "string",
+ isTag = isPartStr && !/\W/.test(part),
+ isPartStrNotTag = isPartStr && !isTag;
+
+ if ( isTag && !isXML ) {
+ part = part.toUpperCase();
+ }
+
+ for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
+ if ( (elem = checkSet[i]) ) {
+ while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+
+ checkSet[i] = isPartStrNotTag || elem && elem.nodeName === part ?
+ elem || false :
+ elem === part;
+ }
+ }
+
+ if ( isPartStrNotTag ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ },
+ ">": function(checkSet, part, isXML){
+ var isPartStr = typeof part === "string";
+
+ if ( isPartStr && !/\W/.test(part) ) {
+ part = isXML ? part : part.toUpperCase();
+
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ var parent = elem.parentNode;
+ checkSet[i] = parent.nodeName === part ? parent : false;
+ }
+ }
+ } else {
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ checkSet[i] = isPartStr ?
+ elem.parentNode :
+ elem.parentNode === part;
+ }
+ }
+
+ if ( isPartStr ) {
+ Sizzle.filter( part, checkSet, true );
+ }
+ }
+ },
+ "": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( !part.match(/\W/) ) {
+ var nodeCheck = part = isXML ? part : part.toUpperCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+ },
+ "~": function(checkSet, part, isXML){
+ var doneName = done++, checkFn = dirCheck;
+
+ if ( typeof part === "string" && !part.match(/\W/) ) {
+ var nodeCheck = part = isXML ? part : part.toUpperCase();
+ checkFn = dirNodeCheck;
+ }
+
+ checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
+ }
+ },
+ find: {
+ ID: function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? [m] : [];
+ }
+ },
+ NAME: function(match, context, isXML){
+ if ( typeof context.getElementsByName !== "undefined" ) {
+ var ret = [], results = context.getElementsByName(match[1]);
+
+ for ( var i = 0, l = results.length; i < l; i++ ) {
+ if ( results[i].getAttribute("name") === match[1] ) {
+ ret.push( results[i] );
+ }
+ }
+
+ return ret.length === 0 ? null : ret;
+ }
+ },
+ TAG: function(match, context){
+ return context.getElementsByTagName(match[1]);
+ }
+ },
+ preFilter: {
+ CLASS: function(match, curLoop, inplace, result, not, isXML){
+ match = " " + match[1].replace(/\\/g, "") + " ";
+
+ if ( isXML ) {
+ return match;
+ }
+
+ for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+ if ( elem ) {
+ if ( not ^ (elem.className && (" " + elem.className + " ").indexOf(match) >= 0) ) {
+ if ( !inplace )
+ result.push( elem );
+ } else if ( inplace ) {
+ curLoop[i] = false;
+ }
+ }
+ }
+
+ return false;
+ },
+ ID: function(match){
+ return match[1].replace(/\\/g, "");
+ },
+ TAG: function(match, curLoop){
+ for ( var i = 0; curLoop[i] === false; i++ ){}
+ return curLoop[i] && isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
+ },
+ CHILD: function(match){
+ if ( match[1] == "nth" ) {
+ // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+ var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+ match[2] == "even" && "2n" || match[2] == "odd" && "2n+1" ||
+ !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+
+ // calculate the numbers (first)n+(last) including if they are negative
+ match[2] = (test[1] + (test[2] || 1)) - 0;
+ match[3] = test[3] - 0;
+ }
+
+ // TODO: Move to normal caching system
+ match[0] = done++;
+
+ return match;
+ },
+ ATTR: function(match, curLoop, inplace, result, not, isXML){
+ var name = match[1].replace(/\\/g, "");
+
+ if ( !isXML && Expr.attrMap[name] ) {
+ match[1] = Expr.attrMap[name];
+ }
+
+ if ( match[2] === "~=" ) {
+ match[4] = " " + match[4] + " ";
+ }
+
+ return match;
+ },
+ PSEUDO: function(match, curLoop, inplace, result, not){
+ if ( match[1] === "not" ) {
+ // If we're dealing with a complex expression, or a simple one
+ if ( match[3].match(chunker).length > 1 || /^\w/.test(match[3]) ) {
+ match[3] = Sizzle(match[3], null, null, curLoop);
+ } else {
+ var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+ if ( !inplace ) {
+ result.push.apply( result, ret );
+ }
+ return false;
+ }
+ } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+ return true;
+ }
+
+ return match;
+ },
+ POS: function(match){
+ match.unshift( true );
+ return match;
+ }
+ },
+ filters: {
+ enabled: function(elem){
+ return elem.disabled === false && elem.type !== "hidden";
+ },
+ disabled: function(elem){
+ return elem.disabled === true;
+ },
+ checked: function(elem){
+ return elem.checked === true;
+ },
+ selected: function(elem){
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ elem.parentNode.selectedIndex;
+ return elem.selected === true;
+ },
+ parent: function(elem){
+ return !!elem.firstChild;
+ },
+ empty: function(elem){
+ return !elem.firstChild;
+ },
+ has: function(elem, i, match){
+ return !!Sizzle( match[3], elem ).length;
+ },
+ header: function(elem){
+ return /h\d/i.test( elem.nodeName );
+ },
+ text: function(elem){
+ return "text" === elem.type;
+ },
+ radio: function(elem){
+ return "radio" === elem.type;
+ },
+ checkbox: function(elem){
+ return "checkbox" === elem.type;
+ },
+ file: function(elem){
+ return "file" === elem.type;
+ },
+ password: function(elem){
+ return "password" === elem.type;
+ },
+ submit: function(elem){
+ return "submit" === elem.type;
+ },
+ image: function(elem){
+ return "image" === elem.type;
+ },
+ reset: function(elem){
+ return "reset" === elem.type;
+ },
+ button: function(elem){
+ return "button" === elem.type || elem.nodeName.toUpperCase() === "BUTTON";
+ },
+ input: function(elem){
+ return /input|select|textarea|button/i.test(elem.nodeName);
+ }
+ },
+ setFilters: {
+ first: function(elem, i){
+ return i === 0;
+ },
+ last: function(elem, i, match, array){
+ return i === array.length - 1;
+ },
+ even: function(elem, i){
+ return i % 2 === 0;
+ },
+ odd: function(elem, i){
+ return i % 2 === 1;
+ },
+ lt: function(elem, i, match){
+ return i < match[3] - 0;
+ },
+ gt: function(elem, i, match){
+ return i > match[3] - 0;
+ },
+ nth: function(elem, i, match){
+ return match[3] - 0 == i;
+ },
+ eq: function(elem, i, match){
+ return match[3] - 0 == i;
+ }
+ },
+ filter: {
+ PSEUDO: function(elem, match, i, array){
+ var name = match[1], filter = Expr.filters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ } else if ( name === "contains" ) {
+ return (elem.textContent || elem.innerText || "").indexOf(match[3]) >= 0;
+ } else if ( name === "not" ) {
+ var not = match[3];
+
+ for ( var i = 0, l = not.length; i < l; i++ ) {
+ if ( not[i] === elem ) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ },
+ CHILD: function(elem, match){
+ var type = match[1], node = elem;
+ switch (type) {
+ case 'only':
+ case 'first':
+ while (node = node.previousSibling) {
+ if ( node.nodeType === 1 ) return false;
+ }
+ if ( type == 'first') return true;
+ node = elem;
+ case 'last':
+ while (node = node.nextSibling) {
+ if ( node.nodeType === 1 ) return false;
+ }
+ return true;
+ case 'nth':
+ var first = match[2], last = match[3];
+
+ if ( first == 1 && last == 0 ) {
+ return true;
+ }
+
+ var doneName = match[0],
+ parent = elem.parentNode;
+
+ if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+ var count = 0;
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ node.nodeIndex = ++count;
+ }
+ }
+ parent.sizcache = doneName;
+ }
+
+ var diff = elem.nodeIndex - last;
+ if ( first == 0 ) {
+ return diff == 0;
+ } else {
+ return ( diff % first == 0 && diff / first >= 0 );
+ }
+ }
+ },
+ ID: function(elem, match){
+ return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ },
+ TAG: function(elem, match){
+ return (match === "*" && elem.nodeType === 1) || elem.nodeName === match;
+ },
+ CLASS: function(elem, match){
+ return (" " + (elem.className || elem.getAttribute("class")) + " ")
+ .indexOf( match ) > -1;
+ },
+ ATTR: function(elem, match){
+ var name = match[1],
+ result = Expr.attrHandle[ name ] ?
+ Expr.attrHandle[ name ]( elem ) :
+ elem[ name ] != null ?
+ elem[ name ] :
+ elem.getAttribute( name ),
+ value = result + "",
+ type = match[2],
+ check = match[4];
+
+ return result == null ?
+ type === "!=" :
+ type === "=" ?
+ value === check :
+ type === "*=" ?
+ value.indexOf(check) >= 0 :
+ type === "~=" ?
+ (" " + value + " ").indexOf(check) >= 0 :
+ !check ?
+ value && result !== false :
+ type === "!=" ?
+ value != check :
+ type === "^=" ?
+ value.indexOf(check) === 0 :
+ type === "$=" ?
+ value.substr(value.length - check.length) === check :
+ type === "|=" ?
+ value === check || value.substr(0, check.length + 1) === check + "-" :
+ false;
+ },
+ POS: function(elem, match, i, array){
+ var name = match[2], filter = Expr.setFilters[ name ];
+
+ if ( filter ) {
+ return filter( elem, i, match, array );
+ }
+ }
+ }
+};
+
+var origPOS = Expr.match.POS;
+
+for ( var type in Expr.match ) {
+ Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
+}
+
+var makeArray = function(array, results) {
+ array = Array.prototype.slice.call( array );
+
+ if ( results ) {
+ results.push.apply( results, array );
+ return results;
+ }
+
+ return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+try {
+ Array.prototype.slice.call( document.documentElement.childNodes );
+
+// Provide a fallback method if it does not work
+} catch(e){
+ makeArray = function(array, results) {
+ var ret = results || [];
+
+ if ( toString.call(array) === "[object Array]" ) {
+ Array.prototype.push.apply( ret, array );
+ } else {
+ if ( typeof array.length === "number" ) {
+ for ( var i = 0, l = array.length; i < l; i++ ) {
+ ret.push( array[i] );
+ }
+ } else {
+ for ( var i = 0; array[i]; i++ ) {
+ ret.push( array[i] );
+ }
+ }
+ }
+
+ return ret;
+ };
+}
+
+var sortOrder;
+
+if ( document.documentElement.compareDocumentPosition ) {
+ sortOrder = function( a, b ) {
+ var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( "sourceIndex" in document.documentElement ) {
+ sortOrder = function( a, b ) {
+ var ret = a.sourceIndex - b.sourceIndex;
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+} else if ( document.createRange ) {
+ sortOrder = function( a, b ) {
+ var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
+ aRange.selectNode(a);
+ aRange.collapse(true);
+ bRange.selectNode(b);
+ bRange.collapse(true);
+ var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
+ if ( ret === 0 ) {
+ hasDuplicate = true;
+ }
+ return ret;
+ };
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+ // We're going to inject a fake input element with a specified name
+ var form = document.createElement("form"),
+ id = "script" + (new Date).getTime();
+ form.innerHTML = "<input name='" + id + "'/>";
+
+ // Inject it into the root element, check its status, and remove it quickly
+ var root = document.documentElement;
+ root.insertBefore( form, root.firstChild );
+
+ // The workaround has to do additional checks after a getElementById
+ // Which slows things down for other browsers (hence the branching)
+ if ( !!document.getElementById( id ) ) {
+ Expr.find.ID = function(match, context, isXML){
+ if ( typeof context.getElementById !== "undefined" && !isXML ) {
+ var m = context.getElementById(match[1]);
+ return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
+ }
+ };
+
+ Expr.filter.ID = function(elem, match){
+ var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ return elem.nodeType === 1 && node && node.nodeValue === match;
+ };
+ }
+
+ root.removeChild( form );
+})();
+
+(function(){
+ // Check to see if the browser returns only elements
+ // when doing getElementsByTagName("*")
+
+ // Create a fake element
+ var div = document.createElement("div");
+ div.appendChild( document.createComment("") );
+
+ // Make sure no comments are found
+ if ( div.getElementsByTagName("*").length > 0 ) {
+ Expr.find.TAG = function(match, context){
+ var results = context.getElementsByTagName(match[1]);
+
+ // Filter out possible comments
+ if ( match[1] === "*" ) {
+ var tmp = [];
+
+ for ( var i = 0; results[i]; i++ ) {
+ if ( results[i].nodeType === 1 ) {
+ tmp.push( results[i] );
+ }
+ }
+
+ results = tmp;
+ }
+
+ return results;
+ };
+ }
+
+ // Check to see if an attribute returns normalized href attributes
+ div.innerHTML = "<a href='#'></a>";
+ if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
+ div.firstChild.getAttribute("href") !== "#" ) {
+ Expr.attrHandle.href = function(elem){
+ return elem.getAttribute("href", 2);
+ };
+ }
+})();
+
+if ( document.querySelectorAll ) (function(){
+ var oldSizzle = Sizzle, div = document.createElement("div");
+ div.innerHTML = "<p class='TEST'></p>";
+
+ // Safari can't handle uppercase or unicode characters when
+ // in quirks mode.
+ if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
+ return;
+ }
+
+ Sizzle = function(query, context, extra, seed){
+ context = context || document;
+
+ // Only use querySelectorAll on non-XML documents
+ // (ID selectors don't work in non-HTML documents)
+ if ( !seed && context.nodeType === 9 && !isXML(context) ) {
+ try {
+ return makeArray( context.querySelectorAll(query), extra );
+ } catch(e){}
+ }
+
+ return oldSizzle(query, context, extra, seed);
+ };
+
+ Sizzle.find = oldSizzle.find;
+ Sizzle.filter = oldSizzle.filter;
+ Sizzle.selectors = oldSizzle.selectors;
+ Sizzle.matches = oldSizzle.matches;
+})();
+
+if ( document.getElementsByClassName && document.documentElement.getElementsByClassName ) (function(){
+ var div = document.createElement("div");
+ div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+
+ // Opera can't find a second classname (in 9.6)
+ if ( div.getElementsByClassName("e").length === 0 )
+ return;
+
+ // Safari caches class attributes, doesn't catch changes (in 3.2)
+ div.lastChild.className = "e";
+
+ if ( div.getElementsByClassName("e").length === 1 )
+ return;
+
+ Expr.order.splice(1, 0, "CLASS");
+ Expr.find.CLASS = function(match, context, isXML) {
+ if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
+ return context.getElementsByClassName(match[1]);
+ }
+ };
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ var sibDir = dir == "previousSibling" && !isXML;
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ if ( sibDir && elem.nodeType === 1 ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 && !isXML ){
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+
+ if ( elem.nodeName === cur ) {
+ match = elem;
+ break;
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+ var sibDir = dir == "previousSibling" && !isXML;
+ for ( var i = 0, l = checkSet.length; i < l; i++ ) {
+ var elem = checkSet[i];
+ if ( elem ) {
+ if ( sibDir && elem.nodeType === 1 ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ elem = elem[dir];
+ var match = false;
+
+ while ( elem ) {
+ if ( elem.sizcache === doneName ) {
+ match = checkSet[elem.sizset];
+ break;
+ }
+
+ if ( elem.nodeType === 1 ) {
+ if ( !isXML ) {
+ elem.sizcache = doneName;
+ elem.sizset = i;
+ }
+ if ( typeof cur !== "string" ) {
+ if ( elem === cur ) {
+ match = true;
+ break;
+ }
+
+ } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
+ match = elem;
+ break;
+ }
+ }
+
+ elem = elem[dir];
+ }
+
+ checkSet[i] = match;
+ }
+ }
+}
+
+var contains = document.compareDocumentPosition ? function(a, b){
+ return a.compareDocumentPosition(b) & 16;
+} : function(a, b){
+ return a !== b && (a.contains ? a.contains(b) : true);
+};
+
+var isXML = function(elem){
+ return elem.nodeType === 9 && elem.documentElement.nodeName !== "HTML" ||
+ !!elem.ownerDocument && isXML( elem.ownerDocument );
+};
+
+var posProcess = function(selector, context){
+ var tmpSet = [], later = "", match,
+ root = context.nodeType ? [context] : context;
+
+ // Position selectors must be done after the filter
+ // And so must :not(positional) so we move all PSEUDOs to the end
+ while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+ later += match[0];
+ selector = selector.replace( Expr.match.PSEUDO, "" );
+ }
+
+ selector = Expr.relative[selector] ? selector + "*" : selector;
+
+ for ( var i = 0, l = root.length; i < l; i++ ) {
+ Sizzle( selector, root[i], tmpSet );
+ }
+
+ return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.filter = Sizzle.filter;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.filters;
+
+Sizzle.selectors.filters.hidden = function(elem){
+ return elem.offsetWidth === 0 || elem.offsetHeight === 0;
+};
+
+Sizzle.selectors.filters.visible = function(elem){
+ return elem.offsetWidth > 0 || elem.offsetHeight > 0;
+};
+
+Sizzle.selectors.filters.animated = function(elem){
+ return jQuery.grep(jQuery.timers, function(fn){
+ return elem === fn.elem;
+ }).length;
+};
+
+jQuery.multiFilter = function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return Sizzle.matches(expr, elems);
+};
+
+jQuery.dir = function( elem, dir ){
+ var matched = [], cur = elem[dir];
+ while ( cur && cur != document ) {
+ if ( cur.nodeType == 1 )
+ matched.push( cur );
+ cur = cur[dir];
+ }
+ return matched;
+};
+
+jQuery.nth = function(cur, result, dir, elem){
+ result = result || 1;
+ var num = 0;
+
+ for ( ; cur; cur = cur[dir] )
+ if ( cur.nodeType == 1 && ++num == result )
+ break;
+
+ return cur;
+};
+
+jQuery.sibling = function(n, elem){
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType == 1 && n != elem )
+ r.push( n );
+ }
+
+ return r;
+};
+
+return;
+
+window.Sizzle = Sizzle;
+
+})();
+/*
+ * A number of helper functions used for managing events.
+ * Many of the ideas behind this code originated from
+ * Dean Edwards' addEvent library.
+ */
+jQuery.event = {
+
+ // Bind an event to an element
+ // Original by Dean Edwards
+ add: function(elem, types, handler, data) {
+ if ( elem.nodeType == 3 || elem.nodeType == 8 )
+ return;
+
+ // For whatever reason, IE has trouble passing the window object
+ // around, causing it to be cloned in the process
+ if ( elem.setInterval && elem != window )
+ elem = window;
+
+ // Make sure that the function being executed has a unique ID
+ if ( !handler.guid )
+ handler.guid = this.guid++;
+
+ // if data is passed, bind to handler
+ if ( data !== undefined ) {
+ // Create temporary function pointer to original handler
+ var fn = handler;
+
+ // Create unique handler function, wrapped around original handler
+ handler = this.proxy( fn );
+
+ // Store data in unique handler
+ handler.data = data;
+ }
+
+ // Init the element's event structure
+ var events = jQuery.data(elem, "events") || jQuery.data(elem, "events", {}),
+ handle = jQuery.data(elem, "handle") || jQuery.data(elem, "handle", function(){
+ // Handle the second event of a trigger and when
+ // an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
+ jQuery.event.handle.apply(arguments.callee.elem, arguments) :
+ undefined;
+ });
+ // Add elem as a property of the handle function
+ // This is to prevent a memory leak with non-native
+ // event in IE.
+ handle.elem = elem;
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ jQuery.each(types.split(/\s+/), function(index, type) {
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ handler.type = namespaces.slice().sort().join(".");
+
+ // Get the current list of functions bound to this event
+ var handlers = events[type];
+
+ if ( jQuery.event.specialAll[type] )
+ jQuery.event.specialAll[type].setup.call(elem, data, namespaces);
+
+ // Init the event handler queue
+ if (!handlers) {
+ handlers = events[type] = {};
+
+ // Check for a special event handler
+ // Only use addEventListener/attachEvent if the special
+ // events handler returns false
+ if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
+ // Bind the global event handler to the element
+ if (elem.addEventListener)
+ elem.addEventListener(type, handle, false);
+ else if (elem.attachEvent)
+ elem.attachEvent("on" + type, handle);
+ }
+ }
+
+ // Add the function to the element's handler list
+ handlers[handler.guid] = handler;
+
+ // Keep track of which events have been used, for global triggering
+ jQuery.event.global[type] = true;
+ });
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ guid: 1,
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function(elem, types, handler) {
+ // don't do events on text and comment nodes
+ if ( elem.nodeType == 3 || elem.nodeType == 8 )
+ return;
+
+ var events = jQuery.data(elem, "events"), ret, index;
+
+ if ( events ) {
+ // Unbind all events for the element
+ if ( types === undefined || (typeof types === "string" && types.charAt(0) == ".") )
+ for ( var type in events )
+ this.remove( elem, type + (types || "") );
+ else {
+ // types is actually an event object here
+ if ( types.type ) {
+ handler = types.handler;
+ types = types.type;
+ }
+
+ // Handle multiple events seperated by a space
+ // jQuery(...).unbind("mouseover mouseout", fn);
+ jQuery.each(types.split(/\s+/), function(index, type){
+ // Namespaced event handlers
+ var namespaces = type.split(".");
+ type = namespaces.shift();
+ var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
+
+ if ( events[type] ) {
+ // remove the given handler for the given type
+ if ( handler )
+ delete events[type][handler.guid];
+
+ // remove all handlers for the given type
+ else
+ for ( var handle in events[type] )
+ // Handle the removal of namespaced events
+ if ( namespace.test(events[type][handle].type) )
+ delete events[type][handle];
+
+ if ( jQuery.event.specialAll[type] )
+ jQuery.event.specialAll[type].teardown.call(elem, namespaces);
+
+ // remove generic event handler if no more handlers exist
+ for ( ret in events[type] ) break;
+ if ( !ret ) {
+ if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
+ if (elem.removeEventListener)
+ elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
+ else if (elem.detachEvent)
+ elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
+ }
+ ret = null;
+ delete events[type];
+ }
+ }
+ });
+ }
+
+ // Remove the expando if it's no longer used
+ for ( ret in events ) break;
+ if ( !ret ) {
+ var handle = jQuery.data( elem, "handle" );
+ if ( handle ) handle.elem = null;
+ jQuery.removeData( elem, "events" );
+ jQuery.removeData( elem, "handle" );
+ }
+ }
+ },
+
+ // bubbling is internal
+ trigger: function( event, data, elem, bubbling ) {
+ // Event object or event type
+ var type = event.type || event;
+
+ if( !bubbling ){
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[expando] ? event :
+ // Object literal
+ jQuery.extend( jQuery.Event(type), event ) :
+ // Just the event type (string)
+ jQuery.Event(type);
+
+ if ( type.indexOf("!") >= 0 ) {
+ event.type = type = type.slice(0, -1);
+ event.exclusive = true;
+ }
+
+ // Handle a global trigger
+ if ( !elem ) {
+ // Don't bubble custom events when global (to avoid too much overhead)
+ event.stopPropagation();
+ // Only trigger if we've ever bound an event for it
+ if ( this.global[type] )
+ jQuery.each( jQuery.cache, function(){
+ if ( this.events && this.events[type] )
+ jQuery.event.trigger( event, data, this.handle.elem );
+ });
+ }
+
+ // Handle triggering a single element
+
+ // don't do events on text and comment nodes
+ if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
+ return undefined;
+
+ // Clean up in case it is reused
+ event.result = undefined;
+ event.target = elem;
+
+ // Clone the incoming data, if any
+ data = jQuery.makeArray(data);
+ data.unshift( event );
+ }
+
+ event.currentTarget = elem;
+
+ // Trigger the event, it is assumed that "handle" is a function
+ var handle = jQuery.data(elem, "handle");
+ if ( handle )
+ handle.apply( elem, data );
+
+ // Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
+ if ( (!elem[type] || (jQuery.nodeName(elem, 'a') && type == "click")) && elem["on"+type] && elem["on"+type].apply( elem, data ) === false )
+ event.result = false;
+
+ // Trigger the native events (except for clicks on links)
+ if ( !bubbling && elem[type] && !event.isDefaultPrevented() && !(jQuery.nodeName(elem, 'a') && type == "click") ) {
+ this.triggered = true;
+ try {
+ elem[ type ]();
+ // prevent IE from throwing an error for some hidden elements
+ } catch (e) {}
+ }
+
+ this.triggered = false;
+
+ if ( !event.isPropagationStopped() ) {
+ var parent = elem.parentNode || elem.ownerDocument;
+ if ( parent )
+ jQuery.event.trigger(event, data, parent, true);
+ }
+ },
+
+ handle: function(event) {
+ // returned undefined or false
+ var all, handlers;
+
+ event = arguments[0] = jQuery.event.fix( event || window.event );
+ event.currentTarget = this;
+
+ // Namespaced event handlers
+ var namespaces = event.type.split(".");
+ event.type = namespaces.shift();
+
+ // Cache this now, all = true means, any handler
+ all = !namespaces.length && !event.exclusive;
+
+ var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
+
+ handlers = ( jQuery.data(this, "events") || {} )[event.type];
+
+ for ( var j in handlers ) {
+ var handler = handlers[j];
+
+ // Filter the functions by class
+ if ( all || namespace.test(handler.type) ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handler;
+ event.data = handler.data;
+
+ var ret = handler.apply(this, arguments);
+
+ if( ret !== undefined ){
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ if( event.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(event) {
+ if ( event[expando] )
+ return event;
+
+ // store a copy of the original event object
+ // and "clone" to set read-only properties
+ var originalEvent = event;
+ event = jQuery.Event( originalEvent );
+
+ for ( var i = this.props.length, prop; i; ){
+ prop = this.props[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary
+ if ( !event.target )
+ event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+
+ // check if target is a textnode (safari)
+ if ( event.target.nodeType == 3 )
+ event.target = event.target.parentNode;
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && event.fromElement )
+ event.relatedTarget = event.fromElement == event.target ? event.toElement : event.fromElement;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && event.clientX != null ) {
+ var doc = document.documentElement, body = document.body;
+ event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc.clientLeft || 0);
+ event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc.clientTop || 0);
+ }
+
+ // Add which for key events
+ if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) )
+ event.which = event.charCode || event.keyCode;
+
+ // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs)
+ if ( !event.metaKey && event.ctrlKey )
+ event.metaKey = event.ctrlKey;
+
+ // Add which for click: 1 == left; 2 == middle; 3 == right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && event.button )
+ event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) ));
+
+ return event;
+ },
+
+ proxy: function( fn, proxy ){
+ proxy = proxy || function(){ return fn.apply(this, arguments); };
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
+ // So proxy can be declared as an argument
+ return proxy;
+ },
+
+ special: {
+ ready: {
+ // Make sure the ready event is setup
+ setup: bindReady,
+ teardown: function() {}
+ }
+ },
+
+ specialAll: {
+ live: {
+ setup: function( selector, namespaces ){
+ jQuery.event.add( this, namespaces[0], liveHandler );
+ },
+ teardown: function( namespaces ){
+ if ( namespaces.length ) {
+ var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
+
+ jQuery.each( (jQuery.data(this, "events").live || {}), function(){
+ if ( name.test(this.type) )
+ remove++;
+ });
+
+ if ( remove < 1 )
+ jQuery.event.remove( this, namespaces[0], liveHandler );
+ }
+ }
+ }
+ }
+};
+
+jQuery.Event = function( src ){
+ // Allow instantiation without the 'new' keyword
+ if( !this.preventDefault )
+ return new jQuery.Event(src);
+
+ // Event object
+ if( src && src.type ){
+ this.originalEvent = src;
+ this.type = src.type;
+ // Event type
+ }else
+ this.type = src;
+
+ // timeStamp is buggy for some events on Firefox(#3843)
+ // So we won't rely on the native value
+ this.timeStamp = now();
+
+ // Mark it as fixed
+ this[expando] = true;
+};
+
+function returnFalse(){
+ return false;
+}
+function returnTrue(){
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if( !e )
+ return;
+ // if preventDefault exists run it on the original event
+ if (e.preventDefault)
+ e.preventDefault();
+ // otherwise set the returnValue property of the original event to false (IE)
+ e.returnValue = false;
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if( !e )
+ return;
+ // if stopPropagation exists run it on the original event
+ if (e.stopPropagation)
+ e.stopPropagation();
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation:function(){
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function(event) {
+ // Check if mouse(over|out) are still within the same parent element
+ var parent = event.relatedTarget;
+ // Traverse up the tree
+ while ( parent && parent != this )
+ try { parent = parent.parentNode; }
+ catch(e) { parent = this; }
+
+ if( parent != this ){
+ // set the correct event type
+ event.type = event.data;
+ // handle event if we actually just moused on to a non sub-element
+ jQuery.event.handle.apply( this, arguments );
+ }
+};
+
+jQuery.each({
+ mouseover: 'mouseenter',
+ mouseout: 'mouseleave'
+}, function( orig, fix ){
+ jQuery.event.special[ fix ] = {
+ setup: function(){
+ jQuery.event.add( this, orig, withinElement, fix );
+ },
+ teardown: function(){
+ jQuery.event.remove( this, orig, withinElement );
+ }
+ };
+});
+
+jQuery.fn.extend({
+ bind: function( type, data, fn ) {
+ return type == "unload" ? this.one(type, data, fn) : this.each(function(){
+ jQuery.event.add( this, type, fn || data, fn && data );
+ });
+ },
+
+ one: function( type, data, fn ) {
+ var one = jQuery.event.proxy( fn || data, function(event) {
+ jQuery(this).unbind(event, one);
+ return (fn || data).apply( this, arguments );
+ });
+ return this.each(function(){
+ jQuery.event.add( this, type, one, fn && data);
+ });
+ },
+
+ unbind: function( type, fn ) {
+ return this.each(function(){
+ jQuery.event.remove( this, type, fn );
+ });
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function(){
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+
+ triggerHandler: function( type, data ) {
+ if( this[0] ){
+ var event = jQuery.Event(type);
+ event.preventDefault();
+ event.stopPropagation();
+ jQuery.event.trigger( event, data, this[0] );
+ return event.result;
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments, i = 1;
+
+ // link all the functions, so any of them can unbind this click handler
+ while( i < args.length )
+ jQuery.event.proxy( fn, args[i++] );
+
+ return this.click( jQuery.event.proxy( fn, function(event) {
+ // Figure out which function to execute
+ this.lastToggle = ( this.lastToggle || 0 ) % i;
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ this.lastToggle++ ].apply( this, arguments ) || false;
+ }));
+ },
+
+ hover: function(fnOver, fnOut) {
+ return this.mouseenter(fnOver).mouseleave(fnOut);
+ },
+
+ ready: function(fn) {
+ // Attach the listeners
+ bindReady();
+
+ // If the DOM is already ready
+ if ( jQuery.isReady )
+ // Execute the function immediately
+ fn.call( document, jQuery );
+
+ // Otherwise, remember the function for later
+ else
+ // Add the function to the wait list
+ jQuery.readyList.push( fn );
+
+ return this;
+ },
+
+ live: function( type, fn ){
+ var proxy = jQuery.event.proxy( fn );
+ proxy.guid += this.selector + type;
+
+ jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy );
+
+ return this;
+ },
+
+ die: function( type, fn ){
+ jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null );
+ return this;
+ }
+});
+
+function liveHandler( event ){
+ var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
+ stop = true,
+ elems = [];
+
+ jQuery.each(jQuery.data(this, "events").live || [], function(i, fn){
+ if ( check.test(fn.type) ) {
+ var elem = jQuery(event.target).closest(fn.data)[0];
+ if ( elem )
+ elems.push({ elem: elem, fn: fn });
+ }
+ });
+
+ elems.sort(function(a,b) {
+ return jQuery.data(a.elem, "closest") - jQuery.data(b.elem, "closest");
+ });
+
+ jQuery.each(elems, function(){
+ if ( this.fn.call(this.elem, event, this.fn.data) === false )
+ return (stop = false);
+ });
+
+ return stop;
+}
+
+function liveConvert(type, selector){
+ return ["live", type, selector.replace(/\./g, "`").replace(/ /g, "|")].join(".");
+}
+
+jQuery.extend({
+ isReady: false,
+ readyList: [],
+ // Handle when the DOM is ready
+ ready: function() {
+ // Make sure that the DOM is not already loaded
+ if ( !jQuery.isReady ) {
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If there are functions bound, to execute
+ if ( jQuery.readyList ) {
+ // Execute all of them
+ jQuery.each( jQuery.readyList, function(){
+ this.call( document, jQuery );
+ });
+
+ // Reset the list of functions
+ jQuery.readyList = null;
+ }
+
+ // Trigger any bound ready events
+ jQuery(document).triggerHandler("ready");
+ }
+ }
+});
+
+var readyBound = false;
+
+function bindReady(){
+ if ( readyBound ) return;
+ readyBound = true;
+
+ // Mozilla, Opera and webkit nightlies currently support this event
+ if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", function(){
+ document.removeEventListener( "DOMContentLoaded", arguments.callee, false );
+ jQuery.ready();
+ }, false );
+
+ // If IE event model is used
+ } else if ( document.attachEvent ) {
+ // ensure firing before onload,
+ // maybe late but safe also for iframes
+ document.attachEvent("onreadystatechange", function(){
+ if ( document.readyState === "complete" ) {
+ document.detachEvent( "onreadystatechange", arguments.callee );
+ jQuery.ready();
+ }
+ });
+
+ // If IE and not an iframe
+ // continually check to see if the document is ready
+ if ( document.documentElement.doScroll && window == window.top ) (function(){
+ if ( jQuery.isReady ) return;
+
+ try {
+ // If IE is used, use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ document.documentElement.doScroll("left");
+ } catch( error ) {
+ setTimeout( arguments.callee, 0 );
+ return;
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+ })();
+ }
+
+ // A fallback to window.onload, that will always work
+ jQuery.event.add( window, "load", jQuery.ready );
+}
+
+jQuery.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(i, name){
+
+ // Handle event binding
+ jQuery.fn[name] = function(fn){
+ return fn ? this.bind(name, fn) : this.trigger(name);
+ };
+});
+
+// Prevent memory leaks in IE
+// And prevent errors on refresh with events like mouseover in other browsers
+// Window isn't included so as not to unbind existing unload events
+jQuery( window ).bind( 'unload', function(){
+ for ( var id in jQuery.cache )
+ // Skip the window
+ if ( id != 1 && jQuery.cache[ id ].handle )
+ jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+});
+(function(){
+
+ jQuery.support = {};
+
+ var root = document.documentElement,
+ script = document.createElement("script"),
+ div = document.createElement("div"),
+ id = "script" + (new Date).getTime();
+
+ div.style.display = "none";
+ div.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 all = div.getElementsByTagName("*"),
+ a = div.getElementsByTagName("a")[0];
+
+ // Can't get basic test support
+ if ( !all || !all.length || !a ) {
+ return;
+ }
+
+ jQuery.support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: div.firstChild.nodeType == 3,
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName("tbody").length,
+
+ // Make sure that you can get all elements in an <object> element
+ // IE 7 always returns no results
+ objectAll: !!div.getElementsByTagName("object")[0]
+ .getElementsByTagName("*").length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName("link").length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText insted)
+ style: /red/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: a.getAttribute("href") === "/a",
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ opacity: a.style.opacity === "0.5",
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Will be defined later
+ scriptEval: false,
+ noCloneEvent: true,
+ boxModel: null
+ };
+
+ script.type = "text/javascript";
+ try {
+ script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
+ } catch(e){}
+
+ root.insertBefore( script, root.firstChild );
+
+ // Make sure that the execution of code works by injecting a script
+ // tag with appendChild/createTextNode
+ // (IE doesn't support this, fails, and uses .text instead)
+ if ( window[ id ] ) {
+ jQuery.support.scriptEval = true;
+ delete window[ id ];
+ }
+
+ root.removeChild( script );
+
+ if ( div.attachEvent && div.fireEvent ) {
+ div.attachEvent("onclick", function(){
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ jQuery.support.noCloneEvent = false;
+ div.detachEvent("onclick", arguments.callee);
+ });
+ div.cloneNode(true).fireEvent("onclick");
+ }
+
+ // Figure out if the W3C box model works as expected
+ // document.body must exist before we can do this
+ jQuery(function(){
+ var div = document.createElement("div");
+ div.style.width = div.style.paddingLeft = "1px";
+
+ document.body.appendChild( div );
+ jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+ document.body.removeChild( div ).style.display = 'none';
+ });
+})();
+
+var styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat";
+
+jQuery.props = {
+ "for": "htmlFor",
+ "class": "className",
+ "float": styleFloat,
+ cssFloat: styleFloat,
+ styleFloat: styleFloat,
+ readonly: "readOnly",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ rowspan: "rowSpan",
+ tabindex: "tabIndex"
+};
+jQuery.fn.extend({
+ // Keep a copy of the old load
+ _load: jQuery.fn.load,
+
+ load: function( url, params, callback ) {
+ if ( typeof url !== "string" )
+ return this._load( url );
+
+ var off = url.indexOf(" ");
+ if ( off >= 0 ) {
+ var selector = url.slice(off, url.length);
+ url = url.slice(0, off);
+ }
+
+ // Default to a GET request
+ var type = "GET";
+
+ // If the second parameter was provided
+ if ( params )
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+ // We assume that it's the callback
+ callback = params;
+ params = null;
+
+ // Otherwise, build a param string
+ } else if( typeof params === "object" ) {
+ params = jQuery.param( params );
+ type = "POST";
+ }
+
+ var self = this;
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+ type: type,
+ dataType: "html",
+ data: params,
+ complete: function(res, status){
+ // If successful, inject the HTML into all the matched elements
+ if ( status == "success" || status == "notmodified" )
+ // See if a selector was specified
+ self.html( selector ?
+ // Create a dummy div to hold the results
+ jQuery("<div/>")
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append(res.responseText.replace(/<script(.|\s)*?\/script>/g, ""))
+
+ // Locate the specified elements
+ .find(selector) :
+
+ // If not, just inject the full result
+ res.responseText );
+
+ if( callback )
+ self.each( callback, [res.responseText, status, res] );
+ }
+ });
+ return this;
+ },
+
+ serialize: function() {
+ return jQuery.param(this.serializeArray());
+ },
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.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(i, elem){
+ var val = jQuery(this).val();
+ return val == null ? null :
+ jQuery.isArray(val) ?
+ jQuery.map( val, function(val, i){
+ return {name: elem.name, value: val};
+ }) :
+ {name: elem.name, value: val};
+ }).get();
+ }
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","), function(i,o){
+ jQuery.fn[o] = function(f){
+ return this.bind(o, f);
+ };
+});
+
+var jsc = now();
+
+jQuery.extend({
+
+ get: function( url, data, callback, type ) {
+ // shift arguments if data argument was ommited
+ if ( jQuery.isFunction( data ) ) {
+ callback = data;
+ data = null;
+ }
+
+ return jQuery.ajax({
+ type: "GET",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get(url, null, callback, "script");
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get(url, data, callback, "json");
+ },
+
+ post: function( url, data, callback, type ) {
+ if ( jQuery.isFunction( data ) ) {
+ callback = data;
+ data = {};
+ }
+
+ return jQuery.ajax({
+ type: "POST",
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ },
+
+ ajaxSetup: function( settings ) {
+ jQuery.extend( jQuery.ajaxSettings, settings );
+ },
+
+ ajaxSettings: {
+ url: location.href,
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ username: null,
+ password: null,
+ */
+ // Create the request object; Microsoft failed to properly
+ // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
+ // This function can be overriden by calling jQuery.ajaxSetup
+ xhr:function(){
+ return window.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: "*/*"
+ }
+ },
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+
+ ajax: function( s ) {
+ // Extend the settings, but re-extend 's' so that it can be
+ // checked again later (in the test suite, specifically)
+ s = jQuery.extend(true, s, jQuery.extend(true, {}, jQuery.ajaxSettings, s));
+
+ var jsonp, jsre = /=\?(&|$)/g, status, data,
+ type = s.type.toUpperCase();
+
+ // convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" )
+ s.data = jQuery.param(s.data);
+
+ // Handle JSONP Parameter Callbacks
+ if ( s.dataType == "jsonp" ) {
+ if ( type == "GET" ) {
+ if ( !s.url.match(jsre) )
+ s.url += (s.url.match(/\?/) ? "&" : "?") + (s.jsonp || "callback") + "=?";
+ } else if ( !s.data || !s.data.match(jsre) )
+ s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
+ s.dataType = "json";
+ }
+
+ // Build temporary JSONP function
+ if ( s.dataType == "json" && (s.data && s.data.match(jsre) || s.url.match(jsre)) ) {
+ jsonp = "jsonp" + jsc++;
+
+ // Replace the =? sequence both in the query string and the data
+ if ( s.data )
+ s.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
+ s.url = s.url.replace(jsre, "=" + jsonp + "$1");
+
+ // We need to make sure
+ // that a JSONP style response is executed properly
+ s.dataType = "script";
+
+ // Handle JSONP-style loading
+ window[ jsonp ] = function(tmp){
+ data = tmp;
+ success();
+ complete();
+ // Garbage collect
+ window[ jsonp ] = undefined;
+ try{ delete window[ jsonp ]; } catch(e){}
+ if ( head )
+ head.removeChild( script );
+ };
+ }
+
+ if ( s.dataType == "script" && s.cache == null )
+ s.cache = false;
+
+ if ( s.cache === false && type == "GET" ) {
+ var ts = now();
+ // try replacing _= if it is there
+ var ret = s.url.replace(/(\?|&)_=.*?(&|$)/, "$1_=" + ts + "$2");
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ((ret == s.url) ? (s.url.match(/\?/) ? "&" : "?") + "_=" + ts : "");
+ }
+
+ // If data is available, append data to url for get requests
+ if ( s.data && type == "GET" ) {
+ s.url += (s.url.match(/\?/) ? "&" : "?") + s.data;
+
+ // IE likes to send both get and post data, prevent this
+ s.data = null;
+ }
+
+ // Watch for a new set of requests
+ if ( s.global && ! jQuery.active++ )
+ jQuery.event.trigger( "ajaxStart" );
+
+ // Matches an absolute URL, and saves the domain
+ var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url );
+
+ // If we're requesting a remote document
+ // and trying to load JSON or Script with a GET
+ if ( s.dataType == "script" && type == "GET" && parts
+ && ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
+
+ var head = document.getElementsByTagName("head")[0];
+ var script = document.createElement("script");
+ script.src = s.url;
+ if (s.scriptCharset)
+ script.charset = s.scriptCharset;
+
+ // Handle Script loading
+ if ( !jsonp ) {
+ var done = false;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function(){
+ if ( !done && (!this.readyState ||
+ this.readyState == "loaded" || this.readyState == "complete") ) {
+ done = true;
+ success();
+ complete();
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+ head.removeChild( script );
+ }
+ };
+ }
+
+ head.appendChild(script);
+
+ // We handle everything using the script element injection
+ return undefined;
+ }
+
+ var requestDone = false;
+
+ // Create the request object
+ var xhr = s.xhr();
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if( s.username )
+ xhr.open(type, s.url, s.async, s.username, s.password);
+ else
+ xhr.open(type, s.url, s.async);
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ // Set the correct header, if data is being sent
+ if ( s.data )
+ xhr.setRequestHeader("Content-Type", s.contentType);
+
+ // Set the If-Modified-Since header, if ifModified mode.
+ if ( s.ifModified )
+ xhr.setRequestHeader("If-Modified-Since",
+ jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );
+
+ // Set header so the called script knows that it's an XMLHttpRequest
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
+
+ // Set the Accepts header for the server, depending on the dataType
+ xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
+ s.accepts[ s.dataType ] + ", */*" :
+ s.accepts._default );
+ } catch(e){}
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && s.beforeSend(xhr, s) === false ) {
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active )
+ jQuery.event.trigger( "ajaxStop" );
+ // close opended socket
+ xhr.abort();
+ return false;
+ }
+
+ if ( s.global )
+ jQuery.event.trigger("ajaxSend", [xhr, s]);
+
+ // Wait for a response to come back
+ var onreadystatechange = function(isTimeout){
+ // The request was aborted, clear the interval and decrement jQuery.active
+ if (xhr.readyState == 0) {
+ if (ival) {
+ // clear poll interval
+ clearInterval(ival);
+ ival = null;
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active )
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ // The transfer is complete and the data is available, or the request timed out
+ } else if ( !requestDone && xhr && (xhr.readyState == 4 || isTimeout == "timeout") ) {
+ requestDone = true;
+
+ // clear poll interval
+ if (ival) {
+ clearInterval(ival);
+ ival = null;
+ }
+
+ status = isTimeout == "timeout" ? "timeout" :
+ !jQuery.httpSuccess( xhr ) ? "error" :
+ s.ifModified && jQuery.httpNotModified( xhr, s.url ) ? "notmodified" :
+ "success";
+
+ if ( status == "success" ) {
+ // Watch for, and catch, XML document parse errors
+ try {
+ // process the data (runs the xml through httpData regardless of callback)
+ data = jQuery.httpData( xhr, s.dataType, s );
+ } catch(e) {
+ status = "parsererror";
+ }
+ }
+
+ // Make sure that the request was successful or notmodified
+ if ( status == "success" ) {
+ // Cache Last-Modified header, if ifModified mode.
+ var modRes;
+ try {
+ modRes = xhr.getResponseHeader("Last-Modified");
+ } catch(e) {} // swallow exception thrown by FF if header is not available
+
+ if ( s.ifModified && modRes )
+ jQuery.lastModified[s.url] = modRes;
+
+ // JSONP handles its own success callback
+ if ( !jsonp )
+ success();
+ } else
+ jQuery.handleError(s, xhr, status);
+
+ // Fire the complete handlers
+ complete();
+
+ if ( isTimeout )
+ xhr.abort();
+
+ // Stop memory leaks
+ if ( s.async )
+ xhr = null;
+ }
+ };
+
+ if ( s.async ) {
+ // don't attach the handler to the request, just poll it instead
+ var ival = setInterval(onreadystatechange, 13);
+
+ // Timeout checker
+ if ( s.timeout > 0 )
+ setTimeout(function(){
+ // Check to see if the request is still happening
+ if ( xhr && !requestDone )
+ onreadystatechange( "timeout" );
+ }, s.timeout);
+ }
+
+ // Send the data
+ try {
+ xhr.send(s.data);
+ } catch(e) {
+ jQuery.handleError(s, xhr, null, e);
+ }
+
+ // firefox 1.5 doesn't fire statechange for sync requests
+ if ( !s.async )
+ onreadystatechange();
+
+ function success(){
+ // If a local callback was specified, fire it and pass it the data
+ if ( s.success )
+ s.success( data, status );
+
+ // Fire the global callback
+ if ( s.global )
+ jQuery.event.trigger( "ajaxSuccess", [xhr, s] );
+ }
+
+ function complete(){
+ // Process result
+ if ( s.complete )
+ s.complete(xhr, status);
+
+ // The request was completed
+ if ( s.global )
+ jQuery.event.trigger( "ajaxComplete", [xhr, s] );
+
+ // Handle the global AJAX counter
+ if ( s.global && ! --jQuery.active )
+ jQuery.event.trigger( "ajaxStop" );
+ }
+
+ // return XMLHttpRequest to allow aborting the request etc.
+ return xhr;
+ },
+
+ handleError: function( s, xhr, status, e ) {
+ // If a local callback was specified, fire it
+ if ( s.error ) s.error( xhr, status, e );
+
+ // Fire the global callback
+ if ( s.global )
+ jQuery.event.trigger( "ajaxError", [xhr, s, e] );
+ },
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Determines if an XMLHttpRequest was successful or not
+ httpSuccess: function( xhr ) {
+ try {
+ // IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
+ return !xhr.status && location.protocol == "file:" ||
+ ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status == 304 || xhr.status == 1223;
+ } catch(e){}
+ return false;
+ },
+
+ // Determines if an XMLHttpRequest returns NotModified
+ httpNotModified: function( xhr, url ) {
+ try {
+ var xhrRes = xhr.getResponseHeader("Last-Modified");
+
+ // Firefox always returns 200. check Last-Modified date
+ return xhr.status == 304 || xhrRes == jQuery.lastModified[url];
+ } catch(e){}
+ return false;
+ },
+
+ httpData: function( xhr, type, s ) {
+ var ct = xhr.getResponseHeader("content-type"),
+ xml = type == "xml" || !type && ct && ct.indexOf("xml") >= 0,
+ data = xml ? xhr.responseXML : xhr.responseText;
+
+ if ( xml && data.documentElement.tagName == "parsererror" )
+ throw "parsererror";
+
+ // Allow a pre-filtering function to sanitize the response
+ // s != null is checked to keep backwards compatibility
+ if( s && s.dataFilter )
+ data = s.dataFilter( data, type );
+
+ // The filter can actually parse the response
+ if( typeof data === "string" ){
+
+ // If the type is "script", eval it in global context
+ if ( type == "script" )
+ jQuery.globalEval( data );
+
+ // Get the JavaScript object, if JSON is used.
+ if ( type == "json" )
+ data = window["eval"]("(" + data + ")");
+ }
+
+ return data;
+ },
+
+ // Serialize an array of form elements or a set of
+ // key/values into a query string
+ param: function( a ) {
+ var s = [ ];
+
+ function add( key, value ){
+ s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
+ };
+
+ // If an array was passed in, assume that it is an array
+ // of form elements
+ if ( jQuery.isArray(a) || a.jquery )
+ // Serialize the form elements
+ jQuery.each( a, function(){
+ add( this.name, this.value );
+ });
+
+ // Otherwise, assume that it's an object of key/value pairs
+ else
+ // Serialize the key/values
+ for ( var j in a )
+ // If the value is an array then the key names need to be repeated
+ if ( jQuery.isArray(a[j]) )
+ jQuery.each( a[j], function(){
+ add( j, this );
+ });
+ else
+ add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );
+
+ // Return the resulting serialization
+ return s.join("&").replace(/%20/g, "+");
+ }
+
+});
+var elemdisplay = {},
+ timerId,
+ fxAttrs = [
+ // height animations
+ [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
+ // width animations
+ [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
+ // opacity animations
+ [ "opacity" ]
+ ];
+
+function genFx( type, num ){
+ var obj = {};
+ jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
+ obj[ this ] = type;
+ });
+ return obj;
+}
+
+jQuery.fn.extend({
+ show: function(speed,callback){
+ if ( speed ) {
+ return this.animate( genFx("show", 3), speed, callback);
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ){
+ var old = jQuery.data(this[i], "olddisplay");
+
+ this[i].style.display = old || "";
+
+ if ( jQuery.css(this[i], "display") === "none" ) {
+ var tagName = this[i].tagName, display;
+
+ if ( elemdisplay[ tagName ] ) {
+ display = elemdisplay[ tagName ];
+ } else {
+ var elem = jQuery("<" + tagName + " />").appendTo("body");
+
+ display = elem.css("display");
+ if ( display === "none" )
+ display = "block";
+
+ elem.remove();
+
+ elemdisplay[ tagName ] = display;
+ }
+
+ jQuery.data(this[i], "olddisplay", display);
+ }
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var i = 0, l = this.length; i < l; i++ ){
+ this[i].style.display = jQuery.data(this[i], "olddisplay") || "";
+ }
+
+ return this;
+ }
+ },
+
+ hide: function(speed,callback){
+ if ( speed ) {
+ return this.animate( genFx("hide", 3), speed, callback);
+ } else {
+ for ( var i = 0, l = this.length; i < l; i++ ){
+ var old = jQuery.data(this[i], "olddisplay");
+ if ( !old && old !== "none" )
+ jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
+ }
+
+ // Set the display of the elements in a second loop
+ // to avoid the constant reflow
+ for ( var i = 0, l = this.length; i < l; i++ ){
+ this[i].style.display = "none";
+ }
+
+ return this;
+ }
+ },
+
+ // Save the old toggle function
+ _toggle: jQuery.fn.toggle,
+
+ toggle: function( fn, fn2 ){
+ var bool = typeof fn === "boolean";
+
+ return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
+ this._toggle.apply( this, arguments ) :
+ fn == null || bool ?
+ this.each(function(){
+ var state = bool ? fn : jQuery(this).is(":hidden");
+ jQuery(this)[ state ? "show" : "hide" ]();
+ }) :
+ this.animate(genFx("toggle", 3), fn, fn2);
+ },
+
+ fadeTo: function(speed,to,callback){
+ return this.animate({opacity: to}, speed, callback);
+ },
+
+ animate: function( prop, speed, easing, callback ) {
+ var optall = jQuery.speed(speed, easing, callback);
+
+ return this[ optall.queue === false ? "each" : "queue" ](function(){
+
+ var opt = jQuery.extend({}, optall), p,
+ hidden = this.nodeType == 1 && jQuery(this).is(":hidden"),
+ self = this;
+
+ for ( p in prop ) {
+ if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
+ return opt.complete.call(this);
+
+ if ( ( p == "height" || p == "width" ) && this.style ) {
+ // Store display property
+ opt.display = jQuery.css(this, "display");
+
+ // Make sure that nothing sneaks out
+ opt.overflow = this.style.overflow;
+ }
+ }
+
+ if ( opt.overflow != null )
+ this.style.overflow = "hidden";
+
+ opt.curAnim = jQuery.extend({}, prop);
+
+ jQuery.each( prop, function(name, val){
+ var e = new jQuery.fx( self, opt, name );
+
+ if ( /toggle|show|hide/.test(val) )
+ e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+ else {
+ var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
+ start = e.cur(true) || 0;
+
+ if ( parts ) {
+ var end = parseFloat(parts[2]),
+ unit = parts[3] || "px";
+
+ // We need to compute starting value
+ if ( unit != "px" ) {
+ self.style[ name ] = (end || 1) + unit;
+ start = ((end || 1) / e.cur(true)) * start;
+ self.style[ name ] = start + unit;
+ }
+
+ // If a +=/-= token was provided, we're doing a relative animation
+ if ( parts[1] )
+ end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
+
+ e.custom( start, end, unit );
+ } else
+ e.custom( start, val, "" );
+ }
+ });
+
+ // For JS strict compliance
+ return true;
+ });
+ },
+
+ stop: function(clearQueue, gotoEnd){
+ var timers = jQuery.timers;
+
+ if (clearQueue)
+ this.queue([]);
+
+ this.each(function(){
+ // go in reverse order so anything added to the queue during the loop is ignored
+ for ( var i = timers.length - 1; i >= 0; i-- )
+ if ( timers[i].elem == this ) {
+ if (gotoEnd)
+ // force the next step to be the last
+ timers[i](true);
+ timers.splice(i, 1);
+ }
+ });
+
+ // start the next in the queue if the last step wasn't forced
+ if (!gotoEnd)
+ this.dequeue();
+
+ return this;
+ }
+
+});
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show", 1),
+ slideUp: genFx("hide", 1),
+ slideToggle: genFx("toggle", 1),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" }
+}, function( name, props ){
+ jQuery.fn[ name ] = function( speed, callback ){
+ return this.animate( props, speed, callback );
+ };
+});
+
+jQuery.extend({
+
+ speed: function(speed, easing, fn) {
+ var opt = typeof speed === "object" ? speed : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
+
+ // Queueing
+ opt.old = opt.complete;
+ opt.complete = function(){
+ if ( opt.queue !== false )
+ jQuery(this).dequeue();
+ if ( jQuery.isFunction( opt.old ) )
+ opt.old.call( this );
+ };
+
+ return opt;
+ },
+
+ easing: {
+ linear: function( p, n, firstNum, diff ) {
+ return firstNum + diff * p;
+ },
+ swing: function( p, n, firstNum, diff ) {
+ return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
+ }
+ },
+
+ timers: [],
+
+ fx: function( elem, options, prop ){
+ this.options = options;
+ this.elem = elem;
+ this.prop = prop;
+
+ if ( !options.orig )
+ options.orig = {};
+ }
+
+});
+
+jQuery.fx.prototype = {
+
+ // Simple function for setting a style value
+ update: function(){
+ if ( this.options.step )
+ this.options.step.call( this.elem, this.now, this );
+
+ (jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
+
+ // Set display property to block for height/width animations
+ if ( ( this.prop == "height" || this.prop == "width" ) && this.elem.style )
+ this.elem.style.display = "block";
+ },
+
+ // Get the current size
+ cur: function(force){
+ if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) )
+ return this.elem[ this.prop ];
+
+ var r = parseFloat(jQuery.css(this.elem, this.prop, force));
+ return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
+ },
+
+ // Start an animation from one number to another
+ custom: function(from, to, unit){
+ this.startTime = now();
+ this.start = from;
+ this.end = to;
+ this.unit = unit || this.unit || "px";
+ this.now = this.start;
+ this.pos = this.state = 0;
+
+ var self = this;
+ function t(gotoEnd){
+ return self.step(gotoEnd);
+ }
+
+ t.elem = this.elem;
+
+ if ( t() && jQuery.timers.push(t) && !timerId ) {
+ timerId = setInterval(function(){
+ var timers = jQuery.timers;
+
+ for ( var i = 0; i < timers.length; i++ )
+ if ( !timers[i]() )
+ timers.splice(i--, 1);
+
+ if ( !timers.length ) {
+ clearInterval( timerId );
+ timerId = undefined;
+ }
+ }, 13);
+ }
+ },
+
+ // Simple 'show' function
+ show: function(){
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+ this.options.show = true;
+
+ // Begin the animation
+ // Make sure that we start at a small width/height to avoid any
+ // flash of content
+ this.custom(this.prop == "width" || this.prop == "height" ? 1 : 0, this.cur());
+
+ // Start by showing the element
+ jQuery(this.elem).show();
+ },
+
+ // Simple 'hide' function
+ hide: function(){
+ // Remember where we started, so that we can go back to it later
+ this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
+ this.options.hide = true;
+
+ // Begin the animation
+ this.custom(this.cur(), 0);
+ },
+
+ // Each step of an animation
+ step: function(gotoEnd){
+ var t = now();
+
+ if ( gotoEnd || t >= this.options.duration + this.startTime ) {
+ this.now = this.end;
+ this.pos = this.state = 1;
+ this.update();
+
+ this.options.curAnim[ this.prop ] = true;
+
+ var done = true;
+ for ( var i in this.options.curAnim )
+ if ( this.options.curAnim[i] !== true )
+ done = false;
+
+ if ( done ) {
+ if ( this.options.display != null ) {
+ // Reset the overflow
+ this.elem.style.overflow = this.options.overflow;
+
+ // Reset the display
+ this.elem.style.display = this.options.display;
+ if ( jQuery.css(this.elem, "display") == "none" )
+ this.elem.style.display = "block";
+ }
+
+ // Hide the element if the "hide" operation was done
+ if ( this.options.hide )
+ jQuery(this.elem).hide();
+
+ // Reset the properties, if the item has been hidden or shown
+ if ( this.options.hide || this.options.show )
+ for ( var p in this.options.curAnim )
+ jQuery.attr(this.elem.style, p, this.options.orig[p]);
+
+ // Execute the complete function
+ this.options.complete.call( this.elem );
+ }
+
+ return false;
+ } else {
+ var n = t - this.startTime;
+ this.state = n / this.options.duration;
+
+ // Perform the easing function, defaults to swing
+ this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
+ this.now = this.start + ((this.end - this.start) * this.pos);
+
+ // Perform the next step of the animation
+ this.update();
+ }
+
+ return true;
+ }
+
+};
+
+jQuery.extend( jQuery.fx, {
+ speeds:{
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+ },
+ step: {
+
+ opacity: function(fx){
+ jQuery.attr(fx.elem.style, "opacity", fx.now);
+ },
+
+ _default: function(fx){
+ if ( fx.elem.style && fx.elem.style[ fx.prop ] != null )
+ fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+ else
+ fx.elem[ fx.prop ] = fx.now;
+ }
+ }
+});
+if ( document.documentElement["getBoundingClientRect"] )
+ jQuery.fn.offset = function() {
+ if ( !this[0] ) return { top: 0, left: 0 };
+ if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
+ var box = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,
+ clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+ top = box.top + (self.pageYOffset || jQuery.boxModel && docElem.scrollTop || body.scrollTop ) - clientTop,
+ left = box.left + (self.pageXOffset || jQuery.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
+ return { top: top, left: left };
+ };
+else
+ jQuery.fn.offset = function() {
+ if ( !this[0] ) return { top: 0, left: 0 };
+ if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
+ jQuery.offset.initialized || jQuery.offset.initialize();
+
+ var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem,
+ doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
+ body = doc.body, defaultView = doc.defaultView,
+ prevComputedStyle = defaultView.getComputedStyle(elem, null),
+ top = elem.offsetTop, left = elem.offsetLeft;
+
+ while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
+ computedStyle = defaultView.getComputedStyle(elem, null);
+ top -= elem.scrollTop, left -= elem.scrollLeft;
+ if ( elem === offsetParent ) {
+ top += elem.offsetTop, left += elem.offsetLeft;
+ if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.tagName)) )
+ top += parseInt( computedStyle.borderTopWidth, 10) || 0,
+ left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
+ prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
+ }
+ if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" )
+ top += parseInt( computedStyle.borderTopWidth, 10) || 0,
+ left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
+ prevComputedStyle = computedStyle;
+ }
+
+ if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" )
+ top += body.offsetTop,
+ left += body.offsetLeft;
+
+ if ( prevComputedStyle.position === "fixed" )
+ top += Math.max(docElem.scrollTop, body.scrollTop),
+ left += Math.max(docElem.scrollLeft, body.scrollLeft);
+
+ return { top: top, left: left };
+ };
+
+jQuery.offset = {
+ initialize: function() {
+ if ( this.initialized ) return;
+ var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
+ html = '<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>';
+
+ rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
+ for ( prop in rules ) container.style[prop] = rules[prop];
+
+ container.innerHTML = html;
+ body.insertBefore(container, body.firstChild);
+ innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
+
+ this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+ this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
+
+ innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
+ this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
+
+ body.style.marginTop = '1px';
+ this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0);
+ body.style.marginTop = bodyMarginTop;
+
+ body.removeChild(container);
+ this.initialized = true;
+ },
+
+ bodyOffset: function(body) {
+ jQuery.offset.initialized || jQuery.offset.initialize();
+ var top = body.offsetTop, left = body.offsetLeft;
+ if ( jQuery.offset.doesNotIncludeMarginInBodyOffset )
+ top += parseInt( jQuery.curCSS(body, 'marginTop', true), 10 ) || 0,
+ left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0;
+ return { top: top, left: left };
+ }
+};
+
+
+jQuery.fn.extend({
+ position: function() {
+ var left = 0, top = 0, results;
+
+ if ( this[0] ) {
+ // Get *real* offsetParent
+ var offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = /^body|html$/i.test(offsetParent[0].tagName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= num( this, 'marginTop' );
+ offset.left -= num( this, 'marginLeft' );
+
+ // Add offsetParent borders
+ parentOffset.top += num( offsetParent, 'borderTopWidth' );
+ parentOffset.left += num( offsetParent, 'borderLeftWidth' );
+
+ // Subtract the two offsets
+ results = {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ }
+
+ return results;
+ },
+
+ offsetParent: function() {
+ var offsetParent = this[0].offsetParent || document.body;
+ while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static') )
+ offsetParent = offsetParent.offsetParent;
+ return jQuery(offsetParent);
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( ['Left', 'Top'], function(i, name) {
+ var method = 'scroll' + name;
+
+ jQuery.fn[ method ] = function(val) {
+ if (!this[0]) return null;
+
+ return val !== undefined ?
+
+ // Set the scroll offset
+ this.each(function() {
+ this == window || this == document ?
+ window.scrollTo(
+ !i ? val : jQuery(window).scrollLeft(),
+ i ? val : jQuery(window).scrollTop()
+ ) :
+ this[ method ] = val;
+ }) :
+
+ // Return the scroll offset
+ this[0] == window || this[0] == document ?
+ self[ i ? 'pageYOffset' : 'pageXOffset' ] ||
+ jQuery.boxModel && document.documentElement[ method ] ||
+ document.body[ method ] :
+ this[0][ method ];
+ };
+});
+// Create innerHeight, innerWidth, outerHeight and outerWidth methods
+jQuery.each([ "Height", "Width" ], function(i, name){
+
+ var tl = i ? "Left" : "Top", // top or left
+ br = i ? "Right" : "Bottom", // bottom or right
+ lower = name.toLowerCase();
+
+ // innerHeight and innerWidth
+ jQuery.fn["inner" + name] = function(){
+ return this[0] ?
+ jQuery.css( this[0], lower, false, "padding" ) :
+ null;
+ };
+
+ // outerHeight and outerWidth
+ jQuery.fn["outer" + name] = function(margin) {
+ return this[0] ?
+ jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) :
+ null;
+ };
+
+ var type = name.toLowerCase();
+
+ jQuery.fn[ type ] = function( size ) {
+ // Get window width or height
+ return this[0] == window ?
+ // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+ document.compatMode == "CSS1Compat" && document.documentElement[ "client" + name ] ||
+ document.body[ "client" + name ] :
+
+ // Get document width or height
+ this[0] == document ?
+ // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+ Math.max(
+ document.documentElement["client" + name],
+ document.body["scroll" + name], document.documentElement["scroll" + name],
+ document.body["offset" + name], document.documentElement["offset" + name]
+ ) :
+
+ // Get or set width or height on the element
+ size === undefined ?
+ // Get width or height on the element
+ (this.length ? jQuery.css( this[0], type ) : null) :
+
+ // Set the width or height on the element (default to pixels if value is unitless)
+ this.css( type, typeof size === "string" ? size : size + "px" );
+ };
+
+});
+})();
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/jquery.min.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/jquery.min.js
new file mode 100644
index 000000000..7c2430802
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/jquery.min.js
@@ -0,0 +1,154 @@
+/*!
+ * jQuery JavaScript Library v1.4.2
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Sat Feb 13 22:33:48 2010 -0500
+ */
+(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
+e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
+j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
+"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
+true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
+Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
+(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
+a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
+"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
+function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
+c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
+L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
+"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
+a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
+d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
+a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
+!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
+true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
+parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
+false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
+s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
+applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
+else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
+a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
+w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
+cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
+i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
+" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
+this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
+e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
+c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
+a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
+function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
+k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
+C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
+null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
+e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
+f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
+if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
+d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
+"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
+a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
+isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
+{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
+if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
+e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
+"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
+d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
+!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
+toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
+u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
+function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
+if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
+t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
+g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
+for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
+1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.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\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
+relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
+l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
+h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
+CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
+g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
+text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
+setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
+h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
+m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
+"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
+h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
+!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
+h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
+q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
+if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
+(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
+function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
+gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
+c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
+{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
+"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
+d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
+a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
+1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
+a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
+c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
+wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
+prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
+this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
+return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
+""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
+this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
+u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
+1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
+return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
+""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
+c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
+c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
+function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
+Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
+"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
+a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
+a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
+"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
+serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
+function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
+global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
+e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
+"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
+false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
+false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
+c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
+d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
+g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
+1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
+"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
+if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
+this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
+"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
+animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
+j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
+this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
+"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
+c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
+this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
+this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
+e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
+c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
+function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
+this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
+k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
+f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<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>";
+a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
+c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
+d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
+f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
+"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
+e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/label_quantum.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/label_quantum.js
new file mode 100644
index 000000000..6e07cbc1f
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/label_quantum.js
@@ -0,0 +1,5 @@
+zk.afterLoad("zul.wgt", function () {
+ zul.wgt.Label.prototype.getEncodedText = function() {
+ return zUtl.encodeXML(this._value, {multiline:this._multiline,pre:this._pre, maxlength: this._maxlength}).replace(/_nl_/g, "<br />");
+ }
+}); \ No newline at end of file
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/nova_button.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/nova_button.js
new file mode 100644
index 000000000..75dc28a1f
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/nova_button.js
@@ -0,0 +1,1184 @@
+function NovaButton() {
+
+}
+
+NovaButton.prototype = new GControl();
+
+NovaButton.globals = {
+ currentButton: null,
+ layerOptionContainer: null,
+ layerOptionVisible: false,
+ searchOptionContainer: null,
+ searchOptionVisible: false,
+ //new changes
+ searchResultContainer: null,
+ //new changes
+ searchTabSelected: null,
+ map: null,
+ originalLayerState: null
+};
+
+NovaButton.globals.dragzoom = {
+ cornerTopDiv: null,
+ cornerRightDiv: null,
+ cornerBottomDiv: null,
+ cornerLeftDiv: null,
+ mapPosition: null,
+ outlineDiv: null,
+ mapWidth: 0,
+ mapHeight: 0,
+ mapRatio: 0,
+ startX: 0,
+ startY: 0,
+ zoomArea: null,
+ moving: false
+};
+
+// Creates a one DIV for each of the buttons and places them in a container
+// DIV which is returned as our control element.
+NovaButton.prototype.initialize = function(map) {
+ var container = document.createElement("div");
+ container.style.zIndex = "150";
+ var that = this;
+
+ // "Cursor" button
+ var cursorDiv = document.createElement("div");
+ cursorDiv.id = "cursorDiv";
+ NovaButton.globals.currentButton = "cursorDiv";
+ this.setButtonStyle(cursorDiv, true);
+ cursorDiv.style.fontWeight = "bold";
+ cursorDiv.appendChild(document.createTextNode("Cursor"));
+ GEvent.addDomListener(cursorDiv, "click", function() {
+ var globals = NovaButton.globals;
+ if (globals.currentButton == "cursorDiv") {
+ return;
+ }
+
+ this.style.fontWeight = "bold";
+ globals.currentButton = "cursorDiv";
+ if (!map.draggingEnabled()) {
+ map.enableDragging();
+ }
+ document.getElementById("detailDiv").style.fontWeight = "normal";
+ document.getElementById("zoomRectangleDiv").style.fontWeight = "normal";
+
+ that.resetDragZoom();
+ });
+
+ // "detail" button
+ var detailDiv = document.createElement("div");
+ detailDiv.id = "detailDiv";
+ this.setButtonStyle(detailDiv, true);
+ detailDiv.appendChild(document.createTextNode("Detail"));
+ GEvent.addDomListener(detailDiv, "click", function() {
+ var globals = NovaButton.globals;
+ if (globals.currentButton == "detailDiv") {
+ return;
+ }
+
+ this.style.fontWeight = "bold";
+ globals.currentButton = "detailDiv";
+ if (map.draggingEnabled()) {
+ map.disableDragging();
+ }
+ document.getElementById("cursorDiv").style.fontWeight = "normal";
+ document.getElementById("zoomRectangleDiv").style.fontWeight = "normal";
+
+ that.resetDragZoom();
+ });
+
+ // zoom rectangle button
+ var zoomRectangleDiv = document.createElement("div");
+ zoomRectangleDiv.id = "zoomRectangleDiv";
+ this.setButtonStyle(zoomRectangleDiv, true);
+ zoomRectangleDiv.appendChild(document.createTextNode("Zoom Rect."));
+ GEvent.addDomListener(zoomRectangleDiv, "click", function() {
+ var globals = NovaButton.globals;
+ if (globals.currentButton == "zoomRectangleDiv") {
+ return;
+ }
+
+ this.style.fontWeight = "bold";
+ globals.currentButton = "zoomRectangleDiv";
+
+ if (map.draggingEnabled()) {
+ map.disableDragging();
+ }
+ document.getElementById("cursorDiv").style.fontWeight = "normal";
+ document.getElementById("detailDiv").style.fontWeight = "normal";
+
+ that.initCover();
+ });
+
+ // "Zoom In" button
+ var zoomInDiv = document.createElement("div");
+ this.setButtonStyle(zoomInDiv, true);
+ zoomInDiv.appendChild(document.createTextNode("Zoom In"));
+ // The "true" argument in the zoomIn() method allows continuous zooming
+ GEvent.addDomListener(zoomInDiv, "click", function() {
+ //map.zoomIn(null,null,true);
+ map.zoomIn();
+ });
+
+ // "Zoom Out" button
+ var zoomOutDiv = document.createElement("div");
+ this.setButtonStyle(zoomOutDiv, true);
+ zoomOutDiv.style.borderTop = 0+'px';
+ zoomOutDiv.appendChild(document.createTextNode("Zoom Out"));
+ // The "true" argument in the zoomOut() method allows continuous zooming
+ GEvent.addDomListener(zoomOutDiv, "click", function() {
+ //map.zoomOut(null,true);
+ map.zoomOut();
+ });
+
+ // "Default View" button
+ var defaultViewDiv = document.createElement("div");
+ this.setButtonStyle(defaultViewDiv, true);
+ defaultViewDiv.appendChild(document.createTextNode("Default View"));
+ GEvent.addDomListener(defaultViewDiv, "click", function(e) {
+ that.defaultViewClickEvent();
+ });
+
+ // "layer" button
+ var showLayerDiv = document.createElement("div");
+ this.setButtonStyle(showLayerDiv, true);
+ showLayerDiv.appendChild(document.createTextNode("Layers"));
+ GEvent.addDomListener(showLayerDiv, "click", function(e) {
+ that.showLayerClickEvent(e);
+ });
+
+ // initialize layer option
+ var layerOptionContainer = document.createElement("div");
+ this.setMenuContainerStyle(layerOptionContainer);
+ this.initializeLayerDiv(layerOptionContainer);
+
+ // "search" button
+ var searchDiv = document.createElement("div");
+ this.setButtonStyle(searchDiv, true);
+ searchDiv.appendChild(document.createTextNode("Search"));
+ GEvent.addDomListener(searchDiv, "click", function(e) {
+ that.searchClickEvent(e);
+ });
+
+ var searchOptionContainer = document.createElement("div");
+ searchOptionContainer.style.position = "absolute";
+ searchOptionContainer.style.left = "100px";
+ searchOptionContainer.style.top = "100px";
+ searchOptionContainer.style.display = "none";
+ this.initializeSearchDiv(searchOptionContainer);
+
+ var buttonContainer = document.createElement("div");
+ buttonContainer.appendChild(cursorDiv);
+ buttonContainer.appendChild(detailDiv);
+ //buttonContainer.appendChild(zoomRectangleDiv);
+ //buttonContainer.appendChild(zoomInDiv);
+ //buttonContainer.appendChild(zoomOutDiv);
+ //buttonContainer.appendChild(defaultViewDiv);
+ //buttonContainer.appendChild(showLayerDiv);
+ //buttonContainer.appendChild(searchDiv);
+
+ // zoom area div
+ var zoomAreaDiv = document.createElement("div");
+ this.setZoomAreaStyle(zoomAreaDiv);
+ var DIVS_TO_CREATE = ['outlineDiv', 'cornerTopDiv', 'cornerLeftDiv', 'cornerRightDiv', 'cornerBottomDiv'];
+ for (var i=0; i<DIVS_TO_CREATE.length; i++) {
+ var id = DIVS_TO_CREATE[i];
+ var div = document.createElement("div");
+ div.style.position = "absolute";
+ div.style.display = "none";
+ zoomAreaDiv.appendChild(div);
+ NovaButton.globals.dragzoom[id] = div;
+ }
+
+ GEvent.addDomListener(zoomAreaDiv, 'mousedown', function(e) {
+ that.mouseDown(e);
+ });
+ GEvent.addDomListener(document, 'mousemove', function(e) {
+ that.mouseMove(e);
+ });
+ GEvent.addDomListener(document, 'mouseup', function(e) {
+ that.mouseUp(e);
+ });
+
+ // assign global variable
+ NovaButton.globals.layerOptionContainer = layerOptionContainer;
+ NovaButton.globals.map = map;
+ NovaButton.globals.dragzoom.zoomArea = zoomAreaDiv;
+ NovaButton.globals.dragzoom.mapPosition = NovaButtonUtils.getElementPosition(map.getContainer());
+ NovaButton.globals.searchOptionContainer = searchOptionContainer;
+ this.setDimensions();
+
+ zoomAreaDiv.onselectstart = function() {return false;};
+
+ //styles
+ this.initZoomAreaStyles();
+
+ container.appendChild(buttonContainer);
+ map.getContainer().appendChild(container);
+ //map.getContainer().appendChild(layerOptionContainer);
+ //map.getContainer().appendChild(searchOptionContainer);
+ document.body.appendChild(layerOptionContainer);
+ document.body.appendChild(searchOptionContainer);
+ map.getContainer().appendChild(zoomAreaDiv);
+
+ return container;
+}
+
+// The control will appear in the top left corner of the map with 5 pixels of padding.
+NovaButton.prototype.getDefaultPosition = function() {
+ return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(70, 5));
+}
+
+NovaButton.prototype.setSearchResultStyle = function(container) {
+ container.style.width = "300px";
+ container.style.height = "150px";
+ container.style.background = "#FFFFF0";
+ container.style.fontFamily = "Verdana";
+ container.style.fontSize = "12px";
+ container.style.position = "absolute";
+ container.style.border = "1px solid black";
+ container.style.top = "201px";
+ container.style.left = "0px";
+ container.style.display = "none";
+ container.style.overflow = "auto";
+ container.align = "left";
+}
+
+// Sets the proper CSS for the given button element.
+NovaButton.prototype.setButtonStyle = function(button, horizontalAlign) {
+ button.style.color = "black";
+ button.style.backgroundColor = "white";
+ button.style.fontFamily = "Verdana";
+ button.style.fontSize = "12px";
+ button.style.fontWeight= "normal";
+ button.style.border = "1px solid gray";
+ button.style.padding = "0px";
+ button.style.marginBottom = "0px";
+ button.style.textAlign = "center";
+ button.style.width = "80px";
+ button.style.height = "15px";
+ button.style.cursor = "pointer";
+ //button.style.zIndex = "200";
+
+ if (horizontalAlign) {
+ if(button.addEventListener) {
+ button.style.cssFloat = "left" ;
+ }
+ else {
+ button.style.styleFloat = "left" ;
+ }
+ }
+}
+
+NovaButton.prototype.setTabHeaderStyle = function(header) {
+ //header.style.position = "absolute";
+ //header.style.zIndex = "2";
+ header.align = "left";
+}
+
+NovaButton.prototype.setTabButtonStyle = function(tab) {
+ tab.style.padding = "3px 5px 3px 5px";
+ tab.style.fontFamily = "Verdana";
+ tab.style.fontSize = "12px";
+ tab.style.textAlign = "center";
+ tab.style.width = "7em";
+ tab.style.height = "15px";
+ tab.style.cursor = "pointer";
+ tab.style.background = "#C6DEFF";
+
+ if(tab.addEventListener) {
+ tab.style.cssFloat = "left" ;
+ }
+ else {
+ tab.style.styleFloat = "left" ;
+ }
+}
+
+NovaButton.prototype.setTabBodyStyle = function(body) {
+ body.style.width = "400px";
+ body.style.height = "150px";
+ body.style.background = "#FFFFF0";
+ body.style.fontFamily = "Verdana";
+ body.style.fontSize = "12px";
+ //body.style.zIndex = "1";
+ body.style.padding = "3px 5px 3px 5px";
+ body.style.top = "20px";
+ body.style.left = "0px";
+ body.style.position = "absolute";
+ body.style.display = "none";
+ body.align = "left";
+}
+
+NovaButton.prototype.setTabFooterStyle = function(footer) {
+ footer.style.width = "400px";
+ footer.style.height = "20px";
+ footer.align = "center";
+ footer.style.padding = "3px 5px 3px 5px";
+ footer.style.background = "#FFFFF0";
+ footer.style.position = "absolute";
+ footer.style.top = "175px";
+ footer.style.left = "0";
+}
+
+NovaButton.prototype.tabMouseOver = function(e) {
+ var tab = Event.element(e);
+ tab.style.background = "#ADDFFF";
+}
+
+NovaButton.prototype.tabMouseOut = function(e) {
+ var tab = Event.element(e);
+ tab.style.background = "#C6DEFF";
+}
+
+NovaButton.prototype.tabClickEvent = function(e) {
+ var tab = Event.element(e);
+
+ if (tab.id == NovaButton.globals.searchTabSelected) {
+ return false;
+ }
+
+ NovaButton.globals.searchTabSelected = tab.id;
+ tab.style.fontWeight = "bold";
+
+ if (tab.id == "nodeTab") {
+ document.getElementById("nodeBody").style.display = "inline";
+ document.getElementById("addressBody").style.display = "none";
+ document.getElementById("addressTab").style.fontWeight = "normal";
+ }
+ else {
+ document.getElementById("addressBody").style.display = "inline";
+ document.getElementById("nodeBody").style.display = "none";
+ document.getElementById("nodeTab").style.fontWeight = "normal";
+ }
+}
+
+NovaButton.prototype.initializeSearchDiv = function(searchOptionContainer) {
+ var header = document.createElement("div");
+ this.setTabHeaderStyle(header);
+ var that = this;
+
+ var nodeTab = header.appendChild(document.createElement("div"));
+ nodeTab.id = "nodeTab";
+ this.setTabButtonStyle(nodeTab);
+ nodeTab.appendChild(document.createTextNode("Node"));
+ GEvent.addDomListener(nodeTab, "mouseover", function(e) {
+ that.tabMouseOver(e);
+ });
+ GEvent.addDomListener(nodeTab, "mouseout", function(e) {
+ that.tabMouseOut(e);
+ });
+ GEvent.addDomListener(nodeTab, "click", function(e) {
+ that.tabClickEvent(e);
+ });
+
+ var addressTab = header.appendChild(document.createElement("div"));
+ addressTab.id = "addressTab";
+ this.setTabButtonStyle(addressTab);
+ addressTab.appendChild(document.createTextNode("Address"));
+ GEvent.addDomListener(addressTab, "mouseover", function(e) {
+ that.tabMouseOver(e);
+ });
+ GEvent.addDomListener(addressTab, "mouseout", function(e) {
+ that.tabMouseOut(e);
+ });
+ GEvent.addDomListener(addressTab, "click", function(e) {
+ that.tabClickEvent(e);
+ });
+
+ var body = document.createElement("div");
+ var nodeBody = body.appendChild(document.createElement("div"));
+ nodeBody.id = "nodeBody";
+ this.setTabBodyStyle(nodeBody);
+ this.initializeNodeBody(nodeBody);
+
+ var addressBody = body.appendChild(document.createElement("div"));
+ addressBody.id = "addressBody";
+ this.setTabBodyStyle(addressBody);
+ this.initializeAddressBody(addressBody);
+
+ //new changes
+ var searchResultContainer = body.appendChild(document.createElement("div"));
+ searchResultContainer.style.opacity = "0.8";
+ searchResultContainer.style.filter = 'alpha(opacity=' + (0.6 * 100) + ')';
+ this.setSearchResultStyle(searchResultContainer);
+ //new changes
+
+ var footer = document.createElement("div");
+ this.setTabFooterStyle(footer);
+ var buttonDiv = footer.appendChild(document.createElement("div"));
+ this.setButtonStyle(buttonDiv, false);
+ buttonDiv.appendChild(document.createTextNode("Submit"));
+ GEvent.addDomListener(buttonDiv, "click", function(e) {
+ that.submitSearchClickEvent(e);
+ });
+
+ searchOptionContainer.appendChild(header);
+ searchOptionContainer.appendChild(body);
+ searchOptionContainer.appendChild(footer);
+ //searchOptionContainer.appendChild(nodeBody);
+ //searchOptionContainer.appendChild(addressBody);
+
+ // default tab
+ nodeTab.style.fontWeight = "bold";
+ nodeBody.style.display = "inline";
+ NovaButton.globals.searchTabSelected = "nodeTab";
+ //new changes
+ NovaButton.globals.searchResultContainer = searchResultContainer;
+ //new chjanges
+}
+
+NovaButton.prototype.initializeNodeBody = function(nodeBody) {
+ var searchByNodeId = document.createElement("input");
+ searchByNodeId.type = "radio";
+ searchByNodeId.defaultChecked = true;
+ searchByNodeId.name = "nodeGroup";
+ searchByNodeId.id = "searchByNodeId";
+ searchByNodeId.value = "searchByNodeId";
+ searchByNodeId.onclick = function () {
+ searchByLocation.checked = false;
+ searchByNodeId.checked = true;
+ };
+ nodeBody.appendChild(searchByNodeId);
+ nodeBody.appendChild(document.createTextNode("Node ID"));
+ nodeBody.appendChild(document.createElement("br"));
+
+ var searchByLocation = document.createElement("input");
+ searchByLocation.type = "radio";
+ searchByLocation.defaultChecked = false;
+ searchByLocation.name = "nodeGroup";
+ searchByLocation.id = "searchByLocation";
+ searchByLocation.value = "searchByLocation";
+ // ie bug
+ searchByLocation.onclick = function () {
+ searchByLocation.checked = true;
+ searchByNodeId.checked = false;
+ };
+ nodeBody.appendChild(searchByLocation);
+ nodeBody.appendChild(document.createTextNode("Node Location"));
+ nodeBody.appendChild(document.createElement("br"));
+ nodeBody.appendChild(document.createElement("br"));
+
+ var exactMatchSearch = document.createElement("input");
+ exactMatchSearch.type = "checkbox";
+ exactMatchSearch.id = "exactMatch";
+ nodeBody.appendChild(exactMatchSearch);
+ nodeBody.appendChild(document.createTextNode("Exact Match"));
+ nodeBody.appendChild(document.createElement("br"));
+
+ var searchInput = document.createElement("input");
+ searchInput.id = "nodeSearchInput";
+ searchInput.setAttribute("type", "text");
+ searchInput.setAttribute("size", "60");
+
+ nodeBody.appendChild(searchInput);
+}
+
+NovaButton.prototype.initializeAddressBody = function(addressBody) {
+ var addressLabel = addressBody.appendChild(document.createElement("div"));
+ addressLabel.appendChild(document.createTextNode("Enter address (e.g. 180 park ave, florham park, nj 07932)"));
+
+ var searchInput = document.createElement("input");
+ searchInput.id = "addressSearchInput";
+ searchInput.setAttribute("type", "text");
+ searchInput.setAttribute("size", "60");
+
+ addressBody.appendChild(searchInput);
+}
+
+//new changes start
+NovaButton.prototype.setSearchResult = function(jsonData) {
+ var resultContainer = NovaButton.globals.searchResultContainer;
+ for (var i = resultContainer.childNodes.length - 1; i >= 0; i--) {
+ resultContainer.removeChild(resultContainer.lastChild);
+ }
+
+ var table = resultContainer.appendChild(document.createElement("table"));
+ var tbody = table.appendChild(document.createElement("tbody"));
+ var list = jsonData.list;
+
+ if (list == null) {
+ var tr = tbody.appendChild(document.createElement("tr"));
+ var td = tr.appendChild(document.createElement("td"));
+ td.appendChild(document.createTextNode("Not Found"));
+ td.style.fontSize = "12px";
+ td.style.textDecoration = "none";
+ td.font = "Arial,Helvetica,sans-serif";
+ td.style.fontWeight = "normal";
+ }
+ else {
+ for (var i = 0; i < list.length; i++) {
+ var tr = tbody.appendChild(document.createElement("tr"));
+ var td = tr.appendChild(document.createElement("td"));
+
+ td.appendChild(document.createTextNode(list[i].type + "(" + list[i].numberOfT1 +
+ "): " + list[i].id));
+ td.style.fontSize = "12px";
+ td.style.textDecoration = "underline";
+ td.style.color = "blue";
+ td.style.fontWeight = "normal";
+ td.style.cursor = "pointer";
+ td.font = "Arial,Helvetica,sans-serif";
+ td.id = list[i].latitude + ">>" + list[i].longitude;
+
+ td.onmouseover = function() {
+ this.style.fontWeight = "bold";
+ }
+
+ td.onmouseout = function() {
+ this.style.fontWeight = "normal";
+ }
+
+ td.onclick = function() {
+ this.style.color = "red";
+ var latitudeLongitude = this.id.split(">>");
+ var latlng = new GLatLng(latitudeLongitude[0], latitudeLongitude[1]);
+ map.setCenter(latlng, 17);
+ updateImage(0);
+ }
+ }
+ }
+
+ resultContainer.style.display = "";
+}
+//new changes end
+NovaButton.prototype.initializeLayerDiv = function(layerDiv) {
+ for (var i = layerDiv.childNodes.length - 1; i >= 0; i--) {
+ layerDiv.removeChild(layerDiv.lastChild);
+ }
+
+ var colorList = document.getElementById("colorList").value;
+ var selectedLayerList = document.getElementById("selectedLayerList").value;
+ var colorArray = colorList.split("~!");
+ var selectedColorArray = selectedLayerList.split("~!");
+ //layerDiv.style.background = "white";
+ var table = layerDiv.appendChild(document.createElement("table"));
+ table.width="100%";
+ table.height="100%";
+ //this.setMenuStyle(table);
+ /****Creating the data table****/
+ var tbody = table.appendChild(document.createElement("tbody"));
+ var tr;
+ var td;
+ var originalLayerState = new Array();
+ for (i = 0; i < colorArray.length; i++) {
+ tr = tbody.appendChild(document.createElement("tr"));
+ tr.style.height="20px";
+ var colorItem = colorArray[i].split(",");
+
+ td = tr.appendChild(document.createElement("td"));
+ var chkbox = document.createElement("input");
+ chkbox.type="checkbox";
+ chkbox.name = "" + colorItem[0] + "chk";
+ chkbox.value = colorItem[0];
+ chkbox.id = colorItem[0] + "chk";
+ if (this.checkIfColorSelected(selectedColorArray, colorItem[0]) == true){
+ chkbox.defaultChecked=true;
+ originalLayerState[i] = "true," + colorArray[i];
+ }
+ else {
+ originalLayerState[i] = "false," + colorArray[i];
+ }
+ td.appendChild(chkbox);
+
+ td = tr.appendChild(document.createElement("td"));
+ td.width="75%";
+ td.appendChild(document.createTextNode(colorItem[0]));
+ td.style.fontFamily = "Verdana";
+ td.style.fontSize = "12px";
+
+ td = tr.appendChild(document.createElement("td"));
+ td.width="10%";
+ //td.style.background = colorItem[1];
+ td.innerHTML="<input type='text' id='" + colorItem[0] + "colorbx' value='" + colorItem[1] + "' size='6' style='background-color:#" + colorItem[1] + "' background-color='#" + colorItem[1] + "' onclick='openPicker(\"" + colorItem[0] + "colorbx\")'/>"
+ tbody.appendChild(tr);
+ }
+
+ NovaButton.globals.originalLayerState = originalLayerState;
+
+ /**to get rid of extra space**/
+ /*var layerHeight = layerDiv.style.height.substring(0, layerDiv.style.height.length -2);
+ if (colorArray.length * 30 < layerHeight){
+ tr = tbody.appendChild(document.createElement("tr"));
+ tr.height= (layerHeight - (colorArray.length * 40 ) ) + "px";
+ td = tr.appendChild(document.createElement("td"));
+ }*/
+
+
+ tr = tbody.appendChild(document.createElement("tr"));
+ tr.vAlign="bottom";
+ tr.style.height="20px";
+ td = tr.appendChild(document.createElement("td"));
+ td.colSpan="3";
+ var buttonTable = td.appendChild(document.createElement("table"));
+ buttonTable.height="100%";
+ buttonTable.width="100%";
+
+ var buttonBody = buttonTable.appendChild(document.createElement("tbody"));
+ tr = buttonBody.appendChild(document.createElement("tr"));
+ td = tr.appendChild(document.createElement("td"));
+ td.width="20%";
+ td = tr.appendChild(document.createElement("td"));
+ td.appendChild(document.createTextNode("OK"));
+ td.onclick = function ()
+ {
+ var selectedLayers = "";
+ var colorList = "";
+ var changed = false;
+ var originalLayerState = NovaButton.globals.originalLayerState;
+ //saving the user selected choices
+ for (i = 0; i < colorArray.length; i++) {
+ var colorItem = colorArray[i].split(",");
+ //saving the selected layers
+ var temp; // variable to hold changes value
+ if (document.getElementById("" + colorItem[0] + "chk").checked == true){
+ selectedLayers = selectedLayers + "~!" + colorItem[0];
+ temp = "true," + colorItem[0];
+ }
+ else {
+ temp = "false," + colorItem[0];
+ }
+ //saving the colours of all the layers
+ var userSelectedColor = document.getElementById("" + colorItem[0] + "colorbx").value;
+ if (userSelectedColor.charAt(0) == '#') {
+ userSelectedColor = userSelectedColor.substring(1);
+ }
+ colorList = colorList + "~!" + colorItem[0] + "," + userSelectedColor;
+ temp = temp + "," + userSelectedColor;
+
+ //check to see if there is anything change and update
+ // originalLayerState to reflect the changes
+ if (changed) {
+ originalLayerState[i] = temp;
+ }
+ else if (originalLayerState[i] != temp) {
+ changed = true;
+ originalLayerState[i] = temp;
+ }
+ }
+ selectedLayers = selectedLayers.substring(2, selectedLayers.length);
+ colorList = colorList.substring(2, colorList.length);
+ document.getElementById("selectedLayerList").value = selectedLayers;
+ document.getElementById("colorList").value = colorList;
+
+ // update if there is anything change
+ if (changed) {
+ updateImage(0);
+ }
+
+ //to remove the layer
+ NovaButton.prototype.showLayerClickEvent();
+ };
+ td.width="25%";
+ this.setButtonStyle(td, true);
+ td.style.cursor = "hand";
+
+ td = tr.appendChild(document.createElement("td"));
+ td.appendChild(document.createTextNode("Cancel"));
+ td.width="25%";
+ this.setButtonStyle(td, true);
+ td.style.cursor = "hand";
+ td.onclick = function ()
+ {
+ //remove all the contents
+ layerDiv.innerHTML="";
+ //re-initiate the layers to original values
+ NovaButton.prototype.initializeLayerDiv(layerDiv);
+ NovaButton.prototype.showLayerClickEvent();
+ };
+ td = tr.appendChild(document.createElement("td"));
+ td.width="10%";
+
+}
+
+NovaButton.prototype.checkIfColorSelected= function(selectedColorArray, colorItem) {
+ for (j = 0; j < selectedColorArray.length; j++) {
+ if (selectedColorArray[j] == colorItem){
+ return true;
+ }
+ }
+ return false;
+}
+
+NovaButton.prototype.setMenuContainerStyle = function(menuContainer) {
+ menuContainer.style.position = "absolute";
+ menuContainer.style.background = "#FFFFF0"
+ menuContainer.style.overflow = "auto";
+ menuContainer.style.scrolling="yes";
+ menuContainer.style.display = "none";
+ menuContainer.style.width = "300px";
+ menuContainer.style.height = "300px";
+}
+
+NovaButton.prototype.setMenuStyle = function(menu) {
+ menu.style.width = "300px";
+ menu.style.height = "300px";
+ menu.style.background = "#FFF";
+}
+
+NovaButton.prototype.setMenuItemStyle = function(menuItem) {
+ menuItem.style.padding = "4px 3px 4px 33px";
+ menuItem.style.fontFamily = "Vardana, Arial, Helvetica, sans-serif" ;
+ menuItem.style.fontSize = "10pt";
+ menuItem.style.color = "#333" ;
+ menuItem.style.cursor = "default" ;
+ menuItem.style.background = "no-repeat left center" ;
+}
+
+NovaButton.prototype.showLayerOption = function(posX, posY) {
+ var globals = NovaButton.globals;
+
+ //position the menu at the given location
+ if(typeof posX == "number") {
+ globals.layerOptionContainer.style.left = posX + "px";
+ }
+
+ if(typeof posY == "number") {
+ globals.layerOptionContainer.style.top = posY + "px";
+ }
+ //new chanes start
+ var resultContainer = globals.searchResultContainer;
+ resultContainer.style.display = "none";
+ //nw changes end
+ //display the menu
+ globals.layerOptionContainer.style.display = "block";
+}
+
+NovaButton.prototype.showSearchOption = function(posX, posY) {
+ var globals = NovaButton.globals;
+
+ //position the menu at the given location
+ if(typeof posX == "number") {
+ globals.searchOptionContainer.style.left = posX + "px";
+ }
+
+ if(typeof posY == "number") {
+ globals.searchOptionContainer.style.top = posY + "px";
+ }
+
+ //display the menu
+ globals.searchOptionContainer.style.display = "inline";
+}
+
+NovaButton.prototype.defaultViewClickEvent = function() {
+ var defaultZoomLevel = document.getElementById("defaultZoomLevel").value * 1;
+ map.setCenter(new GLatLng(document.getElementById("defaultCenterLatitude").value,
+ document.getElementById("defaultCenterLongitude").value),
+ defaultZoomLevel);
+ updateImage(0);
+}
+
+NovaButton.prototype.showLayerClickEvent = function(e) {
+ if (NovaButton.globals.layerOptionVisible) {
+ //to remove the color picker
+ cancel();
+ NovaButton.globals.layerOptionVisible = false;
+ NovaButton.globals.layerOptionContainer.style.display = "none";
+ return;
+ }
+
+ if (NovaButton.globals.searchOptionContainer.style.display != "none"){
+ NovaButton.prototype.searchClickEvent();
+ }
+ if (CingularButton.globals.listOptionContainer.style.display != "none"){
+ currentMonthClickEvent();
+ }
+
+ if (!e) {
+ e = window.event;
+ }
+
+ e.cancelBubble = true;
+
+ if (e.stopPropagation) {
+ e.stopPropagation();
+ }
+
+ var button = Event.element(e);
+ var posX = button.offsetLeft;
+ var posY = button.offsetTop;
+ this.showLayerOption(posX, posY + button.offsetHeight);
+ NovaButton.globals.layerOptionVisible = true;
+}
+
+NovaButton.prototype.searchClickEvent = function(e) {
+ if (NovaButton.globals.searchOptionVisible) {
+ NovaButton.globals.searchOptionVisible = false;
+ NovaButton.globals.searchOptionContainer.style.display = "none";
+ return;
+ }
+
+ if (NovaButton.globals.layerOptionContainer.style.display != "none"){
+ NovaButton.prototype.showLayerClickEvent();
+ }
+ if (CingularButton.globals.listOptionContainer.style.display != "none"){
+ currentMonthClickEvent();
+ }
+
+ if (!e) {
+ e = window.event;
+ }
+
+ e.cancelBubble = true;
+
+ if (e.stopPropagation) {
+ e.stopPropagation();
+ }
+
+ var button = Event.element(e);
+ var posX = button.offsetLeft;
+ var posY = button.offsetTop;
+ this.showSearchOption(posX, posY + button.offsetHeight + 3);
+ NovaButton.globals.searchOptionVisible = true;
+}
+
+NovaButton.prototype.submitSearchClickEvent = function(e) {
+ if (NovaButton.globals.searchTabSelected == "nodeTab") {
+ var input = document.getElementById("nodeSearchInput").value.trim();
+
+ if (input.length == 0) {
+ alert("Input field required");
+ return;
+ }
+
+ var searchType;
+ // ie bug
+ var searchByNodeId = document.getElementById("searchByNodeId");
+
+ if (searchByNodeId.checked) {
+ searchType = searchByNodeId.value;
+ }
+ else {
+ searchType = document.getElementById("searchByLocation").value;
+ }
+
+ var checkbox = document.getElementById("exactMatch");
+
+ searchObject(input, searchType, checkbox.checked, e.clientX, e.clientY);
+ }
+ else {
+ var address = document.getElementById("addressSearchInput").value.trim();
+
+ if (address.length == 0) {
+ alert("Address field required");
+ return;
+ }
+
+ geocoder.getLatLng(
+ address,
+ function(ll) {
+ if (ll != null) {
+ if (addressMarker == null) {
+ addressMarker = new GMarker(ll);
+ map.addOverlay(addressMarker);
+ GEvent.addListener(addressMarker, "click", marker_onclick);
+ }
+ else {
+ addressMarker.setLatLng(ll);
+ }
+
+ map.setCenter(ll);
+ updateImage(0);
+ }
+ }
+ );
+ }
+
+ this.searchClickEvent(e);
+}
+
+function marker_onclick() {
+ map.removeOverlay(addressMarker);
+ addressMarker = null;
+}
+
+// start drag zoom function
+NovaButton.prototype.initCover = function() {
+ var dragZoomGlobals = NovaButton.globals.dragzoom;
+ dragZoomGlobals.mapPosition = NovaButtonUtils.getElementPosition(NovaButton.globals.map.getContainer());
+ this.setDimensions();
+
+ dragZoomGlobals.zoomArea.style.display = "block";
+ dragZoomGlobals.zoomArea.style.background = "#000";
+
+ dragZoomGlobals.outlineDiv.style.width = "0px";
+ dragZoomGlobals.outlineDiv.style.height = "0px";
+};
+
+NovaButton.prototype.initZoomAreaStyles = function(){
+ var dragZoomGlobals = NovaButton.globals.dragzoom;
+ dragZoomGlobals.zoomArea.style.background = "#000";
+ dragZoomGlobals.zoomArea.style.opacity = "0.2";
+ dragZoomGlobals.zoomArea.style.filter = 'alpha(opacity=' + (0.2 * 100) + ')';
+
+ dragZoomGlobals.cornerTopDiv.style.background = "#000";
+ dragZoomGlobals.cornerTopDiv.style.opacity = "0.2";
+ dragZoomGlobals.cornerTopDiv.style.filter = 'alpha(opacity=' + (0.2 * 100) + ')';
+
+ dragZoomGlobals.cornerRightDiv.style.background = "#000";
+ dragZoomGlobals.cornerRightDiv.style.opacity = "0.2";
+ dragZoomGlobals.cornerRightDiv.style.filter = 'alpha(opacity=' + (0.2 * 100) + ')';
+
+ dragZoomGlobals.cornerBottomDiv.style.background = "#000";
+ dragZoomGlobals.cornerBottomDiv.style.opacity = "0.2";
+ dragZoomGlobals.cornerBottomDiv.style.filter = 'alpha(opacity=' + (0.2 * 100) + ')';
+
+ dragZoomGlobals.cornerLeftDiv.style.background = "#000";
+ dragZoomGlobals.cornerLeftDiv.style.opacity = "0.2";
+ dragZoomGlobals.cornerLeftDiv.style.filter = 'alpha(opacity=' + (0.2 * 100) + ')';
+
+ dragZoomGlobals.outlineDiv.style.border = "2px solid blue";
+};
+
+NovaButton.prototype.resetDragZoom = function() {
+ var dragZoomGlobals = NovaButton.globals.dragzoom;
+ dragZoomGlobals.zoomArea.style.display = "none";
+ dragZoomGlobals.zoomArea.style.opacity = "0.2";
+ dragZoomGlobals.zoomArea.style.filter = 'alpha(opacity=' + (0.2 * 100) + ')';
+
+ dragZoomGlobals.cornerTopDiv.style.display = "none";
+ dragZoomGlobals.cornerTopDiv.style.opacity = "0.2";
+ dragZoomGlobals.cornerTopDiv.style.filter = 'alpha(opacity=' + (0.2 * 100) + ')';
+
+ dragZoomGlobals.cornerRightDiv.style.display = "none";
+ dragZoomGlobals.cornerRightDiv.style.opacity = "0.2";
+ dragZoomGlobals.cornerRightDiv.style.filter = 'alpha(opacity=' + (0.2 * 100) + ')';
+
+ dragZoomGlobals.cornerBottomDiv.style.display = "none";
+ dragZoomGlobals.cornerBottomDiv.style.opacity = "0.2";
+ dragZoomGlobals.cornerBottomDiv.style.filter = 'alpha(opacity=' + (0.2 * 100) + ')';
+
+ dragZoomGlobals.cornerLeftDiv.style.display = "none";
+ dragZoomGlobals.cornerLeftDiv.style.opacity = "0.2";
+ dragZoomGlobals.cornerLeftDiv.style.filter = 'alpha(opacity=' + (0.2 * 100) + ')';
+
+ dragZoomGlobals.outlineDiv.style.display = 'none';
+};
+
+NovaButton.prototype.setZoomAreaStyle = function(zoomArea) {
+ zoomArea.style.position = "absolute";
+ zoomArea.style.display = "none";
+ zoomArea.style.overflow = "hidden";
+ zoomArea.style.cursor = "crosshair";
+ zoomArea.style.zIndex = "101";
+}
+
+NovaButton.prototype.getRectangle = function(startX, startY, pos){
+ var left = false;
+ var top = false;
+ var dX = pos.left - startX;
+ var dY = pos.top - startY;
+ if (dX < 0) {
+ dX = dX * -1;
+ left = true;
+ }
+ if (dY < 0) {
+ dY = dY * -1;
+ top = true;
+ }
+ delta = dX > dY ? dX : dY;
+
+ return {
+ startX: startX,
+ startY: startY,
+ endX: startX + dX,
+ endY: startY + dY,
+ width: dX,
+ height: dY,
+ left:left,
+ top:top
+ }
+};
+
+NovaButton.prototype.mouseDown = function(e) {
+ if (NovaButton.globals.currentButton != "zoomRectangleDiv") {
+ return;
+ }
+
+ var dragZoomGlobals = NovaButton.globals.dragzoom;
+ var pos = this.getRelPos(e);
+ dragZoomGlobals.startX = pos.left;
+ dragZoomGlobals.startY = pos.top;
+
+ dragZoomGlobals.zoomArea.style.background = "transparent";
+ dragZoomGlobals.zoomArea.style.opacity = "1";
+ dragZoomGlobals.zoomArea.style.filter = 'alpha(opacity=100)';
+
+ dragZoomGlobals.outlineDiv.style.left = dragZoomGlobals.startX + "px";
+ dragZoomGlobals.outlineDiv.style.top = dragZoomGlobals.startY + "px";
+ dragZoomGlobals.outlineDiv.style.display = "block";
+ dragZoomGlobals.outlineDiv.style.width = "1px";
+ dragZoomGlobals.outlineDiv.style.height = "1px";
+
+ dragZoomGlobals.cornerTopDiv.style.top = (dragZoomGlobals.startY - dragZoomGlobals.mapHeight) + 'px';
+ dragZoomGlobals.cornerTopDiv.style.display ='block';
+ dragZoomGlobals.cornerLeftDiv.style.left = (dragZoomGlobals.startX - dragZoomGlobals.mapWidth) +'px';
+ dragZoomGlobals.cornerLeftDiv.style.top = dragZoomGlobals.startY + 'px';
+ dragZoomGlobals.cornerLeftDiv.style.display = 'block';
+
+ dragZoomGlobals.cornerRightDiv.style.left = dragZoomGlobals.startX + 'px';
+ dragZoomGlobals.cornerRightDiv.style.top = dragZoomGlobals.startY + 'px';
+ dragZoomGlobals.cornerRightDiv.style.display = 'block';
+ dragZoomGlobals.cornerBottomDiv.style.left = dragZoomGlobals.startX + 'px';
+ dragZoomGlobals.cornerBottomDiv.style.top = dragZoomGlobals.startY + 'px';
+ dragZoomGlobals.cornerBottomDiv.style.width = '0px';
+ dragZoomGlobals.cornerBottomDiv.style.display = 'block';
+
+ dragZoomGlobals.moving = true;
+
+ return false;
+}
+
+NovaButton.prototype.mouseMove = function(e) {
+ var dragZoomGlobals = NovaButton.globals.dragzoom;
+
+ if(dragZoomGlobals.moving) {
+ var pos = this.getRelPos(e);
+ var rect = this.getRectangle(dragZoomGlobals.startX, dragZoomGlobals.startY, pos);
+
+ if (rect.left) {
+ addX = -rect.width;
+ } else {
+ addX = 0;
+ }
+
+ if (rect.top) {
+ addY = -rect.height;
+ } else {
+ addY = 0;
+ }
+
+ dragZoomGlobals.outlineDiv.style.left = dragZoomGlobals.startX + addX + "px";
+ dragZoomGlobals.outlineDiv.style.top = dragZoomGlobals.startY + addY + "px";
+ dragZoomGlobals.outlineDiv.style.display = "block";
+ dragZoomGlobals.outlineDiv.style.width = rect.width + "px";
+ dragZoomGlobals.outlineDiv.style.height = rect.height + "px";
+
+ dragZoomGlobals.cornerTopDiv.style.height = ((dragZoomGlobals.startY + addY) - (dragZoomGlobals.startY - dragZoomGlobals.mapHeight)) + 'px';
+ dragZoomGlobals.cornerLeftDiv.style.top = (dragZoomGlobals.startY + addY) + 'px';
+ dragZoomGlobals.cornerLeftDiv.style.width = ((dragZoomGlobals.startX + addX) - (dragZoomGlobals.startX - dragZoomGlobals.mapWidth)) + 'px';
+ dragZoomGlobals.cornerRightDiv.style.top = dragZoomGlobals.cornerLeftDiv.style.top;
+ dragZoomGlobals.cornerRightDiv.style.left = (dragZoomGlobals.startX + addX + rect.width + 4) + 'px';
+ dragZoomGlobals.cornerBottomDiv.style.top = (dragZoomGlobals.startY + addY + rect.height + 4) + 'px';
+ dragZoomGlobals.cornerBottomDiv.style.left = (dragZoomGlobals.startX - dragZoomGlobals.mapWidth + ((dragZoomGlobals.startX + addX) - (dragZoomGlobals.startX - dragZoomGlobals.mapWidth))) + 'px';
+ dragZoomGlobals.cornerBottomDiv.style.width = (rect.width + 4) + 'px';
+
+ return false;
+ }
+}
+
+NovaButton.prototype.mouseUp = function(e) {
+ var dragZoomGlobals = NovaButton.globals.dragzoom;
+ var map = NovaButton.globals.map;
+
+ if (dragZoomGlobals.moving) {
+ var pos = this.getRelPos(e);
+ dragZoomGlobals.moving = false;
+
+ var rect = this.getRectangle(dragZoomGlobals.startX, dragZoomGlobals.startY, pos);
+
+ if (rect.left) {
+ rect.endX = rect.startX - rect.width;
+ }
+
+ if (rect.top) {
+ rect.endY = rect.startY - rect.height;
+ }
+
+ this.resetDragZoom();
+
+ if (rect.width >= 0 && rect.height >= 0) {
+ var nwpx = new GPoint(rect.startX, rect.startY);
+ var nepx = new GPoint(rect.endX, rect.startY);
+ var sepx = new GPoint(rect.endX, rect.endY);
+ var swpx = new GPoint(rect.startX, rect.endY);
+ var nw = NovaButton.globals.map.fromContainerPixelToLatLng(nwpx);
+ var ne = NovaButton.globals.map.fromContainerPixelToLatLng(nepx);
+ var se = NovaButton.globals.map.fromContainerPixelToLatLng(sepx);
+ var sw = NovaButton.globals.map.fromContainerPixelToLatLng(swpx);
+
+ var zoomAreaPoly = new GPolyline([nw, ne, se, sw, nw], "blue", 3, .4);
+ var polyBounds = zoomAreaPoly.getBounds();
+ var ne = polyBounds.getNorthEast();
+ var sw = polyBounds.getSouthWest();
+ var se = new GLatLng(sw.lat(), ne.lng());
+ var nw = new GLatLng(ne.lat(), sw.lng());
+ var zoomLevel = map.getBoundsZoomLevel(polyBounds);
+ var center = polyBounds.getCenter();
+ map.setCenter(center, zoomLevel);
+ }
+
+ this.initCover();
+ }
+}
+
+NovaButton.prototype.setDimensions = function() {
+ var dragZoomGlobals = NovaButton.globals.dragzoom;
+ var mapSize = NovaButton.globals.map.getSize();
+ dragZoomGlobals.mapWidth = mapSize.width;
+ dragZoomGlobals.mapHeight = mapSize.height;
+ dragZoomGlobals.mapRatio = dragZoomGlobals.mapHeight / dragZoomGlobals.mapWidth;
+ // set left:0px in next <div>s in case we inherit text-align:center from map <div> in IE.
+ dragZoomGlobals.zoomArea.style.top = "0px";
+ dragZoomGlobals.zoomArea.style.left = "0px";
+ dragZoomGlobals.zoomArea.style.width = dragZoomGlobals.mapWidth + "px";
+ dragZoomGlobals.zoomArea.style.height = dragZoomGlobals.mapHeight + "px";
+
+ dragZoomGlobals.cornerTopDiv.style.top = "0px";
+ dragZoomGlobals.cornerTopDiv.style.left = "0px";
+ dragZoomGlobals.cornerTopDiv.style.width = dragZoomGlobals.mapWidth + "px";
+ dragZoomGlobals.cornerTopDiv.style.height = dragZoomGlobals.mapHeight + "px";
+
+ dragZoomGlobals.cornerRightDiv.style.top = "0px";
+ dragZoomGlobals.cornerRightDiv.style.left = "0px";
+ dragZoomGlobals.cornerRightDiv.style.width = dragZoomGlobals.mapWidth + "px";
+ dragZoomGlobals.cornerRightDiv.style.height = dragZoomGlobals.mapHeight + "px";
+
+ dragZoomGlobals.cornerBottomDiv.style.top = "0px";
+ dragZoomGlobals.cornerBottomDiv.style.left = "0px";
+ dragZoomGlobals.cornerBottomDiv.style.width = dragZoomGlobals.mapWidth + "px";
+ dragZoomGlobals.cornerBottomDiv.style.height = dragZoomGlobals.mapHeight + "px";
+
+ dragZoomGlobals.cornerLeftDiv.style.top = "0px";
+ dragZoomGlobals.cornerLeftDiv.style.left = "0px";
+ dragZoomGlobals.cornerLeftDiv.style.width = dragZoomGlobals.mapWidth + "px";
+ dragZoomGlobals.cornerLeftDiv.style.height = dragZoomGlobals.mapHeight + "px";
+};
+
+NovaButton.prototype.getRelPos = function(e) {
+ var pos = NovaButtonUtils.getMousePosition(e);
+ var dragZoomGlobals = NovaButton.globals.dragzoom;
+ return {top: (pos.top - dragZoomGlobals.mapPosition.top),
+ left: (pos.left - dragZoomGlobals.mapPosition.left)};
+};
+// end drag zoom function
+
+var NovaButtonUtils = {
+};
+
+NovaButtonUtils.getElementPosition = function(element) {
+ var leftPos = element.offsetLeft; // initialize var to store calculations
+ var topPos = element.offsetTop; // initialize var to store calculations
+ var parElement = element.offsetParent; // identify first offset parent element
+ while (parElement != null ) { // move up through element hierarchy
+ leftPos += parElement.offsetLeft; // appending left offset of each parent
+ topPos += parElement.offsetTop;
+ parElement = parElement.offsetParent; // until no more offset parents exist
+ }
+ return {left: leftPos, top: topPos};
+};
+
+NovaButtonUtils.getMousePosition = function(e) {
+ var posX = 0;
+ var posY = 0;
+ if (!e) var e = window.event;
+ if (e.pageX || e.pageY) {
+ posX = e.pageX;
+ posY = e.pageY;
+ } else if (e.clientX || e.clientY){
+ posX = e.clientX +
+ (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
+ posY = e.clientY +
+ (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
+ }
+ return {left: posX, top: posY};
+}; \ No newline at end of file
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/other_scripts.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/other_scripts.js
new file mode 100644
index 000000000..3784600b8
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/other_scripts.js
@@ -0,0 +1,331 @@
+//Reusable Asset Library - CSS Positioning Version (v3.3)
+//Release Date: 1/26/07
+
+
+//begin: quick help =======================================
+var uitmpl_qhId;
+var uitmpl_cookieVal;
+var qhRule;
+var qhCookie;
+
+//sets cookie value and qhId
+qhCookie=document.cookie;
+var pos=qhCookie.indexOf("qhId=");
+
+if(pos==-1){
+document.cookie="qhId=0";
+uitmpl_qhId="0";
+qhCookie=document.cookie;
+pos=qhCookie.indexOf("qhId=");
+}
+//reads cookie if value is present and sets qhId accordingly
+var start=pos+5;
+var end=qhCookie.indexOf(";", start);
+if (end==-1) end=qhCookie.length;
+uitmpl_cookieVal=qhCookie.substring(start,end);
+if(uitmpl_cookieVal!=0){
+ uitmpl_qhId=1;
+}else{
+uitmpl_qhId=0;
+}
+
+
+//loops through all qh divs and toggles display based on qhId
+function uitmpl_qhPageInit(){
+var getTag = document.getElementsByTagName("div");
+ for (i=0;i<getTag.length;i++){
+ if (getTag[i].className=="mQH"){
+ getTag[i].style.display=(uitmpl_qhId!="0")?"block":"none";
+ //getTag[i].onmouseover="alert('foo')";
+ }
+ }
+ //changes instruction in help menu if menu exists
+ if (uitmpl_qhId==1&&document.getElementById("shHd")){
+ document.getElementById("shHd").innerHTML = "Hide";
+ }
+}
+
+function uitmpl_qhPageToggle(){
+//change instruction in help menu
+var getCurrent = document.getElementById("shHd").innerHTML;
+var setCurrent = (getCurrent=="Show")?"Hide":"Show";
+document.getElementById("shHd").innerHTML = setCurrent;
+//change cookie value
+document.cookie = (setCurrent=="Show")?"qhId=0":"qhId=1";
+//change qhId value
+uitmpl_qhId = (setCurrent=="Show")?"0":"1";
+//rerun page init
+uitmpl_qhPageInit();
+}
+
+//individual quick help toggle
+function uitmpl_qh(obj){
+ var state = document.getElementById(obj).style.display;
+ document.getElementById(obj).style.display=(state!="block")?"block":"none";
+
+}
+//end: quick help =======================================
+
+//begin: error validation =======================================
+//string validation
+function uitmpl_errStrVal(obj, errId){
+ var x=obj.value;
+ var regExp = {
+ number:/(^\d+$)|(^\d+\.\d+$)/,
+ email:/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
+ //phone:/(^\d+$)|(^\d+\.\d+$)/,
+ //time:/(^\d+$)|(^\d+\.\d+$)/
+ };
+
+ var alrtStr = {
+ number:"Please input a valid number!",
+ email:"Please input a valid email address!",
+ date:"That date is invalid. Please try again."
+ //phone:"Please input a valid phone number!",
+ //time:"Please input a valid time!"
+ };
+
+ var getReg = eval("regExp."+errId);
+ var getAlrt = eval("alrtStr."+errId);
+
+ //Number----------------------------------------------------------
+ if (errId=="number"&&!x.match(getReg)){
+ alert(getAlrt);
+ obj.focus();
+ obj.select();
+ }
+ //Email-----------------------------------------------------------
+ else if (errId=="email"&&!x.match(getReg)){
+ alert(getAlrt);
+ obj.focus();
+ obj.select();
+ }
+ //Date------------------------------------------------------------
+ if (errId=="date"&&!uitmpl_chkdate(obj)){
+ alert(getAlrt);
+ obj.focus();
+ obj.select();
+ }
+}
+
+//supplemental date check function
+function uitmpl_chkdate(objName) {
+var strDatestyle = "US"; //United States date style
+//var strDatestyle = "EU"; //European date style
+var strDate;
+var strDateArray;
+var strDay;
+var strMonth;
+var strYear;
+var intday;
+var intMonth;
+var intYear;
+var booFound = false;
+
+var datefield = objName;
+var strSeparatorArray = new Array("-"," ","/",".");
+var intElementNr;
+var err = 0;
+var strMonthArray = new Array(12);
+strMonthArray[0] = "Jan";
+strMonthArray[1] = "Feb";
+strMonthArray[2] = "Mar";
+strMonthArray[3] = "Apr";
+strMonthArray[4] = "May";
+strMonthArray[5] = "Jun";
+strMonthArray[6] = "Jul";
+strMonthArray[7] = "Aug";
+strMonthArray[8] = "Sep";
+strMonthArray[9] = "Oct";
+strMonthArray[10] = "Nov";
+strMonthArray[11] = "Dec";
+strDate = datefield.value;
+if (strDate.length < 1) {
+return true;
+}
+for (intElementNr = 0; intElementNr < strSeparatorArray.length; intElementNr++) {
+if (strDate.indexOf(strSeparatorArray[intElementNr]) != -1) {
+strDateArray = strDate.split(strSeparatorArray[intElementNr]);
+if (strDateArray.length != 3) {
+err = 1;
+return false;
+}
+else {
+strDay = strDateArray[0];
+strMonth = strDateArray[1];
+strYear = strDateArray[2];
+}
+booFound = true;
+ }
+}
+if (booFound == false) {
+if (strDate.length>5) {
+strDay = strDate.substr(0, 2);
+strMonth = strDate.substr(2, 2);
+strYear = strDate.substr(4);
+ }
+}
+if (strYear.length == 2) {
+strYear = '20' + strYear;
+}
+// US style
+if (strDatestyle == "US") {
+strTemp = strDay;
+strDay = strMonth;
+strMonth = strTemp;
+}
+intday = parseInt(strDay, 10);
+if (isNaN(intday)) {
+err = 2;
+return false;
+}
+intMonth = parseInt(strMonth, 10);
+if (isNaN(intMonth)) {
+for (i = 0;i<12;i++) {
+if (strMonth.toUpperCase() == strMonthArray[i].toUpperCase()) {
+intMonth = i+1;
+strMonth = strMonthArray[i];
+i = 12;
+ }
+}
+if (isNaN(intMonth)) {
+err = 3;
+return false;
+ }
+}
+intYear = parseInt(strYear, 10);
+if (isNaN(intYear)) {
+err = 4;
+return false;
+}
+if (intMonth>12 || intMonth<1) {
+err = 5;
+return false;
+}
+if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || intMonth == 10 || intMonth == 12) && (intday > 31 || intday < 1)) {
+err = 6;
+return false;
+}
+if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intday > 30 || intday < 1)) {
+err = 7;
+return false;
+}
+if (intMonth == 2) {
+if (intday < 1) {
+err = 8;
+return false;
+}
+if (LeapYear(intYear) == true) {
+if (intday > 29) {
+err = 9;
+return false;
+}
+}
+else {
+if (intday > 28) {
+err = 10;
+return false;
+}
+}
+}
+//if (strDatestyle == "US") {
+//datefield.value = strMonthArray[intMonth-1] + " " + intday+" " + strYear;
+//}
+//else {
+//datefield.value = intday + " " + strMonthArray[intMonth-1] + " " + strYear;
+//}
+return true;
+}
+function LeapYear(intYear) {
+if (intYear % 100 == 0) {
+if (intYear % 400 == 0) { return true; }
+}
+else {
+if ((intYear % 4) == 0) { return true; }
+}
+return false;
+}
+
+//range validation
+function uitmpl_errRangeVal(obj, minNum, maxNum){
+if (obj.value>=minNum&&obj.value<=maxNum||obj.value==""){
+return true;
+}else{
+alert("Please input a number within the range of "+minNum+" and "+maxNum+"!");
+obj.focus();
+obj.select();
+}
+}
+
+//end: error validation =======================================
+//begin: popup windows =======================================
+function uitmpl_popUpReg(url) {
+ window.open(url);
+}
+function uitmpl_popUpConfig(url, name, w, h, sc, rsz) {
+ var features = "width="+w+",height="+h+",scrollbars="+sc+",resizable="+rsz+"menubar=0,status=1";
+ var newWin = window.open(url, name, features);
+ newWin.focus();
+//popups from nav links:
+}
+
+
+function uitmpl_contact(){
+uitmpl_popUpReg("");
+}
+function uitmpl_bizDirect(){
+uitmpl_popUpReg("");
+}
+
+//function uitmpl_closeApp(){
+//if(window.confirm("You did NOT save your data. Do you want to close 'application name' without saving your data?")) {
+//window.close();
+
+function uitmpl_closeApp(name){
+if (name != "") {
+var cAppName=name;
+}
+else {
+var cAppName="the current application";
+}
+if(window.confirm("You did NOT save your data. Do you want to close\n" + cAppName + " without saving your data?")) {
+window.close();
+}
+}
+//end: popup windows =======================================
+
+
+
+
+
+//Select all checkboxes on a form=====================================
+function uitmpl_chkBoxSelect(formName,btnOn,btnOff) {
+
+ document.getElementById(btnOff).style.display = "block";
+ document.getElementById(btnOn).style.display = "none";
+
+ var f = formName;
+ for (i=0; i < f.elements.length; i++) {
+ if (f.elements[i].type=="checkbox") {
+ var e = f.elements[i];
+ e.checked = true;
+ }
+ }
+}
+
+
+//Clear all checkboxes on a form======================================
+function uitmpl_chkBoxClear(formName,btnOn, btnOff) {
+
+ document.getElementById(btnOff).style.display = "none";
+ document.getElementById(btnOn).style.display = "block";
+
+ var f = formName;
+ for (i=0; i < f.elements.length; i++) {
+ if (f.elements[i].type=="checkbox") {
+ var e = f.elements[i];
+ e.checked = false;
+ }
+ }
+}
+
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/persist_table_header.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/persist_table_header.js
new file mode 100644
index 000000000..2c90306f0
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/persist_table_header.js
@@ -0,0 +1,47 @@
+ function UpdateTableHeaders() {
+ $("div.divTableWithFloatingHeader").each(function() {
+ var originalHeaderRow = $(".tableFloatingHeaderOriginal", this);
+ var floatingHeaderRow = $(".tableFloatingHeader", this);
+ var offset = $(this).offset();
+ var scrollTop = $(window).scrollTop();
+ if ((scrollTop > offset.top) && (scrollTop < offset.top + $(this).height())) {
+ floatingHeaderRow.css("visibility", "visible");
+ floatingHeaderRow.css("top", Math.min(scrollTop - offset.top, $(this).height() - floatingHeaderRow.height()) + "px");
+ floatingHeaderRow.css("z-index", "20");
+
+ // Copy cell widths from original header
+ $("th", floatingHeaderRow).each(function(index) {
+ var cellWidth = $("th", originalHeaderRow).eq(index).css('width');
+ $(this).css('width', cellWidth);
+ });
+
+ // Copy row width from whole table
+ floatingHeaderRow.css("width", $(this).css("width"));
+ }
+ else {
+ floatingHeaderRow.css("visibility", "hidden");
+ floatingHeaderRow.css("top", "0px");
+ }
+ });
+ }
+
+ $(document).ready(function() {
+ $("table.tableWithFloatingHeader").each(function() {
+ $(this).wrap("<div class=\"divTableWithFloatingHeader\" style=\"position:relative\"></div>");
+
+ var originalHeaderRow = $("tr:first", this)
+ originalHeaderRow.before(originalHeaderRow.clone());
+ var clonedHeaderRow = $("tr:first", this)
+
+ clonedHeaderRow.addClass("tableFloatingHeader");
+ clonedHeaderRow.css("position", "absolute");
+ clonedHeaderRow.css("top", "0px");
+ clonedHeaderRow.css("left", $(this).css("margin-left"));
+ clonedHeaderRow.css("visibility", "hidden");
+
+ originalHeaderRow.addClass("tableFloatingHeaderOriginal");
+ });
+ UpdateTableHeaders();
+ $(window.parent).scroll(UpdateTableHeaders);
+ $(window.parent).resize(UpdateTableHeaders);
+ }); \ No newline at end of file
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/prototype-1.6.0.3.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/prototype-1.6.0.3.js
new file mode 100644
index 000000000..dfe8ab4e1
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/prototype-1.6.0.3.js
@@ -0,0 +1,4320 @@
+/* Prototype JavaScript framework, version 1.6.0.3
+ * (c) 2005-2008 Sam Stephenson
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ * For details, see the Prototype web site: http://www.prototypejs.org/
+ *
+ *--------------------------------------------------------------------------*/
+
+var Prototype = {
+ Version: '1.6.0.3',
+
+ Browser: {
+ IE: !!(window.attachEvent &&
+ navigator.userAgent.indexOf('Opera') === -1),
+ Opera: navigator.userAgent.indexOf('Opera') > -1,
+ WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
+ Gecko: navigator.userAgent.indexOf('Gecko') > -1 &&
+ navigator.userAgent.indexOf('KHTML') === -1,
+ MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
+ },
+
+ BrowserFeatures: {
+ XPath: !!document.evaluate,
+ SelectorsAPI: !!document.querySelector,
+ ElementExtensions: !!window.HTMLElement,
+ SpecificElementExtensions:
+ document.createElement('div')['__proto__'] &&
+ document.createElement('div')['__proto__'] !==
+ document.createElement('form')['__proto__']
+ },
+
+ ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
+ JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
+
+ emptyFunction: function() { },
+ K: function(x) { return x }
+};
+
+if (Prototype.Browser.MobileSafari)
+ Prototype.BrowserFeatures.SpecificElementExtensions = false;
+
+
+/* Based on Alex Arnell's inheritance implementation. */
+var Class = {
+ create: function() {
+ var parent = null, properties = $A(arguments);
+ if (Object.isFunction(properties[0]))
+ parent = properties.shift();
+
+ function klass() {
+ this.initialize.apply(this, arguments);
+ }
+
+ Object.extend(klass, Class.Methods);
+ klass.superclass = parent;
+ klass.subclasses = [];
+
+ if (parent) {
+ var subclass = function() { };
+ subclass.prototype = parent.prototype;
+ klass.prototype = new subclass;
+ parent.subclasses.push(klass);
+ }
+
+ for (var i = 0; i < properties.length; i++)
+ klass.addMethods(properties[i]);
+
+ if (!klass.prototype.initialize)
+ klass.prototype.initialize = Prototype.emptyFunction;
+
+ klass.prototype.constructor = klass;
+
+ return klass;
+ }
+};
+
+Class.Methods = {
+ addMethods: function(source) {
+ var ancestor = this.superclass && this.superclass.prototype;
+ var properties = Object.keys(source);
+
+ if (!Object.keys({ toString: true }).length)
+ properties.push("toString", "valueOf");
+
+ for (var i = 0, length = properties.length; i < length; i++) {
+ var property = properties[i], value = source[property];
+ if (ancestor && Object.isFunction(value) &&
+ value.argumentNames().first() == "$super") {
+ var method = value;
+ value = (function(m) {
+ return function() { return ancestor[m].apply(this, arguments) };
+ })(property).wrap(method);
+
+ value.valueOf = method.valueOf.bind(method);
+ value.toString = method.toString.bind(method);
+ }
+ this.prototype[property] = value;
+ }
+
+ return this;
+ }
+};
+
+var Abstract = { };
+
+Object.extend = function(destination, source) {
+ for (var property in source)
+ destination[property] = source[property];
+ return destination;
+};
+
+Object.extend(Object, {
+ inspect: function(object) {
+ try {
+ if (Object.isUndefined(object)) return 'undefined';
+ if (object === null) return 'null';
+ return object.inspect ? object.inspect() : String(object);
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+ },
+
+ toJSON: function(object) {
+ var type = typeof object;
+ switch (type) {
+ case 'undefined':
+ case 'function':
+ case 'unknown': return;
+ case 'boolean': return object.toString();
+ }
+
+ if (object === null) return 'null';
+ if (object.toJSON) return object.toJSON();
+ if (Object.isElement(object)) return;
+
+ var results = [];
+ for (var property in object) {
+ var value = Object.toJSON(object[property]);
+ if (!Object.isUndefined(value))
+ results.push(property.toJSON() + ': ' + value);
+ }
+
+ return '{' + results.join(', ') + '}';
+ },
+
+ toQueryString: function(object) {
+ return $H(object).toQueryString();
+ },
+
+ toHTML: function(object) {
+ return object && object.toHTML ? object.toHTML() : String.interpret(object);
+ },
+
+ keys: function(object) {
+ var keys = [];
+ for (var property in object)
+ keys.push(property);
+ return keys;
+ },
+
+ values: function(object) {
+ var values = [];
+ for (var property in object)
+ values.push(object[property]);
+ return values;
+ },
+
+ clone: function(object) {
+ return Object.extend({ }, object);
+ },
+
+ isElement: function(object) {
+ return !!(object && object.nodeType == 1);
+ },
+
+ isArray: function(object) {
+ return object != null && typeof object == "object" &&
+ 'splice' in object && 'join' in object;
+ },
+
+ isHash: function(object) {
+ return object instanceof Hash;
+ },
+
+ isFunction: function(object) {
+ return typeof object == "function";
+ },
+
+ isString: function(object) {
+ return typeof object == "string";
+ },
+
+ isNumber: function(object) {
+ return typeof object == "number";
+ },
+
+ isUndefined: function(object) {
+ return typeof object == "undefined";
+ }
+});
+
+Object.extend(Function.prototype, {
+ argumentNames: function() {
+ var names = this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1]
+ .replace(/\s+/g, '').split(',');
+ return names.length == 1 && !names[0] ? [] : names;
+ },
+
+ bind: function() {
+ if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this;
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function() {
+ return __method.apply(object, args.concat($A(arguments)));
+ }
+ },
+
+ bindAsEventListener: function() {
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function(event) {
+ return __method.apply(object, [event || window.event].concat(args));
+ }
+ },
+
+ curry: function() {
+ if (!arguments.length) return this;
+ var __method = this, args = $A(arguments);
+ return function() {
+ return __method.apply(this, args.concat($A(arguments)));
+ }
+ },
+
+ delay: function() {
+ var __method = this, args = $A(arguments), timeout = args.shift() * 1000;
+ return window.setTimeout(function() {
+ return __method.apply(__method, args);
+ }, timeout);
+ },
+
+ defer: function() {
+ var args = [0.01].concat($A(arguments));
+ return this.delay.apply(this, args);
+ },
+
+ wrap: function(wrapper) {
+ var __method = this;
+ return function() {
+ return wrapper.apply(this, [__method.bind(this)].concat($A(arguments)));
+ }
+ },
+
+ methodize: function() {
+ if (this._methodized) return this._methodized;
+ var __method = this;
+ return this._methodized = function() {
+ return __method.apply(null, [this].concat($A(arguments)));
+ };
+ }
+});
+
+Date.prototype.toJSON = function() {
+ return '"' + this.getUTCFullYear() + '-' +
+ (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
+ this.getUTCDate().toPaddedString(2) + 'T' +
+ this.getUTCHours().toPaddedString(2) + ':' +
+ this.getUTCMinutes().toPaddedString(2) + ':' +
+ this.getUTCSeconds().toPaddedString(2) + 'Z"';
+};
+
+var Try = {
+ these: function() {
+ var returnValue;
+
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ var lambda = arguments[i];
+ try {
+ returnValue = lambda();
+ break;
+ } catch (e) { }
+ }
+
+ return returnValue;
+ }
+};
+
+RegExp.prototype.match = RegExp.prototype.test;
+
+RegExp.escape = function(str) {
+ return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+};
+
+/*--------------------------------------------------------------------------*/
+
+var PeriodicalExecuter = Class.create({
+ initialize: function(callback, frequency) {
+ this.callback = callback;
+ this.frequency = frequency;
+ this.currentlyExecuting = false;
+
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ execute: function() {
+ this.callback(this);
+ },
+
+ stop: function() {
+ if (!this.timer) return;
+ clearInterval(this.timer);
+ this.timer = null;
+ },
+
+ onTimerEvent: function() {
+ if (!this.currentlyExecuting) {
+ try {
+ this.currentlyExecuting = true;
+ this.execute();
+ } finally {
+ this.currentlyExecuting = false;
+ }
+ }
+ }
+});
+Object.extend(String, {
+ interpret: function(value) {
+ return value == null ? '' : String(value);
+ },
+ specialChar: {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '\\': '\\\\'
+ }
+});
+
+Object.extend(String.prototype, {
+ gsub: function(pattern, replacement) {
+ var result = '', source = this, match;
+ replacement = arguments.callee.prepareReplacement(replacement);
+
+ while (source.length > 0) {
+ if (match = source.match(pattern)) {
+ result += source.slice(0, match.index);
+ result += String.interpret(replacement(match));
+ source = source.slice(match.index + match[0].length);
+ } else {
+ result += source, source = '';
+ }
+ }
+ return result;
+ },
+
+ sub: function(pattern, replacement, count) {
+ replacement = this.gsub.prepareReplacement(replacement);
+ count = Object.isUndefined(count) ? 1 : count;
+
+ return this.gsub(pattern, function(match) {
+ if (--count < 0) return match[0];
+ return replacement(match);
+ });
+ },
+
+ scan: function(pattern, iterator) {
+ this.gsub(pattern, iterator);
+ return String(this);
+ },
+
+ truncate: function(length, truncation) {
+ length = length || 30;
+ truncation = Object.isUndefined(truncation) ? '...' : truncation;
+ return this.length > length ?
+ this.slice(0, length - truncation.length) + truncation : String(this);
+ },
+
+ strip: function() {
+ return this.replace(/^\s+/, '').replace(/\s+$/, '');
+ },
+
+ stripTags: function() {
+ return this.replace(/<\/?[^>]+>/gi, '');
+ },
+
+ stripScripts: function() {
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+ },
+
+ extractScripts: function() {
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
+ var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+ return (this.match(matchAll) || []).map(function(scriptTag) {
+ return (scriptTag.match(matchOne) || ['', ''])[1];
+ });
+ },
+
+ evalScripts: function() {
+ return this.extractScripts().map(function(script) { return eval(script) });
+ },
+
+ escapeHTML: function() {
+ var self = arguments.callee;
+ self.text.data = this;
+ return self.div.innerHTML;
+ },
+
+ unescapeHTML: function() {
+ var div = new Element('div');
+ div.innerHTML = this.stripTags();
+ return div.childNodes[0] ? (div.childNodes.length > 1 ?
+ $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
+ div.childNodes[0].nodeValue) : '';
+ },
+
+ toQueryParams: function(separator) {
+ var match = this.strip().match(/([^?#]*)(#.*)?$/);
+ if (!match) return { };
+
+ return match[1].split(separator || '&').inject({ }, function(hash, pair) {
+ if ((pair = pair.split('='))[0]) {
+ var key = decodeURIComponent(pair.shift());
+ var value = pair.length > 1 ? pair.join('=') : pair[0];
+ if (value != undefined) value = decodeURIComponent(value);
+
+ if (key in hash) {
+ if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
+ hash[key].push(value);
+ }
+ else hash[key] = value;
+ }
+ return hash;
+ });
+ },
+
+ toArray: function() {
+ return this.split('');
+ },
+
+ succ: function() {
+ return this.slice(0, this.length - 1) +
+ String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
+ },
+
+ times: function(count) {
+ return count < 1 ? '' : new Array(count + 1).join(this);
+ },
+
+ camelize: function() {
+ var parts = this.split('-'), len = parts.length;
+ if (len == 1) return parts[0];
+
+ var camelized = this.charAt(0) == '-'
+ ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
+ : parts[0];
+
+ for (var i = 1; i < len; i++)
+ camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
+
+ return camelized;
+ },
+
+ capitalize: function() {
+ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+ },
+
+ underscore: function() {
+ return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
+ },
+
+ dasherize: function() {
+ return this.gsub(/_/,'-');
+ },
+
+ inspect: function(useDoubleQuotes) {
+ var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
+ var character = String.specialChar[match[0]];
+ return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
+ });
+ if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
+ return "'" + escapedString.replace(/'/g, '\\\'') + "'";
+ },
+
+ toJSON: function() {
+ return this.inspect(true);
+ },
+
+ unfilterJSON: function(filter) {
+ return this.sub(filter || Prototype.JSONFilter, '#{1}');
+ },
+
+ isJSON: function() {
+ var str = this;
+ if (str.blank()) return false;
+ str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
+ return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
+ },
+
+ evalJSON: function(sanitize) {
+ var json = this.unfilterJSON();
+ try {
+ if (!sanitize || json.isJSON()) return eval('(' + json + ')');
+ } catch (e) { }
+ throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
+ },
+
+ include: function(pattern) {
+ return this.indexOf(pattern) > -1;
+ },
+
+ startsWith: function(pattern) {
+ return this.indexOf(pattern) === 0;
+ },
+
+ endsWith: function(pattern) {
+ var d = this.length - pattern.length;
+ return d >= 0 && this.lastIndexOf(pattern) === d;
+ },
+
+ empty: function() {
+ return this == '';
+ },
+
+ blank: function() {
+ return /^\s*$/.test(this);
+ },
+
+ interpolate: function(object, pattern) {
+ return new Template(this, pattern).evaluate(object);
+ }
+});
+
+if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
+ escapeHTML: function() {
+ return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
+ },
+ unescapeHTML: function() {
+ return this.stripTags().replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
+ }
+});
+
+String.prototype.gsub.prepareReplacement = function(replacement) {
+ if (Object.isFunction(replacement)) return replacement;
+ var template = new Template(replacement);
+ return function(match) { return template.evaluate(match) };
+};
+
+String.prototype.parseQuery = String.prototype.toQueryParams;
+
+Object.extend(String.prototype.escapeHTML, {
+ div: document.createElement('div'),
+ text: document.createTextNode('')
+});
+
+String.prototype.escapeHTML.div.appendChild(String.prototype.escapeHTML.text);
+
+var Template = Class.create({
+ initialize: function(template, pattern) {
+ this.template = template.toString();
+ this.pattern = pattern || Template.Pattern;
+ },
+
+ evaluate: function(object) {
+ if (Object.isFunction(object.toTemplateReplacements))
+ object = object.toTemplateReplacements();
+
+ return this.template.gsub(this.pattern, function(match) {
+ if (object == null) return '';
+
+ var before = match[1] || '';
+ if (before == '\\') return match[2];
+
+ var ctx = object, expr = match[3];
+ var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
+ match = pattern.exec(expr);
+ if (match == null) return before;
+
+ while (match != null) {
+ var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1];
+ ctx = ctx[comp];
+ if (null == ctx || '' == match[3]) break;
+ expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
+ match = pattern.exec(expr);
+ }
+
+ return before + String.interpret(ctx);
+ });
+ }
+});
+Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
+
+var $break = { };
+
+var Enumerable = {
+ each: function(iterator, context) {
+ var index = 0;
+ try {
+ this._each(function(value) {
+ iterator.call(context, value, index++);
+ });
+ } catch (e) {
+ if (e != $break) throw e;
+ }
+ return this;
+ },
+
+ eachSlice: function(number, iterator, context) {
+ var index = -number, slices = [], array = this.toArray();
+ if (number < 1) return array;
+ while ((index += number) < array.length)
+ slices.push(array.slice(index, index+number));
+ return slices.collect(iterator, context);
+ },
+
+ all: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result = true;
+ this.each(function(value, index) {
+ result = result && !!iterator.call(context, value, index);
+ if (!result) throw $break;
+ });
+ return result;
+ },
+
+ any: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result = false;
+ this.each(function(value, index) {
+ if (result = !!iterator.call(context, value, index))
+ throw $break;
+ });
+ return result;
+ },
+
+ collect: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var results = [];
+ this.each(function(value, index) {
+ results.push(iterator.call(context, value, index));
+ });
+ return results;
+ },
+
+ detect: function(iterator, context) {
+ var result;
+ this.each(function(value, index) {
+ if (iterator.call(context, value, index)) {
+ result = value;
+ throw $break;
+ }
+ });
+ return result;
+ },
+
+ findAll: function(iterator, context) {
+ var results = [];
+ this.each(function(value, index) {
+ if (iterator.call(context, value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ grep: function(filter, iterator, context) {
+ iterator = iterator || Prototype.K;
+ var results = [];
+
+ if (Object.isString(filter))
+ filter = new RegExp(filter);
+
+ this.each(function(value, index) {
+ if (filter.match(value))
+ results.push(iterator.call(context, value, index));
+ });
+ return results;
+ },
+
+ include: function(object) {
+ if (Object.isFunction(this.indexOf))
+ if (this.indexOf(object) != -1) return true;
+
+ var found = false;
+ this.each(function(value) {
+ if (value == object) {
+ found = true;
+ throw $break;
+ }
+ });
+ return found;
+ },
+
+ inGroupsOf: function(number, fillWith) {
+ fillWith = Object.isUndefined(fillWith) ? null : fillWith;
+ return this.eachSlice(number, function(slice) {
+ while(slice.length < number) slice.push(fillWith);
+ return slice;
+ });
+ },
+
+ inject: function(memo, iterator, context) {
+ this.each(function(value, index) {
+ memo = iterator.call(context, memo, value, index);
+ });
+ return memo;
+ },
+
+ invoke: function(method) {
+ var args = $A(arguments).slice(1);
+ return this.map(function(value) {
+ return value[method].apply(value, args);
+ });
+ },
+
+ max: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator.call(context, value, index);
+ if (result == null || value >= result)
+ result = value;
+ });
+ return result;
+ },
+
+ min: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator.call(context, value, index);
+ if (result == null || value < result)
+ result = value;
+ });
+ return result;
+ },
+
+ partition: function(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var trues = [], falses = [];
+ this.each(function(value, index) {
+ (iterator.call(context, value, index) ?
+ trues : falses).push(value);
+ });
+ return [trues, falses];
+ },
+
+ pluck: function(property) {
+ var results = [];
+ this.each(function(value) {
+ results.push(value[property]);
+ });
+ return results;
+ },
+
+ reject: function(iterator, context) {
+ var results = [];
+ this.each(function(value, index) {
+ if (!iterator.call(context, value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ sortBy: function(iterator, context) {
+ return this.map(function(value, index) {
+ return {
+ value: value,
+ criteria: iterator.call(context, value, index)
+ };
+ }).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }).pluck('value');
+ },
+
+ toArray: function() {
+ return this.map();
+ },
+
+ zip: function() {
+ var iterator = Prototype.K, args = $A(arguments);
+ if (Object.isFunction(args.last()))
+ iterator = args.pop();
+
+ var collections = [this].concat(args).map($A);
+ return this.map(function(value, index) {
+ return iterator(collections.pluck(index));
+ });
+ },
+
+ size: function() {
+ return this.toArray().length;
+ },
+
+ inspect: function() {
+ return '#<Enumerable:' + this.toArray().inspect() + '>';
+ }
+};
+
+Object.extend(Enumerable, {
+ map: Enumerable.collect,
+ find: Enumerable.detect,
+ select: Enumerable.findAll,
+ filter: Enumerable.findAll,
+ member: Enumerable.include,
+ entries: Enumerable.toArray,
+ every: Enumerable.all,
+ some: Enumerable.any
+});
+function $A(iterable) {
+ if (!iterable) return [];
+ if (iterable.toArray) return iterable.toArray();
+ var length = iterable.length || 0, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+}
+
+if (Prototype.Browser.WebKit) {
+ $A = function(iterable) {
+ if (!iterable) return [];
+ // In Safari, only use the `toArray` method if it's not a NodeList.
+ // A NodeList is a function, has an function `item` property, and a numeric
+ // `length` property. Adapted from Google Doctype.
+ if (!(typeof iterable === 'function' && typeof iterable.length ===
+ 'number' && typeof iterable.item === 'function') && iterable.toArray)
+ return iterable.toArray();
+ var length = iterable.length || 0, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+ };
+}
+
+Array.from = $A;
+
+Object.extend(Array.prototype, Enumerable);
+
+if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse;
+
+Object.extend(Array.prototype, {
+ _each: function(iterator) {
+ for (var i = 0, length = this.length; i < length; i++)
+ iterator(this[i]);
+ },
+
+ clear: function() {
+ this.length = 0;
+ return this;
+ },
+
+ first: function() {
+ return this[0];
+ },
+
+ last: function() {
+ return this[this.length - 1];
+ },
+
+ compact: function() {
+ return this.select(function(value) {
+ return value != null;
+ });
+ },
+
+ flatten: function() {
+ return this.inject([], function(array, value) {
+ return array.concat(Object.isArray(value) ?
+ value.flatten() : [value]);
+ });
+ },
+
+ without: function() {
+ var values = $A(arguments);
+ return this.select(function(value) {
+ return !values.include(value);
+ });
+ },
+
+ reverse: function(inline) {
+ return (inline !== false ? this : this.toArray())._reverse();
+ },
+
+ reduce: function() {
+ return this.length > 1 ? this : this[0];
+ },
+
+ uniq: function(sorted) {
+ return this.inject([], function(array, value, index) {
+ if (0 == index || (sorted ? array.last() != value : !array.include(value)))
+ array.push(value);
+ return array;
+ });
+ },
+
+ intersect: function(array) {
+ return this.uniq().findAll(function(item) {
+ return array.detect(function(value) { return item === value });
+ });
+ },
+
+ clone: function() {
+ return [].concat(this);
+ },
+
+ size: function() {
+ return this.length;
+ },
+
+ inspect: function() {
+ return '[' + this.map(Object.inspect).join(', ') + ']';
+ },
+
+ toJSON: function() {
+ var results = [];
+ this.each(function(object) {
+ var value = Object.toJSON(object);
+ if (!Object.isUndefined(value)) results.push(value);
+ });
+ return '[' + results.join(', ') + ']';
+ }
+});
+
+// use native browser JS 1.6 implementation if available
+if (Object.isFunction(Array.prototype.forEach))
+ Array.prototype._each = Array.prototype.forEach;
+
+if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
+ i || (i = 0);
+ var length = this.length;
+ if (i < 0) i = length + i;
+ for (; i < length; i++)
+ if (this[i] === item) return i;
+ return -1;
+};
+
+if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
+ i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
+ var n = this.slice(0, i).reverse().indexOf(item);
+ return (n < 0) ? n : i - n - 1;
+};
+
+Array.prototype.toArray = Array.prototype.clone;
+
+function $w(string) {
+ if (!Object.isString(string)) return [];
+ string = string.strip();
+ return string ? string.split(/\s+/) : [];
+}
+
+if (Prototype.Browser.Opera){
+ Array.prototype.concat = function() {
+ var array = [];
+ for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ if (Object.isArray(arguments[i])) {
+ for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++)
+ array.push(arguments[i][j]);
+ } else {
+ array.push(arguments[i]);
+ }
+ }
+ return array;
+ };
+}
+Object.extend(Number.prototype, {
+ toColorPart: function() {
+ return this.toPaddedString(2, 16);
+ },
+
+ succ: function() {
+ return this + 1;
+ },
+
+ times: function(iterator, context) {
+ $R(0, this, true).each(iterator, context);
+ return this;
+ },
+
+ toPaddedString: function(length, radix) {
+ var string = this.toString(radix || 10);
+ return '0'.times(length - string.length) + string;
+ },
+
+ toJSON: function() {
+ return isFinite(this) ? this.toString() : 'null';
+ }
+});
+
+$w('abs round ceil floor').each(function(method){
+ Number.prototype[method] = Math[method].methodize();
+});
+function $H(object) {
+ return new Hash(object);
+};
+
+var Hash = Class.create(Enumerable, (function() {
+
+ function toQueryPair(key, value) {
+ if (Object.isUndefined(value)) return key;
+ return key + '=' + encodeURIComponent(String.interpret(value));
+ }
+
+ return {
+ initialize: function(object) {
+ this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
+ },
+
+ _each: function(iterator) {
+ for (var key in this._object) {
+ var value = this._object[key], pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+ },
+
+ set: function(key, value) {
+ return this._object[key] = value;
+ },
+
+ get: function(key) {
+ // simulating poorly supported hasOwnProperty
+ if (this._object[key] !== Object.prototype[key])
+ return this._object[key];
+ },
+
+ unset: function(key) {
+ var value = this._object[key];
+ delete this._object[key];
+ return value;
+ },
+
+ toObject: function() {
+ return Object.clone(this._object);
+ },
+
+ keys: function() {
+ return this.pluck('key');
+ },
+
+ values: function() {
+ return this.pluck('value');
+ },
+
+ index: function(value) {
+ var match = this.detect(function(pair) {
+ return pair.value === value;
+ });
+ return match && match.key;
+ },
+
+ merge: function(object) {
+ return this.clone().update(object);
+ },
+
+ update: function(object) {
+ return new Hash(object).inject(this, function(result, pair) {
+ result.set(pair.key, pair.value);
+ return result;
+ });
+ },
+
+ toQueryString: function() {
+ return this.inject([], function(results, pair) {
+ var key = encodeURIComponent(pair.key), values = pair.value;
+
+ if (values && typeof values == 'object') {
+ if (Object.isArray(values))
+ return results.concat(values.map(toQueryPair.curry(key)));
+ } else results.push(toQueryPair(key, values));
+ return results;
+ }).join('&');
+ },
+
+ inspect: function() {
+ return '#<Hash:{' + this.map(function(pair) {
+ return pair.map(Object.inspect).join(': ');
+ }).join(', ') + '}>';
+ },
+
+ toJSON: function() {
+ return Object.toJSON(this.toObject());
+ },
+
+ clone: function() {
+ return new Hash(this);
+ }
+ }
+})());
+
+Hash.prototype.toTemplateReplacements = Hash.prototype.toObject;
+Hash.from = $H;
+var ObjectRange = Class.create(Enumerable, {
+ initialize: function(start, end, exclusive) {
+ this.start = start;
+ this.end = end;
+ this.exclusive = exclusive;
+ },
+
+ _each: function(iterator) {
+ var value = this.start;
+ while (this.include(value)) {
+ iterator(value);
+ value = value.succ();
+ }
+ },
+
+ include: function(value) {
+ if (value < this.start)
+ return false;
+ if (this.exclusive)
+ return value < this.end;
+ return value <= this.end;
+ }
+});
+
+var $R = function(start, end, exclusive) {
+ return new ObjectRange(start, end, exclusive);
+};
+
+var Ajax = {
+ getTransport: function() {
+ return Try.these(
+ function() {return new XMLHttpRequest()},
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+ ) || false;
+ },
+
+ activeRequestCount: 0
+};
+
+Ajax.Responders = {
+ responders: [],
+
+ _each: function(iterator) {
+ this.responders._each(iterator);
+ },
+
+ register: function(responder) {
+ if (!this.include(responder))
+ this.responders.push(responder);
+ },
+
+ unregister: function(responder) {
+ this.responders = this.responders.without(responder);
+ },
+
+ dispatch: function(callback, request, transport, json) {
+ this.each(function(responder) {
+ if (Object.isFunction(responder[callback])) {
+ try {
+ responder[callback].apply(responder, [request, transport, json]);
+ } catch (e) { }
+ }
+ });
+ }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+ onCreate: function() { Ajax.activeRequestCount++ },
+ onComplete: function() { Ajax.activeRequestCount-- }
+});
+
+Ajax.Base = Class.create({
+ initialize: function(options) {
+ this.options = {
+ method: 'post',
+ asynchronous: true,
+ contentType: 'application/x-www-form-urlencoded',
+ encoding: 'UTF-8',
+ parameters: '',
+ evalJSON: true,
+ evalJS: true
+ };
+ Object.extend(this.options, options || { });
+
+ this.options.method = this.options.method.toLowerCase();
+
+ if (Object.isString(this.options.parameters))
+ this.options.parameters = this.options.parameters.toQueryParams();
+ else if (Object.isHash(this.options.parameters))
+ this.options.parameters = this.options.parameters.toObject();
+ }
+});
+
+Ajax.Request = Class.create(Ajax.Base, {
+ _complete: false,
+
+ initialize: function($super, url, options) {
+ $super(options);
+ this.transport = Ajax.getTransport();
+ this.request(url);
+ },
+
+ request: function(url) {
+ this.url = url;
+ this.method = this.options.method;
+ var params = Object.clone(this.options.parameters);
+
+ if (!['get', 'post'].include(this.method)) {
+ // simulate other verbs over post
+ params['_method'] = this.method;
+ this.method = 'post';
+ }
+
+ this.parameters = params;
+
+ if (params = Object.toQueryString(params)) {
+ // when GET, append parameters to URL
+ if (this.method == 'get')
+ this.url += (this.url.include('?') ? '&' : '?') + params;
+ else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+ params += '&_=';
+ }
+
+ try {
+ var response = new Ajax.Response(this);
+ if (this.options.onCreate) this.options.onCreate(response);
+ Ajax.Responders.dispatch('onCreate', this, response);
+
+ this.transport.open(this.method.toUpperCase(), this.url,
+ this.options.asynchronous);
+
+ if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
+
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
+ this.setRequestHeaders();
+
+ this.body = this.method == 'post' ? (this.options.postBody || params) : null;
+ this.transport.send(this.body);
+
+ /* Force Firefox to handle ready state 4 for synchronous requests */
+ if (!this.options.asynchronous && this.transport.overrideMimeType)
+ this.onStateChange();
+
+ }
+ catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ onStateChange: function() {
+ var readyState = this.transport.readyState;
+ if (readyState > 1 && !((readyState == 4) && this._complete))
+ this.respondToReadyState(this.transport.readyState);
+ },
+
+ setRequestHeaders: function() {
+ var headers = {
+ 'X-Requested-With': 'XMLHttpRequest',
+ 'X-Prototype-Version': Prototype.Version,
+ 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+ };
+
+ if (this.method == 'post') {
+ headers['Content-type'] = this.options.contentType +
+ (this.options.encoding ? '; charset=' + this.options.encoding : '');
+
+ /* Force "Connection: close" for older Mozilla browsers to work
+ * around a bug where XMLHttpRequest sends an incorrect
+ * Content-length header. See Mozilla Bugzilla #246651.
+ */
+ if (this.transport.overrideMimeType &&
+ (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+ headers['Connection'] = 'close';
+ }
+
+ // user-defined headers
+ if (typeof this.options.requestHeaders == 'object') {
+ var extras = this.options.requestHeaders;
+
+ if (Object.isFunction(extras.push))
+ for (var i = 0, length = extras.length; i < length; i += 2)
+ headers[extras[i]] = extras[i+1];
+ else
+ $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+ }
+
+ for (var name in headers)
+ this.transport.setRequestHeader(name, headers[name]);
+ },
+
+ success: function() {
+ var status = this.getStatus();
+ return !status || (status >= 200 && status < 300);
+ },
+
+ getStatus: function() {
+ try {
+ return this.transport.status || 0;
+ } catch (e) { return 0 }
+ },
+
+ respondToReadyState: function(readyState) {
+ var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
+
+ if (state == 'Complete') {
+ try {
+ this._complete = true;
+ (this.options['on' + response.status]
+ || this.options['on' + (this.success() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ var contentType = response.getHeader('Content-type');
+ if (this.options.evalJS == 'force'
+ || (this.options.evalJS && this.isSameOrigin() && contentType
+ && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
+ this.evalResponse();
+ }
+
+ try {
+ (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
+ Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if (state == 'Complete') {
+ // avoid memory leak in MSIE: clean up
+ this.transport.onreadystatechange = Prototype.emptyFunction;
+ }
+ },
+
+ isSameOrigin: function() {
+ var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
+ return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
+ protocol: location.protocol,
+ domain: document.domain,
+ port: location.port ? ':' + location.port : ''
+ }));
+ },
+
+ getHeader: function(name) {
+ try {
+ return this.transport.getResponseHeader(name) || null;
+ } catch (e) { return null }
+ },
+
+ evalResponse: function() {
+ try {
+ return eval((this.transport.responseText || '').unfilterJSON());
+ } catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ dispatchException: function(exception) {
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
+ Ajax.Responders.dispatch('onException', this, exception);
+ }
+});
+
+Ajax.Request.Events =
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+Ajax.Response = Class.create({
+ initialize: function(request){
+ this.request = request;
+ var transport = this.transport = request.transport,
+ readyState = this.readyState = transport.readyState;
+
+ if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
+ this.status = this.getStatus();
+ this.statusText = this.getStatusText();
+ this.responseText = String.interpret(transport.responseText);
+ this.headerJSON = this._getHeaderJSON();
+ }
+
+ if(readyState == 4) {
+ var xml = transport.responseXML;
+ this.responseXML = Object.isUndefined(xml) ? null : xml;
+ this.responseJSON = this._getResponseJSON();
+ }
+ },
+
+ status: 0,
+ statusText: '',
+
+ getStatus: Ajax.Request.prototype.getStatus,
+
+ getStatusText: function() {
+ try {
+ return this.transport.statusText || '';
+ } catch (e) { return '' }
+ },
+
+ getHeader: Ajax.Request.prototype.getHeader,
+
+ getAllHeaders: function() {
+ try {
+ return this.getAllResponseHeaders();
+ } catch (e) { return null }
+ },
+
+ getResponseHeader: function(name) {
+ return this.transport.getResponseHeader(name);
+ },
+
+ getAllResponseHeaders: function() {
+ return this.transport.getAllResponseHeaders();
+ },
+
+ _getHeaderJSON: function() {
+ var json = this.getHeader('X-JSON');
+ if (!json) return null;
+ json = decodeURIComponent(escape(json));
+ try {
+ return json.evalJSON(this.request.options.sanitizeJSON ||
+ !this.request.isSameOrigin());
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ },
+
+ _getResponseJSON: function() {
+ var options = this.request.options;
+ if (!options.evalJSON || (options.evalJSON != 'force' &&
+ !(this.getHeader('Content-type') || '').include('application/json')) ||
+ this.responseText.blank())
+ return null;
+ try {
+ return this.responseText.evalJSON(options.sanitizeJSON ||
+ !this.request.isSameOrigin());
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ }
+});
+
+Ajax.Updater = Class.create(Ajax.Request, {
+ initialize: function($super, container, url, options) {
+ this.container = {
+ success: (container.success || container),
+ failure: (container.failure || (container.success ? null : container))
+ };
+
+ options = Object.clone(options);
+ var onComplete = options.onComplete;
+ options.onComplete = (function(response, json) {
+ this.updateContent(response.responseText);
+ if (Object.isFunction(onComplete)) onComplete(response, json);
+ }).bind(this);
+
+ $super(url, options);
+ },
+
+ updateContent: function(responseText) {
+ var receiver = this.container[this.success() ? 'success' : 'failure'],
+ options = this.options;
+
+ if (!options.evalScripts) responseText = responseText.stripScripts();
+
+ if (receiver = $(receiver)) {
+ if (options.insertion) {
+ if (Object.isString(options.insertion)) {
+ var insertion = { }; insertion[options.insertion] = responseText;
+ receiver.insert(insertion);
+ }
+ else options.insertion(receiver, responseText);
+ }
+ else receiver.update(responseText);
+ }
+ }
+});
+
+Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
+ initialize: function($super, container, url, options) {
+ $super(options);
+ this.onComplete = this.options.onComplete;
+
+ this.frequency = (this.options.frequency || 2);
+ this.decay = (this.options.decay || 1);
+
+ this.updater = { };
+ this.container = container;
+ this.url = url;
+
+ this.start();
+ },
+
+ start: function() {
+ this.options.onComplete = this.updateComplete.bind(this);
+ this.onTimerEvent();
+ },
+
+ stop: function() {
+ this.updater.options.onComplete = undefined;
+ clearTimeout(this.timer);
+ (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+ },
+
+ updateComplete: function(response) {
+ if (this.options.decay) {
+ this.decay = (response.responseText == this.lastText ?
+ this.decay * this.options.decay : 1);
+
+ this.lastText = response.responseText;
+ }
+ this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
+ },
+
+ onTimerEvent: function() {
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
+ }
+});
+function $(element) {
+ if (arguments.length > 1) {
+ for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+ elements.push($(arguments[i]));
+ return elements;
+ }
+ if (Object.isString(element))
+ element = document.getElementById(element);
+ return Element.extend(element);
+}
+
+if (Prototype.BrowserFeatures.XPath) {
+ document._getElementsByXPath = function(expression, parentElement) {
+ var results = [];
+ var query = document.evaluate(expression, $(parentElement) || document,
+ null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+ for (var i = 0, length = query.snapshotLength; i < length; i++)
+ results.push(Element.extend(query.snapshotItem(i)));
+ return results;
+ };
+}
+
+/*--------------------------------------------------------------------------*/
+
+if (!window.Node) var Node = { };
+
+if (!Node.ELEMENT_NODE) {
+ // DOM level 2 ECMAScript Language Binding
+ Object.extend(Node, {
+ ELEMENT_NODE: 1,
+ ATTRIBUTE_NODE: 2,
+ TEXT_NODE: 3,
+ CDATA_SECTION_NODE: 4,
+ ENTITY_REFERENCE_NODE: 5,
+ ENTITY_NODE: 6,
+ PROCESSING_INSTRUCTION_NODE: 7,
+ COMMENT_NODE: 8,
+ DOCUMENT_NODE: 9,
+ DOCUMENT_TYPE_NODE: 10,
+ DOCUMENT_FRAGMENT_NODE: 11,
+ NOTATION_NODE: 12
+ });
+}
+
+(function() {
+ var element = this.Element;
+ this.Element = function(tagName, attributes) {
+ attributes = attributes || { };
+ tagName = tagName.toLowerCase();
+ var cache = Element.cache;
+ if (Prototype.Browser.IE && attributes.name) {
+ tagName = '<' + tagName + ' name="' + attributes.name + '">';
+ delete attributes.name;
+ return Element.writeAttribute(document.createElement(tagName), attributes);
+ }
+ if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
+ return Element.writeAttribute(cache[tagName].cloneNode(false), attributes);
+ };
+ Object.extend(this.Element, element || { });
+ if (element) this.Element.prototype = element.prototype;
+}).call(window);
+
+Element.cache = { };
+
+Element.Methods = {
+ visible: function(element) {
+ return $(element).style.display != 'none';
+ },
+
+ toggle: function(element) {
+ element = $(element);
+ Element[Element.visible(element) ? 'hide' : 'show'](element);
+ return element;
+ },
+
+ hide: function(element) {
+ element = $(element);
+ element.style.display = 'none';
+ return element;
+ },
+
+ show: function(element) {
+ element = $(element);
+ element.style.display = '';
+ return element;
+ },
+
+ remove: function(element) {
+ element = $(element);
+ element.parentNode.removeChild(element);
+ return element;
+ },
+
+ update: function(element, content) {
+ element = $(element);
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) return element.update().insert(content);
+ content = Object.toHTML(content);
+ element.innerHTML = content.stripScripts();
+ content.evalScripts.bind(content).defer();
+ return element;
+ },
+
+ replace: function(element, content) {
+ element = $(element);
+ if (content && content.toElement) content = content.toElement();
+ else if (!Object.isElement(content)) {
+ content = Object.toHTML(content);
+ var range = element.ownerDocument.createRange();
+ range.selectNode(element);
+ content.evalScripts.bind(content).defer();
+ content = range.createContextualFragment(content.stripScripts());
+ }
+ element.parentNode.replaceChild(content, element);
+ return element;
+ },
+
+ insert: function(element, insertions) {
+ element = $(element);
+
+ if (Object.isString(insertions) || Object.isNumber(insertions) ||
+ Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
+ insertions = {bottom:insertions};
+
+ var content, insert, tagName, childNodes;
+
+ for (var position in insertions) {
+ content = insertions[position];
+ position = position.toLowerCase();
+ insert = Element._insertionTranslations[position];
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) {
+ insert(element, content);
+ continue;
+ }
+
+ content = Object.toHTML(content);
+
+ tagName = ((position == 'before' || position == 'after')
+ ? element.parentNode : element).tagName.toUpperCase();
+
+ childNodes = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+
+ if (position == 'top' || position == 'after') childNodes.reverse();
+ childNodes.each(insert.curry(element));
+
+ content.evalScripts.bind(content).defer();
+ }
+
+ return element;
+ },
+
+ wrap: function(element, wrapper, attributes) {
+ element = $(element);
+ if (Object.isElement(wrapper))
+ $(wrapper).writeAttribute(attributes || { });
+ else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
+ else wrapper = new Element('div', wrapper);
+ if (element.parentNode)
+ element.parentNode.replaceChild(wrapper, element);
+ wrapper.appendChild(element);
+ return wrapper;
+ },
+
+ inspect: function(element) {
+ element = $(element);
+ var result = '<' + element.tagName.toLowerCase();
+ $H({'id': 'id', 'className': 'class'}).each(function(pair) {
+ var property = pair.first(), attribute = pair.last();
+ var value = (element[property] || '').toString();
+ if (value) result += ' ' + attribute + '=' + value.inspect(true);
+ });
+ return result + '>';
+ },
+
+ recursivelyCollect: function(element, property) {
+ element = $(element);
+ var elements = [];
+ while (element = element[property])
+ if (element.nodeType == 1)
+ elements.push(Element.extend(element));
+ return elements;
+ },
+
+ ancestors: function(element) {
+ return $(element).recursivelyCollect('parentNode');
+ },
+
+ descendants: function(element) {
+ return $(element).select("*");
+ },
+
+ firstDescendant: function(element) {
+ element = $(element).firstChild;
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ return $(element);
+ },
+
+ immediateDescendants: function(element) {
+ if (!(element = $(element).firstChild)) return [];
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ if (element) return [element].concat($(element).nextSiblings());
+ return [];
+ },
+
+ previousSiblings: function(element) {
+ return $(element).recursivelyCollect('previousSibling');
+ },
+
+ nextSiblings: function(element) {
+ return $(element).recursivelyCollect('nextSibling');
+ },
+
+ siblings: function(element) {
+ element = $(element);
+ return element.previousSiblings().reverse().concat(element.nextSiblings());
+ },
+
+ match: function(element, selector) {
+ if (Object.isString(selector))
+ selector = new Selector(selector);
+ return selector.match($(element));
+ },
+
+ up: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(element.parentNode);
+ var ancestors = element.ancestors();
+ return Object.isNumber(expression) ? ancestors[expression] :
+ Selector.findElement(ancestors, expression, index);
+ },
+
+ down: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return element.firstDescendant();
+ return Object.isNumber(expression) ? element.descendants()[expression] :
+ Element.select(element, expression)[index || 0];
+ },
+
+ previous: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
+ var previousSiblings = element.previousSiblings();
+ return Object.isNumber(expression) ? previousSiblings[expression] :
+ Selector.findElement(previousSiblings, expression, index);
+ },
+
+ next: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
+ var nextSiblings = element.nextSiblings();
+ return Object.isNumber(expression) ? nextSiblings[expression] :
+ Selector.findElement(nextSiblings, expression, index);
+ },
+
+ select: function() {
+ var args = $A(arguments), element = $(args.shift());
+ return Selector.findChildElements(element, args);
+ },
+
+ adjacent: function() {
+ var args = $A(arguments), element = $(args.shift());
+ return Selector.findChildElements(element.parentNode, args).without(element);
+ },
+
+ identify: function(element) {
+ element = $(element);
+ var id = element.readAttribute('id'), self = arguments.callee;
+ if (id) return id;
+ do { id = 'anonymous_element_' + self.counter++ } while ($(id));
+ element.writeAttribute('id', id);
+ return id;
+ },
+
+ readAttribute: function(element, name) {
+ element = $(element);
+ if (Prototype.Browser.IE) {
+ var t = Element._attributeTranslations.read;
+ if (t.values[name]) return t.values[name](element, name);
+ if (t.names[name]) name = t.names[name];
+ if (name.include(':')) {
+ return (!element.attributes || !element.attributes[name]) ? null :
+ element.attributes[name].value;
+ }
+ }
+ return element.getAttribute(name);
+ },
+
+ writeAttribute: function(element, name, value) {
+ element = $(element);
+ var attributes = { }, t = Element._attributeTranslations.write;
+
+ if (typeof name == 'object') attributes = name;
+ else attributes[name] = Object.isUndefined(value) ? true : value;
+
+ for (var attr in attributes) {
+ name = t.names[attr] || attr;
+ value = attributes[attr];
+ if (t.values[attr]) name = t.values[attr](element, value);
+ if (value === false || value === null)
+ element.removeAttribute(name);
+ else if (value === true)
+ element.setAttribute(name, name);
+ else element.setAttribute(name, value);
+ }
+ return element;
+ },
+
+ getHeight: function(element) {
+ return $(element).getDimensions().height;
+ },
+
+ getWidth: function(element) {
+ return $(element).getDimensions().width;
+ },
+
+ classNames: function(element) {
+ return new Element.ClassNames(element);
+ },
+
+ hasClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ var elementClassName = element.className;
+ return (elementClassName.length > 0 && (elementClassName == className ||
+ new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
+ },
+
+ addClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ if (!element.hasClassName(className))
+ element.className += (element.className ? ' ' : '') + className;
+ return element;
+ },
+
+ removeClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ element.className = element.className.replace(
+ new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
+ return element;
+ },
+
+ toggleClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ return element[element.hasClassName(className) ?
+ 'removeClassName' : 'addClassName'](className);
+ },
+
+ // removes whitespace-only text node children
+ cleanWhitespace: function(element) {
+ element = $(element);
+ var node = element.firstChild;
+ while (node) {
+ var nextNode = node.nextSibling;
+ if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+ element.removeChild(node);
+ node = nextNode;
+ }
+ return element;
+ },
+
+ empty: function(element) {
+ return $(element).innerHTML.blank();
+ },
+
+ descendantOf: function(element, ancestor) {
+ element = $(element), ancestor = $(ancestor);
+
+ if (element.compareDocumentPosition)
+ return (element.compareDocumentPosition(ancestor) & 8) === 8;
+
+ if (ancestor.contains)
+ return ancestor.contains(element) && ancestor !== element;
+
+ while (element = element.parentNode)
+ if (element == ancestor) return true;
+
+ return false;
+ },
+
+ scrollTo: function(element) {
+ element = $(element);
+ var pos = element.cumulativeOffset();
+ window.scrollTo(pos[0], pos[1]);
+ return element;
+ },
+
+ getStyle: function(element, style) {
+ element = $(element);
+ style = style == 'float' ? 'cssFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value || value == 'auto') {
+ var css = document.defaultView.getComputedStyle(element, null);
+ value = css ? css[style] : null;
+ }
+ if (style == 'opacity') return value ? parseFloat(value) : 1.0;
+ return value == 'auto' ? null : value;
+ },
+
+ getOpacity: function(element) {
+ return $(element).getStyle('opacity');
+ },
+
+ setStyle: function(element, styles) {
+ element = $(element);
+ var elementStyle = element.style, match;
+ if (Object.isString(styles)) {
+ element.style.cssText += ';' + styles;
+ return styles.include('opacity') ?
+ element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
+ }
+ for (var property in styles)
+ if (property == 'opacity') element.setOpacity(styles[property]);
+ else
+ elementStyle[(property == 'float' || property == 'cssFloat') ?
+ (Object.isUndefined(elementStyle.styleFloat) ? 'cssFloat' : 'styleFloat') :
+ property] = styles[property];
+
+ return element;
+ },
+
+ setOpacity: function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1 || value === '') ? '' :
+ (value < 0.00001) ? 0 : value;
+ return element;
+ },
+
+ getDimensions: function(element) {
+ element = $(element);
+ var display = element.getStyle('display');
+ if (display != 'none' && display != null) // Safari bug
+ return {width: element.offsetWidth, height: element.offsetHeight};
+
+ // All *Width and *Height properties give 0 on elements with display none,
+ // so enable the element temporarily
+ var els = element.style;
+ var originalVisibility = els.visibility;
+ var originalPosition = els.position;
+ var originalDisplay = els.display;
+ els.visibility = 'hidden';
+ els.position = 'absolute';
+ els.display = 'block';
+ var originalWidth = element.clientWidth;
+ var originalHeight = element.clientHeight;
+ els.display = originalDisplay;
+ els.position = originalPosition;
+ els.visibility = originalVisibility;
+ return {width: originalWidth, height: originalHeight};
+ },
+
+ makePositioned: function(element) {
+ element = $(element);
+ var pos = Element.getStyle(element, 'position');
+ if (pos == 'static' || !pos) {
+ element._madePositioned = true;
+ element.style.position = 'relative';
+ // Opera returns the offset relative to the positioning context, when an
+ // element is position relative but top and left have not been defined
+ if (Prototype.Browser.Opera) {
+ element.style.top = 0;
+ element.style.left = 0;
+ }
+ }
+ return element;
+ },
+
+ undoPositioned: function(element) {
+ element = $(element);
+ if (element._madePositioned) {
+ element._madePositioned = undefined;
+ element.style.position =
+ element.style.top =
+ element.style.left =
+ element.style.bottom =
+ element.style.right = '';
+ }
+ return element;
+ },
+
+ makeClipping: function(element) {
+ element = $(element);
+ if (element._overflow) return element;
+ element._overflow = Element.getStyle(element, 'overflow') || 'auto';
+ if (element._overflow !== 'hidden')
+ element.style.overflow = 'hidden';
+ return element;
+ },
+
+ undoClipping: function(element) {
+ element = $(element);
+ if (!element._overflow) return element;
+ element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
+ element._overflow = null;
+ return element;
+ },
+
+ cumulativeOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ } while (element);
+ return Element._returnOffset(valueL, valueT);
+ },
+
+ positionedOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ if (element) {
+ if (element.tagName.toUpperCase() == 'BODY') break;
+ var p = Element.getStyle(element, 'position');
+ if (p !== 'static') break;
+ }
+ } while (element);
+ return Element._returnOffset(valueL, valueT);
+ },
+
+ absolutize: function(element) {
+ element = $(element);
+ if (element.getStyle('position') == 'absolute') return element;
+ // Position.prepare(); // To be done manually by Scripty when it needs it.
+
+ var offsets = element.positionedOffset();
+ var top = offsets[1];
+ var left = offsets[0];
+ var width = element.clientWidth;
+ var height = element.clientHeight;
+
+ element._originalLeft = left - parseFloat(element.style.left || 0);
+ element._originalTop = top - parseFloat(element.style.top || 0);
+ element._originalWidth = element.style.width;
+ element._originalHeight = element.style.height;
+
+ element.style.position = 'absolute';
+ element.style.top = top + 'px';
+ element.style.left = left + 'px';
+ element.style.width = width + 'px';
+ element.style.height = height + 'px';
+ return element;
+ },
+
+ relativize: function(element) {
+ element = $(element);
+ if (element.getStyle('position') == 'relative') return element;
+ // Position.prepare(); // To be done manually by Scripty when it needs it.
+
+ element.style.position = 'relative';
+ var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
+ var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
+
+ element.style.top = top + 'px';
+ element.style.left = left + 'px';
+ element.style.height = element._originalHeight;
+ element.style.width = element._originalWidth;
+ return element;
+ },
+
+ cumulativeScrollOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.scrollTop || 0;
+ valueL += element.scrollLeft || 0;
+ element = element.parentNode;
+ } while (element);
+ return Element._returnOffset(valueL, valueT);
+ },
+
+ getOffsetParent: function(element) {
+ if (element.offsetParent) return $(element.offsetParent);
+ if (element == document.body) return $(element);
+
+ while ((element = element.parentNode) && element != document.body)
+ if (Element.getStyle(element, 'position') != 'static')
+ return $(element);
+
+ return $(document.body);
+ },
+
+ viewportOffset: function(forElement) {
+ var valueT = 0, valueL = 0;
+
+ var element = forElement;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+
+ // Safari fix
+ if (element.offsetParent == document.body &&
+ Element.getStyle(element, 'position') == 'absolute') break;
+
+ } while (element = element.offsetParent);
+
+ element = forElement;
+ do {
+ if (!Prototype.Browser.Opera || (element.tagName && (element.tagName.toUpperCase() == 'BODY'))) {
+ valueT -= element.scrollTop || 0;
+ valueL -= element.scrollLeft || 0;
+ }
+ } while (element = element.parentNode);
+
+ return Element._returnOffset(valueL, valueT);
+ },
+
+ clonePosition: function(element, source) {
+ var options = Object.extend({
+ setLeft: true,
+ setTop: true,
+ setWidth: true,
+ setHeight: true,
+ offsetTop: 0,
+ offsetLeft: 0
+ }, arguments[2] || { });
+
+ // find page position of source
+ source = $(source);
+ var p = source.viewportOffset();
+
+ // find coordinate system to use
+ element = $(element);
+ var delta = [0, 0];
+ var parent = null;
+ // delta [0,0] will do fine with position: fixed elements,
+ // position:absolute needs offsetParent deltas
+ if (Element.getStyle(element, 'position') == 'absolute') {
+ parent = element.getOffsetParent();
+ delta = parent.viewportOffset();
+ }
+
+ // correct by body offsets (fixes Safari)
+ if (parent == document.body) {
+ delta[0] -= document.body.offsetLeft;
+ delta[1] -= document.body.offsetTop;
+ }
+
+ // set position
+ if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
+ if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
+ if (options.setWidth) element.style.width = source.offsetWidth + 'px';
+ if (options.setHeight) element.style.height = source.offsetHeight + 'px';
+ return element;
+ }
+};
+
+Element.Methods.identify.counter = 1;
+
+Object.extend(Element.Methods, {
+ getElementsBySelector: Element.Methods.select,
+ childElements: Element.Methods.immediateDescendants
+});
+
+Element._attributeTranslations = {
+ write: {
+ names: {
+ className: 'class',
+ htmlFor: 'for'
+ },
+ values: { }
+ }
+};
+
+if (Prototype.Browser.Opera) {
+ Element.Methods.getStyle = Element.Methods.getStyle.wrap(
+ function(proceed, element, style) {
+ switch (style) {
+ case 'left': case 'top': case 'right': case 'bottom':
+ if (proceed(element, 'position') === 'static') return null;
+ case 'height': case 'width':
+ // returns '0px' for hidden elements; we want it to return null
+ if (!Element.visible(element)) return null;
+
+ // returns the border-box dimensions rather than the content-box
+ // dimensions, so we subtract padding and borders from the value
+ var dim = parseInt(proceed(element, style), 10);
+
+ if (dim !== element['offset' + style.capitalize()])
+ return dim + 'px';
+
+ var properties;
+ if (style === 'height') {
+ properties = ['border-top-width', 'padding-top',
+ 'padding-bottom', 'border-bottom-width'];
+ }
+ else {
+ properties = ['border-left-width', 'padding-left',
+ 'padding-right', 'border-right-width'];
+ }
+ return properties.inject(dim, function(memo, property) {
+ var val = proceed(element, property);
+ return val === null ? memo : memo - parseInt(val, 10);
+ }) + 'px';
+ default: return proceed(element, style);
+ }
+ }
+ );
+
+ Element.Methods.readAttribute = Element.Methods.readAttribute.wrap(
+ function(proceed, element, attribute) {
+ if (attribute === 'title') return element.title;
+ return proceed(element, attribute);
+ }
+ );
+}
+
+else if (Prototype.Browser.IE) {
+ // IE doesn't report offsets correctly for static elements, so we change them
+ // to "relative" to get the values, then change them back.
+ Element.Methods.getOffsetParent = Element.Methods.getOffsetParent.wrap(
+ function(proceed, element) {
+ element = $(element);
+ // IE throws an error if element is not in document
+ try { element.offsetParent }
+ catch(e) { return $(document.body) }
+ var position = element.getStyle('position');
+ if (position !== 'static') return proceed(element);
+ element.setStyle({ position: 'relative' });
+ var value = proceed(element);
+ element.setStyle({ position: position });
+ return value;
+ }
+ );
+
+ $w('positionedOffset viewportOffset').each(function(method) {
+ Element.Methods[method] = Element.Methods[method].wrap(
+ function(proceed, element) {
+ element = $(element);
+ try { element.offsetParent }
+ catch(e) { return Element._returnOffset(0,0) }
+ var position = element.getStyle('position');
+ if (position !== 'static') return proceed(element);
+ // Trigger hasLayout on the offset parent so that IE6 reports
+ // accurate offsetTop and offsetLeft values for position: fixed.
+ var offsetParent = element.getOffsetParent();
+ if (offsetParent && offsetParent.getStyle('position') === 'fixed')
+ offsetParent.setStyle({ zoom: 1 });
+ element.setStyle({ position: 'relative' });
+ var value = proceed(element);
+ element.setStyle({ position: position });
+ return value;
+ }
+ );
+ });
+
+ Element.Methods.cumulativeOffset = Element.Methods.cumulativeOffset.wrap(
+ function(proceed, element) {
+ try { element.offsetParent }
+ catch(e) { return Element._returnOffset(0,0) }
+ return proceed(element);
+ }
+ );
+
+ Element.Methods.getStyle = function(element, style) {
+ element = $(element);
+ style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value && element.currentStyle) value = element.currentStyle[style];
+
+ if (style == 'opacity') {
+ if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
+ if (value[1]) return parseFloat(value[1]) / 100;
+ return 1.0;
+ }
+
+ if (value == 'auto') {
+ if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
+ return element['offset' + style.capitalize()] + 'px';
+ return null;
+ }
+ return value;
+ };
+
+ Element.Methods.setOpacity = function(element, value) {
+ function stripAlpha(filter){
+ return filter.replace(/alpha\([^\)]*\)/gi,'');
+ }
+ element = $(element);
+ var currentStyle = element.currentStyle;
+ if ((currentStyle && !currentStyle.hasLayout) ||
+ (!currentStyle && element.style.zoom == 'normal'))
+ element.style.zoom = 1;
+
+ var filter = element.getStyle('filter'), style = element.style;
+ if (value == 1 || value === '') {
+ (filter = stripAlpha(filter)) ?
+ style.filter = filter : style.removeAttribute('filter');
+ return element;
+ } else if (value < 0.00001) value = 0;
+ style.filter = stripAlpha(filter) +
+ 'alpha(opacity=' + (value * 100) + ')';
+ return element;
+ };
+
+ Element._attributeTranslations = {
+ read: {
+ names: {
+ 'class': 'className',
+ 'for': 'htmlFor'
+ },
+ values: {
+ _getAttr: function(element, attribute) {
+ return element.getAttribute(attribute, 2);
+ },
+ _getAttrNode: function(element, attribute) {
+ var node = element.getAttributeNode(attribute);
+ return node ? node.value : "";
+ },
+ _getEv: function(element, attribute) {
+ attribute = element.getAttribute(attribute);
+ return attribute ? attribute.toString().slice(23, -2) : null;
+ },
+ _flag: function(element, attribute) {
+ return $(element).hasAttribute(attribute) ? attribute : null;
+ },
+ style: function(element) {
+ return element.style.cssText.toLowerCase();
+ },
+ title: function(element) {
+ return element.title;
+ }
+ }
+ }
+ };
+
+ Element._attributeTranslations.write = {
+ names: Object.extend({
+ cellpadding: 'cellPadding',
+ cellspacing: 'cellSpacing'
+ }, Element._attributeTranslations.read.names),
+ values: {
+ checked: function(element, value) {
+ element.checked = !!value;
+ },
+
+ style: function(element, value) {
+ element.style.cssText = value ? value : '';
+ }
+ }
+ };
+
+ Element._attributeTranslations.has = {};
+
+ $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
+ 'encType maxLength readOnly longDesc frameBorder').each(function(attr) {
+ Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
+ Element._attributeTranslations.has[attr.toLowerCase()] = attr;
+ });
+
+ (function(v) {
+ Object.extend(v, {
+ href: v._getAttr,
+ src: v._getAttr,
+ type: v._getAttr,
+ action: v._getAttrNode,
+ disabled: v._flag,
+ checked: v._flag,
+ readonly: v._flag,
+ multiple: v._flag,
+ onload: v._getEv,
+ onunload: v._getEv,
+ onclick: v._getEv,
+ ondblclick: v._getEv,
+ onmousedown: v._getEv,
+ onmouseup: v._getEv,
+ onmouseover: v._getEv,
+ onmousemove: v._getEv,
+ onmouseout: v._getEv,
+ onfocus: v._getEv,
+ onblur: v._getEv,
+ onkeypress: v._getEv,
+ onkeydown: v._getEv,
+ onkeyup: v._getEv,
+ onsubmit: v._getEv,
+ onreset: v._getEv,
+ onselect: v._getEv,
+ onchange: v._getEv
+ });
+ })(Element._attributeTranslations.read.values);
+}
+
+else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1) ? 0.999999 :
+ (value === '') ? '' : (value < 0.00001) ? 0 : value;
+ return element;
+ };
+}
+
+else if (Prototype.Browser.WebKit) {
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1 || value === '') ? '' :
+ (value < 0.00001) ? 0 : value;
+
+ if (value == 1)
+ if(element.tagName.toUpperCase() == 'IMG' && element.width) {
+ element.width++; element.width--;
+ } else try {
+ var n = document.createTextNode(' ');
+ element.appendChild(n);
+ element.removeChild(n);
+ } catch (e) { }
+
+ return element;
+ };
+
+ // Safari returns margins on body which is incorrect if the child is absolutely
+ // positioned. For performance reasons, redefine Element#cumulativeOffset for
+ // KHTML/WebKit only.
+ Element.Methods.cumulativeOffset = function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ if (element.offsetParent == document.body)
+ if (Element.getStyle(element, 'position') == 'absolute') break;
+
+ element = element.offsetParent;
+ } while (element);
+
+ return Element._returnOffset(valueL, valueT);
+ };
+}
+
+if (Prototype.Browser.IE || Prototype.Browser.Opera) {
+ // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements
+ Element.Methods.update = function(element, content) {
+ element = $(element);
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) return element.update().insert(content);
+
+ content = Object.toHTML(content);
+ var tagName = element.tagName.toUpperCase();
+
+ if (tagName in Element._insertionTranslations.tags) {
+ $A(element.childNodes).each(function(node) { element.removeChild(node) });
+ Element._getContentFromAnonymousElement(tagName, content.stripScripts())
+ .each(function(node) { element.appendChild(node) });
+ }
+ else element.innerHTML = content.stripScripts();
+
+ content.evalScripts.bind(content).defer();
+ return element;
+ };
+}
+
+if ('outerHTML' in document.createElement('div')) {
+ Element.Methods.replace = function(element, content) {
+ element = $(element);
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) {
+ element.parentNode.replaceChild(content, element);
+ return element;
+ }
+
+ content = Object.toHTML(content);
+ var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
+
+ if (Element._insertionTranslations.tags[tagName]) {
+ var nextSibling = element.next();
+ var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+ parent.removeChild(element);
+ if (nextSibling)
+ fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
+ else
+ fragments.each(function(node) { parent.appendChild(node) });
+ }
+ else element.outerHTML = content.stripScripts();
+
+ content.evalScripts.bind(content).defer();
+ return element;
+ };
+}
+
+Element._returnOffset = function(l, t) {
+ var result = [l, t];
+ result.left = l;
+ result.top = t;
+ return result;
+};
+
+Element._getContentFromAnonymousElement = function(tagName, html) {
+ var div = new Element('div'), t = Element._insertionTranslations.tags[tagName];
+ if (t) {
+ div.innerHTML = t[0] + html + t[1];
+ t[2].times(function() { div = div.firstChild });
+ } else div.innerHTML = html;
+ return $A(div.childNodes);
+};
+
+Element._insertionTranslations = {
+ before: function(element, node) {
+ element.parentNode.insertBefore(node, element);
+ },
+ top: function(element, node) {
+ element.insertBefore(node, element.firstChild);
+ },
+ bottom: function(element, node) {
+ element.appendChild(node);
+ },
+ after: function(element, node) {
+ element.parentNode.insertBefore(node, element.nextSibling);
+ },
+ tags: {
+ TABLE: ['<table>', '</table>', 1],
+ TBODY: ['<table><tbody>', '</tbody></table>', 2],
+ TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3],
+ TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
+ SELECT: ['<select>', '</select>', 1]
+ }
+};
+
+(function() {
+ Object.extend(this.tags, {
+ THEAD: this.tags.TBODY,
+ TFOOT: this.tags.TBODY,
+ TH: this.tags.TD
+ });
+}).call(Element._insertionTranslations);
+
+Element.Methods.Simulated = {
+ hasAttribute: function(element, attribute) {
+ attribute = Element._attributeTranslations.has[attribute] || attribute;
+ var node = $(element).getAttributeNode(attribute);
+ return !!(node && node.specified);
+ }
+};
+
+Element.Methods.ByTag = { };
+
+Object.extend(Element, Element.Methods);
+
+if (!Prototype.BrowserFeatures.ElementExtensions &&
+ document.createElement('div')['__proto__']) {
+ window.HTMLElement = { };
+ window.HTMLElement.prototype = document.createElement('div')['__proto__'];
+ Prototype.BrowserFeatures.ElementExtensions = true;
+}
+
+Element.extend = (function() {
+ if (Prototype.BrowserFeatures.SpecificElementExtensions)
+ return Prototype.K;
+
+ var Methods = { }, ByTag = Element.Methods.ByTag;
+
+ var extend = Object.extend(function(element) {
+ if (!element || element._extendedByPrototype ||
+ element.nodeType != 1 || element == window) return element;
+
+ var methods = Object.clone(Methods),
+ tagName = element.tagName.toUpperCase(), property, value;
+
+ // extend methods for specific tags
+ if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
+
+ for (property in methods) {
+ value = methods[property];
+ if (Object.isFunction(value) && !(property in element))
+ element[property] = value.methodize();
+ }
+
+ element._extendedByPrototype = Prototype.emptyFunction;
+ return element;
+
+ }, {
+ refresh: function() {
+ // extend methods for all tags (Safari doesn't need this)
+ if (!Prototype.BrowserFeatures.ElementExtensions) {
+ Object.extend(Methods, Element.Methods);
+ Object.extend(Methods, Element.Methods.Simulated);
+ }
+ }
+ });
+
+ extend.refresh();
+ return extend;
+})();
+
+Element.hasAttribute = function(element, attribute) {
+ if (element.hasAttribute) return element.hasAttribute(attribute);
+ return Element.Methods.Simulated.hasAttribute(element, attribute);
+};
+
+Element.addMethods = function(methods) {
+ var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
+
+ if (!methods) {
+ Object.extend(Form, Form.Methods);
+ Object.extend(Form.Element, Form.Element.Methods);
+ Object.extend(Element.Methods.ByTag, {
+ "FORM": Object.clone(Form.Methods),
+ "INPUT": Object.clone(Form.Element.Methods),
+ "SELECT": Object.clone(Form.Element.Methods),
+ "TEXTAREA": Object.clone(Form.Element.Methods)
+ });
+ }
+
+ if (arguments.length == 2) {
+ var tagName = methods;
+ methods = arguments[1];
+ }
+
+ if (!tagName) Object.extend(Element.Methods, methods || { });
+ else {
+ if (Object.isArray(tagName)) tagName.each(extend);
+ else extend(tagName);
+ }
+
+ function extend(tagName) {
+ tagName = tagName.toUpperCase();
+ if (!Element.Methods.ByTag[tagName])
+ Element.Methods.ByTag[tagName] = { };
+ Object.extend(Element.Methods.ByTag[tagName], methods);
+ }
+
+ function copy(methods, destination, onlyIfAbsent) {
+ onlyIfAbsent = onlyIfAbsent || false;
+ for (var property in methods) {
+ var value = methods[property];
+ if (!Object.isFunction(value)) continue;
+ if (!onlyIfAbsent || !(property in destination))
+ destination[property] = value.methodize();
+ }
+ }
+
+ function findDOMClass(tagName) {
+ var klass;
+ var trans = {
+ "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
+ "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
+ "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
+ "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
+ "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
+ "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
+ "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
+ "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
+ "FrameSet", "IFRAME": "IFrame"
+ };
+ if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName.capitalize() + 'Element';
+ if (window[klass]) return window[klass];
+
+ window[klass] = { };
+ window[klass].prototype = document.createElement(tagName)['__proto__'];
+ return window[klass];
+ }
+
+ if (F.ElementExtensions) {
+ copy(Element.Methods, HTMLElement.prototype);
+ copy(Element.Methods.Simulated, HTMLElement.prototype, true);
+ }
+
+ if (F.SpecificElementExtensions) {
+ for (var tag in Element.Methods.ByTag) {
+ var klass = findDOMClass(tag);
+ if (Object.isUndefined(klass)) continue;
+ copy(T[tag], klass.prototype);
+ }
+ }
+
+ Object.extend(Element, Element.Methods);
+ delete Element.ByTag;
+
+ if (Element.extend.refresh) Element.extend.refresh();
+ Element.cache = { };
+};
+
+document.viewport = {
+ getDimensions: function() {
+ var dimensions = { }, B = Prototype.Browser;
+ $w('width height').each(function(d) {
+ var D = d.capitalize();
+ if (B.WebKit && !document.evaluate) {
+ // Safari <3.0 needs self.innerWidth/Height
+ dimensions[d] = self['inner' + D];
+ } else if (B.Opera && parseFloat(window.opera.version()) < 9.5) {
+ // Opera <9.5 needs document.body.clientWidth/Height
+ dimensions[d] = document.body['client' + D]
+ } else {
+ dimensions[d] = document.documentElement['client' + D];
+ }
+ });
+ return dimensions;
+ },
+
+ getWidth: function() {
+ return this.getDimensions().width;
+ },
+
+ getHeight: function() {
+ return this.getDimensions().height;
+ },
+
+ getScrollOffsets: function() {
+ return Element._returnOffset(
+ window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
+ window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
+ }
+};
+/* Portions of the Selector class are derived from Jack Slocum's DomQuery,
+ * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style
+ * license. Please see http://www.yui-ext.com/ for more information. */
+
+var Selector = Class.create({
+ initialize: function(expression) {
+ this.expression = expression.strip();
+
+ if (this.shouldUseSelectorsAPI()) {
+ this.mode = 'selectorsAPI';
+ } else if (this.shouldUseXPath()) {
+ this.mode = 'xpath';
+ this.compileXPathMatcher();
+ } else {
+ this.mode = "normal";
+ this.compileMatcher();
+ }
+
+ },
+
+ shouldUseXPath: function() {
+ if (!Prototype.BrowserFeatures.XPath) return false;
+
+ var e = this.expression;
+
+ // Safari 3 chokes on :*-of-type and :empty
+ if (Prototype.Browser.WebKit &&
+ (e.include("-of-type") || e.include(":empty")))
+ return false;
+
+ // XPath can't do namespaced attributes, nor can it read
+ // the "checked" property from DOM nodes
+ if ((/(\[[\w-]*?:|:checked)/).test(e))
+ return false;
+
+ return true;
+ },
+
+ shouldUseSelectorsAPI: function() {
+ if (!Prototype.BrowserFeatures.SelectorsAPI) return false;
+
+ if (!Selector._div) Selector._div = new Element('div');
+
+ // Make sure the browser treats the selector as valid. Test on an
+ // isolated element to minimize cost of this check.
+ try {
+ Selector._div.querySelector(this.expression);
+ } catch(e) {
+ return false;
+ }
+
+ return true;
+ },
+
+ compileMatcher: function() {
+ var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
+ c = Selector.criteria, le, p, m;
+
+ if (Selector._cache[e]) {
+ this.matcher = Selector._cache[e];
+ return;
+ }
+
+ this.matcher = ["this.matcher = function(root) {",
+ "var r = root, h = Selector.handlers, c = false, n;"];
+
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in ps) {
+ p = ps[i];
+ if (m = e.match(p)) {
+ this.matcher.push(Object.isFunction(c[i]) ? c[i](m) :
+ new Template(c[i]).evaluate(m));
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+
+ this.matcher.push("return h.unique(n);\n}");
+ eval(this.matcher.join('\n'));
+ Selector._cache[this.expression] = this.matcher;
+ },
+
+ compileXPathMatcher: function() {
+ var e = this.expression, ps = Selector.patterns,
+ x = Selector.xpath, le, m;
+
+ if (Selector._cache[e]) {
+ this.xpath = Selector._cache[e]; return;
+ }
+
+ this.matcher = ['.//*'];
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in ps) {
+ if (m = e.match(ps[i])) {
+ this.matcher.push(Object.isFunction(x[i]) ? x[i](m) :
+ new Template(x[i]).evaluate(m));
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+
+ this.xpath = this.matcher.join('');
+ Selector._cache[this.expression] = this.xpath;
+ },
+
+ findElements: function(root) {
+ root = root || document;
+ var e = this.expression, results;
+
+ switch (this.mode) {
+ case 'selectorsAPI':
+ // querySelectorAll queries document-wide, then filters to descendants
+ // of the context element. That's not what we want.
+ // Add an explicit context to the selector if necessary.
+ if (root !== document) {
+ var oldId = root.id, id = $(root).identify();
+ e = "#" + id + " " + e;
+ }
+
+ results = $A(root.querySelectorAll(e)).map(Element.extend);
+ root.id = oldId;
+
+ return results;
+ case 'xpath':
+ return document._getElementsByXPath(this.xpath, root);
+ default:
+ return this.matcher(root);
+ }
+ },
+
+ match: function(element) {
+ this.tokens = [];
+
+ var e = this.expression, ps = Selector.patterns, as = Selector.assertions;
+ var le, p, m;
+
+ while (e && le !== e && (/\S/).test(e)) {
+ le = e;
+ for (var i in ps) {
+ p = ps[i];
+ if (m = e.match(p)) {
+ // use the Selector.assertions methods unless the selector
+ // is too complex.
+ if (as[i]) {
+ this.tokens.push([i, Object.clone(m)]);
+ e = e.replace(m[0], '');
+ } else {
+ // reluctantly do a document-wide search
+ // and look for a match in the array
+ return this.findElements(document).include(element);
+ }
+ }
+ }
+ }
+
+ var match = true, name, matches;
+ for (var i = 0, token; token = this.tokens[i]; i++) {
+ name = token[0], matches = token[1];
+ if (!Selector.assertions[name](element, matches)) {
+ match = false; break;
+ }
+ }
+
+ return match;
+ },
+
+ toString: function() {
+ return this.expression;
+ },
+
+ inspect: function() {
+ return "#<Selector:" + this.expression.inspect() + ">";
+ }
+});
+
+Object.extend(Selector, {
+ _cache: { },
+
+ xpath: {
+ descendant: "//*",
+ child: "/*",
+ adjacent: "/following-sibling::*[1]",
+ laterSibling: '/following-sibling::*',
+ tagName: function(m) {
+ if (m[1] == '*') return '';
+ return "[local-name()='" + m[1].toLowerCase() +
+ "' or local-name()='" + m[1].toUpperCase() + "']";
+ },
+ className: "[contains(concat(' ', @class, ' '), ' #{1} ')]",
+ id: "[@id='#{1}']",
+ attrPresence: function(m) {
+ m[1] = m[1].toLowerCase();
+ return new Template("[@#{1}]").evaluate(m);
+ },
+ attr: function(m) {
+ m[1] = m[1].toLowerCase();
+ m[3] = m[5] || m[6];
+ return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
+ },
+ pseudo: function(m) {
+ var h = Selector.xpath.pseudos[m[1]];
+ if (!h) return '';
+ if (Object.isFunction(h)) return h(m);
+ return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
+ },
+ operators: {
+ '=': "[@#{1}='#{3}']",
+ '!=': "[@#{1}!='#{3}']",
+ '^=': "[starts-with(@#{1}, '#{3}')]",
+ '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",
+ '*=': "[contains(@#{1}, '#{3}')]",
+ '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",
+ '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]"
+ },
+ pseudos: {
+ 'first-child': '[not(preceding-sibling::*)]',
+ 'last-child': '[not(following-sibling::*)]',
+ 'only-child': '[not(preceding-sibling::* or following-sibling::*)]',
+ 'empty': "[count(*) = 0 and (count(text()) = 0)]",
+ 'checked': "[@checked]",
+ 'disabled': "[(@disabled) and (@type!='hidden')]",
+ 'enabled': "[not(@disabled) and (@type!='hidden')]",
+ 'not': function(m) {
+ var e = m[6], p = Selector.patterns,
+ x = Selector.xpath, le, v;
+
+ var exclusion = [];
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in p) {
+ if (m = e.match(p[i])) {
+ v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m);
+ exclusion.push("(" + v.substring(1, v.length - 1) + ")");
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+ return "[not(" + exclusion.join(" and ") + ")]";
+ },
+ 'nth-child': function(m) {
+ return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);
+ },
+ 'nth-last-child': function(m) {
+ return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);
+ },
+ 'nth-of-type': function(m) {
+ return Selector.xpath.pseudos.nth("position() ", m);
+ },
+ 'nth-last-of-type': function(m) {
+ return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m);
+ },
+ 'first-of-type': function(m) {
+ m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m);
+ },
+ 'last-of-type': function(m) {
+ m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m);
+ },
+ 'only-of-type': function(m) {
+ var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m);
+ },
+ nth: function(fragment, m) {
+ var mm, formula = m[6], predicate;
+ if (formula == 'even') formula = '2n+0';
+ if (formula == 'odd') formula = '2n+1';
+ if (mm = formula.match(/^(\d+)$/)) // digit only
+ return '[' + fragment + "= " + mm[1] + ']';
+ if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
+ if (mm[1] == "-") mm[1] = -1;
+ var a = mm[1] ? Number(mm[1]) : 1;
+ var b = mm[2] ? Number(mm[2]) : 0;
+ predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " +
+ "((#{fragment} - #{b}) div #{a} >= 0)]";
+ return new Template(predicate).evaluate({
+ fragment: fragment, a: a, b: b });
+ }
+ }
+ }
+ },
+
+ criteria: {
+ tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;',
+ className: 'n = h.className(n, r, "#{1}", c); c = false;',
+ id: 'n = h.id(n, r, "#{1}", c); c = false;',
+ attrPresence: 'n = h.attrPresence(n, r, "#{1}", c); c = false;',
+ attr: function(m) {
+ m[3] = (m[5] || m[6]);
+ return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m);
+ },
+ pseudo: function(m) {
+ if (m[6]) m[6] = m[6].replace(/"/g, '\\"');
+ return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);
+ },
+ descendant: 'c = "descendant";',
+ child: 'c = "child";',
+ adjacent: 'c = "adjacent";',
+ laterSibling: 'c = "laterSibling";'
+ },
+
+ patterns: {
+ // combinators must be listed first
+ // (and descendant needs to be last combinator)
+ laterSibling: /^\s*~\s*/,
+ child: /^\s*>\s*/,
+ adjacent: /^\s*\+\s*/,
+ descendant: /^\s/,
+
+ // selectors follow
+ tagName: /^\s*(\*|[\w\-]+)(\b|$)?/,
+ id: /^#([\w\-\*]+)(\b|$)/,
+ className: /^\.([\w\-\*]+)(\b|$)/,
+ pseudo:
+/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,
+ attrPresence: /^\[((?:[\w]+:)?[\w]+)\]/,
+ attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/
+ },
+
+ // for Selector.match and Element#match
+ assertions: {
+ tagName: function(element, matches) {
+ return matches[1].toUpperCase() == element.tagName.toUpperCase();
+ },
+
+ className: function(element, matches) {
+ return Element.hasClassName(element, matches[1]);
+ },
+
+ id: function(element, matches) {
+ return element.id === matches[1];
+ },
+
+ attrPresence: function(element, matches) {
+ return Element.hasAttribute(element, matches[1]);
+ },
+
+ attr: function(element, matches) {
+ var nodeValue = Element.readAttribute(element, matches[1]);
+ return nodeValue && Selector.operators[matches[2]](nodeValue, matches[5] || matches[6]);
+ }
+ },
+
+ handlers: {
+ // UTILITY FUNCTIONS
+ // joins two collections
+ concat: function(a, b) {
+ for (var i = 0, node; node = b[i]; i++)
+ a.push(node);
+ return a;
+ },
+
+ // marks an array of nodes for counting
+ mark: function(nodes) {
+ var _true = Prototype.emptyFunction;
+ for (var i = 0, node; node = nodes[i]; i++)
+ node._countedByPrototype = _true;
+ return nodes;
+ },
+
+ unmark: function(nodes) {
+ for (var i = 0, node; node = nodes[i]; i++)
+ node._countedByPrototype = undefined;
+ return nodes;
+ },
+
+ // mark each child node with its position (for nth calls)
+ // "ofType" flag indicates whether we're indexing for nth-of-type
+ // rather than nth-child
+ index: function(parentNode, reverse, ofType) {
+ parentNode._countedByPrototype = Prototype.emptyFunction;
+ if (reverse) {
+ for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) {
+ var node = nodes[i];
+ if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++;
+ }
+ } else {
+ for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
+ if (node.nodeType == 1 && (!ofType || node._countedByPrototype)) node.nodeIndex = j++;
+ }
+ },
+
+ // filters out duplicates and extends all nodes
+ unique: function(nodes) {
+ if (nodes.length == 0) return nodes;
+ var results = [], n;
+ for (var i = 0, l = nodes.length; i < l; i++)
+ if (!(n = nodes[i])._countedByPrototype) {
+ n._countedByPrototype = Prototype.emptyFunction;
+ results.push(Element.extend(n));
+ }
+ return Selector.handlers.unmark(results);
+ },
+
+ // COMBINATOR FUNCTIONS
+ descendant: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ h.concat(results, node.getElementsByTagName('*'));
+ return results;
+ },
+
+ child: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ for (var j = 0, child; child = node.childNodes[j]; j++)
+ if (child.nodeType == 1 && child.tagName != '!') results.push(child);
+ }
+ return results;
+ },
+
+ adjacent: function(nodes) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ var next = this.nextElementSibling(node);
+ if (next) results.push(next);
+ }
+ return results;
+ },
+
+ laterSibling: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ h.concat(results, Element.nextSiblings(node));
+ return results;
+ },
+
+ nextElementSibling: function(node) {
+ while (node = node.nextSibling)
+ if (node.nodeType == 1) return node;
+ return null;
+ },
+
+ previousElementSibling: function(node) {
+ while (node = node.previousSibling)
+ if (node.nodeType == 1) return node;
+ return null;
+ },
+
+ // TOKEN FUNCTIONS
+ tagName: function(nodes, root, tagName, combinator) {
+ var uTagName = tagName.toUpperCase();
+ var results = [], h = Selector.handlers;
+ if (nodes) {
+ if (combinator) {
+ // fastlane for ordinary descendant combinators
+ if (combinator == "descendant") {
+ for (var i = 0, node; node = nodes[i]; i++)
+ h.concat(results, node.getElementsByTagName(tagName));
+ return results;
+ } else nodes = this[combinator](nodes);
+ if (tagName == "*") return nodes;
+ }
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node.tagName.toUpperCase() === uTagName) results.push(node);
+ return results;
+ } else return root.getElementsByTagName(tagName);
+ },
+
+ id: function(nodes, root, id, combinator) {
+ var targetNode = $(id), h = Selector.handlers;
+ if (!targetNode) return [];
+ if (!nodes && root == document) return [targetNode];
+ if (nodes) {
+ if (combinator) {
+ if (combinator == 'child') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (targetNode.parentNode == node) return [targetNode];
+ } else if (combinator == 'descendant') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Element.descendantOf(targetNode, node)) return [targetNode];
+ } else if (combinator == 'adjacent') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Selector.handlers.previousElementSibling(targetNode) == node)
+ return [targetNode];
+ } else nodes = h[combinator](nodes);
+ }
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node == targetNode) return [targetNode];
+ return [];
+ }
+ return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
+ },
+
+ className: function(nodes, root, className, combinator) {
+ if (nodes && combinator) nodes = this[combinator](nodes);
+ return Selector.handlers.byClassName(nodes, root, className);
+ },
+
+ byClassName: function(nodes, root, className) {
+ if (!nodes) nodes = Selector.handlers.descendant([root]);
+ var needle = ' ' + className + ' ';
+ for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) {
+ nodeClassName = node.className;
+ if (nodeClassName.length == 0) continue;
+ if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle))
+ results.push(node);
+ }
+ return results;
+ },
+
+ attrPresence: function(nodes, root, attr, combinator) {
+ if (!nodes) nodes = root.getElementsByTagName("*");
+ if (nodes && combinator) nodes = this[combinator](nodes);
+ var results = [];
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Element.hasAttribute(node, attr)) results.push(node);
+ return results;
+ },
+
+ attr: function(nodes, root, attr, value, operator, combinator) {
+ if (!nodes) nodes = root.getElementsByTagName("*");
+ if (nodes && combinator) nodes = this[combinator](nodes);
+ var handler = Selector.operators[operator], results = [];
+ for (var i = 0, node; node = nodes[i]; i++) {
+ var nodeValue = Element.readAttribute(node, attr);
+ if (nodeValue === null) continue;
+ if (handler(nodeValue, value)) results.push(node);
+ }
+ return results;
+ },
+
+ pseudo: function(nodes, name, value, root, combinator) {
+ if (nodes && combinator) nodes = this[combinator](nodes);
+ if (!nodes) nodes = root.getElementsByTagName("*");
+ return Selector.pseudos[name](nodes, value, root);
+ }
+ },
+
+ pseudos: {
+ 'first-child': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ if (Selector.handlers.previousElementSibling(node)) continue;
+ results.push(node);
+ }
+ return results;
+ },
+ 'last-child': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ if (Selector.handlers.nextElementSibling(node)) continue;
+ results.push(node);
+ }
+ return results;
+ },
+ 'only-child': function(nodes, value, root) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!h.previousElementSibling(node) && !h.nextElementSibling(node))
+ results.push(node);
+ return results;
+ },
+ 'nth-child': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root);
+ },
+ 'nth-last-child': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, true);
+ },
+ 'nth-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, false, true);
+ },
+ 'nth-last-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, true, true);
+ },
+ 'first-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, "1", root, false, true);
+ },
+ 'last-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, "1", root, true, true);
+ },
+ 'only-of-type': function(nodes, formula, root) {
+ var p = Selector.pseudos;
+ return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root);
+ },
+
+ // handles the an+b logic
+ getIndices: function(a, b, total) {
+ if (a == 0) return b > 0 ? [b] : [];
+ return $R(1, total).inject([], function(memo, i) {
+ if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i);
+ return memo;
+ });
+ },
+
+ // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type
+ nth: function(nodes, formula, root, reverse, ofType) {
+ if (nodes.length == 0) return [];
+ if (formula == 'even') formula = '2n+0';
+ if (formula == 'odd') formula = '2n+1';
+ var h = Selector.handlers, results = [], indexed = [], m;
+ h.mark(nodes);
+ for (var i = 0, node; node = nodes[i]; i++) {
+ if (!node.parentNode._countedByPrototype) {
+ h.index(node.parentNode, reverse, ofType);
+ indexed.push(node.parentNode);
+ }
+ }
+ if (formula.match(/^\d+$/)) { // just a number
+ formula = Number(formula);
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node.nodeIndex == formula) results.push(node);
+ } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
+ if (m[1] == "-") m[1] = -1;
+ var a = m[1] ? Number(m[1]) : 1;
+ var b = m[2] ? Number(m[2]) : 0;
+ var indices = Selector.pseudos.getIndices(a, b, nodes.length);
+ for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
+ for (var j = 0; j < l; j++)
+ if (node.nodeIndex == indices[j]) results.push(node);
+ }
+ }
+ h.unmark(nodes);
+ h.unmark(indexed);
+ return results;
+ },
+
+ 'empty': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ // IE treats comments as element nodes
+ if (node.tagName == '!' || node.firstChild) continue;
+ results.push(node);
+ }
+ return results;
+ },
+
+ 'not': function(nodes, selector, root) {
+ var h = Selector.handlers, selectorType, m;
+ var exclusions = new Selector(selector).findElements(root);
+ h.mark(exclusions);
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!node._countedByPrototype) results.push(node);
+ h.unmark(exclusions);
+ return results;
+ },
+
+ 'enabled': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!node.disabled && (!node.type || node.type !== 'hidden'))
+ results.push(node);
+ return results;
+ },
+
+ 'disabled': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (node.disabled) results.push(node);
+ return results;
+ },
+
+ 'checked': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (node.checked) results.push(node);
+ return results;
+ }
+ },
+
+ operators: {
+ '=': function(nv, v) { return nv == v; },
+ '!=': function(nv, v) { return nv != v; },
+ '^=': function(nv, v) { return nv == v || nv && nv.startsWith(v); },
+ '$=': function(nv, v) { return nv == v || nv && nv.endsWith(v); },
+ '*=': function(nv, v) { return nv == v || nv && nv.include(v); },
+ '$=': function(nv, v) { return nv.endsWith(v); },
+ '*=': function(nv, v) { return nv.include(v); },
+ '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); },
+ '|=': function(nv, v) { return ('-' + (nv || "").toUpperCase() +
+ '-').include('-' + (v || "").toUpperCase() + '-'); }
+ },
+
+ split: function(expression) {
+ var expressions = [];
+ expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) {
+ expressions.push(m[1].strip());
+ });
+ return expressions;
+ },
+
+ matchElements: function(elements, expression) {
+ var matches = $$(expression), h = Selector.handlers;
+ h.mark(matches);
+ for (var i = 0, results = [], element; element = elements[i]; i++)
+ if (element._countedByPrototype) results.push(element);
+ h.unmark(matches);
+ return results;
+ },
+
+ findElement: function(elements, expression, index) {
+ if (Object.isNumber(expression)) {
+ index = expression; expression = false;
+ }
+ return Selector.matchElements(elements, expression || '*')[index || 0];
+ },
+
+ findChildElements: function(element, expressions) {
+ expressions = Selector.split(expressions.join(','));
+ var results = [], h = Selector.handlers;
+ for (var i = 0, l = expressions.length, selector; i < l; i++) {
+ selector = new Selector(expressions[i].strip());
+ h.concat(results, selector.findElements(element));
+ }
+ return (l > 1) ? h.unique(results) : results;
+ }
+});
+
+if (Prototype.Browser.IE) {
+ Object.extend(Selector.handlers, {
+ // IE returns comment nodes on getElementsByTagName("*").
+ // Filter them out.
+ concat: function(a, b) {
+ for (var i = 0, node; node = b[i]; i++)
+ if (node.tagName !== "!") a.push(node);
+ return a;
+ },
+
+ // IE improperly serializes _countedByPrototype in (inner|outer)HTML.
+ unmark: function(nodes) {
+ for (var i = 0, node; node = nodes[i]; i++)
+ node.removeAttribute('_countedByPrototype');
+ return nodes;
+ }
+ });
+}
+
+function $$() {
+ return Selector.findChildElements(document, $A(arguments));
+}
+var Form = {
+ reset: function(form) {
+ $(form).reset();
+ return form;
+ },
+
+ serializeElements: function(elements, options) {
+ if (typeof options != 'object') options = { hash: !!options };
+ else if (Object.isUndefined(options.hash)) options.hash = true;
+ var key, value, submitted = false, submit = options.submit;
+
+ var data = elements.inject({ }, function(result, element) {
+ if (!element.disabled && element.name) {
+ key = element.name; value = $(element).getValue();
+ if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
+ submit !== false && (!submit || key == submit) && (submitted = true)))) {
+ if (key in result) {
+ // a key is already present; construct an array of values
+ if (!Object.isArray(result[key])) result[key] = [result[key]];
+ result[key].push(value);
+ }
+ else result[key] = value;
+ }
+ }
+ return result;
+ });
+
+ return options.hash ? data : Object.toQueryString(data);
+ }
+};
+
+Form.Methods = {
+ serialize: function(form, options) {
+ return Form.serializeElements(Form.getElements(form), options);
+ },
+
+ getElements: function(form) {
+ return $A($(form).getElementsByTagName('*')).inject([],
+ function(elements, child) {
+ if (Form.Element.Serializers[child.tagName.toLowerCase()])
+ elements.push(Element.extend(child));
+ return elements;
+ }
+ );
+ },
+
+ getInputs: function(form, typeName, name) {
+ form = $(form);
+ var inputs = form.getElementsByTagName('input');
+
+ if (!typeName && !name) return $A(inputs).map(Element.extend);
+
+ for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
+ var input = inputs[i];
+ if ((typeName && input.type != typeName) || (name && input.name != name))
+ continue;
+ matchingInputs.push(Element.extend(input));
+ }
+
+ return matchingInputs;
+ },
+
+ disable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('disable');
+ return form;
+ },
+
+ enable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('enable');
+ return form;
+ },
+
+ findFirstElement: function(form) {
+ var elements = $(form).getElements().findAll(function(element) {
+ return 'hidden' != element.type && !element.disabled;
+ });
+ var firstByIndex = elements.findAll(function(element) {
+ return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
+ }).sortBy(function(element) { return element.tabIndex }).first();
+
+ return firstByIndex ? firstByIndex : elements.find(function(element) {
+ return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
+ });
+ },
+
+ focusFirstElement: function(form) {
+ form = $(form);
+ form.findFirstElement().activate();
+ return form;
+ },
+
+ request: function(form, options) {
+ form = $(form), options = Object.clone(options || { });
+
+ var params = options.parameters, action = form.readAttribute('action') || '';
+ if (action.blank()) action = window.location.href;
+ options.parameters = form.serialize(true);
+
+ if (params) {
+ if (Object.isString(params)) params = params.toQueryParams();
+ Object.extend(options.parameters, params);
+ }
+
+ if (form.hasAttribute('method') && !options.method)
+ options.method = form.method;
+
+ return new Ajax.Request(action, options);
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element = {
+ focus: function(element) {
+ $(element).focus();
+ return element;
+ },
+
+ select: function(element) {
+ $(element).select();
+ return element;
+ }
+};
+
+Form.Element.Methods = {
+ serialize: function(element) {
+ element = $(element);
+ if (!element.disabled && element.name) {
+ var value = element.getValue();
+ if (value != undefined) {
+ var pair = { };
+ pair[element.name] = value;
+ return Object.toQueryString(pair);
+ }
+ }
+ return '';
+ },
+
+ getValue: function(element) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ return Form.Element.Serializers[method](element);
+ },
+
+ setValue: function(element, value) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ Form.Element.Serializers[method](element, value);
+ return element;
+ },
+
+ clear: function(element) {
+ $(element).value = '';
+ return element;
+ },
+
+ present: function(element) {
+ return $(element).value != '';
+ },
+
+ activate: function(element) {
+ element = $(element);
+ try {
+ element.focus();
+ if (element.select && (element.tagName.toLowerCase() != 'input' ||
+ !['button', 'reset', 'submit'].include(element.type)))
+ element.select();
+ } catch (e) { }
+ return element;
+ },
+
+ disable: function(element) {
+ element = $(element);
+ element.disabled = true;
+ return element;
+ },
+
+ enable: function(element) {
+ element = $(element);
+ element.disabled = false;
+ return element;
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+var Field = Form.Element;
+var $F = Form.Element.Methods.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element.Serializers = {
+ input: function(element, value) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ return Form.Element.Serializers.inputSelector(element, value);
+ default:
+ return Form.Element.Serializers.textarea(element, value);
+ }
+ },
+
+ inputSelector: function(element, value) {
+ if (Object.isUndefined(value)) return element.checked ? element.value : null;
+ else element.checked = !!value;
+ },
+
+ textarea: function(element, value) {
+ if (Object.isUndefined(value)) return element.value;
+ else element.value = value;
+ },
+
+ select: function(element, value) {
+ if (Object.isUndefined(value))
+ return this[element.type == 'select-one' ?
+ 'selectOne' : 'selectMany'](element);
+ else {
+ var opt, currentValue, single = !Object.isArray(value);
+ for (var i = 0, length = element.length; i < length; i++) {
+ opt = element.options[i];
+ currentValue = this.optionValue(opt);
+ if (single) {
+ if (currentValue == value) {
+ opt.selected = true;
+ return;
+ }
+ }
+ else opt.selected = value.include(currentValue);
+ }
+ }
+ },
+
+ selectOne: function(element) {
+ var index = element.selectedIndex;
+ return index >= 0 ? this.optionValue(element.options[index]) : null;
+ },
+
+ selectMany: function(element) {
+ var values, length = element.length;
+ if (!length) return null;
+
+ for (var i = 0, values = []; i < length; i++) {
+ var opt = element.options[i];
+ if (opt.selected) values.push(this.optionValue(opt));
+ }
+ return values;
+ },
+
+ optionValue: function(opt) {
+ // extend element because hasAttribute may not be native
+ return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
+ initialize: function($super, element, frequency, callback) {
+ $super(callback, frequency);
+ this.element = $(element);
+ this.lastValue = this.getValue();
+ },
+
+ execute: function() {
+ var value = this.getValue();
+ if (Object.isString(this.lastValue) && Object.isString(value) ?
+ this.lastValue != value : String(this.lastValue) != String(value)) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ }
+});
+
+Form.Element.Observer = Class.create(Abstract.TimedObserver, {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.Observer = Class.create(Abstract.TimedObserver, {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = Class.create({
+ initialize: function(element, callback) {
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ if (this.element.tagName.toLowerCase() == 'form')
+ this.registerFormCallbacks();
+ else
+ this.registerCallback(this.element);
+ },
+
+ onElementEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ },
+
+ registerFormCallbacks: function() {
+ Form.getElements(this.element).each(this.registerCallback, this);
+ },
+
+ registerCallback: function(element) {
+ if (element.type) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ Event.observe(element, 'click', this.onElementEvent.bind(this));
+ break;
+ default:
+ Event.observe(element, 'change', this.onElementEvent.bind(this));
+ break;
+ }
+ }
+ }
+});
+
+Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.EventObserver = Class.create(Abstract.EventObserver, {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+if (!window.Event) var Event = { };
+
+Object.extend(Event, {
+ KEY_BACKSPACE: 8,
+ KEY_TAB: 9,
+ KEY_RETURN: 13,
+ KEY_ESC: 27,
+ KEY_LEFT: 37,
+ KEY_UP: 38,
+ KEY_RIGHT: 39,
+ KEY_DOWN: 40,
+ KEY_DELETE: 46,
+ KEY_HOME: 36,
+ KEY_END: 35,
+ KEY_PAGEUP: 33,
+ KEY_PAGEDOWN: 34,
+ KEY_INSERT: 45,
+
+ cache: { },
+
+ relatedTarget: function(event) {
+ var element;
+ switch(event.type) {
+ case 'mouseover': element = event.fromElement; break;
+ case 'mouseout': element = event.toElement; break;
+ default: return null;
+ }
+ return Element.extend(element);
+ }
+});
+
+Event.Methods = (function() {
+ var isButton;
+
+ if (Prototype.Browser.IE) {
+ var buttonMap = { 0: 1, 1: 4, 2: 2 };
+ isButton = function(event, code) {
+ return event.button == buttonMap[code];
+ };
+
+ } else if (Prototype.Browser.WebKit) {
+ isButton = function(event, code) {
+ switch (code) {
+ case 0: return event.which == 1 && !event.metaKey;
+ case 1: return event.which == 1 && event.metaKey;
+ default: return false;
+ }
+ };
+
+ } else {
+ isButton = function(event, code) {
+ return event.which ? (event.which === code + 1) : (event.button === code);
+ };
+ }
+
+ return {
+ isLeftClick: function(event) { return isButton(event, 0) },
+ isMiddleClick: function(event) { return isButton(event, 1) },
+ isRightClick: function(event) { return isButton(event, 2) },
+
+ element: function(event) {
+ event = Event.extend(event);
+
+ var node = event.target,
+ type = event.type,
+ currentTarget = event.currentTarget;
+
+ if (currentTarget && currentTarget.tagName) {
+ // Firefox screws up the "click" event when moving between radio buttons
+ // via arrow keys. It also screws up the "load" and "error" events on images,
+ // reporting the document as the target instead of the original image.
+ if (type === 'load' || type === 'error' ||
+ (type === 'click' && currentTarget.tagName.toLowerCase() === 'input'
+ && currentTarget.type === 'radio'))
+ node = currentTarget;
+ }
+ if (node.nodeType == Node.TEXT_NODE) node = node.parentNode;
+ return Element.extend(node);
+ },
+
+ findElement: function(event, expression) {
+ var element = Event.element(event);
+ if (!expression) return element;
+ var elements = [element].concat(element.ancestors());
+ return Selector.findElement(elements, expression, 0);
+ },
+
+ pointer: function(event) {
+ var docElement = document.documentElement,
+ body = document.body || { scrollLeft: 0, scrollTop: 0 };
+ return {
+ x: event.pageX || (event.clientX +
+ (docElement.scrollLeft || body.scrollLeft) -
+ (docElement.clientLeft || 0)),
+ y: event.pageY || (event.clientY +
+ (docElement.scrollTop || body.scrollTop) -
+ (docElement.clientTop || 0))
+ };
+ },
+
+ pointerX: function(event) { return Event.pointer(event).x },
+ pointerY: function(event) { return Event.pointer(event).y },
+
+ stop: function(event) {
+ Event.extend(event);
+ event.preventDefault();
+ event.stopPropagation();
+ event.stopped = true;
+ }
+ };
+})();
+
+Event.extend = (function() {
+ var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
+ m[name] = Event.Methods[name].methodize();
+ return m;
+ });
+
+ if (Prototype.Browser.IE) {
+ Object.extend(methods, {
+ stopPropagation: function() { this.cancelBubble = true },
+ preventDefault: function() { this.returnValue = false },
+ inspect: function() { return "[object Event]" }
+ });
+
+ return function(event) {
+ if (!event) return false;
+ if (event._extendedByPrototype) return event;
+
+ event._extendedByPrototype = Prototype.emptyFunction;
+ var pointer = Event.pointer(event);
+ Object.extend(event, {
+ target: event.srcElement,
+ relatedTarget: Event.relatedTarget(event),
+ pageX: pointer.x,
+ pageY: pointer.y
+ });
+ return Object.extend(event, methods);
+ };
+
+ } else {
+ Event.prototype = Event.prototype || document.createEvent("HTMLEvents")['__proto__'];
+ Object.extend(Event.prototype, methods);
+ return Prototype.K;
+ }
+})();
+
+Object.extend(Event, (function() {
+ var cache = Event.cache;
+
+ function getEventID(element) {
+ if (element._prototypeEventID) return element._prototypeEventID[0];
+ arguments.callee.id = arguments.callee.id || 1;
+ return element._prototypeEventID = [++arguments.callee.id];
+ }
+
+ function getDOMEventName(eventName) {
+ if (eventName && eventName.include(':')) return "dataavailable";
+ return eventName;
+ }
+
+ function getCacheForID(id) {
+ return cache[id] = cache[id] || { };
+ }
+
+ function getWrappersForEventName(id, eventName) {
+ var c = getCacheForID(id);
+ return c[eventName] = c[eventName] || [];
+ }
+
+ function createWrapper(element, eventName, handler) {
+ var id = getEventID(element);
+ var c = getWrappersForEventName(id, eventName);
+ if (c.pluck("handler").include(handler)) return false;
+
+ var wrapper = function(event) {
+ if (!Event || !Event.extend ||
+ (event.eventName && event.eventName != eventName))
+ return false;
+
+ Event.extend(event);
+ handler.call(element, event);
+ };
+
+ wrapper.handler = handler;
+ c.push(wrapper);
+ return wrapper;
+ }
+
+ function findWrapper(id, eventName, handler) {
+ var c = getWrappersForEventName(id, eventName);
+ return c.find(function(wrapper) { return wrapper.handler == handler });
+ }
+
+ function destroyWrapper(id, eventName, handler) {
+ var c = getCacheForID(id);
+ if (!c[eventName]) return false;
+ c[eventName] = c[eventName].without(findWrapper(id, eventName, handler));
+ }
+
+ function destroyCache() {
+ for (var id in cache)
+ for (var eventName in cache[id])
+ cache[id][eventName] = null;
+ }
+
+
+ // Internet Explorer needs to remove event handlers on page unload
+ // in order to avoid memory leaks.
+ if (window.attachEvent) {
+ window.attachEvent("onunload", destroyCache);
+ }
+
+ // Safari has a dummy event handler on page unload so that it won't
+ // use its bfcache. Safari <= 3.1 has an issue with restoring the "document"
+ // object when page is returned to via the back button using its bfcache.
+ if (Prototype.Browser.WebKit) {
+ window.addEventListener('unload', Prototype.emptyFunction, false);
+ }
+
+ return {
+ observe: function(element, eventName, handler) {
+ element = $(element);
+ var name = getDOMEventName(eventName);
+
+ var wrapper = createWrapper(element, eventName, handler);
+ if (!wrapper) return element;
+
+ if (element.addEventListener) {
+ element.addEventListener(name, wrapper, false);
+ } else {
+ element.attachEvent("on" + name, wrapper);
+ }
+
+ return element;
+ },
+
+ stopObserving: function(element, eventName, handler) {
+ element = $(element);
+ var id = getEventID(element), name = getDOMEventName(eventName);
+
+ if (!handler && eventName) {
+ getWrappersForEventName(id, eventName).each(function(wrapper) {
+ element.stopObserving(eventName, wrapper.handler);
+ });
+ return element;
+
+ } else if (!eventName) {
+ Object.keys(getCacheForID(id)).each(function(eventName) {
+ element.stopObserving(eventName);
+ });
+ return element;
+ }
+
+ var wrapper = findWrapper(id, eventName, handler);
+ if (!wrapper) return element;
+
+ if (element.removeEventListener) {
+ element.removeEventListener(name, wrapper, false);
+ } else {
+ element.detachEvent("on" + name, wrapper);
+ }
+
+ destroyWrapper(id, eventName, handler);
+
+ return element;
+ },
+
+ fire: function(element, eventName, memo) {
+ element = $(element);
+ if (element == document && document.createEvent && !element.dispatchEvent)
+ element = document.documentElement;
+
+ var event;
+ if (document.createEvent) {
+ event = document.createEvent("HTMLEvents");
+ event.initEvent("dataavailable", true, true);
+ } else {
+ event = document.createEventObject();
+ event.eventType = "ondataavailable";
+ }
+
+ event.eventName = eventName;
+ event.memo = memo || { };
+
+ if (document.createEvent) {
+ element.dispatchEvent(event);
+ } else {
+ element.fireEvent(event.eventType, event);
+ }
+
+ return Event.extend(event);
+ }
+ };
+})());
+
+Object.extend(Event, Event.Methods);
+
+Element.addMethods({
+ fire: Event.fire,
+ observe: Event.observe,
+ stopObserving: Event.stopObserving
+});
+
+Object.extend(document, {
+ fire: Element.Methods.fire.methodize(),
+ observe: Element.Methods.observe.methodize(),
+ stopObserving: Element.Methods.stopObserving.methodize(),
+ loaded: false
+});
+
+(function() {
+ /* Support for the DOMContentLoaded event is based on work by Dan Webb,
+ Matthias Miller, Dean Edwards and John Resig. */
+
+ var timer;
+
+ function fireContentLoadedEvent() {
+ if (document.loaded) return;
+ if (timer) window.clearInterval(timer);
+ document.fire("dom:loaded");
+ document.loaded = true;
+ }
+
+ if (document.addEventListener) {
+ if (Prototype.Browser.WebKit) {
+ timer = window.setInterval(function() {
+ if (/loaded|complete/.test(document.readyState))
+ fireContentLoadedEvent();
+ }, 0);
+
+ Event.observe(window, "load", fireContentLoadedEvent);
+
+ } else {
+ document.addEventListener("DOMContentLoaded",
+ fireContentLoadedEvent, false);
+ }
+
+ } else {
+ document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");
+ $("__onDOMContentLoaded").onreadystatechange = function() {
+ if (this.readyState == "complete") {
+ this.onreadystatechange = null;
+ fireContentLoadedEvent();
+ }
+ };
+ }
+})();
+/*------------------------------- DEPRECATED -------------------------------*/
+
+Hash.toQueryString = Object.toQueryString;
+
+var Toggle = { display: Element.toggle };
+
+Element.Methods.childOf = Element.Methods.descendantOf;
+
+var Insertion = {
+ Before: function(element, content) {
+ return Element.insert(element, {before:content});
+ },
+
+ Top: function(element, content) {
+ return Element.insert(element, {top:content});
+ },
+
+ Bottom: function(element, content) {
+ return Element.insert(element, {bottom:content});
+ },
+
+ After: function(element, content) {
+ return Element.insert(element, {after:content});
+ }
+};
+
+var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
+
+// This should be moved to script.aculo.us; notice the deprecated methods
+// further below, that map to the newer Element methods.
+var Position = {
+ // set to true if needed, warning: firefox performance problems
+ // NOT neeeded for page scrolling, only if draggable contained in
+ // scrollable elements
+ includeScrollOffsets: false,
+
+ // must be called before calling withinIncludingScrolloffset, every time the
+ // page is scrolled
+ prepare: function() {
+ this.deltaX = window.pageXOffset
+ || document.documentElement.scrollLeft
+ || document.body.scrollLeft
+ || 0;
+ this.deltaY = window.pageYOffset
+ || document.documentElement.scrollTop
+ || document.body.scrollTop
+ || 0;
+ },
+
+ // caches x/y coordinate pair to use with overlap
+ within: function(element, x, y) {
+ if (this.includeScrollOffsets)
+ return this.withinIncludingScrolloffsets(element, x, y);
+ this.xcomp = x;
+ this.ycomp = y;
+ this.offset = Element.cumulativeOffset(element);
+
+ return (y >= this.offset[1] &&
+ y < this.offset[1] + element.offsetHeight &&
+ x >= this.offset[0] &&
+ x < this.offset[0] + element.offsetWidth);
+ },
+
+ withinIncludingScrolloffsets: function(element, x, y) {
+ var offsetcache = Element.cumulativeScrollOffset(element);
+
+ this.xcomp = x + offsetcache[0] - this.deltaX;
+ this.ycomp = y + offsetcache[1] - this.deltaY;
+ this.offset = Element.cumulativeOffset(element);
+
+ return (this.ycomp >= this.offset[1] &&
+ this.ycomp < this.offset[1] + element.offsetHeight &&
+ this.xcomp >= this.offset[0] &&
+ this.xcomp < this.offset[0] + element.offsetWidth);
+ },
+
+ // within must be called directly before
+ overlap: function(mode, element) {
+ if (!mode) return 0;
+ if (mode == 'vertical')
+ return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
+ element.offsetHeight;
+ if (mode == 'horizontal')
+ return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
+ element.offsetWidth;
+ },
+
+ // Deprecation layer -- use newer Element methods now (1.5.2).
+
+ cumulativeOffset: Element.Methods.cumulativeOffset,
+
+ positionedOffset: Element.Methods.positionedOffset,
+
+ absolutize: function(element) {
+ Position.prepare();
+ return Element.absolutize(element);
+ },
+
+ relativize: function(element) {
+ Position.prepare();
+ return Element.relativize(element);
+ },
+
+ realOffset: Element.Methods.cumulativeScrollOffset,
+
+ offsetParent: Element.Methods.getOffsetParent,
+
+ page: Element.Methods.viewportOffset,
+
+ clone: function(source, target, options) {
+ options = options || { };
+ return Element.clonePosition(target, source, options);
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
+ function iter(name) {
+ return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
+ }
+
+ instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
+ function(element, className) {
+ className = className.toString().strip();
+ var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
+ return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
+ } : function(element, className) {
+ className = className.toString().strip();
+ var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
+ if (!classNames && !className) return elements;
+
+ var nodes = $(element).getElementsByTagName('*');
+ className = ' ' + className + ' ';
+
+ for (var i = 0, child, cn; child = nodes[i]; i++) {
+ if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
+ (classNames && classNames.all(function(name) {
+ return !name.toString().blank() && cn.include(' ' + name + ' ');
+ }))))
+ elements.push(Element.extend(child));
+ }
+ return elements;
+ };
+
+ return function(className, parentElement) {
+ return $(parentElement || document.body).getElementsByClassName(className);
+ };
+}(Element.Methods);
+
+/*--------------------------------------------------------------------------*/
+
+Element.ClassNames = Class.create();
+Element.ClassNames.prototype = {
+ initialize: function(element) {
+ this.element = $(element);
+ },
+
+ _each: function(iterator) {
+ this.element.className.split(/\s+/).select(function(name) {
+ return name.length > 0;
+ })._each(iterator);
+ },
+
+ set: function(className) {
+ this.element.className = className;
+ },
+
+ add: function(classNameToAdd) {
+ if (this.include(classNameToAdd)) return;
+ this.set($A(this).concat(classNameToAdd).join(' '));
+ },
+
+ remove: function(classNameToRemove) {
+ if (!this.include(classNameToRemove)) return;
+ this.set($A(this).without(classNameToRemove).join(' '));
+ },
+
+ toString: function() {
+ return $A(this).join(' ');
+ }
+};
+
+Object.extend(Element.ClassNames.prototype, Enumerable);
+
+/*--------------------------------------------------------------------------*/
+
+Element.addMethods(); \ No newline at end of file
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/raptor.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/raptor.js
new file mode 100644
index 000000000..a13e77c80
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/raptor.js
@@ -0,0 +1,314 @@
+function grayOut(vis, options) {
+ // Pass true to gray out screen, false to ungray
+ // options are optional. This is a JSON object with the following (optional) properties
+ // opacity:0-100 // Lower number = less grayout higher = more of a blackout
+ // zindex: # // HTML elements with a higher zindex appear on top of the gray out
+ // bgcolor: (#xxxxxx) // Standard RGB Hex color code
+ // grayOut(true, {'zindex':'50', 'bgcolor':'#0000FF', 'opacity':'70'});
+ // Because options is JSON opacity/zindex/bgcolor are all optional and can appear
+ // in any order. Pass only the properties you need to set.
+ var options = options || {};
+ var zindex = options.zindex || 50;
+ var opacity = options.opacity || 20;
+ var opaque = (opacity / 100);
+ var bgcolor = options.bgcolor || '#000000';
+ var dark=document.getElementById('darkenScreenObject');
+ //var tbody = document.getElementsByTagName("body")[0];
+ var tbody = document.body;
+ var myAjax = document.getElementById('AjaxLoading');
+
+ if (!dark) {
+ // The dark layer doesn't exist, it's never been created. So we'll
+ // create it here and apply some basic styles.
+ // If you are getting errors in IE see: http://support.microsoft.com/default.aspx/kb/927917
+ var tnode = document.createElement('div'); // Create the layer.
+ tnode.style.position='absolute'; // Position absolutely
+ tnode.style.top='0px'; // In the top
+ tnode.style.left='0px'; // Left corner of the page
+ tnode.style.overflow='hidden'; // Try to avoid making scroll bars
+ tnode.style.display='none'; // Start out Hidden
+ tnode.id='darkenScreenObject'; // Name it so we can find it later
+ tbody.appendChild(tnode); // Add it to the web page
+ dark=document.getElementById('darkenScreenObject'); // Get the object.
+ }
+ if (vis) {
+ // Calculate the page width and height
+ if( document.body && ( document.body.scrollWidth || document.body.scrollHeight ) ) {
+ var pageWidth = document.body.scrollWidth+'px';
+ var pageHeight = document.body.scrollHeight+'px';
+ } else if( document.body.offsetWidth ) {
+ var pageWidth = document.body.offsetWidth+'px';
+ var pageHeight = document.body.offsetHeight+'px';
+ } else {
+ var pageWidth='100%';
+ var pageHeight='100%';
+ }
+ //set the shader to cover the entire page and make it visible.
+ dark.style.opacity=opaque;
+ dark.style.MozOpacity=opaque;
+ dark.style.filter='alpha(opacity='+opacity+')';
+ dark.style.zIndex=zindex;
+ dark.style.backgroundColor=bgcolor;
+ dark.style.width= pageWidth;
+ dark.style.height= pageHeight;
+ dark.style.display='block';
+ //MyAjax
+
+ /* Display the "Loading" box */
+ var tnode = document.createElement('div'); // Create the layer.
+ tnode.style.position='absolute'; // Position absolutely
+ tnode.style.top='0px'; // In the top
+ tnode.style.left='0px'; // Left corner of the page
+ tnode.style.overflow='hidden'; // Try to avoid making scroll bars
+ tnode.style.display='none'; // Start out Hidden
+ tnode.id='AjaxLoading'; // Name it so we can find it later
+ tbody.appendChild(tnode); // Add it to the web page
+ myAjax=document.getElementById('AjaxLoading'); // Get the object.
+
+ // Content
+ // Reset the opacity options. Want this on top
+ var loadingOptions = loadingOptions || {};
+ var zindex = loadingOptions.zindex || 100;
+ var opacity = loadingOptions.opacity || 100;
+ var opaque = (opacity / 100);
+ var bgcolor = loadingOptions.bgcolor || '#FFFFFF';
+
+ myAjax.style.opacity=opaque;
+ myAjax.style.MozOpacity=opaque;
+ myAjax.style.filter='alpha(opacity='+opacity+')';
+ myAjax.style.zIndex=zindex;
+
+ myAjax.style.height= '40px';
+ myAjax.style.padding = '3px';
+ myAjax.style.fontSize = '14px';
+ myAjax.style.width = '100px';
+ myAjax.style.textAlign = 'center';
+ myAjax.style.left = '45%';
+ myAjax.style.top = '5%';
+ myAjax.style.position = 'absolute';
+ myAjax.style.border = '2px solid #666';
+ myAjax.style.backgroundColor = bgcolor;
+
+ myAjax.innerHTML='Loading <img src="static/fusion/raptor/images/progress.gif" id="wait" />';
+ myAjax.style.display='block';
+
+ } else {
+ if(dark) dark.style.display='none';
+ if(myAjax) myAjax.style.display='none';
+ }
+}
+function checkDate(dateStr, isOptional) {
+ if(dateStr.charAt(0) == '[' && dateStr.charAt(dateStr.length-1) == ']')
+ return true;
+ if(dateStr=="")
+ return isOptional;
+
+ if((dateStr.length<6)||(dateStr.length>10))
+ return false;
+
+ if(dateStr.charAt(1)=='/') {
+ dmonth = parseInt(dateStr.substr(0,1));
+ dateStr = dateStr.substr(2,dateStr.length-2);
+ } else {
+ //For some strange reason "08" is parsed as 0, so I remove leading 0-s
+ if(dateStr.charAt(0)=='0')
+ dmonth = parseInt(dateStr.substr(1,1));
+ else
+ dmonth = parseInt(dateStr.substr(0,2));
+ dateStr = dateStr.substr(3,dateStr.length-3);
+ }
+
+ if(dateStr.charAt(1)=='/') {
+ dday = parseInt(dateStr.substr(0,1));
+ dateStr = dateStr.substr(2,dateStr.length-2);
+ } else {
+ //For some strange reason "08" is parsed as 0, so I remove leading 0-s
+ if(dateStr.charAt(0)=='0')
+ dday = parseInt(dateStr.substr(1,1));
+ else
+ dday = parseInt(dateStr.substr(0,2));
+ dateStr = dateStr.substr(3,dateStr.length-3);
+ }
+
+ if(dateStr.length==2) {
+ if (parseInt(dateStr)>50)
+ dateStr="19"+dateStr;
+ else
+ dateStr="20"+dateStr;
+ }
+ dyear = parseInt(dateStr);
+ //alert("day: "+dday+", month: "+dmonth+", year: "+dyear);
+ if((dyear<1990)||(dyear>2090)||(dmonth<1)||(dmonth>12)||(dday<1)||
+ (dday>((dmonth==2)?(((dyear % 4 == 0) && ((!(dyear % 100 == 0))||(dyear % 400 == 0)))?29:28):(((dmonth==1)||(dmonth==3)||(dmonth==5)||(dmonth==7)||(dmonth==8)||(dmonth==10)||(dmonth==12))?31:30))))
+ return false;
+
+ return true;
+} // checkDate
+
+function validateNumber(numValue, mustBeInteger, mustBePositive) {
+ var decimalPointFound = false;
+ for(var i=0; i<numValue.length; i++) {
+ var ch = numValue.charAt(i);
+
+ if(ch=='0'||ch=='1'||ch=='2'||ch=='3'||ch=='4'||ch=='5'||ch=='6'||ch=='7'||ch=='8'||ch=='9') {
+ // Valid character - do nothing
+ } else if(ch=='-') {
+ if(mustBePositive||i>0)
+ return false;
+ } else if(ch=='.') {
+ if(mustBeInteger||decimalPointFound)
+ return false;
+ else
+ decimalPointFound = true;
+ } else
+ // Invalid character
+ return false;
+ } // for
+
+ return true;
+} // validateNumber
+
+function checkInteger(numValue) {
+ return validateNumber(numValue, true, false);
+} // checkInteger
+
+function checkNonNegativeInteger(numValue) {
+ return validateNumber(numValue, true, true);
+} // checkNonNegativeInteger
+
+function checkPositiveInteger(numValue) {
+ if(! checkNonNegativeInteger(numValue))
+ return false;
+
+ if(parseInt(numValue)==0)
+ return false;
+
+ return true;
+} // checkPositiveInteger
+
+function checkFloat(numValue) {
+ return validateNumber(numValue, false, false);
+} // checkFloat
+
+function checkNonNegativeFloat(numValue) {
+ return validateNumber(numValue, false, true);
+} // checkNonNegativeFloat
+
+function checkPositiveFloat(numValue) {
+ if(! checkNonNegativeFloat(numValue))
+ return false;
+
+ if(parseFloat(numValue)<0.001&&parseFloat(numValue)>-0.001)
+ return false;
+
+ return true;
+} // checkPositiveFloat
+
+function getDocHeight(doc) {
+var docHt = 0, sh, oh;
+if (doc.height) docHt = doc.height;
+else if (doc.body) {
+if (doc.body.scrollHeight) docHt = sh = doc.body.scrollHeight;
+if (doc.body.offsetHeight) docHt = oh = doc.body.offsetHeight;
+if (sh && oh) docHt = Math.max(sh, oh);
+}
+return docHt;
+}
+
+function getDocWidth(doc)
+{
+ var docWd = 0, sh, oh;
+ if (doc.width)
+ docWd = doc.width;
+ else if (doc.body)
+ {
+ if (doc.body.scrollWidth)
+ docWd = sh = doc.body.scrollWidth;
+ if (doc.body.offsetWidth)
+ docWd = oh = doc.body.offsetWidth;
+ if (sh && oh)
+ docWd = Math.max(sh, oh);
+ }
+ return docWd;
+}
+
+
+function setIframeHeight(iframeName)
+{
+ var oldY = document.body.scrollTop;
+ var iframeWin = window.frames[iframeName];
+ var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
+ if ( iframeEl && iframeWin ) {
+ iframeEl.style.height = "auto";
+ // helps resize (for some) if new doc shorter than previous
+ var docHt = getDocHeight(iframeWin.document);
+ var docWd = getDocWidth(iframeWin.document);
+ // need to add to height to be sure it will all show
+ if (docHt)
+ iframeEl.style.height = docHt + 1 + "px";
+ if (docWd)
+ iframeEl.style.width = docWd + 1 + "px";
+ }
+ if (oldY != null && oldY != 'undefined')
+ document.body.scrollTop = oldY;
+}
+
+function resizeFrames(){
+ var isFolderAllowed = arguments[0];
+ if (isFolderAllowed == null || isFolderAllowed == 'true'){
+ if (document.getElementById('scrollableTable') && document.body.offsetHeight > 195)
+ document.getElementById('scrollableTable').style.height=document.body.offsetHeight - 185;
+ if (document.getElementById('contentDiv') && document.body.offsetHeight > 145)
+ document.getElementById('contentDiv').style.height=document.body.offsetHeight - 135;
+ if (document.getElementById('content_Iframe') && document.body.offsetHeight > 145)
+ document.getElementById('content_Iframe').height=document.body.offsetHeight - 135;
+
+ }else{
+ setIframeHeight('content_Iframe');
+ }
+}
+
+function resizeWindow() {
+ var isFolderAllowed = arguments[0];
+ if (isFolderAllowed != null)
+ resizeFrames(isFolderAllowed);
+ else
+ resizeFrames(false);
+}
+
+/**
+* Usage : var myObje = $('theIdOfTheElementYouWantToGet');
+* Simple gives you the element. Avoids using document.getElementById();
+*/
+ var $;
+ if (!$ && document.getElementById) {
+ $ = function() {
+ var elements = new Array();
+ for (var i = 0; i < arguments.length; i++) {
+ var element = arguments[i];
+ if (typeof element == 'string') {
+ element = document.getElementById(element);
+ }
+ if (arguments.length == 1) {
+ return element;
+ }
+ elements.push(element);
+ }
+ return elements;
+ }
+ } else if (!$ && document.all) {
+ $ = function() {
+ var elements = new Array();
+ for (var i = 0; i < arguments.length; i++) {
+ var element = arguments[i];
+ if (typeof element == 'string') {
+ element = document.all[element];
+ }
+ if (arguments.length == 1) {
+ return element;
+ }
+ elements.push(element);
+ }
+ return elements;
+ }
+ }
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/rounded-corners.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/rounded-corners.js
new file mode 100644
index 000000000..f5df01ce0
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/rounded-corners.js
@@ -0,0 +1,353 @@
+/************************************************************************************************************<br>
+<br>
+ @fileoverview
+ Rounded corners class<br>
+ (C) www.dhtmlgoodies.com, September 2006<br>
+ <br>
+ This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website. <br>
+ <br>
+ Terms of use:<br>
+ Look at the terms of use at http://www.dhtmlgoodies.com/index.html?page=termsOfUse<br>
+ <br>
+ Thank you!<br>
+ <br>
+ www.dhtmlgoodies.com<br>
+ Alf Magne Kalleland<br>
+<br>
+************************************************************************************************************/
+
+// {{{ Constructor
+function DHTMLgoodies_roundedCorners()
+{
+ var roundedCornerTargets;
+
+ this.roundedCornerTargets = new Array();
+
+}
+ var string = '';
+// }}}
+DHTMLgoodies_roundedCorners.prototype = {
+
+ // {{{ addTarget()
+ /**
+ *
+ *
+ * Add rounded corners to an element
+ *
+ * @param String divId = Id of element on page. Example "leftColumn" for &lt;div id="leftColumn">
+ * @param Int xRadius = Y radius of rounded corners, example 10
+ * @param Int yRadius = Y radius of rounded corners, example 10
+ * @param String color = Background color of element, example #FFF or #AABBCC
+ * @param String color = backgroundColor color of element "behind", example #FFF or #AABBCC
+ * @param Int padding = Padding of content - This will be added as left and right padding(not top and bottom)
+ * @param String heightOfContent = Optional argument. You can specify a fixed height of your content. example "15" which means pixels, or "50%".
+ * @param String whichCorners = Optional argument. Commaseparated list of corners, example "top_left,top_right,bottom_left"
+ *
+ * @public
+ */
+ addTarget : function(divId,xRadius,yRadius,color,backgroundColor,padding,heightOfContent,whichCorners)
+ {
+ var index = this.roundedCornerTargets.length;
+ this.roundedCornerTargets[index] = new Array();
+ this.roundedCornerTargets[index]['divId'] = divId;
+ this.roundedCornerTargets[index]['xRadius'] = xRadius;
+ this.roundedCornerTargets[index]['yRadius'] = yRadius;
+ this.roundedCornerTargets[index]['color'] = color;
+ this.roundedCornerTargets[index]['backgroundColor'] = backgroundColor;
+ this.roundedCornerTargets[index]['padding'] = padding;
+ this.roundedCornerTargets[index]['heightOfContent'] = heightOfContent;
+ this.roundedCornerTargets[index]['whichCorners'] = whichCorners;
+
+ }
+ // }}}
+ ,
+ // {{{ init()
+ /**
+ *
+ *
+ * Initializes the script
+ *
+ *
+ * @public
+ */
+ init : function()
+ {
+
+ for(var targetCounter=0;targetCounter < this.roundedCornerTargets.length;targetCounter++){
+
+ // Creating local variables of each option
+ whichCorners = this.roundedCornerTargets[targetCounter]['whichCorners'];
+ divId = this.roundedCornerTargets[targetCounter]['divId'];
+ xRadius = this.roundedCornerTargets[targetCounter]['xRadius'];
+ yRadius = this.roundedCornerTargets[targetCounter]['yRadius'];
+ color = this.roundedCornerTargets[targetCounter]['color'];
+ backgroundColor = this.roundedCornerTargets[targetCounter]['backgroundColor'];
+ padding = this.roundedCornerTargets[targetCounter]['padding'];
+ heightOfContent = this.roundedCornerTargets[targetCounter]['heightOfContent'];
+ whichCorners = this.roundedCornerTargets[targetCounter]['whichCorners'];
+
+ // Which corners should we add rounded corners to?
+ var cornerArray = new Array();
+ if(!whichCorners || whichCorners=='all'){
+ cornerArray['top_left'] = true;
+ cornerArray['top_right'] = true;
+ cornerArray['bottom_left'] = true;
+ cornerArray['bottom_right'] = true;
+ }else{
+ cornerArray = whichCorners.split(/,/gi);
+ for(var prop in cornerArray)cornerArray[cornerArray[prop]] = true;
+ }
+
+
+ var factorX = xRadius/yRadius; // How big is x radius compared to y radius
+
+ var obj = document.getElementById(divId); // Creating reference to element
+ obj.style.backgroundColor=null; // Setting background color blank
+ obj.style.backgroundColor='transparent';
+ var content = obj.innerHTML; // Saving HTML content of this element
+ obj.innerHTML = ''; // Setting HTML content of element blank-
+
+
+
+
+ // Adding top corner div.
+
+ if(cornerArray['top_left'] || cornerArray['top_right']){
+ var topBar_container = document.createElement('DIV');
+ topBar_container.style.height = yRadius + 'px';
+ topBar_container.style.overflow = 'hidden';
+
+ obj.appendChild(topBar_container);
+ var currentAntialiasSize = 0;
+ var savedRestValue = 0;
+
+ for(no=1;no<=yRadius;no++){
+ var marginSize = (xRadius - (this.getY((yRadius - no),yRadius,factorX)));
+ var marginSize_decimals = (xRadius - (this.getY_withDecimals((yRadius - no),yRadius,factorX)));
+ var restValue = xRadius - marginSize_decimals;
+ var antialiasSize = xRadius - marginSize - Math.floor(savedRestValue)
+ var foregroundSize = xRadius - (marginSize + antialiasSize);
+
+ var el = document.createElement('DIV');
+ el.style.overflow='hidden';
+ el.style.height = '1px';
+ if(cornerArray['top_left'])el.style.marginLeft = marginSize + 'px';
+ if(cornerArray['top_right'])el.style.marginRight = marginSize + 'px';
+ topBar_container.appendChild(el);
+ var y = topBar_container;
+
+ for(var no2=1;no2<=antialiasSize;no2++){
+ switch(no2){
+ case 1:
+ if (no2 == antialiasSize)
+ blendMode = ((restValue + savedRestValue) /2) - foregroundSize;
+ else {
+ var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2),xRadius,1/factorX);
+ blendMode = (restValue - foregroundSize - antialiasSize + 1) * (tmpValue - (yRadius - no)) /2;
+ }
+ break;
+ case antialiasSize:
+ var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2 + 1),xRadius,1/factorX);
+ blendMode = 1 - (1 - (tmpValue - (yRadius - no))) * (1 - (savedRestValue - foregroundSize)) /2;
+ break;
+ default:
+ var tmpValue2 = this.getY_withDecimals((xRadius - marginSize - no2),xRadius,1/factorX);
+ var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2 + 1),xRadius,1/factorX);
+ blendMode = ((tmpValue + tmpValue2) / 2) - (yRadius - no);
+ }
+
+ el.style.backgroundColor = this.__blendColors(backgroundColor,color,blendMode);
+ y.appendChild(el);
+ y = el;
+ var el = document.createElement('DIV');
+ el.style.height = '1px';
+ el.style.overflow='hidden';
+ if(cornerArray['top_left'])el.style.marginLeft = '1px';
+ if(cornerArray['top_right'])el.style.marginRight = '1px';
+ el.style.backgroundColor=color;
+ }
+
+ y.appendChild(el);
+ savedRestValue = restValue;
+ }
+ }
+
+ // Add content
+ var contentDiv = document.createElement('DIV');
+ contentDiv.className = obj.className;
+ contentDiv.style.border='1px solid ' + color;
+ contentDiv.innerHTML = content;
+ contentDiv.style.backgroundColor=color;
+ contentDiv.style.paddingLeft = padding + 'px';
+ contentDiv.style.paddingRight = padding + 'px';
+
+ if(!heightOfContent)heightOfContent = '';
+ heightOfContent = heightOfContent + '';
+ if(heightOfContent.length>0 && heightOfContent.indexOf('%')==-1)heightOfContent = heightOfContent + 'px';
+ if(heightOfContent.length>0)contentDiv.style.height = heightOfContent;
+
+ obj.appendChild(contentDiv);
+
+
+ if(cornerArray['bottom_left'] || cornerArray['bottom_right']){
+ var bottomBar_container = document.createElement('DIV');
+ bottomBar_container.style.height = yRadius + 'px';
+ bottomBar_container.style.overflow = 'hidden';
+
+ obj.appendChild(bottomBar_container);
+ var currentAntialiasSize = 0;
+ var savedRestValue = 0;
+
+ var errorOccured = false;
+ var arrayOfDivs = new Array();
+ for(no=1;no<=yRadius;no++){
+
+ var marginSize = (xRadius - (this.getY((yRadius - no),yRadius,factorX)));
+ var marginSize_decimals = (xRadius - (this.getY_withDecimals((yRadius - no),yRadius,factorX)));
+
+ var restValue = (xRadius - marginSize_decimals);
+ var antialiasSize = xRadius - marginSize - Math.floor(savedRestValue)
+ var foregroundSize = xRadius - (marginSize + antialiasSize);
+
+ var el = document.createElement('DIV');
+ el.style.overflow='hidden';
+ el.style.height = '1px';
+ if(cornerArray['bottom_left'])el.style.marginLeft = marginSize + 'px';
+ if(cornerArray['bottom_right'])el.style.marginRight = marginSize + 'px';
+ bottomBar_container.insertBefore(el,bottomBar_container.firstChild);
+
+ var y = bottomBar_container;
+
+ for(var no2=1;no2<=antialiasSize;no2++){
+ switch(no2){
+ case 1:
+ if (no2 == antialiasSize)
+ blendMode = ((restValue + savedRestValue) /2) - foregroundSize;
+ else {
+ var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2),xRadius,1/factorX);
+ blendMode = (restValue - foregroundSize - antialiasSize + 1) * (tmpValue - (yRadius - no)) /2;
+ }
+ break;
+ case antialiasSize:
+ var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2 + 1),xRadius,1/factorX);
+ blendMode = 1 - (1 - (tmpValue - (yRadius - no))) * (1 - (savedRestValue - foregroundSize)) /2;
+ break;
+ default:
+ var tmpValue2 = this.getY_withDecimals((xRadius - marginSize - no2),xRadius,1/factorX);
+ var tmpValue = this.getY_withDecimals((xRadius - marginSize - no2 + 1),xRadius,1/factorX);
+ blendMode = ((tmpValue + tmpValue2) / 2) - (yRadius - no);
+ }
+
+ el.style.backgroundColor = this.__blendColors(backgroundColor,color,blendMode);
+
+ if(y==bottomBar_container)arrayOfDivs[arrayOfDivs.length] = el;
+
+ try{ // Need to look closer at this problem which occures in Opera.
+ var firstChild = y.getElementsByTagName('DIV')[0];
+ y.insertBefore(el,y.firstChild);
+ }catch(e){
+ y.appendChild(el);
+ errorOccured = true;
+ }
+ y = el;
+
+ var el = document.createElement('DIV');
+ el.style.height = '1px';
+ el.style.overflow='hidden';
+ if(cornerArray['bottom_left'])el.style.marginLeft = '1px';
+ if(cornerArray['bottom_right'])el.style.marginRight = '1px';
+
+ }
+
+ if(errorOccured){ // Opera fix
+ for(var divCounter=arrayOfDivs.length-1;divCounter>=0;divCounter--){
+ bottomBar_container.appendChild(arrayOfDivs[divCounter]);
+ }
+ }
+
+ el.style.backgroundColor=color;
+ y.appendChild(el);
+ savedRestValue = restValue;
+ }
+
+ }
+ }
+ }
+ // }}}
+ ,
+ // {{{ getY()
+ /**
+ *
+ *
+ * Add rounded corners to an element
+ *
+ * @param Int x = x Coordinate
+ * @param Int maxX = Size of rounded corners
+ *
+ *
+ * @private
+ */
+ getY : function(x,maxX,factorX){
+ // y = sqrt(100 - x^2)
+ // Y = 0.5 * ((100 - x^2)^0.5);
+ return Math.max(0,Math.ceil(factorX * Math.sqrt( (maxX * maxX) - (x*x)) ));
+
+ }
+ // }}}
+ ,
+ // {{{ getY_withDecimals()
+ /**
+ *
+ *
+ * Add rounded corners to an element
+ *
+ * @param Int x = x Coordinate
+ * @param Int maxX = Size of rounded corners
+ *
+ *
+ * @private
+ */
+ getY_withDecimals : function(x,maxX,factorX){
+ // y = sqrt(100 - x^2)
+ // Y = 0.5 * ((100 - x^2)^0.5);
+ return Math.max(0,factorX * Math.sqrt( (maxX * maxX) - (x*x)) );
+
+ }
+
+
+ ,
+
+ // {{{ __blendColors()
+ /**
+ *
+ *
+ * Simply blending two colors by extracting red, green and blue and subtracting difference between colors from them.
+ * Finally, we multiply it with the blendMode value
+ *
+ * @param String colorA = RGB color
+ * @param String colorB = RGB color
+ * @param Float blendMode
+ *
+ *
+ * @private
+ */
+ __blendColors : function (colorA, colorB, blendMode) {
+ if(colorA.length=='4'){ // In case we are dealing with colors like #FFF
+ colorA = '#' + colorA.substring(1,1) + colorA.substring(1,1) + colorA.substring(2,1) + colorA.substring(2,1) + colorA.substring(3,1) + colorA.substring(3,1);
+ }
+ if(colorB.length=='4'){ // In case we are dealing with colors like #FFF
+ colorB = '#' + colorB.substring(1,1) + colorB.substring(1,1) + colorB.substring(2,1) + colorB.substring(2,1) + colorB.substring(3,1) + colorB.substring(3,1);
+ }
+ var colorArrayA = [parseInt('0x' + colorA.substring(1,3)), parseInt('0x' + colorA.substring(3, 5)), parseInt('0x' + colorA.substring(5, 7))]; // Create array of Red, Green and Blue ( 0-255)
+ var colorArrayB = [parseInt('0x' + colorB.substring(1,3)), parseInt('0x' + colorB.substring(3, 5)), parseInt('0x' + colorB.substring(5, 7))]; // Create array of Red, Green and Blue ( 0-255)
+ var red = Math.round(colorArrayA[0] + (colorArrayB[0] - colorArrayA[0])*blendMode).toString(16); // Create new Red color ( Hex )
+ var green = Math.round(colorArrayA[1] + (colorArrayB[1] - colorArrayA[1])*blendMode).toString(16); // Create new Green color ( Hex )
+ var blue = Math.round(colorArrayA[2] + (colorArrayB[2] - colorArrayA[2])*blendMode).toString(16); // Create new Blue color ( Hex )
+
+ if(red.length==1)red = '0' + red;
+ if(green.length==1)green = '0' + green;
+ if(blue.length==1)blue = '0' + blue;
+
+ return '#' + red + green+ blue; // Return new RGB color
+ }
+}
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/script.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/script.js
new file mode 100644
index 000000000..ea153016d
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/script.js
@@ -0,0 +1,482 @@
+// A few configuration settings
+var CROSSHAIRS_LOCATION = 'static/fusion/raptor/images/crosshairs.png';
+var HUE_SLIDER_LOCATION = 'static/fusion/raptor/images/h.png';
+var HUE_SLIDER_ARROWS_LOCATION = 'static/fusion/raptor/images/position.png';
+var SAT_VAL_SQUARE_LOCATION = 'static/fusion/raptor/images/sv.png';
+
+// Here are some boring utility functions. The real code comes later.
+
+function hexToRgb(hex_string, default_)
+{
+ if (default_ == undefined)
+ {
+ default_ = null;
+ }
+
+ if (hex_string.substr(0, 1) == '#')
+ {
+ hex_string = hex_string.substr(1);
+ }
+
+ var r;
+ var g;
+ var b;
+ if (hex_string.length == 3)
+ {
+ r = hex_string.substr(0, 1);
+ r += r;
+ g = hex_string.substr(1, 1);
+ g += g;
+ b = hex_string.substr(2, 1);
+ b += b;
+ }
+ else if (hex_string.length == 6)
+ {
+ r = hex_string.substr(0, 2);
+ g = hex_string.substr(2, 2);
+ b = hex_string.substr(4, 2);
+ }
+ else
+ {
+ return default_;
+ }
+
+ r = parseInt(r, 16);
+ g = parseInt(g, 16);
+ b = parseInt(b, 16);
+ if (isNaN(r) || isNaN(g) || isNaN(b))
+ {
+ return default_;
+ }
+ else
+ {
+ return {r: r / 255, g: g / 255, b: b / 255};
+ }
+}
+
+function rgbToHex(r, g, b, includeHash)
+{
+ r = Math.round(r * 255);
+ g = Math.round(g * 255);
+ b = Math.round(b * 255);
+ if (includeHash == undefined)
+ {
+ includeHash = true;
+ }
+
+ r = r.toString(16);
+ if (r.length == 1)
+ {
+ r = '0' + r;
+ }
+ g = g.toString(16);
+ if (g.length == 1)
+ {
+ g = '0' + g;
+ }
+ b = b.toString(16);
+ if (b.length == 1)
+ {
+ b = '0' + b;
+ }
+ return ((includeHash ? '#' : '') + r + g + b).toUpperCase();
+}
+
+var arVersion = navigator.appVersion.split("MSIE");
+var version = parseFloat(arVersion[1]);
+
+function fixPNG(myImage)
+{
+ if ((version >= 5.5) && (version < 7) && (document.body.filters))
+ {
+ var node = document.createElement('span');
+ node.id = myImage.id;
+ node.className = myImage.className;
+ node.title = myImage.title;
+ node.style.cssText = myImage.style.cssText;
+ node.style.setAttribute('filter', "progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ + "(src=\'" + myImage.src + "\', sizingMethod='scale')");
+ node.style.fontSize = '0';
+ node.style.width = myImage.width.toString() + 'px';
+ node.style.height = myImage.height.toString() + 'px';
+ node.style.display = 'inline-block';
+ return node;
+ }
+ else
+ {
+ return myImage.cloneNode(false);
+ }
+}
+
+function trackDrag(node, handler)
+{
+ function fixCoords(x, y)
+ {
+ var nodePageCoords = pageCoords(node);
+ x = (x - nodePageCoords.x) + document.documentElement.scrollLeft;
+ y = (y - nodePageCoords.y) + document.documentElement.scrollTop;
+ if (x < 0) x = 0;
+ if (y < 0) y = 0;
+ if (x > node.offsetWidth - 1) x = node.offsetWidth - 1;
+ if (y > node.offsetHeight - 1) y = node.offsetHeight - 1;
+ return {x: x, y: y};
+ }
+ function mouseDown(ev)
+ {
+ var coords = fixCoords(ev.clientX, ev.clientY);
+ var lastX = coords.x;
+ var lastY = coords.y;
+ handler(coords.x, coords.y);
+
+ function moveHandler(ev)
+ {
+ var coords = fixCoords(ev.clientX, ev.clientY);
+ if (coords.x != lastX || coords.y != lastY)
+ {
+ lastX = coords.x;
+ lastY = coords.y;
+ handler(coords.x, coords.y);
+ }
+ }
+ function upHandler(ev)
+ {
+ myRemoveEventListener(document, 'mouseup', upHandler);
+ myRemoveEventListener(document, 'mousemove', moveHandler);
+ myAddEventListener(node, 'mousedown', mouseDown);
+ }
+ myAddEventListener(document, 'mouseup', upHandler);
+ myAddEventListener(document, 'mousemove', moveHandler);
+ myRemoveEventListener(node, 'mousedown', mouseDown);
+ if (ev.preventDefault) ev.preventDefault();
+ }
+ myAddEventListener(node, 'mousedown', mouseDown);
+ node.onmousedown = function(e) { return false; };
+ node.onselectstart = function(e) { return false; };
+ node.ondragstart = function(e) { return false; };
+}
+
+var eventListeners = [];
+
+function findEventListener(node, event, handler)
+{
+ var i;
+ for (i in eventListeners)
+ {
+ if (eventListeners[i].node == node && eventListeners[i].event == event
+ && eventListeners[i].handler == handler)
+ {
+ return i;
+ }
+ }
+ return null;
+}
+function myAddEventListener(node, event, handler)
+{
+ if (findEventListener(node, event, handler) != null)
+ {
+ return;
+ }
+
+ if (!node.addEventListener)
+ {
+ node.attachEvent('on' + event, handler);
+ }
+ else
+ {
+ node.addEventListener(event, handler, false);
+ }
+
+ eventListeners.push({node: node, event: event, handler: handler});
+}
+
+function removeEventListenerIndex(index)
+{
+ var eventListener = eventListeners[index];
+ delete eventListeners[index];
+
+ if (!eventListener.node.removeEventListener)
+ {
+ eventListener.node.detachEvent('on' + eventListener.event,
+ eventListener.handler);
+ }
+ else
+ {
+ eventListener.node.removeEventListener(eventListener.event,
+ eventListener.handler, false);
+ }
+}
+
+function myRemoveEventListener(node, event, handler)
+{
+ removeEventListenerIndex(findEventListener(node, event, handler));
+}
+
+function cleanupEventListeners()
+{
+ var i;
+ for (i = eventListeners.length; i > 0; i--)
+ {
+ if (eventListeners[i] != undefined)
+ {
+ removeEventListenerIndex(i);
+ }
+ }
+}
+myAddEventListener(window, 'unload', cleanupEventListeners);
+
+// This copyright statement applies to the following two functions,
+// which are taken from MochiKit.
+//
+// Copyright 2005 Bob Ippolito <bob@redivi.com>
+//
+// 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.
+
+function hsvToRgb(hue, saturation, value)
+{
+ var red;
+ var green;
+ var blue;
+ if (value == 0.0)
+ {
+ red = 0;
+ green = 0;
+ blue = 0;
+ }
+ else
+ {
+ var i = Math.floor(hue * 6);
+ var f = (hue * 6) - i;
+ var p = value * (1 - saturation);
+ var q = value * (1 - (saturation * f));
+ var t = value * (1 - (saturation * (1 - f)));
+ switch (i)
+ {
+ case 1: red = q; green = value; blue = p; break;
+ case 2: red = p; green = value; blue = t; break;
+ case 3: red = p; green = q; blue = value; break;
+ case 4: red = t; green = p; blue = value; break;
+ case 5: red = value; green = p; blue = q; break;
+ case 6: // fall through
+ case 0: red = value; green = t; blue = p; break;
+ }
+ }
+ return {r: red, g: green, b: blue};
+}
+
+function rgbToHsv(red, green, blue)
+{
+ var max = Math.max(Math.max(red, green), blue);
+ var min = Math.min(Math.min(red, green), blue);
+ var hue;
+ var saturation;
+ var value = max;
+ if (min == max)
+ {
+ hue = 0;
+ saturation = 0;
+ }
+ else
+ {
+ var delta = (max - min);
+ saturation = delta / max;
+ if (red == max)
+ {
+ hue = (green - blue) / delta;
+ }
+ else if (green == max)
+ {
+ hue = 2 + ((blue - red) / delta);
+ }
+ else
+ {
+ hue = 4 + ((red - green) / delta);
+ }
+ hue /= 6;
+ if (hue < 0)
+ {
+ hue += 1;
+ }
+ if (hue > 1)
+ {
+ hue -= 1;
+ }
+ }
+ return {
+ h: hue,
+ s: saturation,
+ v: value
+ };
+}
+
+function pageCoords(node)
+{
+ var x = node.offsetLeft;
+ var y = node.offsetTop;
+ var parent = node.offsetParent;
+ while (parent != null)
+ {
+ x += parent.offsetLeft;
+ y += parent.offsetTop;
+ parent = parent.offsetParent;
+ }
+ return {x: x, y: y};
+}
+
+// The real code begins here.
+var huePositionImg = document.createElement('img');
+huePositionImg.galleryImg = false;
+huePositionImg.width = 35;
+huePositionImg.height = 11;
+huePositionImg.src = HUE_SLIDER_ARROWS_LOCATION;
+huePositionImg.style.position = 'absolute';
+
+var hueSelectorImg = document.createElement('img');
+hueSelectorImg.galleryImg = false;
+hueSelectorImg.width = 35;
+hueSelectorImg.height = 200;
+hueSelectorImg.src = HUE_SLIDER_LOCATION;
+hueSelectorImg.style.display = 'block';
+
+var satValImg = document.createElement('img');
+satValImg.galleryImg = false;
+satValImg.width = 200;
+satValImg.height = 200;
+satValImg.src = SAT_VAL_SQUARE_LOCATION;
+satValImg.style.display = 'block';
+
+var crossHairsImg = document.createElement('img');
+crossHairsImg.galleryImg = false;
+crossHairsImg.width = 21;
+crossHairsImg.height = 21;
+crossHairsImg.src = CROSSHAIRS_LOCATION;
+crossHairsImg.style.position = 'absolute';
+
+function makeColorSelector(inputBox)
+{
+ var rgb, hsv
+
+ function colorChanged()
+ {
+ var hex = rgbToHex(rgb.r, rgb.g, rgb.b);
+ var hueRgb = hsvToRgb(hsv.h, 1, 1);
+ var hueHex = rgbToHex(hueRgb.r, hueRgb.g, hueRgb.b);
+ previewDiv.style.background = hex;
+ inputBox.value = hex;
+ satValDiv.style.background = hueHex;
+ crossHairs.style.left = ((hsv.v*199)-10).toString() + 'px';
+ crossHairs.style.top = (((1-hsv.s)*199)-10).toString() + 'px';
+ huePos.style.top = ((hsv.h*199)-5).toString() + 'px';
+ }
+ function rgbChanged()
+ {
+ hsv = rgbToHsv(rgb.r, rgb.g, rgb.b);
+ colorChanged();
+ }
+ function hsvChanged()
+ {
+ rgb = hsvToRgb(hsv.h, hsv.s, hsv.v);
+ colorChanged();
+ }
+
+ var colorSelectorDiv = document.createElement('div');
+ colorSelectorDiv.style.padding = '15px';
+ colorSelectorDiv.style.position = 'relative';
+ colorSelectorDiv.style.height = '275px';
+ colorSelectorDiv.style.width = '250px';
+
+ var satValDiv = document.createElement('div');
+ satValDiv.style.position = 'relative';
+ satValDiv.style.width = '200px';
+ satValDiv.style.height = '200px';
+ var newSatValImg = fixPNG(satValImg);
+ satValDiv.appendChild(newSatValImg);
+ var crossHairs = crossHairsImg.cloneNode(false);
+ satValDiv.appendChild(crossHairs);
+ function satValDragged(x, y)
+ {
+ hsv.s = 1-(y/199);
+ hsv.v = (x/199);
+ hsvChanged();
+ }
+ trackDrag(satValDiv, satValDragged)
+ colorSelectorDiv.appendChild(satValDiv);
+
+ var hueDiv = document.createElement('div');
+ hueDiv.style.position = 'absolute';
+ hueDiv.style.left = '230px';
+ hueDiv.style.top = '15px';
+ hueDiv.style.width = '35px';
+ hueDiv.style.height = '200px';
+ var huePos = fixPNG(huePositionImg);
+ hueDiv.appendChild(hueSelectorImg.cloneNode(false));
+ hueDiv.appendChild(huePos);
+ function hueDragged(x, y)
+ {
+ hsv.h = y/199;
+ hsvChanged();
+ }
+ trackDrag(hueDiv, hueDragged);
+ colorSelectorDiv.appendChild(hueDiv);
+
+ var previewDiv = document.createElement('div');
+ previewDiv.style.height = '50px'
+ previewDiv.style.width = '50px';
+ previewDiv.style.position = 'absolute';
+ previewDiv.style.top = '225px';
+ previewDiv.style.left = '15px';
+ previewDiv.style.border = '1px solid black';
+ colorSelectorDiv.appendChild(previewDiv);
+
+ function inputBoxChanged()
+ {
+ rgb = hexToRgb(inputBox.value, {r: 0, g: 0, b: 0});
+ rgbChanged();
+ }
+ myAddEventListener(inputBox, 'change', inputBoxChanged);
+ inputBox.size = 8;
+ inputBox.style.position = 'absolute';
+ inputBox.style.right = '15px';
+ inputBox.style.top = (225 + (25 - (inputBox.offsetHeight/2))).toString() + 'px';
+ colorSelectorDiv.appendChild(inputBox);
+
+ inputBoxChanged();
+
+ return colorSelectorDiv;
+}
+
+function makeColorSelectors(ev)
+{
+ var inputNodes = document.getElementsByTagName('input');
+ var i;
+ for (i = 0; i < inputNodes.length; i++)
+ {
+ var node = inputNodes[i];
+ if (node.className != 'color')
+ {
+ continue;
+ }
+ var parent = node.parentNode;
+ var prevNode = node.previousSibling;
+ var selector = makeColorSelector(node);
+ parent.insertBefore(selector, (prevNode ? prevNode.nextSibling : null));
+ }
+}
+
+myAddEventListener(window, 'load', makeColorSelectors);
diff --git a/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/tree/ajax.js b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/tree/ajax.js
new file mode 100644
index 000000000..a727447d2
--- /dev/null
+++ b/ecomp-sdk-app/src/main/webapp/static/fusion/raptor/js/tree/ajax.js
@@ -0,0 +1,194 @@
+/* Simple AJAX Code-Kit (SACK) v1.6.1 */
+/* ©2005 Gregory Wild-Smith */
+/* www.twilightuniverse.com */
+/* Software licenced under a modified X11 licence,
+ see documentation or authors website for more details */
+
+function sack(file) {
+ this.xmlhttp = null;
+ this.resetData = function() {
+ this.method = "POST";
+ this.queryStringSeparator = "?";
+ this.argumentSeparator = "&";
+ this.URLString = "";
+ this.encodeURIString = true;
+ this.execute = false;
+ this.element = null;
+ this.elementObj = null;
+ this.requestFile = file;
+ this.vars = new Object();
+ this.responseStatus = new Array(2);
+ };
+
+ this.resetFunctions = function() {
+ this.onLoading = function() { };
+ this.onLoaded = function() { };
+ this.onInteractive = function() { };
+ this.onCompletion = function() { };
+ this.onError = function() { };
+ this.onFail = function() { };
+ };
+
+ this.reset = function() {
+ this.resetFunctions();
+ this.resetData();
+ };
+
+ this.createAJAX = function() {
+ try {
+ this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
+ } catch (e1) {
+ try {
+ this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ } catch (e2) {
+ this.xmlhttp = null;
+ }
+ }
+
+ if (! this.xmlhttp) {
+ if (typeof XMLHttpRequest != "undefined") {
+ this.xmlhttp = new XMLHttpRequest();
+ } else {
+ this.failed = true;
+ }
+ }
+ };
+
+ this.setVar = function(name, value){
+ this.vars[name] = Array(value, false);
+ };
+
+ this.encVar = function(name, value, returnvars) {
+ if (true == returnvars) {
+ return Array(encodeURIComponent(name), encodeURIComponent(value));
+ } else {
+ this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
+ }
+ }
+
+ this.processURLString = function(string, encode) {
+ encoded = encodeURIComponent(this.argumentSeparator);
+ regexp = new RegExp(this.argumentSeparator + "|" + encoded);
+ varArray = string.split(regexp);
+ for (i = 0; i < varArray.length; i++){
+ urlVars = varArray[i].split("=");
+ if (true == encode){
+ this.encVar(urlVars[0], urlVars[1]);
+ } else {
+ this.setVar(urlVars[0], urlVars[1]);
+ }
+ }
+ }
+
+ this.createURLString = function(urlstring) {
+ if (this.encodeURIString && this.URLString.length) {
+ this.processURLString(this.URLString, true);
+ }
+ if (urlstring) {
+ if (this.URLString.length) {
+ this.URLString += this.argumentSeparator + urlstring;
+ } else {
+ this.URLString = urlstring;
+ }
+ }
+
+ // prevents caching of URLString
+ this.setVar("rndval", new Date().getTime());
+
+ urlstringtemp = new Array();
+ for (key in this.vars) {
+ if (false == this.vars[key][1] && true == this.encodeURIString) {
+ encoded = this.encVar(key, this.vars[key][0], true);
+ delete this.vars[key];
+ this.vars[encoded[0]] = Array(encoded[1], true);
+ key = encoded[0];
+ }
+
+ urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
+ }
+ if (urlstring){
+ this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
+ } else {
+ this.URLString += urlstringtemp.join(this.argumentSeparator);
+ }
+ }
+
+ this.runResponse = function() {
+ eval(this.response);
+ }
+
+ this.runAJAX = function(urlstring) {
+ if (this.failed) {
+ this.onFail();
+ } else {
+ this.createURLString(urlstring);
+
+ if (this.element) {
+ this.elementObj = document.getElementById(this.element);
+ }
+
+ if (this.xmlhttp) {
+ var self = this;
+ if (this.method == "GET") {
+ totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
+ this.xmlhttp.open(this.method, totalurlstring, true);
+ } else {
+ this.xmlhttp.open(this.method, this.requestFile, true);
+ try {
+ this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
+ } catch (e) { }
+ }
+ //document.myForm.action=urlstring;
+ //document.myForm.submit();
+ this.xmlhttp.onreadystatechange = function() {
+ switch (self.xmlhttp.readyState) {
+ case 1:
+ self.onLoading();
+ break;
+ case 2:
+ self.onLoaded();
+ break;
+ case 3:
+ self.onInteractive();
+ break;
+ case 4:
+ self.response = self.xmlhttp.responseText;
+ self.responseXML = self.xmlhttp.responseXML;
+ self.responseStatus[0] = self.xmlhttp.status;
+ self.responseStatus[1] = self.xmlhttp.statusText;
+
+ if (self.execute) {
+ self.runResponse();
+ }
+
+ if (self.elementObj) {
+ elemNodeName = self.elementObj.nodeName;
+ elemNodeName.toLowerCase();
+ if (elemNodeName == "input"
+ || elemNodeName == "select"
+ || elemNodeName == "option"
+ || elemNodeName == "textarea") {
+ self.elementObj.value = self.response;
+ } else {
+ self.elementObj.innerHTML = self.response;
+ }
+ }
+ if (self.responseStatus[0] == "200") {
+ self.onCompletion();
+ } else {
+ self.onError();
+ }
+
+ self.URLString = "";
+ break;
+ }
+ };
+ this.xmlhttp.send(this.URLString);
+
+ }
+ }
+ };
+
+ this.reset() ;
+ this.createAJAX();
+}