//////////////////////////////////////////////////////////////////////////
//
//   path: /form_state_manager.js  (Begin) 
//
//



	var fsman;

	function FormState(formObj) {
		this.formObj = formObj;		
		this.formObj.onclick = fsmanScan;
		this.formObj.onkeyup = fsmanScan;
		this.formObj.onfocus = fsmanScan;
		this.formObj.onchange = fsmanScan;
		this.registeredButtons = new Array();
		this.allElements = new Array(formObj.elements.length);
		var elementObj;
		for (var j = 0; j < formObj.elements.length; j++) {
			elementObj = formObj.elements[j];
			var elementValue = "";
			var noscan = elementObj.getAttribute("noscan");
			if (noscan != null && noscan.length > 1) {
				this.allElements[j] = "noscan";
			} else {
				switch (elementObj.type) {

					case ("text"):
					case ("textarea"):
					case ("hidden"):
					case ("password"):
						elementValue = elementObj.value;
						break;
					case ("radio"):
					case ("checkbox"):
						elementValue = elementObj.defaultChecked;
						break;
					case ("select-one"):
						elementValue = elementObj.selectedIndex;
						break;
					case ("select-multiple"):
						for (var k = 0; k < elementObj.options.length; k++) {
							// the value is a string representing the selected state of each option
							elementValue += elementObj.options[k].defaultSelected.toString();
						}
						break;
				}
				this.allElements[j] = elementValue;
			}
		}
	}

	FormState.prototype.hasChanged = function () {

		var elementObj;
		var formState;
		var elementValue;
		var elemHasChanged = false;
		for (var i = 0; i < this.formObj.elements.length; i++) {
			elementObj = this.formObj.elements[i];
			elementValue = this.allElements[i];
			var noscan = elementObj.getAttribute("noscan");
			if (noscan != null && noscan.length > 1) {
				elemHasChanged = false;
			} else {			
				switch (elementObj.type) {
					case ("text"):
					case ("textarea"):
					case ("hidden"):
					case ("password"):
						elemHasChanged = (elementValue != elementObj.value);
						break;
					case ("radio"):
					case ("checkbox"):
						if ((elementValue == false && elementObj.checked) || (elementValue == true && !elementObj.checked)) {
							elemHasChanged = true;
						}
						break;
					case ("select-one"):
						elemHasChanged = (elementValue != elementObj.selectedIndex);
						break;
					case ("select-multiple"):
						var multiValueString = "";
						for (var k = 0; k < elementObj.options.length; k++) {
							multiValueString += elementObj.options[k].selected.toString();
						}
						elemHasChanged = (elementValue != multiValueString);

				}
			}
			if (elemHasChanged) {
				return true;
			}
		}
		return elemHasChanged;
	}
	
	FormState.prototype.scan = function () {
		if (this.hasChanged()) {
			this.unlockButtons();
			return true;
		} else {
			this.lockButtons();
			return false;
		}		
	}
	
	FormState.prototype.register = function (buttonObj) {
		if (buttonObj != null) {
			buttonObj.disabled = true;
			this.registeredButtons[this.registeredButtons.length] = buttonObj;
		}
	}
	
	FormState.prototype.unlockButtons = function () {
		for (var i = 0; i < this.registeredButtons.length; i++) {
			this.registeredButtons[i].disabled = false;
		}
	}	
	
	FormState.prototype.lockButtons = function () {
		for (var i = 0; i < this.registeredButtons.length; i++) {
			this.registeredButtons[i].disabled = true;
		}
	}
	
	
	function FormStateManager(documentString, sff) {
		this.initialized = false;
		this.allForms = null;
		this.doc = null;		
		this.docString = documentString;		
		this.registeredButtons = new Array();
		this.selectFirstField = (sff) ? true : false;
		this.forceApplyButtonLockFlag = false;
		this.noscan = false;
		this.initialize();
	}

	FormStateManager.prototype.initialize = function () {
		this.initialized = false;
		this.forceApplyButtonLockFlag = false;
		this.allForms = new Array();
		
		
		if (this.docString != null) {
			this.doc = eval(this.docString);
			if (this.doc != null && this.doc.forms.length > 0) {
				this.allForms = new Array();
				var formStateObj;
				for (var i = 0; i < this.doc.forms.length; i++) {
					var formStateObj = new FormState(this.doc.forms[i]);
					this.registerFormState(formStateObj);
					if (i == 0) {
						this.focusFirst(this.doc.forms[i]);
					}
				}
				this.doc.onunload = fsmanInitialize;
			} else {
				setTimeout("fsmanInitialize()", 500);
				return;
			}
		}
	}
	
	FormStateManager.prototype.registerFormState = function(formStateObj) {
		if (formStateObj != null) {						
			this.allForms[this.allForms.length] = formStateObj;
			this.initialized = true;
		}
	}
	
	FormStateManager.prototype.focusFirst = function (formObj) {
		var elementObj;
		for (var e = 0; e < formObj.elements.length; e++) {
			elementObj = formObj.elements[e];
			if (elementObj.type == "text" || elementObj.type == "textarea") {
				if (this.selectFirstField) {
					elementObj.select();	
				} else {
					elementObj.focus();	
				}	
				break;
			}
		}	
	}

	FormStateManager.prototype.hasChanged = function () {
		if (!this.initialized) {
			this.initialize();
			return false;
		}
		for (var i = 0; i < this.allForms.length; i++) {
			formStateObj = this.allForms[i];
			if (formStateObj.hasChanged()) {
				return true;
			}
		}
		return false;
	}
	
	FormStateManager.prototype.scan = function () {
		if (this.noscan) return;
		var childFSHasChanged = false;
		var fsObj;
		for (var i = 0; i < this.allForms.length; i++) {
			fsObj = this.allForms[i];
			if (fsObj.scan()) {
				childFSHasChanged = true;
			}
		}
		
		if (childFSHasChanged) {
			this.unlockButtons();
		} else {
			this.lockButtons();
		}
	}	

	FormStateManager.prototype.register = function (buttonObj) {
		if (buttonObj != null) {
			buttonObj.disabled = true;
			this.registeredButtons[this.registeredButtons.length] = buttonObj;
		}
	}
	
	FormStateManager.prototype.unlockButtons = function () {
		for (var i = 0; i < this.registeredButtons.length; i++) {
			button = this.registeredButtons[i];
			if (button.name == "mainSubmit") {
				if (this.forceApplyButtonLockFlag) continue;
			}
			button.disabled = false;
		}
	}	
	
	FormStateManager.prototype.lockButtons = function () {
		for (var i = 0; i < this.registeredButtons.length; i++) {
			this.registeredButtons[i].disabled = true;
		}
	}
	
	FormStateManager.prototype.lockApplyButton = function () {
		for (var i = 0; i < this.registeredButtons.length; i++) {
			button = this.registeredButtons[i];
			
			if (button.name == "mainSubmit") {
				button.disabled = true;
			}

		}
	}	
	
	FormStateManager.prototype.unlockApplyButton = function () {
		// Check bypass lock
		if (this.forceApplyButtonLockFlag) return;
		
		for (var i = 0; i < this.registeredButtons.length; i++) {
			button = this.registeredButtons[i];
			
			if (button.name == "mainSubmit") {
				button.disabled = false;
			}

		}
	}
	
	FormStateManager.prototype.unlockResetButton = function () {
		for (var i = 0; i < this.registeredButtons.length; i++) {
			button = this.registeredButtons[i];
			if (button.name == "mainReset") {
				button.disabled = false;
			}

		}
	}	
	
	FormStateManager.prototype.lockResetButton = function () {
		for (var i = 0; i < this.registeredButtons.length; i++) {
			button = this.registeredButtons[i];

			if (button.name == "mainReset") {
				button.disabled = true;
			}

		}
	}
	

	FormStateManager.prototype.forceApplyButtonLock = function () {
		this.forceApplyButtonLockFlag = true;	
	}
	
	FormStateManager.prototype.clearApplyButtonLock = function () {
		this.forceApplyButtonLockFlag = false;	
	}
	
	FormStateManager.prototype.disableScan = function () {
		this.noscan = true;	
	}	
	
	FormStateManager.prototype.enableScan = function () {
		this.noscan = false;	
	}		

	function unlockButtons() {
		if (fsman != null) {
			setTimeout("fsman.unlockButtons()", 50);
		}
	}
	
	function lockButtons() {
		if (fsman != null) {
			setTimeout("fsman.lockButtons()", 50);
		}	
	}
	
	function unlockApplyButton() {
		if (fsman != null) {
			setTimeout("fsman.unlockApplyButton()", 50);	
		}
	}
	
	function lockApplyButton() {
		if (fsman != null) {
			setTimeout("fsman.lockApplyButton()", 50);
		}			
	}
	
	function unlockResetButton() {
		if (fsman != null) {
			setTimeout("fsman.unlockResetButton()", 50);	
		}	
	}
	
	function lockResetButton() {
		if (fsman != null) {
			setTimeout("fsman.lockResetButton()", 50);
		}	
	}
	
	function forceApplyButtonLock() {
		if (fsman != null) {
			setTimeout("fsman.forceApplyButtonLock()", 50);
		}	
	}
	
	function clearApplyButtonLock() {
		if (fsman != null) {
			setTimeout("fsman.clearApplyButtonLock()", 50);
		}	
	}	
	
	function fsmanScan() {
		setTimeout("fsman.scan()", 50);
	}
	function fsmanInitialize() {
		fsman.initialize();		
	}
	


//
//
//   path: /form_state_manager.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/common/AC_ActiveX.js  (Begin) 
//
//


//v1.1
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AX_RunContent(){
  var ret = AC_AX_GetArgs(arguments);
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_AX_GetArgs(args){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "pluginspage":
      case "type":
      case "src":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "data":
      case "codebase":
      case "classid":
      case "id":
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  return ret;
}


//
//
//   path: /RI/components/js/common/AC_ActiveX.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/common/AC_RunActiveContent.js  (Begin) 
//
//


//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
//  if (src.indexOf('?') != -1)
//    return src.replace(/\?/, ext+'?'); 
//  else
//    return src + ext;
	return src;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}


//
//
//   path: /RI/components/js/common/AC_RunActiveContent.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /common/js/gridGeneralJavaScriptFunctions.js  (Begin) 
//
//


// put the google search term in a cookie in order to know what the lead searched for when arriving to the site (temp_google)
if (document.referrer) {	
	var GoogleQueryString_regexp = /^http(s)?:\/\/([^\/]*google\.[^/]+)\/[^?]*\?((.+)&)?q=([^&]*)(&(.*))?$/i;
	var GMiniQueryString_regexp = /^http(s)?:\/\/(rad-google.bsky.net)\/[^?]*\?((.+)&)?q=([^&]*)(&(.*))?$/i;
	//1232 add yahoo + yandex to search term
	var YahooQueryString_regexp = /^http(s)?:\/\/([^\/]*yahoo\.[^/]+)\/[^?]*\?((.+)&)?p=([^&]*)(&(.*))?$/i;
	var YandexQueryString_regexp = /^http(s)?:\/\/([^\/]*yandex\.[^/]+)\/[^?]*\?((.+)&)?text=([^&]*)(&(.*))?$/i;
	
	//1374 add the referrer site for leads coming from Google-Ads in different sites
	var GoogleAdsURLString_regexp =/^http(s)?:\/\/([^\/]*googlesyndication\.[^/]+)\/[^?]*\?((.+)&)?url=([^&]*)(&(.*))?$/i;
	 
	if (document.referrer.match(GoogleQueryString_regexp) && !document.referrer.match(GMiniQueryString_regexp)) {	
		var GoogleQueryString = document.referrer.replace(GoogleQueryString_regexp, '$5');		
		//T1161 - ifat b - add google url to cookie
		var GoogleURLString = document.referrer.replace(GoogleQueryString_regexp, '$2')		
		//T1363 - ib
		if (GoogleQueryString != "") {
			//T1199 - the encoding was not good for utf-8 characters
			//GoogleQueryString = unescape(decodeURIComponent(escape(GoogleQueryString))).replace(";", " ");
			GoogleQueryString = GoogleQueryString.replace(";", "+");
			document.cookie = "GoogleQueryString="+GoogleQueryString+"; path=/";
			document.cookie = "GoogleURLString="+GoogleURLString+"; path=/";
			//alert(location.search);
			var WT_srch_regexp = /\?(.*&)?WT\.srch=1(&.*)?/;
			if (location.search && location.search.match(WT_srch_regexp)) {
				document.cookie = "GooglePaidCampaign=1; path=/";
			} else {
				document.cookie = "GooglePaidCampaign=0; path=/";
			}
		}
	} else if (document.referrer.match(GMiniQueryString_regexp)) {		
		var GMiniQueryString = document.referrer.replace(GMiniQueryString_regexp, '$5');		
		var GMiniURLString = document.referrer.replace(GMiniQueryString_regexp, '$2')		
		if (GMiniQueryString != "") {			
			GMiniQueryString = GMiniQueryString.replace(";", "+");
			document.cookie = "GMiniQueryString="+GMiniQueryString+"; path=/";
			document.cookie = "GMiniURLString="+GMiniURLString+"; path=/";			
		}
	} else if (document.referrer.match(YahooQueryString_regexp)) {		
		var YahooQueryString = document.referrer.replace(YahooQueryString_regexp, '$5');		
		var YahooURLString = document.referrer.replace(YahooQueryString_regexp, '$2')		
		if (YahooQueryString != "") {			
			YahooQueryString = YahooQueryString.replace(";", "+");
			document.cookie = "YahooQueryString="+YahooQueryString+"; path=/";
			document.cookie = "YahooURLString="+YahooURLString+"; path=/";			
		}
	} else if (document.referrer.match(YandexQueryString_regexp)) {		
		var YandexQueryString = document.referrer.replace(YandexQueryString_regexp, '$5');		
		var YandexURLString = document.referrer.replace(YandexQueryString_regexp, '$2')		
		if (YandexQueryString != "") {			
			YandexQueryString = YandexQueryString.replace(";", "+");
			document.cookie = "YandexQueryString="+YandexQueryString+"; path=/";
			document.cookie = "YandexURLString="+YandexURLString+"; path=/";				
			var WT_srch_regexp = /\?(.*&)?WT\.srch=1(&.*)?/;
			if (location.search && location.search.match(WT_srch_regexp)) {
				document.cookie = "YandexPaidCampaign=1; path=/";
			} else {
				document.cookie = "YandexPaidCampaign=0; path=/";
			}		
		}
	//1374 add the referrer site for leads coming from Google-Ads in different sites
	} else if (document.referrer.match(GoogleAdsURLString_regexp)) {	
		var GoogleAdsURLSite = document.referrer.replace(GoogleAdsURLString_regexp, '$5');
		GoogleAdsURLSite = unescape(GoogleAdsURLSite)
		if (GoogleAdsURLSite.lastIndexOf("http") != -1) {
			GoogleAdsURLSite = GoogleAdsURLSite.substring(7);
		}
		if (GoogleAdsURLSite.lastIndexOf("/") == GoogleAdsURLSite.length-1){
			GoogleAdsURLSite = GoogleAdsURLSite.substring(0,GoogleAdsURLSite.length-1);
		}
		GoogleAdsURLSite = escape(GoogleAdsURLSite)
		document.cookie = "GoogleAdsURLSite="+GoogleAdsURLSite+"; path=/";
		var WT_srch_regexp = /\?(.*&)?WT\.srch=1(&.*)?/;
		if (location.search && location.search.match(WT_srch_regexp)) {
			document.cookie = "GooglePaidCampaign=1; path=/";
		} else {
			document.cookie = "GooglePaidCampaign=0; path=/";
		}
	}	
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function readCookie(name , defValue) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return new String("");
}

// This funciton needs to be tested....
function isEmpty(mytext) {
	var re = /^\s{1,}$/g; //match any white space including space, tab, form-feed, etc. 
	if ((mytext.length==0) || (mytext=="") || (mytext==null) || ((mytext.search(re)) > -1)) {
		return true;
	}
	else {
		return false;
	}
}

function isNotEmpty(mytext) {
	return (isEmpty(mytext))? false : true;
}



//
//
//   path: /common/js/gridGeneralJavaScriptFunctions.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/jquery/jquery.empty.js  (Begin) 
//
//





//
//
//   path: /RI/components/js/jquery/jquery.empty.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/jquery/thickbox.js  (Begin) 
//
//


/*
 * Thickbox 3.1 - One Box To Rule Them All.
 * By Cody Lindley (http://www.codylindley.com)
 * Copyright (c) 2007 cody lindley
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/
		  
var tb_pathToImage = "/realcommerce-rad-v7-dpm/RI/components/js/jquery/images/loadingAnimation.gif";

/*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/

//on page load call tb_init
$(document).ready(function(){   
	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
	imgLoader = new Image();// preload image
	imgLoader.src = tb_pathToImage;
});

//add thickbox to href & area elements that have a class of .thickbox
function tb_init(domChunk){
	$(domChunk).click(function(){
	var t = this.title || this.name || null;
	var a = this.href || this.alt;
	var g = this.rel || false;
	tb_show(t,a,g);
	this.blur();
	return false;
	});
}

function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link

	try {
		if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
			$("body","html").css({height: "100%", width: "100%"});
			$("html").css("overflow","hidden");
			if (document.getElementById("tb_hideselect") === null) {//iframe to hide select elements in ie6
				$("body").append("<iframe id='tb_hideselect'></iframe><div id='tb_overlay'></div><div id='tb_window'></div>");
				$("#tb_overlay").click(tb_remove);
			}
		}else{//all others
			if(document.getElementById("tb_overlay") === null){
				$("body").append("<div id='tb_overlay'></div><div id='tb_window'></div>");
				$("#tb_overlay").click(tb_remove);
			}
		}
		
		if(tb_detectMacXFF()){
			$("#tb_overlay").addClass("tb_overlaymacffbghack");//use png overlay so hide flash
		}else{
			$("#tb_overlay").addClass("tb_overlaybg");//use background and opacity
		}
		
		if(caption===null){caption="";}
		$("body").append("<div id='tb_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
		$('#tb_load').show();//show loader
		
		var baseURL;
	   if(url.indexOf("?")!==-1){ //ff there is a query string involved
			baseURL = url.substr(0, url.indexOf("?"));
	   }else{ 
	   		baseURL = url;
	   }
	   
	   var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
	   var urlType = baseURL.toLowerCase().match(urlString);
		urlType = '.jpg'
		if( urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images
				
			TB_PrevCaption = "";
			TB_PrevURL = "";
			TB_PrevHTML = "";
			TB_NextCaption = "";
			TB_NextURL = "";
			TB_NextHTML = "";
			TB_imageCount = "";
			TB_FoundURL = false;
			if(imageGroup){
				TB_TempArray = $("a[rel="+imageGroup+"]").get();
				for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) {
					var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
						if (!(TB_TempArray[TB_Counter].href == url)) {						
							if (TB_FoundURL) {
								TB_NextCaption = TB_TempArray[TB_Counter].title;
								TB_NextURL = TB_TempArray[TB_Counter].href;
								TB_NextHTML = "<span id='tb_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";
							} else {
								TB_PrevCaption = TB_TempArray[TB_Counter].title;
								TB_PrevURL = TB_TempArray[TB_Counter].href;
								TB_PrevHTML = "<span id='tb_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";
							}
						} else {
							TB_FoundURL = true;
							TB_imageCount = "Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);											
						}
				}
			}

			imgPreloader = new Image();
			imgPreloader.onload = function(){		
			imgPreloader.onload = null;
				
			// Resizing large images - orginal by Christian Montoya edited by me.
			var pagesize = tb_getPageSize();
			var x = pagesize[0] - 150;
			var y = pagesize[1] - 150;
			var imageWidth = imgPreloader.width;
			var imageHeight = imgPreloader.height;
			if (imageWidth > x) {
				imageHeight = imageHeight * (x / imageWidth); 
				imageWidth = x; 
				if (imageHeight > y) { 
					imageWidth = imageWidth * (y / imageHeight); 
					imageHeight = y; 
				}
			} else if (imageHeight > y) { 
				imageWidth = imageWidth * (y / imageHeight); 
				imageHeight = y; 
				if (imageWidth > x) { 
					imageHeight = imageHeight * (x / imageWidth); 
					imageWidth = x;
				}
			}
			// End Resizing
			
			TB_WIDTH = imageWidth + 30;
			TB_HEIGHT = imageHeight + 60;
			$("#tb_window").append("<a href='' id='tb_imageoff' title='Close'><img id='tb_image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='tb_caption'>"+caption+"<div id='tb_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='tb_closewindow'><a href='#' id='tb_closewindowbutton' title='Close'>Close</a> or Esc Key</div>"); 		
			
			$("#tb_closewindowbutton").click(tb_remove);
			
			if (!(TB_PrevHTML === "")) {
				function goPrev(){
					if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
					$("#tb_window").remove();
					$("body").append("<div id='tb_window'></div>");
					tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
					return false;	
				}
				$("#tb_prev").click(goPrev);
			}
			
			if (!(TB_NextHTML === "")) {		
				function goNext(){
					$("#tb_window").remove();
					$("body").append("<div id='tb_window'></div>");
					tb_show(TB_NextCaption, TB_NextURL, imageGroup);				
					return false;	
				}
				$("#tb_next").click(goNext);
				
			}

			document.onkeydown = function(e){ 	
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				} else if(keycode == 190){ // display previous image
					if(!(TB_NextHTML == "")){
						document.onkeydown = "";
						goNext();
					}
				} else if(keycode == 188){ // display next image
					if(!(TB_PrevHTML == "")){
						document.onkeydown = "";
						goPrev();
					}
				}	
			};
			
			tb_position();
			$("#tb_load").remove();
			$("#tb_imageoff").click(tb_remove);
			$("#tb_window").css({display:"block"}); //for safari using css instead of show
			};
			
			imgPreloader.src = url;
		}else{//code to show html
			
			var queryString = url.replace(/^[^\?]+\??/,'');
			var params = tb_parseQuery( queryString );

			TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
			TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
			ajaxContentW = TB_WIDTH - 30;
			ajaxContentH = TB_HEIGHT - 45;
			
			if(url.indexOf('tb_iframe') != -1){// either iframe or ajax window		
					urlNoQuery = url.split('tb_');
					$("#tb_iframeContent").remove();
					if(params['modal'] != "true"){//iframe no modal
						$("#tb_window").append("<div id='tb_title'><div id='tb_ajaxwindowtitle'>"+caption+"</div><div id='tb_closeajaxwindow'><a href='#' id='tb_closewindowbutton' title='Close'>Close</a> or Esc Key</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='tb_iframecontent' name='tb_iframecontent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");
					}else{//iframe modal
					$("#tb_overlay").unbind();
						$("#tb_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>");
					}
			}else{// not an iframe, ajax
					if($("#tb_window").css("display") != "block"){
						if(params['modal'] != "true"){//ajax no modal
						$("#tb_window").append("<div id='tb_title'><div id='tb_ajaxwindowtitle'>"+caption+"</div><div id='tb_closeajaxwindow'><a href='#' id='tb_closewindowbutton'>Close</a> or Esc Key</div></div><div id='tb_ajaxcontent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
						}else{//ajax modal
						$("#tb_overlay").unbind();
						$("#tb_window").append("<div id='tb_ajaxcontent' class='tb_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>");	
						}
					}else{//this means the window is already up, we are just loading new content via ajax
						$("#tb_ajaxcontent")[0].style.width = ajaxContentW +"px";
						$("#tb_ajaxcontent")[0].style.height = ajaxContentH +"px";
						$("#tb_ajaxcontent")[0].scrollTop = 0;
						$("#tb_ajaxwindowtitle").html(caption);
					}
			}
					
			$("#tb_closewindowbutton").click(tb_remove);
			
				if(url.indexOf('tb_inline') != -1){	
					$("#tb_ajaxcontent").append($('#' + params['inlineId']).children());
					$("#tb_window").unload(function () {
						$('#' + params['inlineId']).append( $("#tb_ajaxcontent").children() ); // move elements back when you're finished
					});
					tb_position();
					$("#tb_load").remove();
					$("#tb_window").css({display:"block"}); 
				}else if(url.indexOf('tb_iframe') != -1){
					tb_position();
					if($.browser.safari){//safari needs help because it will not fire iframe onload
						$("#tb_load").remove();
						$("#tb_window").css({display:"block"});
					}
				}else{
					$("#tb_ajaxcontent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
						tb_position();
						$("#tb_load").remove();
						tb_init("#tb_ajaxcontent a.thickbox");
						$("#tb_window").css({display:"block"});
					});
				}
			
		}

		if(!params['modal']){
			document.onkeyup = function(e){ 	
				if (e == null) { // ie
					keycode = event.keyCode;
				} else { // mozilla
					keycode = e.which;
				}
				if(keycode == 27){ // close
					tb_remove();
				}	
			};
		}
		
	} catch(e) {
		//nothing here
	}
}

//helper functions below
function tb_showIframe(){
	$("#tb_load").remove();
	$("#tb_window").css({display:"block"});
}

function tb_remove() {
 	$("#tb_imageoff").unbind("click");
	$("#tb_closewindowbutton").unbind("click");
	$("#tb_window").fadeOut("fast",function(){$('#tb_window,#tb_overlay,#tb_hideselect').trigger("unload").unbind().remove();});
	$("#tb_load").remove();
	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
		$("body","html").css({height: "auto", width: "auto"});
		$("html").css("overflow","");
	}
	document.onkeydown = "";
	document.onkeyup = "";
	return false;
}

function tb_position() {
$("#tb_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'});
	if ( !(jQuery.browser.msie && jQuery.browser.version < 7)) { // take away IE6
		$("#tb_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'});
	}
}

function tb_parseQuery ( query ) {
   var Params = {};
   if ( ! query ) {return Params;}// return empty object
   var Pairs = query.split(/[;&]/);
   for ( var i = 0; i < Pairs.length; i++ ) {
      var KeyVal = Pairs[i].split('=');
      if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
      var key = unescape( KeyVal[0] );
      var val = unescape( KeyVal[1] );
      val = val.replace(/\+/g, ' ');
      Params[key] = val;
   }
   return Params;
}

function tb_getPageSize(){
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
	arrayPageSize = [w,h];
	return arrayPageSize;
}

function tb_detectMacXFF() {
  var userAgent = navigator.userAgent.toLowerCase();
  if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) {
    return true;
  }
}




//
//
//   path: /RI/components/js/jquery/thickbox.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/jquery/jquery.dimensions.js  (Begin) 
//
//


/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-09-30 10:53:27 +0200 (Sun, 30 Sep 2007) $
 * $Rev: 516 $
 *
 * Version: 1.0rc1
 */

(function($){

// store a copy of the core height and width methods
var height = $.fn.height,
    width  = $.fn.width;

$.fn.extend({
	/**
	 * If used on document, returns the document's height (innerHeight).
	 * If used on window, returns the viewport's (window) height.
	 * See core docs on height() to see what happens when used on an element.
	 *
	 * @example $("#testdiv").height()
	 * @result 200
	 *
	 * @example $(document).height()
	 * @result 800
	 *
	 * @example $(window).height()
	 * @result 400
	 *
	 * @name height
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	height: function() {
		if ( this[0] == window )
			return self.innerHeight ||
				$.boxModel && document.documentElement.clientHeight || 
				document.body.clientHeight;
		
		if ( this[0] == document )
			return Math.max( document.body.scrollHeight, document.body.offsetHeight );
		
		return height.apply(this, arguments);
	},
	
	/**
	 * If used on document, returns the document's width (innerWidth).
	 * If used on window, returns the viewport's (window) width.
	 * See core docs on width() to see what happens when used on an element.
	 *
	 * @example $("#testdiv").width()
	 * @result 200
	 *
	 * @example $(document).width()
	 * @result 800
	 *
	 * @example $(window).width()
	 * @result 400
	 *
	 * @name width
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	width: function() {
		if ( this[0] == window )
			return self.innerWidth ||
				$.boxModel && document.documentElement.clientWidth ||
				document.body.clientWidth;

		if ( this[0] == document )
			return Math.max( document.body.scrollWidth, document.body.offsetWidth );

		return width.apply(this, arguments);
	},
	
	/**
	 * Returns the inner height value (without the border) for the first matched element.
	 * If used on document, returns the document's height (innerHeight).
	 * If used on window, returns the viewport's (window) height.
	 *
	 * @example $("#testdiv").innerHeight()
	 * @result 210
	 *
	 * @name innerHeight
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	innerHeight: function() {
		return this[0] == window || this[0] == document ?
			this.height() :
			this.is(':visible') ?
				this[0].offsetHeight - num(this, 'borderTopWidth') - num(this, 'borderBottomWidth') :
				this.height() + num(this, 'paddingTop') + num(this, 'paddingBottom');
	},
	
	/**
	 * Returns the inner width value (without the border) for the first matched element.
	 * If used on document, returns the document's width (innerWidth).
	 * If used on window, returns the viewport's (window) width.
	 *
	 * @example $("#testdiv").innerWidth()
	 * @result 210
	 *
	 * @name innerWidth
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	innerWidth: function() {
		return this[0] == window || this[0] == document ?
			this.width() :
			this.is(':visible') ?
				this[0].offsetWidth - num(this, 'borderLeftWidth') - num(this, 'borderRightWidth') :
				this.width() + num(this, 'paddingLeft') + num(this, 'paddingRight');
	},
	
	/**
	 * Returns the outer height value (including the border) for the first matched element.
	 * If used on document, returns the document's height (innerHeight).
	 * If used on window, returns the viewport's (window) height.
	 *
	 * @example $("#testdiv").outerHeight()
	 * @result 220
	 *
	 * @name outerHeight
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	outerHeight: function() {
		return this[0] == window || this[0] == document ?
			this.height() :
			this.is(':visible') ?
				this[0].offsetHeight :
				this.height() + num(this,'borderTopWidth') + num(this, 'borderBottomWidth') + num(this, 'paddingTop') + num(this, 'paddingBottom');
	},
	
	/**
	 * Returns the outer width value (including the border) for the first matched element.
	 * If used on document, returns the document's width (innerWidth).
	 * If used on window, returns the viewport's (window) width.
	 *
	 * @example $("#testdiv").outerHeight()
	 * @result 1000
	 *
	 * @name outerHeight
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	outerWidth: function() {
		return this[0] == window || this[0] == document ?
			this.width() :
			this.is(':visible') ?
				this[0].offsetWidth :
				this.width() + num(this, 'borderLeftWidth') + num(this, 'borderRightWidth') + num(this, 'paddingLeft') + num(this, 'paddingRight');
	},
	
	/**
	 * Returns how many pixels the user has scrolled to the right (scrollLeft).
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $(window).scrollLeft()
	 * @result 100
	 *
	 * @example $(document).scrollLeft()
	 * @result 100
	 * 
	 * @example $("#testdiv").scrollLeft()
	 * @result 100
	 *
	 * @name scrollLeft
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	/**
	 * Sets the scrollLeft property for each element and continues the chain.
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $(window).scrollLeft(100).scrollLeft()
	 * @result 100
	 * 
	 * @example $(document).scrollLeft(100).scrollLeft()
	 * @result 100
	 *
	 * @example $("#testdiv").scrollLeft(100).scrollLeft()
	 * @result 100
	 *
	 * @name scrollLeft
	 * @param Number value A positive number representing the desired scrollLeft.
	 * @type jQuery
	 * @cat Plugins/Dimensions
	 */
	scrollLeft: function(val) {
		if ( val != undefined )
			// set the scroll left
			return this.each(function() {
				if (this == window || this == document)
					window.scrollTo( val, $(window).scrollTop() );
				else
					this.scrollLeft = val;
			});
		
		// return the scroll left offest in pixels
		if ( this[0] == window || this[0] == document )
			return self.pageXOffset ||
				$.boxModel && document.documentElement.scrollLeft ||
				document.body.scrollLeft;
				
		return this[0].scrollLeft;
	},
	
	/**
	 * Returns how many pixels the user has scrolled to the bottom (scrollTop).
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $(window).scrollTop()
	 * @result 100
	 *
	 * @example $(document).scrollTop()
	 * @result 100
	 * 
	 * @example $("#testdiv").scrollTop()
	 * @result 100
	 *
	 * @name scrollTop
	 * @type Number
	 * @cat Plugins/Dimensions
	 */
	/**
	 * Sets the scrollTop property for each element and continues the chain.
	 * Works on containers with overflow: auto and window/document.
	 *
	 * @example $(window).scrollTop(100).scrollTop()
	 * @result 100
	 * 
	 * @example $(document).scrollTop(100).scrollTop()
	 * @result 100
	 *
	 * @example $("#testdiv").scrollTop(100).scrollTop()
	 * @result 100
	 *
	 * @name scrollTop
	 * @param Number value A positive number representing the desired scrollTop.
	 * @type jQuery
	 * @cat Plugins/Dimensions
	 */
	scrollTop: function(val) {
		if ( val != undefined )
			// set the scroll top
			return this.each(function() {
				if (this == window || this == document)
					window.scrollTo( $(window).scrollLeft(), val );
				else
					this.scrollTop = val;
			});
		
		// return the scroll top offset in pixels
		if ( this[0] == window || this[0] == document )
			return self.pageYOffset ||
				$.boxModel && document.documentElement.scrollTop ||
				document.body.scrollTop;

		return this[0].scrollTop;
	},
	
	/** 
	 * Returns the top and left positioned offset in pixels.
	 * The positioned offset is the offset between a positioned
	 * parent and the element itself. The position method takes
	 * an optional map of key value pairs to configure the way
	 * the offset is calculated. Here are the different options.
	 *
	 * (Boolean) margin - Should the margin of the element be included in the calculations? False by default.
	 * (Boolean) border - Should the border of the element be included in the calculations? False by default. 
	 * (Boolean) padding - Should the padding of the element be included in the calcuations? False by default.
	 * (Boolean) scroll - Sould the scroll offsets of the parent elements be included int he calculations? False by default.
	 *                    When true it adds the total scroll offsets of all parents to the total offset and also adds two
	 *                    properties to the returned object, scrollTop and scrollLeft.
	 *
	 * Also an object can be passed as the second paramater to
	 * catch the value of the return and continue the chain.
	 *
	 * For accurate readings make sure to use pixel values for margins, borders and padding.
	 *
	 * @example $("#testdiv").position()
	 * @result { top: 100, left: 100 }
	 *
	 * @example $("#testdiv").position({ margin: true, border: true, padding: true })
	 * @result { top: 90, left: 90 }
	 *
	 * @example var position = {};
	 * $("#testdiv").position({}, position)
	 * @result position = { top: 100, left: 100 }
	 * 
	 * @name position
	 * @param Map options Optional settings to configure the way the offset is calculated.
	 * @param Object returnObject Optional An object to store the return value in, so as not to break the chain. If passed in the
	 *                            chain will not be broken and the result will be assigned to this object.
	 * @type Object
	 * @cat Plugins/Dimensions
	 */
	position: function(options, returnObject) {
		var elem = this[0], parent = elem.parentNode, op = elem.offsetParent,
		    options = $.extend({ margin: false, border: false, padding: false, scroll: false }, options || {}),
			x = elem.offsetLeft,
			y = elem.offsetTop, 
			sl = elem.scrollLeft, 
			st = elem.scrollTop;
			
		// Mozilla and IE do not add the border
		if ($.browser.mozilla || $.browser.msie) {
			// add borders to offset
			x += num(elem, 'borderLeftWidth');
			y += num(elem, 'borderTopWidth');
		}
		
		// Safari and opera includes border on positioned parents
		if (($.browser.safari || $.browser.opera) && $.css(op, 'position') != 'static') {
			x -= num(op, 'borderLeftWidth');
			y -= num(op, 'borderTopWidth');
		}

		if ($.browser.mozilla) {
			do {
				// Mozilla does not add the border for a parent that has overflow set to anything but visible
				if (parent != elem && $.css(parent, 'overflow') != 'visible') {
					x += num(parent, 'borderLeftWidth');
					y += num(parent, 'borderTopWidth');
				}

				if (parent == op) break; // break if we are already at the offestParent
			} while ((parent = parent.parentNode) && parent.tagName != 'BODY');
		}
		
		if ($.browser.msie && (op.tagName != 'BODY' && $.css(op, 'position') == 'static')) {
			do {
				x += op.offsetLeft;
				y += op.offsetTop;
				// add borders to offset
				x += num(op, 'borderLeftWidth');
				y += num(op, 'borderTopWidth');
			} while ((op = op.offsetParent) && (op.tagName != 'BODY' && $.css(op, 'position') == 'static'));
		}
		
		var returnValue = handleOffsetReturn(elem, options, x, y, sl, st);
		
		if (returnObject) { $.extend(returnObject, returnValue); return this; }
		else              { return returnValue; }
	},
	
	/**
	 * Returns the location of the element in pixels from the top left corner of the viewport.
	 * The offset method takes an optional map of key value pairs to configure the way
	 * the offset is calculated. Here are the different options.
	 *
	 * (Boolean) margin - Should the margin of the element be included in the calculations? True by default.
	 * (Boolean) border - Should the border of the element be included in the calculations? False by default. 
	 * (Boolean) padding - Should the padding of the element be included in the calcuations? False by default. 
	 * (Boolean) scroll - Sould the scroll offsets of the parent elements be included int he calculations? True by default.
	 *                    When true it adds the total scroll offsets of all parents to the total offset and also adds two
	 *                    properties to the returned object, scrollTop and scrollLeft.
	 * (Boolean) lite - When true it will use the offsetLite method instead of the full-blown, slower offset method. False by default.
	 *                  Only use this when margins, borders and padding calculations don't matter.
	 *
	 * Also an object can be passed as the second paramater to
	 * catch the value of the return and continue the chain.
	 *
	 * For accurate readings make sure to use pixel values for margins, borders and padding.
	 * 
	 * Known issues:
	 *  - Issue: A div positioned relative or static without any content before it and its parent will report an offsetTop of 0 in Safari
	 *    Workaround: Place content before the relative div ... and set height and width to 0 and overflow to hidden
	 *
	 * @example $("#testdiv").offset()
	 * @result { top: 100, left: 100, scrollTop: 10, scrollLeft: 10 }
	 *
	 * @example $("#testdiv").offset({ scroll: false })
	 * @result { top: 90, left: 90 }
	 *
	 * @example var offset = {}
	 * $("#testdiv").offset({ scroll: false }, offset)
	 * @result offset = { top: 90, left: 90 }
	 *
	 * @name offset
	 * @param Map options Optional settings to configure the way the offset is calculated.
	 * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
	 *                            chain will not be broken and the result will be assigned to this object.
	 * @type Object
	 * @cat Plugins/Dimensions
	 */
	offset: function(options, returnObject) {
		var x = 0, y = 0, sl = 0, st = 0,
		    elem = this[0], parent = this[0], op, parPos, elemPos = $.css(elem, 'position'),
		    mo = $.browser.mozilla, ie = $.browser.msie, sf = $.browser.safari, oa = $.browser.opera,
		    absparent = false, relparent = false, 
		    options = $.extend({ margin: true, border: false, padding: false, scroll: true, lite: false }, options || {});
		
		// Use offsetLite if lite option is true
		if (options.lite) return this.offsetLite(options, returnObject);
		
		if (elem.tagName == 'BODY') {
			// Safari is the only one to get offsetLeft and offsetTop properties of the body "correct"
			// Except they all mess up when the body is positioned absolute or relative
			x = elem.offsetLeft;
			y = elem.offsetTop;
			// Mozilla ignores margin and subtracts border from body element
			if (mo) {
				x += num(elem, 'marginLeft') + (num(elem, 'borderLeftWidth')*2);
				y += num(elem, 'marginTop')  + (num(elem, 'borderTopWidth') *2);
			} else
			// Opera ignores margin
			if (oa) {
				x += num(elem, 'marginLeft');
				y += num(elem, 'marginTop');
			} else
			// IE does not add the border in Standards Mode
			if (ie && jQuery.boxModel) {
				x += num(elem, 'borderLeftWidth');
				y += num(elem, 'borderTopWidth');
			}
		} else {
			do {
				parPos = $.css(parent, 'position');
			
				x += parent.offsetLeft;
				y += parent.offsetTop;

				// Mozilla and IE do not add the border
				if (mo || ie) {
					// add borders to offset
					x += num(parent, 'borderLeftWidth');
					y += num(parent, 'borderTopWidth');

					// Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
					if (mo && parPos == 'absolute') absparent = true;
					// IE does not include the border on the body if an element is position static and without an absolute or relative parent
					if (ie && parPos == 'relative') relparent = true;
				}

				op = parent.offsetParent;
				if (options.scroll || mo) {
					do {
						if (options.scroll) {
							// get scroll offsets
							sl += parent.scrollLeft;
							st += parent.scrollTop;
						}
				
						// Mozilla does not add the border for a parent that has overflow set to anything but visible
						if (mo && parent != elem && $.css(parent, 'overflow') != 'visible') {
							x += num(parent, 'borderLeftWidth');
							y += num(parent, 'borderTopWidth');
						}
				
						parent = parent.parentNode;
					} while (parent != op);
				}
				parent = op;

				if (parent.tagName == 'BODY' || parent.tagName == 'HTML') {
					// Safari and IE Standards Mode doesn't add the body margin for elments positioned with static or relative
					if ((sf || (ie && $.boxModel)) && elemPos != 'absolute' && elemPos != 'fixed') {
						x += num(parent, 'marginLeft');
						y += num(parent, 'marginTop');
					}
					// Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
					// IE does not include the border on the body if an element is positioned static and without an absolute or relative parent
					if ( (mo && !absparent && elemPos != 'fixed') || 
					     (ie && elemPos == 'static' && !relparent) ) {
						x += num(parent, 'borderLeftWidth');
						y += num(parent, 'borderTopWidth');
					}
					break; // Exit the loop
				}
			} while (parent);
		}

		var returnValue = handleOffsetReturn(elem, options, x, y, sl, st);

		if (returnObject) { $.extend(returnObject, returnValue); return this; }
		else              { return returnValue; }
	},
	
	/**
	 * Returns the location of the element in pixels from the top left corner of the viewport.
	 * This method is much faster than offset but not as accurate. This method can be invoked
	 * by setting the lite option to true in the offset method.
	 * The offsetLite method takes an optional map of key value pairs to configure the way
	 * the offset is calculated. Here are the different options.
	 *
	 * (Boolean) margin - Should the margin of the element be included in the calculations? True by default.
	 * (Boolean) border - Should the border of the element be included in the calculations? False by default. 
	 * (Boolean) padding - Should the padding of the element be included in the calcuations? False by default. 
	 * (Boolean) scroll - Sould the scroll offsets of the parent elements be included int he calculations? True by default.
	 *                    When true it adds the total scroll offsets of all parents to the total offset and also adds two
	 *                    properties to the returned object, scrollTop and scrollLeft.
	 *
	 * @name offsetLite
	 * @param Map options Optional settings to configure the way the offset is calculated.
	 * @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
	 *                            chain will not be broken and the result will be assigned to this object.
	 * @type Object
	 * @cat Plugins/Dimensions
	 */
	offsetLite: function(options, returnObject) {
		var x = 0, y = 0, sl = 0, st = 0, parent = this[0], op, 
		    options = $.extend({ margin: true, border: false, padding: false, scroll: true }, options || {});
				
		do {
			x += parent.offsetLeft;
			y += parent.offsetTop;

			op = parent.offsetParent;
			if (options.scroll) {
				// get scroll offsets
				do {
					sl += parent.scrollLeft;
					st += parent.scrollTop;
					parent = parent.parentNode;
				} while(parent != op);
			}
			parent = op;
		} while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML');

		var returnValue = handleOffsetReturn(this[0], options, x, y, sl, st);

		if (returnObject) { $.extend(returnObject, returnValue); return this; }
		else              { return returnValue; }
	}
});

/**
 * Handles converting a CSS Style into an Integer.
 * @private
 */
var num = function(el, prop) {
	return parseInt($.css(el.jquery?el[0]:el,prop))||0;
};

/**
 * Handles the return value of the offset and offsetLite methods.
 * @private
 */
var handleOffsetReturn = function(elem, options, x, y, sl, st) {
	if ( !options.margin ) {
		x -= num(elem, 'marginLeft');
		y -= num(elem, 'marginTop');
	}

	// Safari and Opera do not add the border for the element
	if ( options.border && ($.browser.safari || $.browser.opera) ) {
		x += num(elem, 'borderLeftWidth');
		y += num(elem, 'borderTopWidth');
	} else if ( !options.border && !($.browser.safari || $.browser.opera) ) {
		x -= num(elem, 'borderLeftWidth');
		y -= num(elem, 'borderTopWidth');
	}

	if ( options.padding ) {
		x += num(elem, 'paddingLeft');
		y += num(elem, 'paddingTop');
	}
	
	// do not include scroll offset on the element
	if ( options.scroll ) {
		sl -= elem.scrollLeft;
		st -= elem.scrollTop;
	}

	return options.scroll ? { top: y - st, left: x - sl, scrollTop:  st, scrollLeft: sl }
	                      : { top: y, left: x };
};

})(jQuery);


//
//
//   path: /RI/components/js/jquery/jquery.dimensions.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/jquery/jquery.gradient.js  (Begin) 
//
//


/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Color functions from Steve's Cross Browser Gradient Backgrounds v1.0 (steve@slayeroffice.com && http://slayeroffice.com/code/gradient/)
 *
 * $LastChangedDate: 2007-09-30 10:53:27 +0200 (Sun, 30 Sep 2007) $
 * $Rev: 516 $
 *
 * Version 1.0
 */
(function($) {

/**
 * Adds a gradient to the background of an element.
 *
 * @example $('div').gradient({ from: '000000', to: 'CCCCCC' });
 *
 * @param Map options Settings/options to configure the gradient.
 * @option String from The hex color code to start the gradient with.
 * 		By default the value is "000000".
 * @option String to The hex color code to end the gradient with.
 * 		By default the value is "FFFFFF".
 * @option String direction This tells the gradient to be horizontal
 *      or vertical. By default the value is "horizontal".
 * @option Number length This is used to constrain the gradient to a
 *      particular width or height (depending on the direction). By default
 *      the length is set to null, which will use the width or height
 *      (depending on the direction) of the element.
 * @option String position This tells the gradient to be positioned
 *      at the top, bottom, left and/or right within the element. The
 *      value is just a string that specifices top or bottom and left or right.
 *      By default the value is 'top left'.
 *
 * @name gradient
 * @type jQuery
 * @cat Plugins/gradient
 * @author Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 */
$.fn.gradient = function(options) {
	options = $.extend({ from: '000000', to: 'ffffff', direction: 'horizontal', position: 'top', length: null }, options || {});
	var createColorPath = function(startColor, endColor, distance) {
		var colorPath = [],
		    colorPercent = 1.0,
			distance = (distance < 100) ? distance : 100;
		do {
			colorPath[colorPath.length] = setColorHue(longHexToDec(startColor), colorPercent, longHexToDec(endColor));	
			colorPercent -= ((100/distance)*0.01);
		} while (colorPercent>0);
		return colorPath;
	},
	setColorHue = function(originColor, opacityPercent, maskRGB) {
		var returnColor = [];
		for (var i=0; i<originColor.length; i++)
			returnColor[i] = Math.round(originColor[i]*opacityPercent) + Math.round(maskRGB[i]*(1.0-opacityPercent));
		return returnColor;
	},
	longHexToDec = function(longHex) {
		return new Array(toDec(longHex.substring(0,2)),toDec(longHex.substring(2,4)),toDec(longHex.substring(4,6)));
	},
	toDec = function(hex) {
		return parseInt(hex,16);
	};
	return this.each(function() {
		var $this = $(this), width = $this.innerWidth(), height = $this.innerHeight(), x = 0, y = 0, w = 1, h = 1, html = [],
		    length = options.length || (options.direction == 'vertical' ? width : height),
		    position = (options.position == 'bottom' ? 'bottom:0;' : 'top:0;') + (options.position == 'right' ? 'right:0;' : 'left:0;'), 
		    colorArray = createColorPath(options.from, options.to, length);
		
		if (options.direction == 'horizontal') {
			h = Math.round(length/colorArray.length) || 1;
			w = width;
		} else {
			w = Math.round(length/colorArray.length) || 1;
			h = height;
		}
		
		html.push('<div class="gradient" style="position: absolute; ' + position + ' width: ' + (options.direction == 'vertical' ? length+"px" : "100%") +'; height: ' + (options.direction == 'vertical' ? "100%" : length+"px") + '; overflow: hidden; z-index: 0; background-color: #' + (options.position.indexOf('bottom') != -1 ? options.from : options.to) + '">');
		for(var i=0; i<colorArray.length; i++) {
			html.push('<div style="position:absolute;z-index:1;top:' + y + 'px;left:' + x + 'px;height:' + (options.direction == 'vertical' ? "100%" : h+"px") + ';width:' + (options.direction == 'vertical' ? w+"px" : "100%") + ';background-color:rgb(' + colorArray[i][0] + ',' + colorArray[i][1] + ',' + colorArray[i][2] + ');"></div>');
			options.direction == 'vertical' ? x+=w : y+=h;
			
			if ( y >= height || x >= width) break;
		}
		html.push('</div>');
		
		if ( $this.css('position') == 'static' )
			$this.css('position', 'relative');
		
		$this
			.html('<div style="display:' + $this.css("display") + '; position: relative; z-index: 2;">' + this.innerHTML + '</div>')
			.prepend(html.join(''));
	});
};

})(jQuery);


//
//
//   path: /RI/components/js/jquery/jquery.gradient.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/jquery/pnglet.cut.min.js  (Begin) 
//
//


/**
 * @author fedotp@realcommerce.co.il
 * NOTE: the original Pnglet code was allmost fully rewriten and cuted
 * and this code deriviated from Pnglet library + Fedot's modifications
 * the base64 convertion function is also was changed and other version
 * than in original was used since the new implementation much faster
 *
 * After all modifications we can say this is the fastest ever method of
 * creation PNG based gradient images in JavaScript
 */
function Pnglet(width,height,depth){this.width=width||16;this.height=height||16;this.depth=Math.min(256,depth||16);this.pix_size=height*(width+1);this.data_size=2+this.pix_size+5*Math.floor((this.pix_size+0xffff-1)/0xffff)+4;this.ihdr_offs=0;this.ihdr_size=4+4+13+4;this.plte_offs=this.ihdr_offs+this.ihdr_size;this.plte_size=4+4+3*depth+4;this.trns_offs=this.plte_offs+this.plte_size;this.trns_size=4+4+depth+4;this.idat_offs=this.trns_offs+this.trns_size;this.idat_size=4+4+this.data_size+4;this.iend_offs=this.idat_offs+this.idat_size;this.iend_size=4+4+4;this.png_size=this.iend_offs+this.iend_size;this.png=new Array(this.png_size);function initialize(png,offs,str){for(var i=1;i<arguments.length;i+=1)
if(typeof arguments[i].length!="undefined")
for(var j=0;j<arguments[i].length;j+=1)
png[offs++]=arguments[i].charAt(j);};function byte2(w){return String.fromCharCode((w>>8)&255,w&255);};function byte4(w){return String.fromCharCode((w>>24)&255,(w>>16)&255,(w>>8)&255,w&255);};function byte2lsb(w){return String.fromCharCode(w&255,(w>>8)&255);};for(var i=0;i<this.png_size;i+=1)
this.png[i]=String.fromCharCode(0);initialize(this.png,this.ihdr_offs,byte4(this.ihdr_size-12),'IHDR',byte4(width),byte4(height),String.fromCharCode(8,3));initialize(this.png,this.plte_offs,byte4(this.plte_size-12),'PLTE');initialize(this.png,this.trns_offs,byte4(this.trns_size-12),'tRNS');initialize(this.png,this.idat_offs,byte4(this.idat_size-12),'IDAT');initialize(this.png,this.iend_offs,byte4(this.iend_size-12),'IEND');var header=((8+(7<<4))<<8)|(3<<6);header+=31-(header%31);initialize(this.png,this.idat_offs+8,byte2(header));for(i=0;i*0xffff<this.pix_size;i+=1){var size,bits;if(i+0xffff<this.pix_size){size=0xffff;bits=String.fromCharCode(0);}else{size=this.pix_size-i*0xffff;bits=String.fromCharCode(1);}
initialize(this.png,this.idat_offs+8+2+i*(5+0xffff),bits,byte2lsb(size),byte2lsb(~size));}
this.palette=new Object();this.pindex=0;}
Pnglet.version="19990427.0";Pnglet.prototype.inBounds=function(x,y){return x>=0&&x<this.width&&y>=0&&y<this.height;}
Pnglet.prototype.clipX=function(x){return(x<0)?0:(x>=this.width)?this.width-1:x;}
Pnglet.prototype.clipY=function(y){return(y<0)?0:(y>=this.height)?this.height-1:y;}
Pnglet.prototype.index=function(x,y){var i=y*(this.width+1)+x+1;var j=this.idat_offs+8+2+Math.floor((i/0xffff)+1)*5+i;return j;}
Pnglet.prototype.color=function(red,green,blue,alpha){alpha=alpha>=0?alpha:255;var rgba=(((((alpha<<8)+red)<<8)+green)<<8)+blue;if(typeof this.palette[rgba]=="undefined"){if(this.pindex==this.depth)return String.fromCharCode(0);this.palette[rgba]=String.fromCharCode(this.pindex);this.png[this.plte_offs+8+this.pindex*3+0]=String.fromCharCode(red);this.png[this.plte_offs+8+this.pindex*3+1]=String.fromCharCode(green);this.png[this.plte_offs+8+this.pindex*3+2]=String.fromCharCode(blue);this.png[this.trns_offs+8+this.pindex]=String.fromCharCode(alpha);this.pindex+=1;}
return this.palette[rgba];}
Pnglet.prototype.isColor=function(color){return typeof(color)=='string'&&color.length==1&&color.charCodeAt(0)>=0&&color.charCodeAt(0)<this.depth;}
Pnglet.prototype.red=function(color){return this.png[this.plte_offs+8+color.charCodeAt(0)*3+0].charCodeAt(0);}
Pnglet.prototype.green=function(color){return this.png[this.plte_offs+8+color.charCodeAt(0)*3+1].charCodeAt(0);}
Pnglet.prototype.blue=function(color){return this.png[this.plte_offs+8+color.charCodeAt(0)*3+2].charCodeAt(0);}
Pnglet.prototype.alpha=function(color){return this.png[this.trns_offs+8+color.charCodeAt(0)].charCodeAt(0);}
Pnglet.prototype.point=function(pointColor,x0,y0){var a=arguments;this.pointNXY(pointColor,(a.length-1)/2,function(i){return a[2*i+1];},function(i){return a[2*i+2];});}
Pnglet.prototype.pointNXY=function(pointColor,n,x,y){if(!this.isColor(pointColor))
return;for(var i=0;i<n;i+=1){var x1=x(i),y1=y(i);if(this.inBounds(x1,y1))
this.png[this.index(x1,y1)]=pointColor;}}
Pnglet.prototype.output=function(){function initialize(png,offs,str){for(var i=1;i<arguments.length;i+=1)
if(typeof arguments[i].length!="undefined")
for(var j=0;j<arguments[i].length;j+=1)
png[offs++]=arguments[i].charAt(j);}
function byte4(w){return String.fromCharCode((w>>24)&255,(w>>16)&255,(w>>8)&255,w&255);}
var BASE=65521;var NMAX=5552;var s1=1;var s2=0;var n=NMAX;for(var y=0;y<this.height;y+=1)
for(var x=-1;x<this.width;x+=1){s1+=this.png[this.index(x,y)].charCodeAt(0);s2+=s1;if((n-=1)==0){s1%=BASE;s2%=BASE;n=NMAX;}}
s1%=BASE;s2%=BASE;initialize(this.png,this.idat_offs+this.idat_size-8,byte4((s2<<16)|s1));function crc32(png,offs,size){var crc=-1;for(var i=4;i<size-4;i+=1)
crc=Pnglet.crc32_table[(crc^png[offs+i].charCodeAt(0))&0xff]^((crc>>8)&0x00ffffff);initialize(png,offs+size-4,byte4(crc^-1));}
crc32(this.png,this.ihdr_offs,this.ihdr_size);crc32(this.png,this.plte_offs,this.plte_size);crc32(this.png,this.trns_offs,this.trns_size);crc32(this.png,this.idat_offs,this.idat_size);crc32(this.png,this.iend_offs,this.iend_size);return"\211PNG\r\n\032\n"+this.png.join('');}
Pnglet.crc32_table=new Array(256);for(var n=0;n<256;n++){var c=n;for(var k=0;k<8;k++){if(c&1)
c=-306674912^((c>>1)&0x7fffffff);else
c=(c>>1)&0x7fffffff;}
Pnglet.crc32_table[n]=c;}


//
//
//   path: /RI/components/js/jquery/pnglet.cut.min.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/jquery/jquery.pngradient.js  (Begin) 
//
//


/**
 * @author fedotp@realcommerce.co.il
 */
jQuery.fn.pngradient = function(options){
  return this.each(function(){
    var width = $(this).innerWidth(), height = $(this).innerHeight(), x = 0, y = 0, w = 1, h = 1, html = [];
    if (options.direction != 'vertical'){
      width=1;
      length = height;
    } else {
      height=1;
      length = width;
    }
    options = $.extend({'width':width,'height':height,'length':length}, options);
    bitmap_cache = (typeof bitmap_cache != "undefined"?bitmap_cache:{});
    key = options.from+options.to+options.direction+length;
    if ($(this).attr('gradient')==key)return;
    if (!bitmap_cache[key]){
      bitmap_cache[key] = dataUrl('image/png',(new Gradient(options) ).output());
    }
    source = bitmap_cache[key];
    $(this).attr('gradient',key);
    $(this).css('background-image','url('+source+')!important;');
  });
}

jQuery.fn.filteradiant = function(options) {
  return this.each(function(){
    alpha = 'FF';//CC is nice, this is a transparency level
    filter = 'progid:DXImageTransform.Microsoft.gradient('
             +'  enabled="true"'
             +', startColorstr=#'+alpha+options.from
             +', endColorstr=#'+alpha+options.to
             +', GradientType='+(options.direction=='vertical'?1:0)+')';
    this.style.filter = filter;
  });
}

/*
var gd_gradient_fill = function(options){
  gradient = new Gradient(options);
  return gradient;
}
*/
Gradient = function(){
  if (arguments.length) options = arguments[0];
  if (options.direction=='vertical'){
    line_numbers = options.width;
  }else{
    line_numbers = options.height;
  }
  options = $.extend({ width:1, height:1, direction:'horizontal', from:'000000', to:'ffffff', position:'top', step:0, stretch:false, 'line_numbers':line_numbers },options || {});
  return this.create(options);;
}
// Constructor. Creates, fills and returns an image
Gradient.prototype.create = function(options) {
  for (i in options) this[i] = options[i];
  this.step = parseInt(Math.abs(options.step));
  // Attempt to create a blank image with 256 color pelette
  // do not try to set number of colors to high, remember all this sheep in memmory
  this.palete = createColorPath(this.from,this.to,this.line_numbers);
  this.image = new Pnglet(this.width,this.height,256);//image;
  this.fill();
  return this.image;
}

// The main function that draws the gradient
Gradient.prototype.fill = function() {
  palete_temp = this.palete;
  line_numbers = this.line_numbers;
  colors = Array();
  repeat = (line_numbers-(line_numbers%palete_temp.length))/palete_temp.length;
  if (repeat==1)repeat=0;
  for (i in palete_temp){
    colors.push(palete_temp[i]);
    if (this.stretch && repeat)
      for (j=0;j<=repeat;j++) {
        colors.push(palete_temp[i]);
      }
  }
  last = colors.length-1;
  reversed = (this.position=='right'||this.position=='bottom');
  for ( i=0; i<line_numbers; i=i+1+this.step ) {
    r = (colors[i]?colors[i][0]:colors[last][0]);
    g = (colors[i]?colors[i][1]:colors[last][1]);
    b = (colors[i]?colors[i][2]:colors[last][2]);
    color = this.image.color( r, g, b, 255);
    if (this.direction=='vertical'){
      //this.image.point(color,(reversed?line_numbers-i:i),0);
      this.image.png[this.image.index((reversed?line_numbers-i:i),0)] = color;
    }else{
      //this.image.point(color,0,(reversed?line_numbers-i:i));
      this.image.png[this.image.index(0,(reversed?line_numbers-i:i))] = color;
    }
  }
}

/*
  Color functions from Steve's Cross Browser Gradient Backgrounds v1.0 (steve@slayeroffice.com && http://slayeroffice.com/code/gradient/)
*/

var createColorPath = function(startColor, endColor, distance) {
    var colorPath = [],
        maximum = 250,
        colorPercent = 1.0,
        distance = (distance < maximum) ? distance : maximum;
    do {
      colorPath[colorPath.length] = setColorHue(longHexToDec(startColor), colorPercent, longHexToDec(endColor));
      colorPercent -= ((100/distance)*0.01);
    } while (colorPercent>0);
    return colorPath;
  },
  setColorHue = function(originColor, opacityPercent, maskRGB) {
    var returnColor = [];
    for (var i=0; i<originColor.length; i++)
      returnColor[i] = Math.round(originColor[i]*opacityPercent) + Math.round(maskRGB[i]*(1.0-opacityPercent));
    return returnColor;
  },
  longHexToDec = function(longHex) {
    return new Array(toDec(longHex.substring(0,2)),toDec(longHex.substring(2,4)),toDec(longHex.substring(4,6)));
  },
  toDec = function(hex) {
    return parseInt(hex,16);
  };
  
/*
  convert a binary string, into a data url
  the mime type must be supplied, the encoding will be base64
*/
function dataUrl(mimetype, string) { return "data:"+mimetype+";base64,"+base64(string); }

/*
  This code was written by Tyler Akins and has been placed in the
  public domain.  It would be nice if you left this header intact.
  Base64 code from Tyler Akins -- http://rumkin.com
*/

var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

function base64(input) {
   var output = "";
   var chr1, chr2, chr3;
   var enc1, enc2, enc3, enc4;
   var i = 0;

   do {
      chr1 = input.charCodeAt(i++);
      chr2 = input.charCodeAt(i++);
      chr3 = input.charCodeAt(i++);

      enc1 = chr1 >> 2;
      enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
      enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
      enc4 = chr3 & 63;

      if (isNaN(chr2)) {
         enc3 = enc4 = 64;
      } else if (isNaN(chr3)) {
         enc4 = 64;
      }

      output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + 
         keyStr.charAt(enc3) + keyStr.charAt(enc4);
   } while (i < input.length);
   
   return output;
}


//
//
//   path: /RI/components/js/jquery/jquery.pngradient.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/jquery/jquery.gradiwrap.js  (Begin) 
//
//


/**
 * @author fedotp@realcommerce.co.il
 */

jQuery.fn.gradiwrap = function(options) {
	options = $.extend({ from: '000000', to: 'ffffff', direction: 'horizontal', position: 'top', length: null }, options || {});
	return this.each(function() {
		var width = $(this).innerWidth(), height = $(this).innerHeight(), x = 0, y = 0, w = 1, h = 1, html = [],
        length = options.length || (options.direction == 'vertical' ? width : height);
		version = (navigator.userAgent+'').replace(/^.*MSIE /,'').replace(/;.*$/,'');
    //alert(version);
    if ($.browser.mozilla || $.browser.opera) {
      brw='moz';
    } else if($.browser.msie && version>=5.5){
      brw='msie';
    } else brw='old';

    switch(brw){
      case 'msie':
        $(this).filteradiant(options);
        break;
      case 'moz':
        //$(this).bitmapgradient(options,length);
        $(this).pngradient(options);
        break;
      default:
        $(this).gradient(options);
        break;
      }
	});
};


//
//
//   path: /RI/components/js/jquery/jquery.gradiwrap.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/jquery/jquery.tablehover.js  (Begin) 
//
//


/*
 * jQuery tableHover plugin
 * Version: 0.1.4
 *
 * Copyright (c) 2007 Roman Weich
 * http://p.sohei.org
 *
 * Dual licensed under the MIT and GPL licenses 
 * (This means that you can choose the license that best suits your project, and use it accordingly):
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Changelog: 
 * v 0.1.4 - 2007-12-17
 *	- fix: clicking on a link or child element inside a cell did not set the clickClass on the rows/columns.
 * v 0.1.3 - 2007-09-04
 *	- fix: highlight did not work when the hovered table cell had child elements inside
 * v 0.1.2 - 2007-08-13
 *	- fix/change: changed event binding routine, as is got really slow with jquery 1.1.3.1
 *	-change: added new option "ignoreCols", through which columns can be excluded from the highlighting process
 * v 0.1.1 - 2007-06-05
 *	- fix: errors when using the plugin on a table not having a theader or tfoot
 * v 0.1.0 - 2007-05-31
 */

(function($)
{
	/**
	 * Calculates the actual cellIndex value of all cells in the table and stores it in the realCell property of each cell.
	 * Thats done because the cellIndex value isn't correct when colspans or rowspans are used.
	 * Originally created by Matt Kruse for his table library - Big Thanks! (see http://www.javascripttoolbox.com/)
	 * @param {element} table	The table element.
	 */
	var fixCellIndexes = function(table) 
	{
		var rows = table.rows;
		var len = rows.length;
		var matrix = [];
		for ( var i = 0; i < len; i++ )
		{
			var cells = rows[i].cells;
			var clen = cells.length;
			for ( var j = 0; j < clen; j++ )
			{
				var c = cells[j];
				var rowSpan = c.rowSpan || 1;
				var colSpan = c.colSpan || 1;
				var firstAvailCol = -1;
				if ( !matrix[i] )
				{ 
					matrix[i] = []; 
				}
				var m = matrix[i];
				// Find first available column in the first row
				while ( m[++firstAvailCol] ) {}
				c.realIndex = firstAvailCol;
				for ( var k = i; k < i + rowSpan; k++ )
				{
					if ( !matrix[k] )
					{ 
						matrix[k] = []; 
					}
					var matrixrow = matrix[k];
					for ( var l = firstAvailCol; l < firstAvailCol + colSpan; l++ )
					{
						matrixrow[l] = 1;
					}
				}
			}
		}
	};

	/**
	 * Sets the rowIndex of each row in the table. 
	 * Opera seems to get that wrong using document order instead of logical order on the tfoot-tbody part.
	 * @param {element} table	The table element.
	 */
	var fixRowIndexes = function(tbl) 
	{
		var v = 0, i, k, r = ( tbl.tHead ) ? tbl.tHead.rows : 0;
		if ( r )
		{
			for ( i = 0; i < r.length; i++ )
			{
				r[i].realRIndex = v++;
			}
		}
		for ( k = 0; k < tbl.tBodies.length; k++ )
		{
			r = tbl.tBodies[k].rows;
			if ( r )
			{
				for ( i = 0; i < r.length; i++ )
				{
					r[i].realRIndex = v++;
				}
			}
		}
		r = ( tbl.tFoot ) ? tbl.tFoot.rows : 0;
		if ( r )
		{
			for ( i = 0; i < r.length; i++ )
			{
				r[i].realRIndex = v++;
			}
		}
	};

	/**
	 * Highlights table rows and/or columns on mouse over.
	 * Fixes the highlight of the currently highlighted rows/columns on click.
	 * Works on tables with rowspans and colspans.
	 *
	 * @param {map} options			An object for optional settings (options described below).
	 *
	 * @option {boolean} allowHead		Allow highlighting when hovering over the table header.
	 *							Default value: true
	 * @option {boolean} allowBody		Allow highlighting when hovering over the table body.
	 *							Default value: true
	 * @option {boolean} allowFoot		Allow highlighting when hovering over the table footer.
	 *							Default value: true
	 *
	 * @option {boolean} headRows		If true the rows in the table header will be highlighted when hovering over them.
	 *							Default value: false
	 * @option {boolean} bodyRows		If true the rows in the table body will be highlighted when hovering over them.
	 *							Default value: true
	 * @option {boolean} footRows		If true the rows in the table footer will be highlighted when hovering over them.
	 *							Default value: false
	 * @option {boolean} spanRows		When hovering over a cell spanning over more than one row, highlight all spanned rows.
	 *							Default value: true
	 *
	 * @option {boolean} headCols		If true the cells in the table header (matching the currently hovered column) will be highlighted.
	 *							Default value: false
	 * @option {boolean} bodyCols		If true the cells in the table body (matching the currently hovered column) will be highlighted.
	 *							Default value: true
	 * @option {boolean} footCols		If true the cells in the table footer (matching the currently hovered column) will be highlighted.
	 *							Default value: false
	 * @option {boolean} spanCols		When hovering over a cell spanning over more than one column, highlight all spanned columns.
	 *							Default value: true
	 * @option {array} ignoreCols		An array of numbers. Each column with the matching column index won't be included in the highlighting process.
	 *							Index starting at 1!
	 *							Default value: [] (empty array)
	 *
	 * @option {boolean} headCells		Set a special highlight class to the cell the mouse pointer is currently pointing at (inside the table header only).
	 *							Default value: false
	 * @option {boolean} bodyCells		Set a special highlight class to the cell the mouse pointer is currently pointing at (inside the table body only).
	 *							Default value: true
	 * @option {boolean} footCells		Set a special highlight class to the cell the mouse pointer is currently pointing at (inside the table footer only).
	 *							Default value: false
	 *
	 * @option {string} rowClass			The css class set to the currently highlighted row.
	 *							Default value: 'hover'
	 * @option {string} colClass			The css class set to the currently highlighted column.
	 *							Default value: '' (empty string)
	 * @option {string} cellClass			The css class set to the currently highlighted cell.
	 *							Default value: '' (empty string)
	 * @option {string} clickClass		The css class set to the currently highlighted row and column on mouse click.
	 *							Default value: '' (empty string)
	 *
	 * @example $('#table').tableHover({});
	 * @desc Add simple row highlighting to #table with default settings.
	 *
	 * @example $('#table').tableHover({rowClass: "someclass", colClass: "someotherclass"});
	 * @desc Add row and columnhighlighting to #table and set the specified css classes to the highlighted cells.
	 *
	 * @example $('#table').tableHover({clickClass: "someclickclass"});
	 * @desc Add simple row highlighting to #table and set the specified css class on the cells when clicked.
	 *
	 * @example $('#table').tableHover({allowBody: false, allowFoot: false, allowHead: true, colClass: "someclass"});
	 * @desc Add column highlighting on #table only highlighting the cells when hovering over the table header.
	 *
	 * @example $('#table').tableHover({bodyCols: false, footCols: false, headCols: true, colClass: "someclass"});
	 * @desc Add column highlighting on #table only for the cells in the header.
	 *
	 * @type jQuery
	 *
	 * @name tableHover
	 * @cat Plugins/tableHover
	 * @author Roman Weich (http://p.sohei.org)
	 */
	$.fn.tableHover = function(options)
	{
		var settings = $.extend({
				RC_highlightSpecial : false,
				RC_highlightTableHead : false,
				RC_tableHeadId : '',
			
				allowHead : true,
				allowBody : true,
				allowFoot : true,

				headRows : false,
				bodyRows : true,
				footRows : false,
				spanRows : true,

				headCols : false,
				bodyCols : true,
				footCols : false,
				spanCols : true,
				ignoreCols : [],

				headCells : false,
				bodyCells : true,
				footCells : false,
				//css classes,,
				rowClass : 'hover',
				colClass : '',
				cellClass : '',
				clickClass : ''
			}, options);

		return this.each(function() 
        {
			var colIndex = [], rowIndex = [], tbl = this, r, rCnt = 0, lastClick = [-1, -1];

			if ( !tbl.tBodies || !tbl.tBodies.length )
			{
				return;
			}

			/**
			 * Adds all rows and each of their cells to the row and column indexes.
			 * @param {array} rows		An array of table row elements to add.
			 * @param {string} nodeName	Defines whether the rows are in the header, body or footer of the table.
			 */
			var addToIndex = function(rows, nodeName)
			{
				var c, row, rowI, cI, rI, s;
				//loop through the rows
				for ( rowI = 0; rowI < rows.length; rowI++, rCnt++ )
				{	
					row = rows[rowI];
					
					//if row's class="nohover" then continue
					if(settings.RC_highlightSpecial && 
					   row.className == 'nohover') 
						continue;
					
					//each cell
					for ( cI = 0; cI < row.cells.length; cI++ )
					{
						c = row.cells[cI];
						//add to rowindex
						if ( (nodeName == 'TBODY' && settings.bodyRows) 
							|| (nodeName == 'TFOOT' && settings.footRows) 
							|| (nodeName == 'THEAD' && settings.headRows) )
						{
							s = c.rowSpan;
							while ( --s >= 0 )
							{
								rowIndex[rCnt + s].push(c);
							}
						}
						//add do colindex
						if ( (nodeName == 'TBODY' && settings.bodyCols)
								|| (nodeName == 'THEAD' && settings.headCols) 
								|| (nodeName == 'TFOOT' && settings.footCols) )
						{
							s = c.colSpan;
							while ( --s >= 0 )
							{
								rI = c.realIndex + s;
								if ( $.inArray(rI + 1, settings.ignoreCols) > -1 )
								{
									break;//dont highlight the columns in the ignoreCols array
								}
								if ( !colIndex[rI] )
								{
									colIndex[rI] = [];
								}
								colIndex[rI].push(c);
							}
						}
						//allow hover for the cell?
						if ( (nodeName == 'TBODY' && settings.allowBody) 
								|| (nodeName == 'THEAD' && settings.allowHead) 
								|| (nodeName == 'TFOOT' && settings.allowFoot) )
						{
							c.thover = true;
						}
					}
				}
			};

			/**
			 * Mouseover event handling. Set the highlight to the rows/cells.
			 */
			var over = function(e)
			{
				var p = e.target;
				while ( p != this && p.thover !== true )
				{
					p = p.parentNode;
				}
				if ( p.thover === true )
				{
					highlight(p, true);
				}
			};

			/**
			 * Mouseout event handling. Remove the highlight from the rows/cells.
			 */
			var out = function(e)
			{
				var p = e.target;
				while ( p != this && p.thover !== true )
				{
					p = p.parentNode;
				}
				if ( p.thover === true )
				{
					highlight(p, false);
				}
			};
			
			/**
			 * Mousedown event handling. Sets or removes the clickClass css style to the currently highlighted rows/cells.
			 */
			var click = function(e)
			{
				var t = e.target;
				while ( t && t != tbl && !t.thover ) //search the real target
					t = t.parentNode;
				if ( t.thover && settings.clickClass != '' )
				{
					var x = t.realIndex, y = t.parentNode.realRIndex, s = '';
					//unclick
					$('td.' + settings.clickClass + ', th.' + settings.clickClass, tbl).removeClass(settings.clickClass);
					if ( x != lastClick[0] || y != lastClick[1] )
					{
						//click..
						if ( settings.rowClass != '' )
						{
							s += ',.' + settings.rowClass;
						}
						if ( settings.colClass != '' )
						{
							s += ',.' + settings.colClass;
						}
						if ( settings.cellClass != '' )
						{
							s += ',.' + settings.cellClass;
						}
						if ( s != '' )
						{
							$('td, th', tbl).filter(s.substring(1)).addClass(settings.clickClass);
						}
						lastClick = [x, y];
					}
					else
					{
						lastClick = [-1, -1];
					}
				}
			};
			
			/**
			 * Adds or removes the highlight to/from the columns and rows.
			 * @param {element} cell	The cell with the mouseover/mouseout event.
			 * @param {boolean} on		Defines whether the style will be set or removed.
			 */
			var highlight = function(cell, on)
			{
				if ( on ) //create dummy funcs - dont want to test for on==true all the time
				{
					$.fn.tableHoverHover = $.fn.addClass;
				}
				else
				{
					$.fn.tableHoverHover = $.fn.removeClass;
				}
				
				
				// highlight head
				if(settings.RC_highlightSpecial && settings.RC_highlightTableHead ) 
				{					
					if(cell.realIndex > 0) 
					{
						$(settings.RC_tableHeadId + " td:eq(" + cell.realIndex + ")").
									tableHoverHover(settings.colClass);
					}
				}
				
				
				//highlight columns
				var h = [], rH = [], i = 0, nn;
				
				var rI = cell.parentNode.realRIndex;
				
				if ( settings.colClass != '' )
				{	
					if(settings.RC_highlightSpecial) 
					{	
						if(cell.realIndex > 0) {
							newRI = rI;												
							
							for(i=0; i<rI; i++) 
							{
								if(tbl.rows[i].className == 'nohover') {
									newRI--;
								}
							}
							for(i=0; i<newRI; i++) 
							{							
								h = h.concat(colIndex[cell.realIndex][i]);
							}
						}
					}
					else {
						h = colIndex[cell.realIndex];
						
						while ( settings.spanCols && 
								++i < cell.colSpan && 
								colIndex[cell.realIndex + i] )
						{
							h = h.concat(colIndex[cell.realIndex + i]);
						}						
					}					
					
					$(h).tableHoverHover(settings.colClass);
				}
				//highlight rows
				if ( settings.rowClass != '' )
				{	
					if(settings.RC_highlightSpecial) 
					{						
						if ( rowIndex[rI] ) 
						{
							if(cell.realIndex > 0) 
							{
								for(i=0; i<=cell.realIndex; i++) {
									rH = rH.concat(rowIndex[rI][i]);
								}	
							}													
						}
					}
					else {
						if ( rowIndex[rI] )
						{
							rH = rH.concat(rowIndex[rI]);
						}
						i = 0;
						while ( settings.spanRows && ++i < cell.rowSpan )
						{
							if ( rowIndex[rI + i] )
							{
								rH = rH.concat(rowIndex[rI + i]);
							}
						}
					}
					$(rH).tableHoverHover(settings.rowClass);
				}
				//highlight cell
				if ( settings.cellClass != '' )
				{
					nn = cell.parentNode.parentNode.nodeName.toUpperCase();
					if ( (nn == 'TBODY' && settings.bodyCells)
							|| (nn == 'THEAD' && settings.headCells)
							|| (nn == 'TFOOT' && settings.footCells) )
					{
						$(cell).tableHoverHover(settings.cellClass);
					}
				}
			};

			fixCellIndexes(tbl);
			fixRowIndexes(tbl);

			//init rowIndex
			for ( r = 0; r < tbl.rows.length; r++ )
			{
				rowIndex[r] = [];
			}
			//add header cells to index
			if ( tbl.tHead )
			{
				addToIndex(tbl.tHead.rows, 'THEAD');
			}
			//create index - loop through the bodies
			for ( r = 0; r < tbl.tBodies.length; r++ )
			{
				addToIndex(tbl.tBodies[r].rows, 'TBODY');
			}
			//add footer cells to index
			if ( tbl.tFoot )
			{
				addToIndex(tbl.tFoot.rows, 'TFOOT');
			}
			$(this).bind('mouseover', over).bind('mouseout', out).click(click);
		});
	};
})(jQuery); 


//
//
//   path: /RI/components/js/jquery/jquery.tablehover.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/jquery/jquery.form.js  (Begin) 
//
//


/*
 * jQuery Form Plugin
 * version: 2.12 (06/07/2008)
 * @requires jQuery v1.2.2 or later
 *
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.form.js 3429 2008-06-18 08:04:06Z yossir $
 */
(function($) {

/*
    Usage Note:  
    -----------
    Do not use both ajaxSubmit and ajaxForm on the same form.  These
    functions are intended to be exclusive.  Use ajaxSubmit if you want
    to bind your own submit handler to the form.  For example,

    $(document).ready(function() {
        $('#myForm').bind('submit', function() {
            $(this).ajaxSubmit({
                target: '#output'
            });
            return false; // <-- important!
        });
    });

    Use ajaxForm when you want the plugin to manage all the event binding
    for you.  For example,

    $(document).ready(function() {
        $('#myForm').ajaxForm({
            target: '#output'
        });
    });
        
    When using ajaxForm, the ajaxSubmit function will be invoked for you
    at the appropriate time.  
*/

/**
 * ajaxSubmit() provides a mechanism for immediately submitting 
 * an HTML form using AJAX.
 */
$.fn.ajaxSubmit = function(options) {
    // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
    if (!this.length) {
        log('ajaxSubmit: skipping submit process - no element selected');
        return this;
    }

    if (typeof options == 'function')
        options = { success: options };

    options = $.extend({
        url:  this.attr('action') || window.location.toString(),
        type: this.attr('method') || 'GET'
    }, options || {});

    // hook for manipulating the form data before it is extracted;
    // convenient for use with rich editors like tinyMCE or FCKEditor
    var veto = {};
    this.trigger('form-pre-serialize', [this, options, veto]);
    if (veto.veto) {
        log('ajaxSubmit: submit vetoed via form-pre-serialize trigger');
        return this;
   }

    var a = this.formToArray(options.semantic);
    if (options.data) {
        options.extraData = options.data;
        for (var n in options.data)
            a.push( { name: n, value: options.data[n] } );
    }

    // give pre-submit callback an opportunity to abort the submit
    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
        log('ajaxSubmit: submit aborted via beforeSubmit callback');
        return this;
    }    

    // fire vetoable 'validate' event
    this.trigger('form-submit-validate', [a, this, options, veto]);
    if (veto.veto) {
        log('ajaxSubmit: submit vetoed via form-submit-validate trigger');
        return this;
    }    

    var q = $.param(a);

    if (options.type.toUpperCase() == 'GET') {
        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
        options.data = null;  // data is null for 'get'
    }
    else
        options.data = q; // data is the query string for 'post'

    var $form = this, callbacks = [];
    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });

    // perform a load on the target only if dataType is not provided
    if (!options.dataType && options.target) {
        var oldSuccess = options.success || function(){};
        callbacks.push(function(data) {
            $(options.target).html(data).each(oldSuccess, arguments);
        });
    }
    else if (options.success)
        callbacks.push(options.success);

    options.success = function(data, status) {
        for (var i=0, max=callbacks.length; i < max; i++)
            callbacks[i](data, status, $form);
    };

    // are there files to upload?
    var files = $('input:file', this).fieldValue();
    var found = false;
    for (var j=0; j < files.length; j++)
        if (files[j])
            found = true;

    // options.iframe allows user to force iframe mode
   if (options.iframe || found) { 
       // hack to fix Safari hang (thanks to Tim Molendijk for this)
       // see:  http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d
       if ($.browser.safari && options.closeKeepAlive)
           $.get(options.closeKeepAlive, fileUpload);
       else
           fileUpload();
       }
   else
       $.ajax(options);

    // fire 'notify' event
    this.trigger('form-submit-notify', [this, options]);
    return this;


    // private function for handling file uploads (hat tip to YAHOO!)
    function fileUpload() {
        var form = $form[0];
        
        if ($(':input[@name=submit]', form).length) {
            alert('Error: Form elements must not be named "submit".');
            return;
        }
        
        var opts = $.extend({}, $.ajaxSettings, options);

        var id = 'jqFormIO' + (new Date().getTime());
        var $io = $('<iframe id="' + id + '" name="' + id + '" />');
        var io = $io[0];

        if ($.browser.msie || $.browser.opera) 
            io.src = 'javascript:false;document.write("");';
        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });

        var xhr = { // mock object
            responseText: null,
            responseXML: null,
            status: 0,
            statusText: 'n/a',
            getAllResponseHeaders: function() {},
            getResponseHeader: function() {},
            setRequestHeader: function() {}
        };

        var g = opts.global;
        // trigger ajax global events so that activity/block indicators work like normal
        if (g && ! $.active++) $.event.trigger("ajaxStart");
        if (g) $.event.trigger("ajaxSend", [xhr, opts]);

        var cbInvoked = 0;
        var timedOut = 0;

        // add submitting element to data if we know it
        var sub = form.clk;
        if (sub) {
            var n = sub.name;
            if (n && !sub.disabled) {
                options.extraData = options.extraData || {};
                options.extraData[n] = sub.value;
                if (sub.type == "image") {
                    options.extraData[name+'.x'] = form.clk_x;
                    options.extraData[name+'.y'] = form.clk_y;
                }
            }
        }
        
        // take a breath so that pending repaints get some cpu time before the upload starts
        setTimeout(function() {
            // make sure form attrs are set
            var t = $form.attr('target'), a = $form.attr('action');
            $form.attr({
                target:   id,
                encoding: 'multipart/form-data',
                enctype:  'multipart/form-data',
                method:   'POST',
                action:   opts.url
            });

            // support timout
            if (opts.timeout)
                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);

            // add "extra" data to form if provided in options
            var extraInputs = [];
            try {
                if (options.extraData)
                    for (var n in options.extraData)
                        extraInputs.push(
                            $('<input type="hidden" name="'+n+'" value="'+options.extraData[n]+'" />')
                                .appendTo(form)[0]);
            
                // add iframe to doc and submit the form
                $io.appendTo('body');
                io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
                form.submit();
            }
            finally {
                // reset attrs and remove "extra" input elements
                $form.attr('action', a);
                t ? $form.attr('target', t) : $form.removeAttr('target');
                $(extraInputs).remove();
            }
        }, 10);

        function cb() {
            if (cbInvoked++) return;
            
            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);

            var operaHack = 0;
            var ok = true;
            try {
                if (timedOut) throw 'timeout';
                // extract the server response from the iframe
                var data, doc;

                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
                
                if (doc.body == null && !operaHack && $.browser.opera) {
                    // In Opera 9.2.x the iframe DOM is not always traversable when
                    // the onload callback fires so we give Opera 100ms to right itself
                    operaHack = 1;
                    cbInvoked--;
                    setTimeout(cb, 100);
                    return;
                }
                
                xhr.responseText = doc.body ? doc.body.innerHTML : null;
                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
                xhr.getResponseHeader = function(header){
                    var headers = {'content-type': opts.dataType};
                    return headers[header];
                };

                if (opts.dataType == 'json' || opts.dataType == 'script') {
                    var ta = doc.getElementsByTagName('textarea')[0];
                    xhr.responseText = ta ? ta.value : xhr.responseText;
                }
                else if (opts.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) {
                    xhr.responseXML = toXml(xhr.responseText);
                }
                data = $.httpData(xhr, opts.dataType);
            }
            catch(e){
                ok = false;
                $.handleError(opts, xhr, 'error', e);
            }

            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
            if (ok) {
                opts.success(data, 'success');
                if (g) $.event.trigger("ajaxSuccess", [xhr, opts]);
            }
            if (g) $.event.trigger("ajaxComplete", [xhr, opts]);
            if (g && ! --$.active) $.event.trigger("ajaxStop");
            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');

            // clean up
            setTimeout(function() {
                $io.remove();
                xhr.responseXML = null;
            }, 100);
        };

        function toXml(s, doc) {
            if (window.ActiveXObject) {
                doc = new ActiveXObject('Microsoft.XMLDOM');
                doc.async = 'false';
                doc.loadXML(s);
            }
            else
                doc = (new DOMParser()).parseFromString(s, 'text/xml');
            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
        };
    };
};

/**
 * ajaxForm() provides a mechanism for fully automating form submission.
 *
 * The advantages of using this method instead of ajaxSubmit() are:
 *
 * 1: This method will include coordinates for <input type="image" /> elements (if the element
 *    is used to submit the form).
 * 2. This method will include the submit element's name/value data (for the element that was
 *    used to submit the form).
 * 3. This method binds the submit() method to the form for you.
 *
 * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
 * passes the options argument along after properly binding events for submit elements and
 * the form itself.
 */ 
$.fn.ajaxForm = function(options) {
    return this.ajaxFormUnbind().bind('submit.form-plugin',function() {
        $(this).ajaxSubmit(options);
        return false;
    }).each(function() {
        // store options in hash
        $(":submit,input:image", this).bind('click.form-plugin',function(e) {
            var $form = this.form;
            $form.clk = this;
            if (this.type == 'image') {
                if (e.offsetX != undefined) {
                    $form.clk_x = e.offsetX;
                    $form.clk_y = e.offsetY;
                } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin
                    var offset = $(this).offset();
                    $form.clk_x = e.pageX - offset.left;
                    $form.clk_y = e.pageY - offset.top;
                } else {
                    $form.clk_x = e.pageX - this.offsetLeft;
                    $form.clk_y = e.pageY - this.offsetTop;
                }
            }
            // clear form vars
            setTimeout(function() { $form.clk = $form.clk_x = $form.clk_y = null; }, 10);
        });
    });
};

// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm
$.fn.ajaxFormUnbind = function() {
    this.unbind('submit.form-plugin');
    return this.each(function() {
        $(":submit,input:image", this).unbind('click.form-plugin');
    });

};

/**
 * formToArray() gathers form element data into an array of objects that can
 * be passed to any of the following ajax functions: $.get, $.post, or load.
 * Each object in the array has both a 'name' and 'value' property.  An example of
 * an array for a simple login form might be:
 *
 * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
 *
 * It is this array that is passed to pre-submit callback functions provided to the
 * ajaxSubmit() and ajaxForm() methods.
 */
$.fn.formToArray = function(semantic) {
    var a = [];
    if (this.length == 0) return a;

    var form = this[0];
    var els = semantic ? form.getElementsByTagName('*') : form.elements;
    if (!els) return a;
    for(var i=0, max=els.length; i < max; i++) {
        var el = els[i];
        var n = el.name;
        if (!n) continue;

        if (semantic && form.clk && el.type == "image") {
            // handle image inputs on the fly when semantic == true
            if(!el.disabled && form.clk == el)
                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
            continue;
        }

        var v = $.fieldValue(el, true);
        if (v && v.constructor == Array) {
            for(var j=0, jmax=v.length; j < jmax; j++)
                a.push({name: n, value: v[j]});
        }
        else if (v !== null && typeof v != 'undefined')
            a.push({name: n, value: v});
    }

    if (!semantic && form.clk) {
        // input type=='image' are not found in elements array! handle them here
        var inputs = form.getElementsByTagName("input");
        for(var i=0, max=inputs.length; i < max; i++) {
            var input = inputs[i];
            var n = input.name;
            if(n && !input.disabled && input.type == "image" && form.clk == input)
                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
        }
    }
    return a;
};

/**
 * Serializes form data into a 'submittable' string. This method will return a string
 * in the format: name1=value1&amp;name2=value2
 */
$.fn.formSerialize = function(semantic) {
    //hand off to jQuery.param for proper encoding
    return $.param(this.formToArray(semantic));
};

/**
 * Serializes all field elements in the jQuery object into a query string.
 * This method will return a string in the format: name1=value1&amp;name2=value2
 */
$.fn.fieldSerialize = function(successful) {
    var a = [];
    this.each(function() {
        var n = this.name;
        if (!n) return;
        var v = $.fieldValue(this, successful);
        if (v && v.constructor == Array) {
            for (var i=0,max=v.length; i < max; i++)
                a.push({name: n, value: v[i]});
        }
        else if (v !== null && typeof v != 'undefined')
            a.push({name: this.name, value: v});
    });
    //hand off to jQuery.param for proper encoding
    return $.param(a);
};

/**
 * Returns the value(s) of the element in the matched set.  For example, consider the following form:
 *
 *  <form><fieldset>
 *      <input name="A" type="text" />
 *      <input name="A" type="text" />
 *      <input name="B" type="checkbox" value="B1" />
 *      <input name="B" type="checkbox" value="B2"/>
 *      <input name="C" type="radio" value="C1" />
 *      <input name="C" type="radio" value="C2" />
 *  </fieldset></form>
 *
 *  var v = $(':text').fieldValue();
 *  // if no values are entered into the text inputs
 *  v == ['','']
 *  // if values entered into the text inputs are 'foo' and 'bar'
 *  v == ['foo','bar']
 *
 *  var v = $(':checkbox').fieldValue();
 *  // if neither checkbox is checked
 *  v === undefined
 *  // if both checkboxes are checked
 *  v == ['B1', 'B2']
 *
 *  var v = $(':radio').fieldValue();
 *  // if neither radio is checked
 *  v === undefined
 *  // if first radio is checked
 *  v == ['C1']
 *
 * The successful argument controls whether or not the field element must be 'successful'
 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
 * The default value of the successful argument is true.  If this value is false the value(s)
 * for each element is returned.
 *
 * Note: This method *always* returns an array.  If no valid value can be determined the
 *       array will be empty, otherwise it will contain one or more values.
 */
$.fn.fieldValue = function(successful) {
    for (var val=[], i=0, max=this.length; i < max; i++) {
        var el = this[i];
        var v = $.fieldValue(el, successful);
        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
            continue;
        v.constructor == Array ? $.merge(val, v) : val.push(v);
    }
    return val;
};

/**
 * Returns the value of the field element.
 */
$.fieldValue = function(el, successful) {
    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
    if (typeof successful == 'undefined') successful = true;

    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
        (t == 'checkbox' || t == 'radio') && !el.checked ||
        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
        tag == 'select' && el.selectedIndex == -1))
            return null;

    if (tag == 'select') {
        var index = el.selectedIndex;
        if (index < 0) return null;
        var a = [], ops = el.options;
        var one = (t == 'select-one');
        var max = (one ? index+1 : ops.length);
        for(var i=(one ? index : 0); i < max; i++) {
            var op = ops[i];
            if (op.selected) {
                // extra pain for IE...
                var v = $.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
                if (one) return v;
                a.push(v);
            }
        }
        return a;
    }
    return el.value;
};

/**
 * Clears the form data.  Takes the following actions on the form's input fields:
 *  - input text fields will have their 'value' property set to the empty string
 *  - select elements will have their 'selectedIndex' property set to -1
 *  - checkbox and radio inputs will have their 'checked' property set to false
 *  - inputs of type submit, button, reset, and hidden will *not* be effected
 *  - button elements will *not* be effected
 */
$.fn.clearForm = function() {
    return this.each(function() {
        $('input,select,textarea', this).clearFields();
    });
};

/**
 * Clears the selected form elements.
 */
$.fn.clearFields = $.fn.clearInputs = function() {
    return this.each(function() {
        var t = this.type, tag = this.tagName.toLowerCase();
        if (t == 'text' || t == 'password' || tag == 'textarea')
            this.value = '';
        else if (t == 'checkbox' || t == 'radio')
            this.checked = false;
        else if (tag == 'select')
            this.selectedIndex = -1;
    });
};

/**
 * Resets the form data.  Causes all form elements to be reset to their original value.
 */
$.fn.resetForm = function() {
    return this.each(function() {
        // guard against an input with the name of 'reset'
        // note that IE reports the reset function as an 'object'
        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
            this.reset();
    });
};

/**
 * Enables or disables any matching elements.
 */
$.fn.enable = function(b) { 
    if (b == undefined) b = true;
    return this.each(function() { 
        this.disabled = !b 
    });
};

/**
 * Checks/unchecks any matching checkboxes or radio buttons and
 * selects/deselects and matching option elements.
 */
$.fn.select = function(select) {
    if (select == undefined) select = true;
    return this.each(function() { 
        var t = this.type;
        if (t == 'checkbox' || t == 'radio')
            this.checked = select;
        else if (this.tagName.toLowerCase() == 'option') {
            var $sel = $(this).parent('select');
            if (select && $sel[0] && $sel[0].type == 'select-one') {
                // deselect all other options
                $sel.find('option').select(false);
            }
            this.selected = select;
        }
    });
};

// helper fn for console logging
// set $.fn.ajaxSubmit.debug to true to enable debug logging
function log() {
    if ($.fn.ajaxSubmit.debug && window.console && window.console.log)
        window.console.log('[jquery.form] ' + Array.prototype.join.call(arguments,''));
};

})(jQuery);


//
//
//   path: /RI/components/js/jquery/jquery.form.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/tabs/tabs_utils.js  (Begin) 
//
//


/**
 * util.js 
 * @author Garrett Smith, Brandon Blackmoor
 * @desc Provides functionality for working nodeLists.
 */

Browser = 
{
    isSupported:function()
    {
        return(Boolean(document.getElementsByTagName)&&Boolean(document.getElementById));
    }
    ,id:new function()
    {
        var ua=navigator.userAgent;
        var OMNI=ua.indexOf("Omni")>0;
        this.OP5=ua.indexOf("Opera 5")>=0||ua.indexOf("Opera 6")>=0;
        this.OP7=ua.indexOf("Opera 7")>=0;
        this.MAC=ua.indexOf("Mac")>0;
        if (!this.OP5&&!OMNI)
        {
            this.IE5=ua.indexOf("MSIE 5")>0;
            this.IE5_0=ua.indexOf("MSIE 5.0")>0;
            this.NS6=ua.indexOf("Gecko")>0;
            this.MOZ=this.NS6&&ua.indexOf("Netscape")==-1;
            this.MAC_IE5=this.MAC&&this.IE5;
            this.IE6=ua.indexOf("MSIE 6")>0;
            this.KONQUEROR=ua.indexOf("Konqueror/")>0;
        }
    }
};

var px="px";
TokenizedExps={};

function getTokenizedExp(t)
{
    var x=TokenizedExps[t];
    if (!x)
    {
        x=TokenizedExps[t]=new RegExp("\\b"+t+"\\b");
    }
    return x;
}

function hasToken(s,t)
{
    return getTokenizedExp(t).test(s);
}
;

function getChildNodesWithClass(p,kl)
{
    var coll=p.childNodes;
    var rc=[];
    var exp=getTokenizedExp(kl);
    for(var i=0, n=0; i<coll.length; i++)
    if (exp.test(coll[i].className))
    {
        rc[n++]=coll[i];
    }
    return rc;
}

function getElementsWithClass(p,t,kl)
{
    var rc=[];
    var exp=getTokenizedExp(kl);
    var coll=(t=="*"&&p.all)?p.all:p.getElementsByTagName(t);
    for(var i=0,n=0; i<coll.length; i++)
    {
        if (exp.test(coll[i].className))
        {
            rc[n++]=coll[i];
        }
    }
    return rc;
}

function get_elements_with_class_from_classList(el,t,classList)
{
    var rc=new Array(0);
    var coll=(t=="*"&&el.all)?el.all:el.getElementsByTagName(t);
    var exps=[];
    for(var i=0;
    i<classList.length;
    i++)
    exps[i]=getTokenizedExp(classList[i]);
    for(var j=0,coLen=coll.length; j<coLen; j++)
    {
        kloop:for(var k=0; k<classList.length; k++)
        {
            if (exps[k].test(coll[j].className))
            {
                rc[rc.length]=coll[j];
                break kloop;
            }
        }
    }
    return rc;
}

function findAncestorWithClass(el,kl)
{
    var exp=getTokenizedExp(kl);
    for(var p=el.parentNode; p!=null; )
    {
        if (exp.test(p.className))
        {
            return p;
        }
        p=p.parentNode;
    }
    return null;
}

function getDescendantById(p,id)
{
    var childNodes=p.all?p.all:p.getElementsByTagName("*");
    for(var i=0,len=childNodes.length; i<len; i++)
    if (childNodes[i].id==id)
    {
        return childNodes[i];
    }
    return null;
}

function removeClass(el,kl)
{
    el.className=el.className.replace(getTokenizedExp(kl),"").normalize();
}

function repaintFix(el)
{
    el.style.visibility='hidden';
    el.style.visibility='visible';
}


//
//
//   path: /RI/components/js/tabs/tabs_utils.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/tabs/tabs_global.js  (Begin) 
//
//


/**
 * global.js 
 * @author Garrett Smith, Brandon Blackmoor
 * @desc Provides functionality for extending custom classes.
 *
 * ElementWrapper is a simple wrapper class.
 *
 * EventQueue provides Event Listener Functionality.
 */

Function.prototype.extend=function(souper)
{
    this.prototype=new souper;
    this.prototype.constructor=this;
    this.souper=souper;
    this.prototype.souper=souper;
};

ElementWrapper=function ElementWrapper(el)
{
    if (arguments.length==0)
    {
        return;
    }
    this.el=el;
    this.id=el.id;
    if (!ElementWrapper.list[this.id])
    {
        ElementWrapper.list[this.id]=this;
    }
};

ElementWrapper.list=new function() {};
ElementWrapper.getWrapper=function(id)
{
    return ElementWrapper.list[id];
};

EventQueue=function EventQueue(eventObj)
{
    if (arguments.length==0)
    {
        return;
    }
    this.souper=EventQueue.souper;
    this.souper(eventObj);
    this.eventObj=eventObj;
    this.addToPool();
};

EventQueue.extend(ElementWrapper);
EventQueue.prototype.addEventListener=function(etype,pointer)
{
    var list=this.eventHandlerList(etype);
    return list[list.length++]=pointer;
};

EventQueue.prototype.eventHandlerList=function(etype)
{
    if (!this[etype])
    {
        this[etype]=new EventQueue.EventHandler(this,etype);
    }
    return this[etype];
};

EventQueue.prototype.removeEventListener=function(etype,pointer)
{
    var list=this[etype];
    var len=list.length;
    if (len==0)
    {
        return null;
    }
    var newList=new Array(len-1);
    var rtn=null;
    for (var i=0; i<len; i++)
    {
        if (list[i]!=pointer)
        {
            newList[i]=list[i];
        }
        else 
        {
            rtn=pointer;
        }
    }
    this[etype]=newList;
    return rtn;
};

EventQueue.prototype.handleEvent=function(e)
{
    var rtn=true;
    for (var i=0,len=this[e].length; i<len; i++)
    {
        this.tempFunction=this[e][i];
        if (rtn!=false)
        {
            rtn=this.tempFunction();
        }
    }
    return rtn;
};

EventQueue.prototype.addToPool=function()
{
    if (!EventQueue.list[this.id])
    {
        EventQueue.list[this.id]=this;
    }
};

EventQueue.EventHandler=function EventHandler(wrapper,etype)
{
    this.etype=etype;
    this.length=0;
    wrapper.eventObj[etype]=new Function("return EventQueue.fireEvent('"+wrapper.id+"','"+etype+"')");
};

EventQueue.fireEvent=function(id,e)
{
    var wrapper=EventQueue.list[id];
    if (!wrapper)
    {
        return false;
    }
    var r=wrapper.handleEvent(e);
    return r;
};

EventQueue.EventHandler.prototype.toString=function toString()
{
    return this.id+"."+this.etype;
};

EventQueue.list=new Object;


//
//
//   path: /RI/components/js/tabs/tabs_global.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/tabs/tabs_main.js  (Begin) 
//
//


/*
 *
 * tabs.js
 * @author Garrett Smith, Brandon Blackmoor
 *
 */

if (!window.TabParams)
{
    window.TabParams = {useClone:false,alwaysShowClone:false,eventType:"click",tabTagName:"*"};
}

var tabDisplayNone=Browser.id.OP5?"":"none";
var contentInheritVis=Browser.id.OP5?"visible":"inherit";
TabSystem=function TabSystem(el,tabsDiv)
{
    if (arguments.length==0)
    {
        return;
    }

    this.souper=TabSystem.souper;
    this.souper(el);
    if (typeof tabsDiv.onselectstart!="undefined")
    {
        tabsDiv.onselectstart=function()
        {
            return false;
        };
    }

    this.el.onChange=this.el.onchange=function(){};
    this.el.onBeforeChange=function(){};
    this.defaultActiveTab=null;
    this.activeTab=null;
    this.relatedTab=null;
    this.nextTab=null;
    this.tabsDiv=tabsDiv;
    this.tabParams=this.getTabParams();
    this.tabArray=get_elements_with_class_from_classList(this.tabsDiv,this.tabParams.tabTagName,["tab","tabactive"]);
    this.tabsClone=null;
    this.tabs=new Array(0);
    if (!TabSystem.list[this.id])
    {
        TabSystem.list[this.id]=this;
    }
};

TabSystem.list=new Object;
TabSystem.extend(EventQueue);
TabSystem.prototype.parentSystem=function()
{
    var root=TabSystem.list["body"];
    if (root=this)
    {
        return null;
    }
    var parent=findAncestorWithClass(this.el,"content");
    if (parent!=null)
    {
        return TabSystem.list[parent.id];
    }
    return root;
};

TabSystem.prototype.getTabParams=function()
{
    if (!this.tabParams)
    {
        this.tabParams=new Object;
        var parentSystem=this.parentSystem();
        parentTp=(parentSystem==null)?TabParams:parentSystem.getTabParams();
        for (var param in parentTp)
        this.tabParams[param]=parentTp[param];
    }
    return this.tabParams;
};

TabSystem.prototype.setEventType=function(eventType)
{
    var params=this.getTabParams();
    if (params.eventType==eventType)
    {
        return;
    }

    for (var i=0,len=this.tabArray.length; i<len; i++)
    {
        var tab=Tab.list[this.tabArray[i].id];
        tab.removeEventListener("on"+params.eventType,tab.depressTab);
        tab.addEventListener("on"+eventType,tab.depressTab);
    }
    params.eventType=eventType;
};

function removeTabs(ts)
{
    ts.tabsDiv.style.display="none";
    if (ts.tabsClone)
    {
        ts.tabsClone.style.display="none";
    }
    var cs=getElementsWithClass(ts.el,"div","content");
    for (var i=0; i<cs.length; i++)
    {
        cs[i].style.visibility='visible';
        cs[i].style.display='block';
    }
}

function undoRemoveTabs(ts)
{
    ts.tabsDiv.style.display="block";
    if (ts.tabsClone)
    {
        ts.tabsClone.style.display="block";
    }
    isTabLayout=true;
    for (var i=0; i<ts.tabs.length; i++)
    if (ts.tabs[i]!=ts.activeTab)
    {
        ts.tabs[i].content.style.display="none";
        ts.tabs[i].content.style.visibility="hidden";
    }
}

TabSystem.prototype.setAlwaysShowClone=function(flag)
{
    this.getTabParams().alwaysShowClone=flag;
    this.showTabsCloneIfNecessary();
};

TabSystem.prototype.addClone=function()
{
    if (!this.tabsDiv.cloneNode)
    {
        return;
    }
    this.getTabParams().useClone=true;
    this.tabsClone=this.tabsDiv.cloneNode(true);
    if (!this.tabsClone)
    {
        return;
    }
    this.tabsClone.className="tabs tabsclone";
    this.el.appendChild(this.tabsClone);
    for (var i=0; i<this.tabArray.length; i++)
    {
        var cont=Tab.list[this.tabArray[i].id];
        var bt=getDescendantById(this.tabsClone,cont.id);
        bt.id="Bottom"+bt.id;
        cont.bottomTab=new BottomTab(bt,cont);
    }
    this.addEventListener("onchange",updateTabsClonePosition);
    if (Browser.id.MAC_IE5)
    {
        window.setInterval("updateTabsClonePosition()",300);
    }
    contentPane.addEventListener("onresize",updateTabsClonePosition);
    this.showTabsCloneIfNecessary();
};

tabInit=function tabInit(tabsPrefix)
{
    if (!Browser.isSupported())
    {
        return;
    }
    
    var tabsClass = "tabs";
    if(tabsPrefix != null) {
    
    	tabsClass = tabsPrefix + tabsClass;
    }
    
    var tabsDivs=getElementsWithClass(document.body,"div",tabsClass.toLowerCase());
    if (tabsDivs.length==0)
    {
        var tabsDiv0=document.getElementById(tabsClass);
        if (tabsDiv0)
        {
            tabsDivs=[tabsDiv0];
        }
        else
        {
            return;
        }
    }

 var tabToDepress;
    for (var i=0; i<tabsDivs.length; i++)
    {
        var cnt=findAncestorWithClass(tabsDivs[i],"content")||document.body;
        if (!cnt.id)
        {
            cnt.id="body";
        }
        var ts=new TabSystem(cnt,tabsDivs[i]);
        var len=ts.tabArray.length;
        for (var j=0; j<len; new ControllerTab(ts.tabArray[j++],ts));
    }
	
// - test if tab was passed on url - MTH	
// 	if (document.location.search="") {	

    var activeTabs=readCookie("activeTabs"+escape(getFilename()));

//  }	

    if (activeTabs)
    {
        var activeTabArray=activeTabs.split(",");
        for (var i=0,len=activeTabArray.length;
        i<len;
        i++)
        {
            var tab=Tab.list[activeTabArray[i]];
            if (tab)
            {
                tab.depressTab();
            }
        }
    }

    if (Browser.id.MAC_IE5)
    {
        fixDocHeight=function()
        {
            document.documentElement.style.height=document.body.style.height=document.body.clientHeight+"px";
        };
        contentPane.addEventListener("onresize",fixDocHeight);
        setTimeout("fixDocHeight()",500);
    }

    handleHashNavigation();
// alert("test");
    deletePageCookie("activeTabs"+escape(getFilename()));

    for (id in TabSystem.list)
    {
        var ts=TabSystem.list[id];
        if (ts.tabParams.useClone)
        {
            ts.addClone();
        }
        if (ts.activeTab==null&&ts.defaultActiveTab!=null)
        {
            ts.defaultActiveTab.depressTab();
        }
    }
    if (Browser.id.MOZ)
    {
        repaintFix(document.body);
    }
};

window.id="window";
contentPane=new EventQueue(window);

function handleHashNavigation()
{
    var id=window.location.hash;
//	alert (id.substring(1));
    if (id)
    {
        var el=document.getElementById(id.substring(1));
        if (el)
        {
            var contentEl=findAncestorWithClass(el,"content");
        }
        if (contentEl)
        {
		
//alert (contentEl.id.substring("content".length));		
            switchTabs("tab"+contentEl.id.substring("content".length),null,false);
        }
    }
}

Tab=function Tab(el,ts)
{
    if (arguments.length==0)
    {
        return;
    }
    this.souper=Tab.souper;
    this.souper(el);
    this.content=null;
    this.tabSystem=ts;
    this.properties=new Object;
    this.el.onActivate=function(){};

    this.addEventListener("onmouseover",this.hoverTab);
    this.addEventListener("onmouseout",this.hoverOff);    
    this.addEventListener("on"+this.tabSystem.getTabParams().eventType,this.depressTab);
    if (Browser.id.IE5_0)
    {
        positionTabEl(this);
    }
    if (!Tab.list[this.id])
    {
        Tab.list[this.id]=this;
    }
};

Tab.extend(EventQueue);
Tab.list=new Object;
Tab.prototype.setProperty=function(name,value)
{
    this.properties[name]=value;
};

Tab.prototype.getContent=function()
{
    if (this.content==null)
    {
        var id=this.id.substring(3);
        this.content=document.getElementById("content"+id);
        if (!this.content)
        {
            alert("tab.id="+this.id+"\n"+"content"+id+" does not exist!");
        }
    }
    return this.content;
};

Tab.prototype.getTabSystem=function()
{
    return this.tabSystem;
};

hoverTab=function hoverTab()
{
    var tab=Tab.list[this.id];
    var activeTab=tab.tabSystem.activeTab;
    if (activeTab&&activeTab.id==tab.id)
    {
        return;
    }
    tab.setClassName("tabhover tab");
    if (tab.hoversrc)
    {
        tab.el.src=tab.hoversrc;
    }
};

hoverOff=function hoverOff()
{
    var tab=Tab.list[this.id];
    var activeTab=tab.tabSystem.activeTab;
    if (activeTab&&activeTab.id==tab.id)
    {
        return;
    }
    tab.setClassName("tab");
    if (tab.normalsrc)
    {
        tab.el.src=tab.normalsrc;
    }
};

Tab.prototype.toString=function()
{
    return this.id;
};

function resetTab(tab)
{
    tab.setClassName("tab");
    if (tab.normalsrc)
    {
        tab.el.src=tab.normalsrc;
    }
    tab.getContent().style.display=tabDisplayNone;
    tab.getContent().style.visibility="hidden";
}

ControllerTab=function ControllerTab(el,ts)
{
    if (arguments.length==0)
    {
        return;
    }
    this.souper(el,ts);

    if (el.tagName.toLowerCase()=="img")
    {
        this.normalsrc=el.src;
        this.hoversrc=el.getAttribute("hoversrc");
        this.activesrc=el.getAttribute("activesrc");
    }
    if (hasToken(el.className,"tabactive"))
    {
        this.depressTab();
        this.tabSystem.defaultActiveTab=this;
    }
    else
    {
        this.getContent().style.display=tabDisplayNone;
        this.getContent().style.visibility="hidden";
        if (Browser.id.OP5)
        {
            setTimeout('Tab.list.'+this.id+'.content.style.position="absolute";',50);
        }
    }

    if (Browser.id.OP5)
    {
        setTimeout('Tab.list.'+this.id+'.content.style.visibility="hidden";',50);
    }
    this.tabSystem.tabs[this.tabSystem.tabs.length]=this;
};

ControllerTab.extend(Tab);
ControllerTab.prototype.setClassName=function(klass)
{
    this.el.className=klass;
    if (this.bottomTab)
    {
        this.bottomTab.el.className=klass;
    }
};

ControllerTab.prototype.hoverTab=hoverTab;
ControllerTab.prototype.hoverOff=hoverOff;
ControllerTab.prototype.depressTab=function depressTab(e)
{
    var tab=Tab.list[this.id];
    var tabSystem=tab.tabSystem;
    tabSystem.nextTab=tab;
    if (tabSystem.activeTab==tab)
    {
        return;
    }
    tabSystem.relatedTab=tabSystem.activeTab;
    if (false==tabSystem.el.onBeforeChange())
    {
        return;
    }
    tab.el.onActivate();
    tab.setClassName("tab tabactive");
            
    if (tab.activesrc)
    {
        tab.el.src=tab.activesrc;
    }
    if (tabSystem.activeTab)
    {
        resetTab(tabSystem.activeTab);
    }
    tabSystem.activeTab=tab;
    tabSystem.el.onchange();
    if (tabSystem.relatedTab)
    {
        tabSystem.relatedTab.getContent().style.display="none";
    }
    tab.getContent().style.display="block";
    
    //////////////////////////////////////////    
    if(cheatSheets != null) {
			
		for(var i in cheatSheets) {
			cheatSheets[i]();
		}
	}    
    //////////////////////////////////////////
    
    tab.getContent().style.visibility=contentInheritVis;
    tabSystem.nextTab=null;
    if (tabSystem.tabsClone)
    {
        tabSystem.showTabsCloneIfNecessary();
    }
    if (Browser.id.MOZ)
    {
        updateTabsClonePosition(1);
    }
};

BottomTab=function BottomTab(el,controllerTab)
{
    if (arguments.length==0)
    {
        return;
    }
    this.souper(el,controllerTab.tabSystem);
    this.controllerTab=controllerTab;
};

BottomTab.extend(Tab);
BottomTab.prototype.hoverTab=function()
{
    this.controllerTab.hoverTab();
};

BottomTab.prototype.hoverOff=function()
{
    this.controllerTab.hoverOff();
};

BottomTab.prototype.depressTab=function depressClonedTab(e)
{
    var tabSystem=this.tabSystem;
    if (tabSystem.activeTab==this.controllerTab)
    {
        return;
    }
    this.controllerTab.depressTab(e);
    this.controllerTab.setClassName("tab tabactive");
    window.scrollTo(0,(tabSystem.tabsClone.offsetTop+this.el.offsetHeight)-getViewportHeight());
};

function switchTabs(id,e,bReturn)
{
    if (!Browser.isSupported())
    {
        return true;
    }
    try
    {
        var tab=Tab.list[id];
        tab.depressTab(e);        	
    }
    catch(ex) {}
    if (!bReturn)
    {
        window.scrollTo(0,0);
    }
    return bReturn;
}

updateTabsClonePosition=function updateTabsClonePosition(delay)
{
    for (var id in TabSystem.list)
    if (TabSystem.list[id].tabParams.useClone)
    {
        setTimeout("TabSystem.list."+id+".setTabsClonePosition();",delay||500);
    }
};

TabSystem.prototype.setTabsClonePosition=function()
{
    if (!this.activeTab)
    {
        return;
    }
    var adjustment=0;
    var contentEl=this.activeTab.content;
    if (Browser.id.IE5_0||Browser.id.MAC_IE5)
    {
        adjustment=0;
    }
    else
    {
        adjustment=2;
    }
    this.tabsClone.style.top=(contentEl.offsetHeight+contentEl.offsetTop+adjustment)+px;
};

TabSystem.prototype.showTabsCloneIfNecessary=function()
{
    if (!this.activeTab)
    {
        return;
    }
    var contentEl=this.activeTab.content;
    var contentBottom=contentEl.offsetTop+contentEl.offsetHeight;
    var visibility=(contentBottom>getViewportHeight()||this.getTabParams().alwaysShowClone)?"inherit":"hidden";
    this.tabsClone.style.visibility=visibility;
    this.setTabsClonePosition();
    if (Browser.id.MOZ)
    {
        window.scrollBy(0,1);
        window.scrollBy(0,-1);
    }
};

function saveTabSystemState()
{
    var activeTabList=getElementsWithClass(document.body,TabParams.tabTagName,"tabActive");
    for (var i=0; i<activeTabList.length; i++)
    {
        if (!activeTabList[i].id)
        {
            continue;
        }
        activeTabList[i]=activeTabList[i].id;
        createCookie("activeTabs" + escape(getFilename()), activeTabList);
    }
};

 contentPane.addEventListener("onunload",saveTabSystemState);

function positionTabEl(tab)
{
    var tabs=tab.el.parentNode;
    if (tab.tagName=="IMG"||tab.id.indexOf("Bottomtab")==0)
    {
        return;
    }
    if (!tabs.tabOffset)
    {
        tabs.tabOffset=0;
    }
    var tabWidth=Math.round(tab.el.offsetWidth*1.1)+15;
    var sty=tab.el.style;
    sty.left=tabs.tabOffset+px;
    sty.width=tabWidth+px;
    sty.textAlign="center";
    sty.display="block";
    sty.position="absolute";
    tabs.tabOffset+=parseInt(tab.el.offsetWidth)+4;
}

if (Browser.id.OP5)
{
    window.document.write("<style>.content { position:absolute; } </style>");
}


//
//
//   path: /RI/components/js/tabs/tabs_main.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/tabs/tabs_cookie.js  (Begin) 
//
//


/**
 * $Id: tabs_cookie.js 315 2007-09-06 12:41:30Z oreni $
 * simple user management script
 * Copyright (c) 2003 Brandon Blackmoor
 * Brandon Blackmoor (bblackmoor@sourceforge.net)
 */

function createCookie(name, value, days)
{
    if (days)
    {
        var date = new Date();
        date.setTime(date.getTime() + (days*24*60*60*1000));
        var expires = "; expires=" + date.toGMTString();
    }
    else expires = "";
    document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name)
{
    var nameEquals = name + "=";
    var ca = document.cookie.split(';');
    for (var i=0; i < ca.length; i++)
    {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1, c.length);
        if (c.indexOf(nameEquals) == 0)
        {
            return c.substring(nameEquals.length, c.length);
        }
    }
    return null;
}

function deletePageCookie(name, path)
{
    var value = readCookie(name);
    if (value != null)
    {
        document.cookie = name + "=" + "; path=" + getPath() + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
    return value;
}

function getFilename()
{
    var href = window.location.href;
    var file = href.substring(href.lastIndexOf("/") + 1);
    return file;
}

function getPath()
{
    var href = window.location.href;
    var path = href.substring(href.indexOf("//") + 2);
    path = path.substring(path.indexOf("/"));
    path = path.substring(0, path.lastIndexOf("/") + 1);
    return path;
}


//
//
//   path: /RI/components/js/tabs/tabs_cookie.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/components/Automatic_cheatsheet.js  (Begin) 
//
//


var cheatSheets = new Object();

function Automatic_cheatsheet(uid, inTabsRegion) {
	
	var bodyId =		'#' + uid + 'body';
	var bodyContainer = '#' + uid + 'bodyContainer';
	
	var headId = 		'#' + uid + 'head';
	var headContainer = '#' + uid + 'headContainer';
	
	
	$(document).ready(function() {
		if($(bodyId).height() > 400) 
		{
			$(bodyContainer)
				.css("overflow", "auto")
				.css("height", "400px")
				.removeClass("ah_style_11_cheatsheet_thin")
				.addClass("ah_style_11_cheatsheet_wide_body");
			
			$(headContainer)
				.css("border-right", "2px solid #cccccc")
				.removeClass("ah_style_11_cheatsheet_thin")
				.addClass("ah_style_11_cheatsheet_wide_head");
		}
		
		var calculateCheatSheetHeight = function() {
			
			// Calculating the height of the Cheat Sheet Table Header
			var maxHeight = 0;				
			
			$("#" + uid + "head div.cheatsheettitle nobr").each(function(index) {
						
				var height = ($.browser.msie) 
								? $(this).height()
								: $(this).width();
								
									
				maxHeight = Math.max(height, maxHeight);
			});				
			
			if($.browser.msie) { 
				$("#" + uid + "head div.cheatsheettitle").each(function(index) {								
					$(this).height(maxHeight);
				});
			}
			else {
				$("#" + uid + "head").height(maxHeight);
			}
			
			$("#" + uid + "headContainer").css("opacity","1");
		}
		
		if(inTabsRegion) {
			cheatSheets[uid] = calculateCheatSheetHeight;	
		}
		else {
			calculateCheatSheetHeight();
		}	
	});
	
	
	$(bodyId).tableHover({colClass: 'hover', 
					  	  ignoreCols: [1],
					  	  RC_highlightSpecial : true,
					  	  RC_highlightTableHead : true, 
					  	  RC_tableHeadId : headId});
}


//
//
//   path: /RI/components/js/components/Automatic_cheatsheet.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/components/Automatic_selectionUtil.js  (Begin) 
//
//


new Automatic_selectionUtil();

function Automatic_selectionUtil() {}

Automatic_selectionUtil.go = function(id) {
	
	var selectElement = document.getElementById(id);
		
	var selectedURI = 
		selectElement.options[selectElement.selectedIndex].value;
		
	if(selectedURI != '0') {		
		window.location = selectedURI;	
	}
}


//
//
//   path: /RI/components/js/components/Automatic_selectionUtil.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/components/Automatic_TextList.js  (Begin) 
//
//




/**
 *  Automatic_TextListUtil
 */
function Automatic_TextList(uid, size) {
	
	this.uid = uid;	
	
	this.size = size;
	
	this.init();	
}


/**
 *  init
 */
Automatic_TextList.prototype.init = function() {
	
	for(var i = 0; i<this.size; i++) {	
		
		var rowId = "rowIndex_" + this.uid + "_" + i;
		
		var tr = document.getElementById(rowId);		
		if(tr != null) {
		
			var _this = this;
			
			function RowIdHolder(rowId) {
							
				this.onmouseover = function() {
					_this.onRowMouseOver(rowId);
				}
				
				this.onmouseout = function() {
					_this.onRowMouseOut(rowId);
				}
			}
			var rowIdHolder = new RowIdHolder(rowId);
			
			tr.onmouseover = rowIdHolder.onmouseover;		
			tr.onmouseout = rowIdHolder.onmouseout;
		}
	}	
}	


/**
 *  onRowMouseOver
 */
Automatic_TextList.prototype.onRowMouseOver = function(rowId) {

	$("#" + rowId + " td")
		.css('background', '#F5F3EB'); 
		
	$("#" + rowId + " .alphabeticalTableComponent_rowTitle")
		.removeClass("alphabeticalTableComponent_rowTitle")
		.addClass("alphabeticalTableComponent_rowTitleHover");

	$("#" + rowId + " .alphabeticalTableComponent_rowSubTitle")
		.removeClass("alphabeticalTableComponent_rowSubTitle")
		.addClass("alphabeticalTableComponent_rowSubTitleHover");

	$("#" + rowId + " .alphabeticalTableComponent_rowSeperator")
		.removeClass("alphabeticalTableComponent_rowSeperator")
		.addClass("alphabeticalTableComponent_rowSeperatorHover");	
}


/**
 *  onRowMouseOut
 */
Automatic_TextList.prototype.onRowMouseOut = function(rowId) {
	
	$("#" + rowId + " td")
		.css('background', '#FFFFFF'); 

	$("#" + rowId + " .alphabeticalTableComponent_rowTitleHover")
		.removeClass("alphabeticalTableComponent_rowTitleHover")
		.addClass("alphabeticalTableComponent_rowTitle");

	$("#" + rowId + " .alphabeticalTableComponent_rowSubTitleHover")
		.removeClass("alphabeticalTableComponent_rowSubTitleHover")
		.addClass("alphabeticalTableComponent_rowSubTitle");

	$("#" + rowId + " .alphabeticalTableComponent_rowSeperatorHover")
		.removeClass("alphabeticalTableComponent_rowSeperatorHover")
		.addClass("alphabeticalTableComponent_rowSeperator");
}



//
//
//   path: /RI/components/js/components/Automatic_TextList.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/components/BackNextAnchors.js  (Begin) 
//
//


/**
 *  BackNextAnchors class
 */
function BackNextAnchors(uniqueId, prefix, size) {
	
	if(uniqueId != null) {
		this.size       = size;
		this.currIndex  = 1;
		this.prefix     = prefix;
		this.uniqueId   = uniqueId;
		this.backAnchor = document.getElementById("back_" + uniqueId);
		this.nextAnchor = document.getElementById("next_" + uniqueId);
		
		this.hVisibleContent = 
				document.getElementById(uniqueId + "_hVisibleContent");
		
		this.backAnchorClassName = this.backAnchor.className;
		this.nextAnchorClassName = this.nextAnchor.className;
		
		this.init();
	}
}


BackNextAnchors.DIRECTION_BACK = -1;
BackNextAnchors.DIRECTION_NEXT = 1


/**
 *  init
 */
BackNextAnchors.prototype.init = function() {
	var _this = this;
	this.nextAnchor.onclick = function() {
		if(_this.nextAnchor.getAttribute("href") == "#") {
			_this.onclickListener(BackNextAnchors.DIRECTION_NEXT);
			return false;
		}
	}
	this.backAnchor.onclick = function() {
		if(_this.backAnchor.getAttribute("href") == "#") {
			_this.onclickListener(BackNextAnchors.DIRECTION_BACK);
			return false;
		}
	}
	this.update();
}


/**
 *  toggle
 */
BackNextAnchors.prototype.toggle = function(oldIndex, newIndex) {
	
	document.getElementById(
		this.uniqueId + this.prefix + oldIndex).style.display="none";
		
	document.getElementById(
		this.uniqueId + this.prefix + newIndex).style.display="block";	
		
	this.currIndex = newIndex;
	
	this.update();
}


/**
 *  update
 */
BackNextAnchors.prototype.update = function() {
	if(this.currIndex > 1) {				
		this.backAnchor.href = "#";
		this.backAnchor.className = this.backAnchorClassName;
	}
	else {		
		this.backAnchor.className = this.backAnchorClassName + " nohover";
		this.backAnchor.removeAttribute("href");			
	}
	
	if(this.currIndex < this.size) {		
		this.nextAnchor.href = "#";
		this.nextAnchor.className = this.nextAnchorClassName;		
	}
	else {		
		this.nextAnchor.className = this.nextAnchorClassName + " nohover";
		this.nextAnchor.removeAttribute("href");		
	}
	
	if(this.hVisibleContent != null) {
		this.hVisibleContent.value = this.currIndex;
	}
}


/**
 *  getCurrentVisibleItem
 */
BackNextAnchors.prototype.onclickListener = function(direction) {	
		
	switch(direction) {
		case BackNextAnchors.DIRECTION_BACK:
			this.toggle(this.currIndex, this.currIndex - 1);					
			break;
			
		case BackNextAnchors.DIRECTION_NEXT:
			this.toggle(this.currIndex, this.currIndex + 1);
			break;		
	}
}


//
//
//   path: /RI/components/js/components/BackNextAnchors.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/components/BackNextControls.js  (Begin) 
//
//


/**
 *  BackNextControls class
 */
	function BackNextControls(uniqueId, prefix, size) {
	
	if(uniqueId != null) {
		this.size       = size;
		this.currIndex  = 1;
		this.prefix     = prefix;
		this.uniqueId   = uniqueId;
		this.hVisibleContent = $("#" + uniqueId + "_hVisibleContent");
		// WHen the object is created we also create objects of our back next elements + image arrows for back / next
		this.objBackElement = $("#" + BackNextControls.STR_BACK + "_" + this.uniqueId);
		this.objNextElement = $("#" + BackNextControls.STR_NEXT + "_" + this.uniqueId);
        this.imgBackElement = $("#img_" + BackNextControls.STR_BACK + "_" + this.uniqueId);
		this.imgNextElement = $("#img_" + BackNextControls.STR_NEXT + "_" + this.uniqueId);
		
        
	   	 document.getElementById( "" + uniqueId + prefix + "1"  ).style.display = "block";				
	     

		this.init();
	}
}


BackNextControls.DIRECTION_BACK = -1;
BackNextControls.DIRECTION_NEXT = 1
BackNextControls.STR_BACK = "back";
BackNextControls.STR_NEXT = "next";
/**
 *  init
 */
// This function will be called on the first time we create the BackNextControls object
BackNextControls.prototype.init = function() {
	var _this = this;
	
	// attach "onclick" events to our back next elemnts 
	 this.objNextElement.click(function () { 
          _this.onclickListener(BackNextControls.DIRECTION_NEXT);
		   return false;
	 });

	
   this.objBackElement.click(function () { 
          _this.onclickListener(BackNextControls.DIRECTION_BACK);
		   return false;
	});

	
	this.update();

	// attach onmouseover / onmouseout events to our back /next elements
	this.objBackElement.mouseover(function () { 
		_this.Over(BackNextControls.STR_BACK);
	});

	this.objNextElement.mouseover(function () { 
		_this.Over(BackNextControls.STR_NEXT);
	});


	this.objBackElement.mouseout(function () { 
		_this.Out(BackNextControls.STR_BACK);
	});

	this.objNextElement.mouseout(function () { 
		_this.Out(BackNextControls.STR_NEXT);
	});

	// attach onmouseover / onmouseout + onlcick events to our back /next arrow images
    this.imgBackElement.click(function () { 
		_this.img_Click(BackNextControls.STR_BACK);
		
	});

	this.imgNextElement.click(function () { 
		_this.img_Click(BackNextControls.STR_NEXT);
		
	});

    this.imgBackElement.mouseover(function () { 
	
		_this.img_Over(BackNextControls.STR_BACK);
	});
// we change the type of cursor for image on over/out events
    this.imgNextElement.mouseover(function () { 
	
		_this.img_Over(BackNextControls.STR_NEXT);
	});

     this.imgBackElement.mouseout(function () { 
	
		_this.img_Out(BackNextControls.STR_BACK);
	});

    this.imgNextElement.mouseout(function () { 
	
		_this.img_Out(BackNextControls.STR_NEXT);
	});




}


/**
 *  toggle
 */
BackNextControls.prototype.toggle = function(oldIndex, newIndex) {
	
  if((newIndex > 0) && (newIndex <= this.size)){

 	$("#" + this.uniqueId + this.prefix + oldIndex).attr("style","display:none");
	$("#" + this.uniqueId + this.prefix + newIndex).attr("style","display:block");	
	this.currIndex = newIndex;

	this.update();
	}
}


/**
 *  update
 */
BackNextControls.prototype.update = function() {
 
	if(this.currIndex > 1) {				
		 this.objBackElement.removeClass().addClass("backnextcontrol_noactive");
	}
	else {
	    this.objBackElement.removeClass().addClass("backnextcontrol_simple");
	}
	
	if(this.currIndex < this.size) {
		 this.objNextElement.removeClass().addClass("backnextcontrol_noactive");
	}
	else {		
	  	 this.objNextElement.removeClass().addClass("backnextcontrol_simple");
	}

	if(this.hVisibleContent != null) {
		this.hVisibleContent.value = this.currIndex;
	}
}


/**
 *  getCurrentVisibleItem
 */
BackNextControls.prototype.onclickListener = function(direction) {	
		
	switch(direction) {
		case BackNextControls.DIRECTION_BACK: 
		
			this.toggle(this.currIndex, this.currIndex - 1);
			
			break;
			
		case BackNextControls.DIRECTION_NEXT:
		
			this.toggle(this.currIndex, this.currIndex + 1);
			
			break;		
	}
}



BackNextControls.prototype.Over = function(directionStr) {	

   switch(directionStr) {
		case BackNextControls.STR_BACK:
		    if (this.currIndex > 1 ){
				 this.objBackElement.removeClass().addClass("backnextcontrol_active");
			}
			
			break;
			
		case BackNextControls.STR_NEXT:
		
			 if  (this.currIndex < this.size){
				
				 this.objNextElement.removeClass().addClass("backnextcontrol_active");
			 }
			
			break;		
	}

}


	

BackNextControls.prototype.Out= function(directionStr){

   switch(directionStr) {
		case BackNextControls.STR_BACK:
		
			 if (this.currIndex > 1 ){
			     this.objBackElement.removeClass().addClass("backnextcontrol_noactive");
			 }
			
			break;
			
		case BackNextControls.STR_NEXT:
		
			 if  (this.currIndex < this.size){
					this.objNextElement.removeClass().addClass("backnextcontrol_noactive");
			 }
			
			break;		
	}

}



BackNextControls.prototype.img_Click= function(directionStr){

	switch(directionStr) {
		case BackNextControls.STR_BACK:
		 
			this.objBackElement.click();
					
			break;
			
		case BackNextControls.STR_NEXT:
		
			this.objNextElement.click();
					
			break;	
	}


}
//we only change type of cursor for img event over
BackNextControls.prototype.img_Over= function(directionStr){

   switch(directionStr) {
		case BackNextControls.STR_BACK:
		    if (this.currIndex > 1 ){
				this.imgBackElement.removeClass().addClass("backnextcontrol_imgover");
			 }
			
			break;
			
		case BackNextControls.STR_NEXT:
		
			 if  (this.currIndex < this.size){
				this.imgNextElement.removeClass().addClass("backnextcontrol_imgover");
			 }
			
			break;		
	}

}
// we only change type of cursor for img event out
BackNextControls.prototype.img_Out= function(directionStr){

   switch(directionStr) {
		case BackNextControls.STR_BACK:
		    this.imgBackElement.removeClass().addClass("backnextcontrol_img");
			break;
			
		case BackNextControls.STR_NEXT:
			this.imgNextElement.removeClass().addClass("backnextcontrol_img");
			break;	
	}
}


//
//
//   path: /RI/components/js/components/BackNextControls.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/components/ContentDisplay_BackNextAnchors.js  (Begin) 
//
//


ContentDisplay_BackNextAnchors.prototype = new BackNextAnchors(null);

ContentDisplay_BackNextAnchors.prototype.constructor = ContentDisplay_BackNextAnchors;

/**
 *  BackNextAnchors class
 */
function ContentDisplay_BackNextAnchors(uniqueId, prefix, size, titlesPrefix) {
	
	BackNextAnchors.call(this, uniqueId, prefix, size);
	
	this.titlesPrefix = titlesPrefix;
}



/**
 *  overriding toggle
 */
ContentDisplay_BackNextAnchors.prototype.toggle = function(oldIndex, newIndex) {
	
	if(this.titlesPrefix != null) {
		document.getElementById(
			this.uniqueId + this.titlesPrefix + oldIndex).style.display="none";
			
		document.getElementById(
			this.uniqueId + this.titlesPrefix + newIndex).style.display="block";	
	}
		
	BackNextAnchors.prototype.toggle.call(this, oldIndex, newIndex);	
}


//
//
//   path: /RI/components/js/components/ContentDisplay_BackNextAnchors.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/components/FilteredSearchPanel.js  (Begin) 
//
//


/**
 *  FilteredSearchPanel
 * 
 * @param fetchSubCategoriesURL
 * @param mainCategories
 * @param subCategories
 * @param firstMainCategorySelect
 * @param secondMainCategorySelect
 * @param firstSubCategorySelect
 * @param secondSubCategorySelect
 * @return
 */
function FilteredSearchPanel(info) 
{
//	this.info = new IFilteredSearchInfo();
	this.info = info;
	
	$(info.firstMainCategorySelect)
		.append($("<option></option>").val("").html(info.selectMainCriteriaLabel));
	
	$(info.firstSubCategorySelect)
		.append($("<option></option>").val("").html(info.selectOneLabel));
	
	$(info.secondMainCategorySelect)
		.append($("<option></option>").val("").html(info.selectSecondaryCriteriaLabel));

	$(info.secondSubCategorySelect)
		.append($("<option></option>").val("").html(info.selectOneLabel));
	
	$.each(info.mainCategories, function(val, text) {
	    $(info.firstMainCategorySelect).append(
	        $("<option></option>").val(val).html(text));	    
	});
}




FilteredSearchPanel.prototype.resetSelects = function() {
	try {
		$(this.info.firstMainCategorySelect).removeAttr("disabled");
		$(this.info.firstSubCategorySelect).removeAttr("disabled");
		$(this.info.secondMainCategorySelect).removeAttr("disabled");
		$(this.info.secondSubCategorySelect).removeAttr("disabled");
	}
	catch(ex) {}
};



/**
 *  resetFirstMainCategorySelect
 * 
 * @return
 */
FilteredSearchPanel.prototype.resetFirstMainCategorySelect = function() {
	
	$(this.info.firstMainCategorySelect + " option:first")
		.attr('selected', 'selected');
}



/**
 *  resetFirstSubCategorySelect
 * 
 * @return
 */
FilteredSearchPanel.prototype.resetFirstSubCategorySelect = function() {
	
	var _this = this;
	
	 $(this.info.firstSubCategorySelect)
	 	.children()
	 	.remove(); 
	 
	 $(this.info.firstSubCategorySelect)
		.append($("<option></option>").val("").html(_this.info.selectOneLabel));
};



/**
 *  resetSecondSubCategorySelect
 * 
 * @return
 */
FilteredSearchPanel.prototype.resetSecondSubCategorySelect = function() {	
		
	var _this = this;
	
	$(this.info.secondSubCategorySelect)
    	.children()
    	.remove();
	
	$(this.info.secondSubCategorySelect)
    	.append($("<option></option>").val("").html(_this.info.selectOneLabel));	
};



/**
 *  initOnReady
 * 
 * @return
 */
FilteredSearchPanel.prototype.initOnReady = function() {
	
	var _this = this;
	
	/*
	 *  reset filtered search form - onclick
	 */
	$(this.info.resetFilteredSearchForm).click(function() {
		
		_this.resetSelects();
		_this.resetFirstMainCategorySelect();
		_this.resetFirstSubCategorySelect();
		_this.resetSecondSubCategorySelect();
		
		$(_this.info.firstSubCategorySelect).attr("disabled","disabled");		
		$(_this.info.secondMainCategorySelect).attr("disabled","disabled");
		$(_this.info.secondSubCategorySelect).attr("disabled","disabled");
		
		return false;
	});
	
	
	/*
	 *  first main category 
	 */
	this.resetFirstMainCategorySelect();
	
	
	/*
	 *  first Sub Category Selection on change
	 */
	$(this.info.firstSubCategorySelect).change(function() {
		
		_this.resetSecondSubCategorySelect();
		
		var firstSubCategory = $(_this.info.firstSubCategorySelect + " option:selected").val();
		 
		
		$(_this.info.secondMainCategorySelect + " option:first")
			.attr('selected', 'selected');
		
		
		if(firstSubCategory != "") {			
			
			try{
				$(_this.info.secondMainCategorySelect).removeAttr("disabled");			
			}
			catch(ex) {}
		}
		else {
			
			$(_this.info.secondMainCategorySelect).attr("disabled","disabled");
		}
		
		$(_this.info.secondSubCategorySelect).attr("disabled","disabled");
	});
	
	
	/*
	 *  first Main Category Selection on change
	 */
	$(this.info.firstMainCategorySelect).change(function() {
				
		_this.resetSelects();
		
		_this.resetFirstSubCategorySelect();
		_this.resetSecondSubCategorySelect();
		
		
        var firstMainCategory = $(_this.info.firstMainCategorySelect + " option:selected").val();
        
        if(firstMainCategory != "") {
        	
        	$(_this.info.firstSubCategorySelect).removeAttr("disabled");
        	
	        $(_this.info.secondMainCategorySelect)
	        	.children()
	        	.remove();
	        
	        $(_this.info.secondMainCategorySelect)
    			.append($("<option></option>").val("").html(_this.info.selectSecondaryCriteriaLabel));
        
	        $.each(_this.info.mainCategories, function(val, text) {        	
	        	if(val != firstMainCategory) {
		    	    $(_this.info.secondMainCategorySelect).append(
		    	        $("<option></option>").val(val).html(text));
	        	}
	    	});
	        
	        ///////////////////////////////////////////////////////////////////
	        	       
	        var firstSubCategories = _this.info.subCategories[firstMainCategory];
	        
	        if(firstSubCategories != null) {
	        	
		        $.each(firstSubCategories, function(val, text) {
		    	    $(_this.info.firstSubCategorySelect).append(
		    	        $("<option></option>").val(val).html(text));	    
		    	});
		        
		        $(_this.info.firstSubCategorySelect + " option:first").attr('selected', 'selected');
	        }
	        else {
	        	$(_this.info.firstSubCategorySelect).attr("disabled","disabled");
	        }    	
        }
        else { // if(firstMainCategory != "")       	
        	$(_this.info.firstSubCategorySelect).attr("disabled","disabled");
        }
        
        $(_this.info.secondMainCategorySelect + " option:first").attr('selected', 'selected');
        
        $(_this.info.secondMainCategorySelect).attr("disabled","disabled");
		$(_this.info.secondSubCategorySelect).attr("disabled","disabled");
	});
	
	
	/*
	 *  second Main Category Selection on change
	 */
	$(_this.info.secondMainCategorySelect).change(function() {
				
		var firstSubCategoryId = 
				$(_this.info.firstSubCategorySelect + " option:selected").val();
		
		var secondMainCategoryId =
				$(this).val();
		
		if(secondMainCategoryId == '') {
			
			_this.resetSecondSubCategorySelect();
			
			$(_this.info.secondSubCategorySelect).attr("disabled","disabled");
		}
		else {
		
			var fetchSubCategoriesURL = 
					_this.info.fetchSubCategoriesURL +				
		      	    "&subCatId=" + firstSubCategoryId + 
				    "&mainCatId=" + secondMainCategoryId + 
				    "&lang=" + _this.info.language +
				    "&rnd=" + new Date().getTime();
			
	//		alert(fetchSubCategoriesURL);
			
			$(_this.info.secondSubCategorySelect).load(fetchSubCategoriesURL, function() {
				
				// on load complete
				$(_this.info.secondSubCategorySelect +  " option:first").attr('selected', 'selected');
				
				$(_this.info.secondSubCategorySelect +  " option:only-child")
					.parent()
					.attr("disabled","disabled");
				
				$(_this.info.secondSubCategorySelect +  " option:not(:only-child)")
					.parent()
					.removeAttr("disabled");
			});
		}
    });
};


//
//
//   path: /RI/components/js/components/FilteredSearchPanel.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/components/IFilteredSearchInfo.js  (Begin) 
//
//


/**
 *  IFilteredSearchInfo
 */
function IFilteredSearchInfo() { 
	
	this.selectMainCriteriaLabel = "";	
	this.selectSecondaryCriteriaLabel = "";	
	this.selectOneLabel = "";
	this.language = "";

	this.fetchSubCategoriesURL = "";	
	this.mainCategories = "";	
	this.subCategories = "";	

	this.firstMainCategorySelect = "";			
	this.firstSubCategorySelect = "";			

	this.secondMainCategorySelect = "";	
	this.secondSubCategorySelect = "";
	
	this.resetFilteredSearchForm = "";
}

new IFilteredSearchInfo();


//
//
//   path: /RI/components/js/components/IFilteredSearchInfo.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/components/HighLightButton.js  (Begin) 
//
//


/**
 *  HighLightButton
 */
function HighLightButton(uniqueId) {
	
	if(uniqueId != null) {
	
		this.uniqueId   = uniqueId;
							
		this.init();
	}
}


/**
 *  init
 */
HighLightButton.prototype.init = function() {
	
	var buttonId = "Button_" + this.uniqueId;
	
	var container = document.getElementById(buttonId);
	
	var _this = this;
	
	container.onmouseover = function() {
		_this.onMouseOver();
	}
	
	container.onmouseout = function() {
		_this.onMouseOut();
	}
}


/**
 *  onMouseOver
 */
HighLightButton.prototype.onMouseOver = function() {
	
	$("#Button_" + this.uniqueId)		
		.addClass("over");
}


/**
 *  onMouseOut
 */
HighLightButton.prototype.onMouseOut = function() {

	$("#Button_" + this.uniqueId)	
		.removeClass("over");
}


//
//
//   path: /RI/components/js/components/HighLightButton.js  (End) 
//
//////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////
//
//   path: /RI/components/js/components/ATT_Table.js  (Begin) 
//
//


new ATT_Table();


function ATT_Table() {

	this.HAS_DOM_IMPLEMENTATION     = document.implementation && true;
	this.HAS_DOM_CREATE_DOCUMENT    = this.HAS_DOM_IMPLEMENTATION && document.implementation.createDocument;
	this.HAS_DOM_FEATURE            = this.HAS_DOM_IMPLEMENTATION && document.implementation.hasFeature;
	this.IS_MOZ                     = this.HAS_DOM_CREATE_DOCUMENT && this.HAS_DOM_FEATURE;
	this.IS_SAFARI                  = (navigator.userAgent && navigator.vendor && (navigator.userAgent.toLowerCase().indexOf("applewebkit") != -1 || navigator.vendor.indexOf("Apple") != -1));
	this.IS_IE                      = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1  && navigator.userAgent.toLowerCase().indexOf("opera") == -1;
	this.IS_CHROME                  = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
}


ATT_Table.prototype.loadXMLDoc = function(url) {
 
	var xmlDoc;
	 if(this.IS_MOZ && !this.IS_CHROME) {
	 	 // support Mozilla/Gecko based browsers
		 xmlDoc=document.implementation.createDocument("","",null);
		 xmlDoc.async=false;
		 xmlDoc.preserveWhiteSpace=true;		
		 xmlDoc.load(url);
	 }
	 else if(this.IS_IE){
		 
		 // support Windows / ActiveX
		 xmlDoc=new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");		 
		 xmlDoc.async=false;
		 xmlDoc.load(url);		 
	 }
	 else if (this.IS_CHROME)
	 {	 	
		var xmlhttp = new window.XMLHttpRequest();
		xmlhttp.open("GET",url,false);
		xmlhttp.send(null);
		xmlDoc = xmlhttp.responseXML.documentElement;

	 }
	 return xmlDoc;
} 



ATT_Table.prototype.tranformXMLDocument = function(xmlObject, xslObject, params) {
	
	var resultDocument = null;
	if(this.IS_IE) {
			
		var xslt = new ActiveXObject("Msxml2.XSLTemplate.3.0");
		var xslproc;
		xslt.stylesheet = xslObject;
		xslproc = xslt.createProcessor();
		xslproc.input = xmlObject;
		
		if(params != null) {
			for(var name in params) {
				xslproc.addParameter(name, params[name]);	
			}
		}	
				
		xslproc.transform();
		resultDocument = xslproc.output;
	}
	// code for Mozilla, Firefox, Opera, etc.
	else if(this.IS_MOZ) {
		try {					
			var xsltProcessor = null;
			xsltProcessor=new XSLTProcessor();
			xsltProcessor.importStylesheet(xslObject);
			
			if(params != null) {
				for(var name in params) {
					xsltProcessor.setParameter(null, name, params[name]);	
				}
			}		
						
			resultDocument = xsltProcessor.transformToDocument(xmlObject);		
			
			var serializer = new XMLSerializer(); 		
			resultDocument = serializer.serializeToString(resultDocument);			
		}
		catch(e){
			alert(e);
		}
	}

	return resultDocument;
}


//
//
//   path: /RI/components/js/components/ATT_Table.js  (End) 
//
//////////////////////////////////////////////////////////////////////////



