/* Web Parts Menu */
function webPartsMenu_ExtendContract() {
    if ($("#webPartsMenu_Container").is(':hidden')) {
        webPartsMenu_Extend();
    }
    else {
        webPartsMenu_Contract();
    } // end if
}

function webPartsMenu_Extend() {
    $("#webPartsMenu_Container").show();
}

function webPartsMenu_Contract() {
    $("#webPartsMenu_Container").hide();
}
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();


String.prototype.startsWith = function(str)
{ return (this.match("^" + str) == str) }

function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen)if(isCenter)if(isCenter=="true"){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features+=(features!='')?',':'';
    features+=',left='+myLeft+',top='+myTop;
    features+=',scrollbars=1';
  }
  var newWindow = window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
  newWindow.focus();
}

function OpenPrintWindow(printPageUrl, elementId)
{
    var element = document.getElementById(elementId);
    
    if (element)
    {
        var intWidth = element.clientWidth;
        var intHeight = element.clientHeight;
        
        if (intWidth <= 0)
        {
            intWidth = screen.width / 2;
        } // end if
        
        if (intHeight <= 0)
        {
            intHeight = screen.height / 2;
        } // end if
       
        OpenBrWindow(printPageUrl + '?id=' + elementId, 'printWindow', '', intWidth, intHeight, 'true');
    } // end if
} // end OpenPrintWindow

function PrintWindow()
{
    window.print()
} // end PrintWindow

var Url = {

    // public method for url encoding
    Encode: function(string) {
        return escape(this._utf8_encode(string));
    },

    // public method for url decoding
    Decode: function(string) {
        return this._utf8_decode(unescape(string));
    },

    // private method for UTF-8 encoding
    _utf8_encode: function(string) {
        string = string.replace(/\r\n/g, "\n");
        var utftext = "";

        for (var n = 0; n < string.length; n++) {

            var c = string.charCodeAt(n);

            if (c < 128) {
                utftext += String.fromCharCode(c);
            }
            else if ((c > 127) && (c < 2048)) {
                utftext += String.fromCharCode((c >> 6) | 192);
                utftext += String.fromCharCode((c & 63) | 128);
            }
            else {
                utftext += String.fromCharCode((c >> 12) | 224);
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                utftext += String.fromCharCode((c & 63) | 128);
            }

        }

        return utftext;
    },

    // private method for UTF-8 decoding
    _utf8_decode: function(utftext) {
        var string = "";
        var i = 0;
        var c = c1 = c2 = 0;

        while (i < utftext.length) {

            c = utftext.charCodeAt(i);

            if (c < 128) {
                string += String.fromCharCode(c);
                i++;
            }
            else if ((c > 191) && (c < 224)) {
                c2 = utftext.charCodeAt(i + 1);
                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
                i += 2;
            }
            else {
                c2 = utftext.charCodeAt(i + 1);
                c3 = utftext.charCodeAt(i + 2);
                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
                i += 3;
            }

        }

        return string;
    }

}

function URLEncode (clearString) {
  var output = '';
  var x = 0;
  clearString = clearString.toString();
  var regex = /(^[a-zA-Z0-9_.]*)/;
  while (x < clearString.length) {
    var match = regex.exec(clearString.substr(x));
    if (match != null && match.length > 1 && match[1] != '') {
    	output += match[1];
      x += match[1].length;
    } else {
      if (clearString[x] == ' ')
        output += '+';
      else {
        var charCode = clearString.charCodeAt(x);
        var hexVal = charCode.toString(16);
        output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
      }
      x++;
    }
  }
  return output;
}

// E.g. Blink(strElmId + ",#00FF00,6");
function Blink(args){
  // Set the color and seconds below, e.g., [args,'COLOR',SECONDS]
 	args = (/,/.test(args)) ?  args.split(/,/) :  [args,'#FFD100',10];
 	var who = document.getElementById(args[0]);
 	var count = parseInt(args[2]);
 	if (--count <=0)
 	{
  		who.style.backgroundColor = '';
  		//if(who.focus) who.focus();
 	}
 	else
 	{
  		args[2]=count+'';
  		who.style.backgroundColor=(count%2==0)? '': args[1];
 	 	args='\"'+args.join(',')+'\"';
  		setTimeout("Blink("+args+")",500);
 	} // end if
} // end Blink

function ToggleInstructions(elm,text)
{
	if(elm.value == text)
		elm.value = "";
	else if(elm.value == "")
		elm.value = text;
} // ToggleInstructions

// http://www.howtocreate.co.uk/perfectPopups.html

var PerfectPopImagePositionX = 10;
var PerfectPopImagePositionY = 10;
var PerfectPopImageDefaultWidth  = 640;
var PerfectPopImageDefaultHeight = 400;
var PerfectPopImageAutoClose = false;

function PerfectPopImage(imageURL,imageTitle){
  if (BrowserDetect.browser == 'Explorer')
  {
      PerfectPopImagePositionX = ((screen.availWidth - PerfectPopImageDefaultWidth) / 2);
      PerfectPopImagePositionY = ((screen.availHeight - PerfectPopImageDefaultHeight) / 2)
  } // end if
  
  var imgWin = window.open('','_blank','scrollbars=no,resizable=1,width='+PerfectPopImageDefaultWidth+',height='+PerfectPopImageDefaultHeight+',left='+PerfectPopImagePositionX+',top='+PerfectPopImagePositionY);
  if( !imgWin ) { return true; } //popup blockers should not cause errors
  imgWin.document.write('<html><head><title>'+imageTitle+'<\/title><script type="text\/javascript">\n'+
    'function resizeWinTo() {\n'+
    'if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }'+
    'var oH = document.images[0].height, oW = document.images[0].width;\n'+
    'if( !oH || window.doneAlready ) { return; }\n'+ //in case images are disabled
    'window.doneAlready = true;\n'+ //for Safari and Opera
    'var x = window; x.resizeTo( oW + 200, oH + 200 );\n'+
    'var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n'+
    'if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }\n'+
    'else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }\n'+
    'else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }\n'+
    'if( window.opera && !document.childNodes ) { myW += 16; }\n'+
    'x.resizeTo( oW = oW + ( ( oW + 200 ) - myW ), oH = oH + ( (oH + 200 ) - myH ) );\n'+
    'var scW = screen.availWidth ? screen.availWidth : screen.width;\n'+
    'var scH = screen.availHeight ? screen.availHeight : screen.height;\n'+
    'if( !window.opera ) { x.moveTo(Math.round((scW-oW)/2),Math.round((scH-oH)/2)); }\n'+
    '}\n'+
    '<\/script>'+
    '<\/head><body onload="resizeWinTo();"'+(PerfectPopImageAutoClose?' onblur="self.close();"':'')+'>'+
    (document.layers?('<layer left="0" top="0">'):('<div style="position:absolute;left:0px;top:0px;display:table;">'))+
    '<img src="'+imageURL+'" alt="Loading image ..." title="" onload="resizeWinTo();" onClick="window.close();">'+
    (document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');
  imgWin.document.close();
  if( imgWin.focus ) { imgWin.focus(); }
  return false;
}

String.prototype.trim = function() { return this.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); }

function toggleDisabled(el) {

    if (!el)
        return;

    el.disabled = !el.disabled;
        
    if (el.childNodes && el.childNodes.length > 0)
    {
        for (var x = 0; x < el.childNodes.length; x++)
        {
            toggleDisabled(el.childNodes[x]);
        }
    }
}

function toggleDisplay(eid) {
    var elm = document.getElementById(eid);

    if (!elm)
        return;

    elm.style.display = elm.style.display == '' ? 'none' : '';
} // toggleVisible

var currentScrollLeft = 0;
var currentScrollTop = 0;
function storeScrollPosition(elmId) {
    var elm = document.getElementById(elmId);
    if (elm) {
        currentScrollLeft = elm.scrollLeft;
        currentScrollTop = elm.scrollTop;
    }
} // end storeScrollPosition

function recallScrollPosition(elmId) {
    var elm = document.getElementById(elmId);
    if (elm) {
        elm.scrollLeft = currentScrollLeft;
        elm.scrollTop = currentScrollTop;
    }
} // end recallScrollPosition

function cancelEvent(e) {
    e = e ? e : window.event;
    if (e.stopPropagation)
        e.stopPropagation();
    if (e.preventDefault)
        e.preventDefault();
    e.cancelBubble = true;
    e.cancel = true;
    e.returnValue = false;
    return false;
}

function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow)
        oWindow = window.radWindow;
    else if (window.frameElement && window.frameElement.radWindow)
        oWindow = window.frameElement.radWindow;

    return oWindow;
}

function GetNamedRadWindowManager(id) {
    return $find(id);
}

function GetNamedRadWindow(id) {
    return $find(id);
}

function ShowNamedRadWindow(url, id) {
    var oWnd = GetNamedRadWindow(id);
    
    if (oWnd) {
        if (url)
            oWnd.setUrl(url);

        oWnd.show();
    }
}

function ShowSharedRadWindow(url, id, width, height) {
    var oWnd = GetNamedRadWindow(id);

    if (oWnd) {
        
        oWnd.SetSize(width, height);
        
        if (url)
            oWnd.setUrl(url);

        oWnd.show();
    }
}

function GetCurrentRadWindow() {
    var oWindow = null;
    if (window.radWindow)
        oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog       
    else if (window.frameElement && window.frameElement.radWindow)
        oWindow = window.frameElement.radWindow; //IE (and Moz as well)       
    return oWindow;    
}

function CloseCurrentRadWindow() {
    var oWnd = GetCurrentRadWindow();

    if (oWnd)
        oWnd.close();
}

function CloseCurrentRadWindowAndReloadOpener() {
    var oWnd = GetCurrentRadWindow();

    if (oWnd)
        oWnd.BrowserWindow.location = oWnd.BrowserWindow.location;
}
function warp_InitializePanel(oPanel) {
    var pi = oPanel.getProgressIndicator();
    pi.setTemplate("<img src='/WebResources/images/progressIndicator.gif' />");
    pi.setRelativeContainer(document.body);
    ig_shared.getCBManager()._timeLimit = 180000;
}
/*****

Image Cross Fade Redux
Version 1.0
Last revision: 02.15.2006
steve@slayeroffice.com

Please leave this notice intact. 

Rewrite of old code found here: http://slayeroffice.com/code/imageCrossFade/index.html


*****/


window.addEventListener ? window.addEventListener("load", so_xfade_init, false) : window.attachEvent("onload", so_xfade_init);

var so_document = document, so_imgs = new Array(), so_zInterval = null, so_current = 0, so_pause = false;

function so_xfade_init() {
    if (!so_document.getElementById || !so_document.createElement) return;

    // DON'T FORGET TO GRAB THIS FILE AND PLACE IT ON YOUR SERVER IN THE SAME DIRECTORY AS THE JAVASCRIPT!
    // http://slayeroffice.com/code/imageCrossFade/xfade2.css
    //css = d.createElement("link");
    //css.setAttribute("href","xfade2.css");
    //css.setAttribute("rel","stylesheet");
    //css.setAttribute("type","text/css");
    //d.getElementsByTagName("head")[0].appendChild(css);

    if (!so_document.getElementById("imageContainer"))
        return;

    so_imgs = so_document.getElementById("imageContainer").getElementsByTagName("img");
    for (i = 1; i < so_imgs.length; i++) so_imgs[i].xOpacity = 0;
    so_imgs[0].style.display = "block";
    so_imgs[0].xOpacity = .99;

    setTimeout(so_xfade, 1000);
}

function so_xfade() {
    cOpacity = so_imgs[so_current].xOpacity;
    nIndex = so_imgs[so_current + 1] ? so_current + 1 : 0;

    nOpacity = so_imgs[nIndex].xOpacity;

    cOpacity -= .05;
    nOpacity += .05;

    so_imgs[nIndex].style.display = "block";
    so_imgs[so_current].xOpacity = cOpacity;
    so_imgs[nIndex].xOpacity = nOpacity;

    setOpacity(so_imgs[so_current]);
    setOpacity(so_imgs[nIndex]);

    if (cOpacity <= 0) {
        so_imgs[so_current].style.display = "none";
        so_current = nIndex;
        setTimeout(so_xfade, 1000);
    } else {
        setTimeout(so_xfade, 50);
    }

    function setOpacity(obj) {
        if (obj.xOpacity > .99) {
            obj.xOpacity = .99;
            return;
        }
        obj.style.opacity = obj.xOpacity;
        obj.style.MozOpacity = obj.xOpacity;
        obj.style.filter = "alpha(opacity=" + (obj.xOpacity * 100) + ")";
    }
}

/*
 * jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
 * Revision: 6246
 */
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
/* jTemplates 0.7.8 (http://jtemplates.tpython.com) Copyright (c) 2009 Tomasz Gloc */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('a(37.b&&!37.b.38){(9(b){6 m=9(s,A,f){5.1M=[];5.1u={};5.2p=E;5.1N={};5.1c={};5.f=b.1m({1Z:1f,3a:1O,2q:1f,2r:1f,3b:1O,3c:1O},f);5.1v=(5.f.1v!==F)?(5.f.1v):(13.20);5.Y=(5.f.Y!==F)?(5.f.Y):(13.3d);5.3e(s,A);a(s){5.1w(5.1c[\'21\'],A,5.f)}5.1c=E};m.y.2s=\'0.7.8\';m.R=1O;m.y.3e=9(s,A){6 2t=/\\{#14 *(\\w*?)( .*)*\\}/g;6 22,1x,M;6 1y=E;6 2u=[];2v((22=2t.3N(s))!=E){1y=2t.1y;1x=22[1];M=s.2w(\'{#/14 \'+1x+\'}\',1y);a(M==-1){C j Z(\'15: m "\'+1x+\'" 2x 23 3O.\');}5.1c[1x]=s.2y(1y,M);2u[1x]=13.2z(22[2])}a(1y===E){5.1c[\'21\']=s;c}N(6 i 24 5.1c){a(i!=\'21\'){5.1N[i]=j m()}}N(6 i 24 5.1c){a(i!=\'21\'){5.1N[i].1w(5.1c[i],b.1m({},A||{},5.1N||{}),b.1m({},5.f,2u[i]));5.1c[i]=E}}};m.y.1w=9(s,A,f){a(s==F){5.1M.B(j 1g(\'\',1,5));c}s=s.U(/[\\n\\r]/g,\'\');s=s.U(/\\{\\*.*?\\*\\}/g,\'\');5.2p=b.1m({},5.1N||{},A||{});5.f=j 2A(f);6 p=5.1M;6 1P=s.1h(/\\{#.*?\\}/g);6 16=0,M=0;6 e;6 1i=0;6 25=0;N(6 i=0,l=(1P)?(1P.V):(0);i<l;++i){6 17=1P[i];a(1i){M=s.2w(\'{#/1z}\');a(M==-1){C j Z("15: 3P 1Q 3f 1z.");}a(M>16){p.B(j 1g(s.2y(16,M),1,5))}16=M+11;1i=0;i=b.3Q(\'{#/1z}\',1P);1R}M=s.2w(17,16);a(M>16){p.B(j 1g(s.2y(16,M),1i,5))}6 3R=17.1h(/\\{#([\\w\\/]+).*?\\}/);6 26=I.$1;2B(26){q\'3S\':++25;p.27();q\'a\':e=j 1A(17,p);p.B(e);p=e;D;q\'J\':p.27();D;q\'/a\':2v(25){p=p.28();--25}q\'/N\':q\'/29\':p=p.28();D;q\'29\':e=j 1n(17,p,5);p.B(e);p=e;D;q\'N\':e=2a(17,p,5);p.B(e);p=e;D;q\'1R\':q\'D\':p.B(j 18(26));D;q\'2C\':p.B(j 2D(17,5.2p));D;q\'h\':p.B(j 2E(17));D;q\'2F\':p.B(j 2G(17));D;q\'3T\':p.B(j 1g(\'{\',1,5));D;q\'3U\':p.B(j 1g(\'}\',1,5));D;q\'1z\':1i=1;D;q\'/1z\':a(m.R){C j Z("15: 3V 2H 3f 1z.");}D;2I:a(m.R){C j Z(\'15: 3W 3X: \'+26+\'.\');}}16=M+17.V}a(s.V>16){p.B(j 1g(s.3Y(16),1i,5))}};m.y.K=9(d,h,z,H){++H;6 $T=d,2b,2c;a(5.f.3b){$T=5.1v(d,{2d:(5.f.3a&&H==1),1S:5.f.1Z},5.Y)}a(!5.f.3c){2b=5.1u;2c=h}J{2b=5.1v(5.1u,{2d:(5.f.2q),1S:1f},5.Y);2c=5.1v(h,{2d:(5.f.2q&&H==1),1S:1f},5.Y)}6 $P=b.1m({},2b,2c);6 $Q=(z!=F)?(z):({});$Q.2s=5.2s;6 19=\'\';N(6 i=0,l=5.1M.V;i<l;++i){19+=5.1M[i].K($T,$P,$Q,H)}--H;c 19};m.y.2J=9(1T,1o){5.1u[1T]=1o};13=9(){};13.3d=9(3g){c 3g.U(/&/g,\'&3Z;\').U(/>/g,\'&3h;\').U(/</g,\'&3i;\').U(/"/g,\'&40;\').U(/\'/g,\'&#39;\')};13.20=9(d,1B,Y){a(d==E){c d}2B(d.2K){q 2A:6 o={};N(6 i 24 d){o[i]=13.20(d[i],1B,Y)}a(!1B.1S){a(d.41("2L"))o.2L=d.2L}c o;q 42:6 o=[];N(6 i=0,l=d.V;i<l;++i){o[i]=13.20(d[i],1B,Y)}c o;q 2M:c(1B.2d)?(Y(d)):(d);q 43:a(1B.1S){a(m.R)C j Z("15: 44 45 23 46.");J c F}2I:c d}};13.2z=9(2e){a(2e===E||2e===F){c{}}6 o=2e.47(/[= ]/);a(o[0]===\'\'){o.48()}6 2N={};N(6 i=0,l=o.V;i<l;i+=2){2N[o[i]]=o[i+1]}c 2N};6 1g=9(2O,1i,14){5.2f=2O;5.3j=1i;5.1d=14};1g.y.K=9(d,h,z,H){6 2g=5.2f;a(!5.3j){6 2P=5.1d;6 $T=d;6 $P=h;6 $Q=z;2g=2g.U(/\\{(.*?)\\}/g,9(49,3k){1C{6 1D=10(3k);a(1E 1D==\'9\'){a(2P.f.1Z||!2P.f.2r){c\'\'}J{1D=1D($T,$P,$Q)}}c(1D===F)?(""):(2M(1D))}1F(e){a(m.R){a(e 1G 18)e.1j="4a";C e;}c""}})}c 2g};6 1A=9(L,1H){5.2h=1H;L.1h(/\\{#(?:J)*a (.*?)\\}/);5.3l=I.$1;5.1p=[];5.1q=[];5.1I=5.1p};1A.y.B=9(e){5.1I.B(e)};1A.y.28=9(){c 5.2h};1A.y.27=9(){5.1I=5.1q};1A.y.K=9(d,h,z,H){6 $T=d;6 $P=h;6 $Q=z;6 19=\'\';1C{6 2Q=(10(5.3l))?(5.1p):(5.1q);N(6 i=0,l=2Q.V;i<l;++i){19+=2Q[i].K(d,h,z,H)}}1F(e){a(m.R||(e 1G 18))C e;}c 19};2a=9(L,1H,14){a(L.1h(/\\{#N (\\w+?) *= *(\\S+?) +4b +(\\S+?) *(?:12=(\\S+?))*\\}/)){L=\'{#29 2a.3m 3n \'+I.$1+\' 2H=\'+(I.$2||0)+\' 1Q=\'+(I.$3||-1)+\' 12=\'+(I.$4||1)+\' u=$T}\';c j 1n(L,1H,14)}J{C j Z(\'15: 4c 4d "3o": \'+L);}};2a.3m=9(i){c i};6 1n=9(L,1H,14){5.2h=1H;5.1d=14;L.1h(/\\{#29 (.+?) 3n (\\w+?)( .+)*\\}/);5.3p=I.$1;5.x=I.$2;5.W=I.$3||E;5.W=13.2z(5.W);5.1p=[];5.1q=[];5.1I=5.1p};1n.y.B=9(e){5.1I.B(e)};1n.y.28=9(){c 5.2h};1n.y.27=9(){5.1I=5.1q};1n.y.K=9(d,h,z,H){1C{6 $T=d;6 $P=h;6 $Q=z;6 1r=10(5.3p);6 1U=[];6 1J=1E 1r;a(1J==\'3q\'){6 2R=[];b.1e(1r,9(k,v){1U.B(k);2R.B(v)});1r=2R}6 u=(5.W.u!==F)?(10(5.W.u)):(($T!=E)?($T):({}));6 s=1V(10(5.W.2H)||0),e;6 12=1V(10(5.W.12)||1);a(1J!=\'9\'){e=1r.V}J{a(5.W.1Q===F||5.W.1Q===E){e=1V.4e}J{e=1V(10(5.W.1Q))+((12>0)?(1):(-1))}}6 19=\'\';6 i,l;a(5.W.1W){6 2S=s+1V(10(5.W.1W));e=(2S>e)?(e):(2S)}a((e>s&&12>0)||(e<s&&12<0)){6 1K=0;6 3r=(1J!=\'9\')?(4f.4g((e-s)/12)):F;6 1s,1k;N(;((12>0)?(s<e):(s>e));s+=12,++1K){1s=1U[s];a(1J!=\'9\'){1k=1r[s]}J{1k=1r(s);a(1k===F||1k===E){D}}a((1E 1k==\'9\')&&(5.1d.f.1Z||!5.1d.f.2r)){1R}a((1J==\'3q\')&&(1s 24 2A)){1R}6 3s=u[5.x];u[5.x]=1k;u[5.x+\'$3t\']=s;u[5.x+\'$1K\']=1K;u[5.x+\'$3u\']=(1K==0);u[5.x+\'$3v\']=(s+12>=e);u[5.x+\'$3w\']=3r;u[5.x+\'$1U\']=(1s!==F&&1s.2K==2M)?(5.1d.Y(1s)):(1s);u[5.x+\'$1E\']=1E 1k;N(i=0,l=5.1p.V;i<l;++i){1C{19+=5.1p[i].K(u,h,z,H)}1F(2T){a(2T 1G 18){2B(2T.1j){q\'1R\':i=l;D;q\'D\':i=l;s=e;D;2I:C e;}}J{C e;}}}1l u[5.x+\'$3t\'];1l u[5.x+\'$1K\'];1l u[5.x+\'$3u\'];1l u[5.x+\'$3v\'];1l u[5.x+\'$3w\'];1l u[5.x+\'$1U\'];1l u[5.x+\'$1E\'];1l u[5.x];u[5.x]=3s}}J{N(i=0,l=5.1q.V;i<l;++i){19+=5.1q[i].K($T,h,z,H)}}c 19}1F(e){a(m.R||(e 1G 18))C e;c""}};6 18=9(1j){5.1j=1j};18.y=Z;18.y.K=9(d){C 5;};6 2D=9(L,A){L.1h(/\\{#2C (.*?)(?: 4h=(.*?))?\\}/);5.1d=A[I.$1];a(5.1d==F){a(m.R)C j Z(\'15: 4i 3o 2C: \'+I.$1);}5.3x=I.$2};2D.y.K=9(d,h,z,H){6 $T=d;6 $P=h;1C{c 5.1d.K(10(5.3x),h,z,H)}1F(e){a(m.R||(e 1G 18))C e;}c\'\'};6 2E=9(L){L.1h(/\\{#h 1T=(\\w*?) 1o=(.*?)\\}/);5.x=I.$1;5.2f=I.$2};2E.y.K=9(d,h,z,H){6 $T=d;6 $P=h;6 $Q=z;1C{h[5.x]=10(5.2f)}1F(e){a(m.R||(e 1G 18))C e;h[5.x]=F}c\'\'};6 2G=9(L){L.1h(/\\{#2F 4j=(.*?)\\}/);5.2U=10(I.$1);5.2V=5.2U.V;a(5.2V<=0){C j Z(\'15: 2F 4k 4l 4m\');}5.2W=0;5.2X=-1};2G.y.K=9(d,h,z,H){6 2Y=b.O(z,\'1X\');a(2Y!=5.2X){5.2X=2Y;5.2W=0}6 i=5.2W++%5.2V;c 5.2U[i]};b.1a.1w=9(s,A,f){a(s.2K===m){c b(5).1e(9(){b.O(5,\'2i\',s);b.O(5,\'1X\',0)})}J{c b(5).1e(9(){b.O(5,\'2i\',j m(s,A,f));b.O(5,\'1X\',0)})}};b.1a.4n=9(1L,A,f){6 s=b.2Z({1t:1L,1Y:1f}).3y;c b(5).1w(s,A,f)};b.1a.4o=9(30,A,f){6 s=b(\'#\'+30).2O();a(s==E){s=b(\'#\'+30).3z();s=s.U(/&3i;/g,"<").U(/&3h;/g,">")}s=b.4p(s);s=s.U(/^<\\!\\[4q\\[([\\s\\S]*)\\]\\]>$/3A,\'$1\');s=s.U(/^<\\!--([\\s\\S]*)-->$/3A,\'$1\');c b(5).1w(s,A,f)};b.1a.4r=9(){6 1W=0;b(5).1e(9(){a(b.2j(5)){++1W}});c 1W};b.1a.4s=9(){b(5).3B();c b(5).1e(9(){b.3C(5,\'2i\')})};b.1a.2J=9(1T,1o){c b(5).1e(9(){6 t=b.2j(5);a(t===F){a(m.R)C j Z(\'15: m 2x 23 3D.\');J c}t.2J(1T,1o)})};b.1a.31=9(d,h){c b(5).1e(9(){6 t=b.2j(5);a(t===F){a(m.R)C j Z(\'15: m 2x 23 3D.\');J c}b.O(5,\'1X\',b.O(5,\'1X\')+1);b(5).3z(t.K(d,h,5,0))})};b.1a.4t=9(1L,h,G){6 X=5;G=b.1m({1j:\'4u\',1Y:1O,32:1f},G);b.2Z({1t:1L,1j:G.1j,O:G.O,3E:G.3E,1Y:G.1Y,32:G.32,3F:G.3F,4v:\'4w\',4x:9(d){6 r=b(X).31(d,h);a(G.2k){G.2k(r)}},4y:G.4z,4A:G.4B});c 5};6 2l=9(1t,h,2m,2n,1b,G){5.3G=1t;5.1u=h;5.3H=2m;5.3I=2n;5.1b=1b;5.3J=E;5.33=G||{};6 X=5;b(1b).1e(9(){b.O(5,\'34\',X)});5.35()};2l.y.35=9(){5.3K();a(5.1b.V==0){c}6 X=5;b.4C(5.3G,5.3I,9(d){6 r=b(X.1b).31(d,X.1u);a(X.33.2k){X.33.2k(r)}});5.3J=4D(9(){X.35()},5.3H)};2l.y.3K=9(){5.1b=b.3L(5.1b,9(o){a(b.4E.4F){6 n=o.36;2v(n&&n!=4G){n=n.36}c n!=E}J{c o.36!=E}})};b.1a.4H=9(1t,h,2m,2n,G){c j 2l(1t,h,2m,2n,5,G)};b.1a.3B=9(){c b(5).1e(9(){6 2o=b.O(5,\'34\');a(2o==E){c}6 X=5;2o.1b=b.3L(2o.1b,9(o){c o!=X});b.3C(5,\'34\')})};b.1m({38:9(s,A,f){c j m(s,A,f)},4I:9(1L,A,f){6 s=b.2Z({1t:1L,1Y:1f}).3y;c j m(s,A,f)},2j:9(z){c b.O(z,\'2i\')},4J:9(14,O,3M){c 14.K(O,3M,F,0)},4K:9(1o){m.R=1o}})})(b)}',62,295,'|||||this|var|||function|if|jQuery|return|||settings||param||new|||Template|||node|case||||extData|||_name|prototype|element|includes|push|throw|break|null|undefined|options|deep|RegExp|else|get|oper|se|for|data|||DEBUG_MODE|||replace|length|_option|that|f_escapeString|Error|eval||step|TemplateUtils|template|jTemplates|ss|this_op|JTException|ret|fn|objs|_templates_code|_template|each|false|TextNode|match|literalMode|type|cval|delete|extend|opFOREACH|value|_onTrue|_onFalse|fcount|ckey|url|_param|f_cloneData|setTemplate|tname|lastIndex|literal|opIF|filter|try|__tmp|typeof|catch|instanceof|par|_currentState|mode|iteration|url_|_tree|_templates|true|op|end|continue|noFunc|name|key|Number|count|jTemplateSID|async|disallow_functions|cloneData|MAIN|iter|not|in|elseif_level|op_|switchToElse|getParent|foreach|opFORFactory|_param1|_param2|escapeData|optionText|_value|__t|_parent|jTemplate|getTemplate|on_success|Updater|interval|args|updater|_includes|filter_params|runnable_functions|version|reg|_template_settings|while|indexOf|is|substring|optionToObject|Object|switch|include|Include|UserParam|cycle|Cycle|begin|default|setParam|constructor|toString|String|obj|val|__template|tab|arr|tmp|ex|_values|_length|_index|_lastSessionID|sid|ajax|elementName|processTemplate|cache|_options|jTemplateUpdater|run|parentNode|window|createTemplate||filter_data|clone_data|clone_params|escapeHTML|splitTemplates|of|txt|gt|lt|_literalMode|__1|_cond|funcIterator|as|find|_arg|object|_total|prevValue|index|first|last|total|_root|responseText|html|im|processTemplateStop|removeData|defined|dataFilter|timeout|_url|_interval|_args|timer|detectDeletedNodes|grep|parameter|exec|closed|No|inArray|ppp|elseif|ldelim|rdelim|Missing|unknown|tag|substr|amp|quot|hasOwnProperty|Array|Function|Functions|are|allowed|split|shift|__0|subtemplate|to|Operator|failed|MAX_VALUE|Math|ceil|root|Cannot|values|has|no|elements|setTemplateURL|setTemplateElement|trim|CDATA|hasTemplate|removeTemplate|processTemplateURL|GET|dataType|json|success|error|on_error|complete|on_complete|getJSON|setTimeout|browser|msie|document|processTemplateStart|createTemplateURL|processTemplateToText|jTemplatesDebugMode'.split('|'),0,{}));
/*
 * @name BeautyTips
 * @desc a tooltips/baloon-help plugin for jQuery
 *
 * @author Jeff Robbins - Lullabot - http://www.lullabot.com
 * @version 0.9.5-rc1  (5/20/2009)
 */
jQuery.bt={version:"0.9.5-rc1"};(function($){jQuery.fn.bt=function(content,options){if(typeof content!="string"){var contentSelect=true;options=content;content=false;}else{var contentSelect=false;}if(jQuery.fn.hoverIntent&&jQuery.bt.defaults.trigger=="hover"){jQuery.bt.defaults.trigger="hoverIntent";}return this.each(function(index){var opts=jQuery.extend(false,jQuery.bt.defaults,jQuery.bt.options,options);opts.spikeLength=numb(opts.spikeLength);opts.spikeGirth=numb(opts.spikeGirth);opts.overlap=numb(opts.overlap);var ajaxTimeout=false;if(opts.killTitle){$(this).find("[title]").andSelf().each(function(){if(!$(this).attr("bt-xTitle")){$(this).attr("bt-xTitle",$(this).attr("title")).attr("title","");}});}if(typeof opts.trigger=="string"){opts.trigger=[opts.trigger];}if(opts.trigger[0]=="hoverIntent"){var hoverOpts=jQuery.extend(opts.hoverIntentOpts,{over:function(){this.btOn();},out:function(){this.btOff();}});$(this).hoverIntent(hoverOpts);}else{if(opts.trigger[0]=="hover"){$(this).hover(function(){this.btOn();},function(){this.btOff();});}else{if(opts.trigger[0]=="now"){if($(this).hasClass("bt-active")){this.btOff();}else{this.btOn();}}else{if(opts.trigger[0]=="none"){}else{if(opts.trigger.length>1&&opts.trigger[0]!=opts.trigger[1]){$(this).bind(opts.trigger[0],function(){this.btOn();}).bind(opts.trigger[1],function(){this.btOff();});}else{$(this).bind(opts.trigger[0],function(){if($(this).hasClass("bt-active")){this.btOff();}else{this.btOn();}});}}}}}this.btOn=function(){if(typeof $(this).data("bt-box")=="object"){this.btOff();}opts.preBuild.apply(this);$(jQuery.bt.vars.closeWhenOpenStack).btOff();$(this).addClass("bt-active "+opts.activeClass);if(contentSelect&&opts.ajaxPath==null){if(opts.killTitle){$(this).attr("title",$(this).attr("bt-xTitle"));}content=$.isFunction(opts.contentSelector)?opts.contentSelector.apply(this):eval(opts.contentSelector);if(opts.killTitle){$(this).attr("title","");}}if(opts.ajaxPath!=null&&content==false){if(typeof opts.ajaxPath=="object"){var url=eval(opts.ajaxPath[0]);url+=opts.ajaxPath[1]?" "+opts.ajaxPath[1]:"";}else{var url=opts.ajaxPath;}var off=url.indexOf(" ");if(off>=0){var selector=url.slice(off,url.length);url=url.slice(0,off);}var cacheData=opts.ajaxCache?$(document.body).data("btCache-"+url.replace(/\./g,"")):null;if(typeof cacheData=="string"){content=selector?$("<div/>").append(cacheData.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):cacheData;}else{var target=this;var ajaxOpts=jQuery.extend(false,{type:opts.ajaxType,data:opts.ajaxData,cache:opts.ajaxCache,url:url,complete:function(XMLHttpRequest,textStatus){if(textStatus=="success"||textStatus=="notmodified"){if(opts.ajaxCache){$(document.body).data("btCache-"+url.replace(/\./g,""),XMLHttpRequest.responseText);}ajaxTimeout=false;content=selector?$("<div/>").append(XMLHttpRequest.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):XMLHttpRequest.responseText;}else{if(textStatus=="timeout"){ajaxTimeout=true;}content=opts.ajaxError.replace(/%error/g,XMLHttpRequest.statusText);}if($(target).hasClass("bt-active")){target.btOn();}}},opts.ajaxOpts);jQuery.ajax(ajaxOpts);content=opts.ajaxLoading;}}var shadowMarginX=0;var shadowMarginY=0;var shadowShiftX=0;var shadowShiftY=0;if(opts.shadow&&!shadowSupport()){opts.shadow=false;jQuery.extend(opts,opts.noShadowOpts);}if(opts.shadow){if(opts.shadowBlur>Math.abs(opts.shadowOffsetX)){shadowMarginX=opts.shadowBlur*2;}else{shadowMarginX=opts.shadowBlur+Math.abs(opts.shadowOffsetX);}shadowShiftX=(opts.shadowBlur-opts.shadowOffsetX)>0?opts.shadowBlur-opts.shadowOffsetX:0;if(opts.shadowBlur>Math.abs(opts.shadowOffsetY)){shadowMarginY=opts.shadowBlur*2;}else{shadowMarginY=opts.shadowBlur+Math.abs(opts.shadowOffsetY);}shadowShiftY=(opts.shadowBlur-opts.shadowOffsetY)>0?opts.shadowBlur-opts.shadowOffsetY:0;}if(opts.offsetParent){var offsetParent=$(opts.offsetParent);var offsetParentPos=offsetParent.offset();var pos=$(this).offset();var top=numb(pos.top)-numb(offsetParentPos.top)+numb($(this).css("margin-top"))-shadowShiftY;var left=numb(pos.left)-numb(offsetParentPos.left)+numb($(this).css("margin-left"))-shadowShiftX;}else{var offsetParent=($(this).css("position")=="absolute")?$(this).parents().eq(0).offsetParent():$(this).offsetParent();var pos=$(this).btPosition();var top=numb(pos.top)+numb($(this).css("margin-top"))-shadowShiftY;var left=numb(pos.left)+numb($(this).css("margin-left"))-shadowShiftX;}var width=$(this).btOuterWidth();var height=$(this).outerHeight();if(typeof content=="object"){var original=content;var clone=$(original).clone(true).show();var origClones=$(original).data("bt-clones")||[];origClones.push(clone);$(original).data("bt-clones",origClones);$(clone).data("bt-orig",original);$(this).data("bt-content-orig",{original:original,clone:clone});content=clone;}if(typeof content=="null"||content==""){return;}var $text=$('<div class="bt-content"></div>').append(content).css({padding:opts.padding,position:"absolute",width:(opts.shrinkToFit?"auto":opts.width),zIndex:opts.textzIndex,left:shadowShiftX,top:shadowShiftY}).css(opts.cssStyles);var $box=$('<div class="bt-wrapper"></div>').append($text).addClass(opts.cssClass).css({position:"absolute",width:opts.width,zIndex:opts.wrapperzIndex,visibility:"hidden"}).appendTo(offsetParent);if(jQuery.fn.bgiframe){$text.bgiframe();$box.bgiframe();}$(this).data("bt-box",$box);var scrollTop=numb($(document).scrollTop());var scrollLeft=numb($(document).scrollLeft());var docWidth=numb($(window).width());var docHeight=numb($(window).height());var winRight=scrollLeft+docWidth;var winBottom=scrollTop+docHeight;var space=new Object();var thisOffset=$(this).offset();space.top=thisOffset.top-scrollTop;space.bottom=docHeight-((thisOffset+height)-scrollTop);space.left=thisOffset.left-scrollLeft;space.right=docWidth-((thisOffset.left+width)-scrollLeft);var textOutHeight=numb($text.outerHeight());var textOutWidth=numb($text.btOuterWidth());if(opts.positions.constructor==String){opts.positions=opts.positions.replace(/ /,"").split(",");}if(opts.positions[0]=="most"){var position="top";for(var pig in space){position=space[pig]>space[position]?pig:position;}}else{for(var x in opts.positions){var position=opts.positions[x];if((position=="left"||position=="right")&&space[position]>textOutWidth+opts.spikeLength){break;}else{if((position=="top"||position=="bottom")&&space[position]>textOutHeight+opts.spikeLength){break;}}}}var horiz=left+((width-textOutWidth)*0.5);var vert=top+((height-textOutHeight)*0.5);var points=new Array();var textTop,textLeft,textRight,textBottom,textTopSpace,textBottomSpace,textLeftSpace,textRightSpace,crossPoint,textCenter,spikePoint;switch(position){case"top":$text.css("margin-bottom",opts.spikeLength+"px");$box.css({top:(top-$text.outerHeight(true))+opts.overlap,left:horiz});textRightSpace=(winRight-opts.windowMargin)-($text.offset().left+$text.btOuterWidth(true));var xShift=shadowShiftX;if(textRightSpace<0){$box.css("left",(numb($box.css("left"))+textRightSpace)+"px");xShift-=textRightSpace;}textLeftSpace=($text.offset().left+numb($text.css("margin-left")))-(scrollLeft+opts.windowMargin);if(textLeftSpace<0){$box.css("left",(numb($box.css("left"))-textLeftSpace)+"px");xShift+=textLeftSpace;}textTop=$text.btPosition().top+numb($text.css("margin-top"));textLeft=$text.btPosition().left+numb($text.css("margin-left"));textRight=textLeft+$text.btOuterWidth();textBottom=textTop+$text.outerHeight();textCenter={x:textLeft+($text.btOuterWidth()*opts.centerPointX),y:textTop+($text.outerHeight()*opts.centerPointY)};points[points.length]=spikePoint={y:textBottom+opts.spikeLength,x:((textRight-textLeft)*0.5)+xShift,type:"spike"};crossPoint=findIntersectX(spikePoint.x,spikePoint.y,textCenter.x,textCenter.y,textBottom);crossPoint.x=crossPoint.x<textLeft+opts.spikeGirth/2+opts.cornerRadius?textLeft+opts.spikeGirth/2+opts.cornerRadius:crossPoint.x;crossPoint.x=crossPoint.x>(textRight-opts.spikeGirth/2)-opts.cornerRadius?(textRight-opts.spikeGirth/2)-opts.CornerRadius:crossPoint.x;points[points.length]={x:crossPoint.x-(opts.spikeGirth/2),y:textBottom,type:"join"};points[points.length]={x:textLeft,y:textBottom,type:"corner"};points[points.length]={x:textLeft,y:textTop,type:"corner"};points[points.length]={x:textRight,y:textTop,type:"corner"};points[points.length]={x:textRight,y:textBottom,type:"corner"};points[points.length]={x:crossPoint.x+(opts.spikeGirth/2),y:textBottom,type:"join"};points[points.length]=spikePoint;break;case"left":$text.css("margin-right",opts.spikeLength+"px");$box.css({top:vert+"px",left:((left-$text.btOuterWidth(true))+opts.overlap)+"px"});textBottomSpace=(winBottom-opts.windowMargin)-($text.offset().top+$text.outerHeight(true));var yShift=shadowShiftY;if(textBottomSpace<0){$box.css("top",(numb($box.css("top"))+textBottomSpace)+"px");yShift-=textBottomSpace;}textTopSpace=($text.offset().top+numb($text.css("margin-top")))-(scrollTop+opts.windowMargin);if(textTopSpace<0){$box.css("top",(numb($box.css("top"))-textTopSpace)+"px");yShift+=textTopSpace;}textTop=$text.btPosition().top+numb($text.css("margin-top"));textLeft=$text.btPosition().left+numb($text.css("margin-left"));textRight=textLeft+$text.btOuterWidth();textBottom=textTop+$text.outerHeight();textCenter={x:textLeft+($text.btOuterWidth()*opts.centerPointX),y:textTop+($text.outerHeight()*opts.centerPointY)};points[points.length]=spikePoint={x:textRight+opts.spikeLength,y:((textBottom-textTop)*0.5)+yShift,type:"spike"};crossPoint=findIntersectY(spikePoint.x,spikePoint.y,textCenter.x,textCenter.y,textRight);crossPoint.y=crossPoint.y<textTop+opts.spikeGirth/2+opts.cornerRadius?textTop+opts.spikeGirth/2+opts.cornerRadius:crossPoint.y;crossPoint.y=crossPoint.y>(textBottom-opts.spikeGirth/2)-opts.cornerRadius?(textBottom-opts.spikeGirth/2)-opts.cornerRadius:crossPoint.y;points[points.length]={x:textRight,y:crossPoint.y+opts.spikeGirth/2,type:"join"};points[points.length]={x:textRight,y:textBottom,type:"corner"};points[points.length]={x:textLeft,y:textBottom,type:"corner"};points[points.length]={x:textLeft,y:textTop,type:"corner"};points[points.length]={x:textRight,y:textTop,type:"corner"};points[points.length]={x:textRight,y:crossPoint.y-opts.spikeGirth/2,type:"join"};points[points.length]=spikePoint;break;case"bottom":$text.css("margin-top",opts.spikeLength+"px");$box.css({top:(top+height)-opts.overlap,left:horiz});textRightSpace=(winRight-opts.windowMargin)-($text.offset().left+$text.btOuterWidth(true));var xShift=shadowShiftX;if(textRightSpace<0){$box.css("left",(numb($box.css("left"))+textRightSpace)+"px");xShift-=textRightSpace;}textLeftSpace=($text.offset().left+numb($text.css("margin-left")))-(scrollLeft+opts.windowMargin);if(textLeftSpace<0){$box.css("left",(numb($box.css("left"))-textLeftSpace)+"px");xShift+=textLeftSpace;}textTop=$text.btPosition().top+numb($text.css("margin-top"));textLeft=$text.btPosition().left+numb($text.css("margin-left"));textRight=textLeft+$text.btOuterWidth();textBottom=textTop+$text.outerHeight();textCenter={x:textLeft+($text.btOuterWidth()*opts.centerPointX),y:textTop+($text.outerHeight()*opts.centerPointY)};points[points.length]=spikePoint={x:((textRight-textLeft)*0.5)+xShift,y:shadowShiftY,type:"spike"};crossPoint=findIntersectX(spikePoint.x,spikePoint.y,textCenter.x,textCenter.y,textTop);crossPoint.x=crossPoint.x<textLeft+opts.spikeGirth/2+opts.cornerRadius?textLeft+opts.spikeGirth/2+opts.cornerRadius:crossPoint.x;crossPoint.x=crossPoint.x>(textRight-opts.spikeGirth/2)-opts.cornerRadius?(textRight-opts.spikeGirth/2)-opts.cornerRadius:crossPoint.x;points[points.length]={x:crossPoint.x+opts.spikeGirth/2,y:textTop,type:"join"};points[points.length]={x:textRight,y:textTop,type:"corner"};points[points.length]={x:textRight,y:textBottom,type:"corner"};points[points.length]={x:textLeft,y:textBottom,type:"corner"};points[points.length]={x:textLeft,y:textTop,type:"corner"};points[points.length]={x:crossPoint.x-(opts.spikeGirth/2),y:textTop,type:"join"};points[points.length]=spikePoint;break;case"right":$text.css("margin-left",(opts.spikeLength+"px"));$box.css({top:vert+"px",left:((left+width)-opts.overlap)+"px"});textBottomSpace=(winBottom-opts.windowMargin)-($text.offset().top+$text.outerHeight(true));var yShift=shadowShiftY;if(textBottomSpace<0){$box.css("top",(numb($box.css("top"))+textBottomSpace)+"px");yShift-=textBottomSpace;}textTopSpace=($text.offset().top+numb($text.css("margin-top")))-(scrollTop+opts.windowMargin);if(textTopSpace<0){$box.css("top",(numb($box.css("top"))-textTopSpace)+"px");yShift+=textTopSpace;}textTop=$text.btPosition().top+numb($text.css("margin-top"));textLeft=$text.btPosition().left+numb($text.css("margin-left"));textRight=textLeft+$text.btOuterWidth();textBottom=textTop+$text.outerHeight();textCenter={x:textLeft+($text.btOuterWidth()*opts.centerPointX),y:textTop+($text.outerHeight()*opts.centerPointY)};points[points.length]=spikePoint={x:shadowShiftX,y:((textBottom-textTop)*0.5)+yShift,type:"spike"};crossPoint=findIntersectY(spikePoint.x,spikePoint.y,textCenter.x,textCenter.y,textLeft);crossPoint.y=crossPoint.y<textTop+opts.spikeGirth/2+opts.cornerRadius?textTop+opts.spikeGirth/2+opts.cornerRadius:crossPoint.y;crossPoint.y=crossPoint.y>(textBottom-opts.spikeGirth/2)-opts.cornerRadius?(textBottom-opts.spikeGirth/2)-opts.cornerRadius:crossPoint.y;points[points.length]={x:textLeft,y:crossPoint.y-opts.spikeGirth/2,type:"join"};points[points.length]={x:textLeft,y:textTop,type:"corner"};points[points.length]={x:textRight,y:textTop,type:"corner"};points[points.length]={x:textRight,y:textBottom,type:"corner"};points[points.length]={x:textLeft,y:textBottom,type:"corner"};points[points.length]={x:textLeft,y:crossPoint.y+opts.spikeGirth/2,type:"join"};points[points.length]=spikePoint;break;}var canvas=document.createElement("canvas");$(canvas).attr("width",(numb($text.btOuterWidth(true))+opts.strokeWidth*2+shadowMarginX)).attr("height",(numb($text.outerHeight(true))+opts.strokeWidth*2+shadowMarginY)).appendTo($box).css({position:"absolute",zIndex:opts.boxzIndex});if(typeof G_vmlCanvasManager!="undefined"){canvas=G_vmlCanvasManager.initElement(canvas);}if(opts.cornerRadius>0){var newPoints=new Array();var newPoint;for(var i=0;i<points.length;i++){if(points[i].type=="corner"){newPoint=betweenPoint(points[i],points[(i-1)%points.length],opts.cornerRadius);newPoint.type="arcStart";newPoints[newPoints.length]=newPoint;newPoints[newPoints.length]=points[i];newPoint=betweenPoint(points[i],points[(i+1)%points.length],opts.cornerRadius);newPoint.type="arcEnd";newPoints[newPoints.length]=newPoint;}else{newPoints[newPoints.length]=points[i];}}points=newPoints;}var ctx=canvas.getContext("2d");if(opts.shadow&&opts.shadowOverlap!==true){var shadowOverlap=numb(opts.shadowOverlap);switch(position){case"top":if(opts.shadowOffsetX+opts.shadowBlur-shadowOverlap>0){$box.css("top",(numb($box.css("top"))-(opts.shadowOffsetX+opts.shadowBlur-shadowOverlap)));}break;case"right":if(shadowShiftX-shadowOverlap>0){$box.css("left",(numb($box.css("left"))+shadowShiftX-shadowOverlap));}break;case"bottom":if(shadowShiftY-shadowOverlap>0){$box.css("top",(numb($box.css("top"))+shadowShiftY-shadowOverlap));}break;case"left":if(opts.shadowOffsetY+opts.shadowBlur-shadowOverlap>0){$box.css("left",(numb($box.css("left"))-(opts.shadowOffsetY+opts.shadowBlur-shadowOverlap)));}break;}}drawIt.apply(ctx,[points],opts.strokeWidth);ctx.fillStyle=opts.fill;if(opts.shadow){ctx.shadowOffsetX=opts.shadowOffsetX;ctx.shadowOffsetY=opts.shadowOffsetY;ctx.shadowBlur=opts.shadowBlur;ctx.shadowColor=opts.shadowColor;}ctx.closePath();ctx.fill();if(opts.strokeWidth>0){ctx.shadowColor="rgba(0, 0, 0, 0)";ctx.lineWidth=opts.strokeWidth;ctx.strokeStyle=opts.strokeStyle;ctx.beginPath();drawIt.apply(ctx,[points],opts.strokeWidth);ctx.closePath();ctx.stroke();}opts.preShow.apply(this,[$box[0]]);$box.css({display:"none",visibility:"visible"});opts.showTip.apply(this,[$box[0]]);if(opts.overlay){var overlay=$('<div class="bt-overlay"></div>').css({position:"absolute",backgroundColor:"blue",top:top,left:left,width:width,height:height,opacity:".2"}).appendTo(offsetParent);$(this).data("overlay",overlay);}if((opts.ajaxPath!=null&&opts.ajaxCache==false)||ajaxTimeout){content=false;}if(opts.clickAnywhereToClose){jQuery.bt.vars.clickAnywhereStack.push(this);$(document).click(jQuery.bt.docClick);}if(opts.closeWhenOthersOpen){jQuery.bt.vars.closeWhenOpenStack.push(this);}opts.postShow.apply(this,[$box[0]]);};this.btOff=function(){var box=$(this).data("bt-box");opts.preHide.apply(this,[box]);var i=this;i.btCleanup=function(){var box=$(i).data("bt-box");var contentOrig=$(i).data("bt-content-orig");var overlay=$(i).data("bt-overlay");if(typeof box=="object"){$(box).remove();$(i).removeData("bt-box");}if(typeof contentOrig=="object"){var clones=$(contentOrig.original).data("bt-clones");$(contentOrig).data("bt-clones",arrayRemove(clones,contentOrig.clone));}if(typeof overlay=="object"){$(overlay).remove();$(i).removeData("bt-overlay");}jQuery.bt.vars.clickAnywhereStack=arrayRemove(jQuery.bt.vars.clickAnywhereStack,i);jQuery.bt.vars.closeWhenOpenStack=arrayRemove(jQuery.bt.vars.closeWhenOpenStack,i);$(i).removeClass("bt-active "+opts.activeClass);opts.postHide.apply(i);};opts.hideTip.apply(this,[box,i.btCleanup]);};var refresh=this.btRefresh=function(){this.btOff();this.btOn();};});function drawIt(points,strokeWidth){this.moveTo(points[0].x,points[0].y);for(i=1;i<points.length;i++){if(points[i-1].type=="arcStart"){this.quadraticCurveTo(round5(points[i].x,strokeWidth),round5(points[i].y,strokeWidth),round5(points[(i+1)%points.length].x,strokeWidth),round5(points[(i+1)%points.length].y,strokeWidth));i++;}else{this.lineTo(round5(points[i].x,strokeWidth),round5(points[i].y,strokeWidth));}}}function round5(num,strokeWidth){var ret;strokeWidth=numb(strokeWidth);if(strokeWidth%2){ret=num;}else{ret=Math.round(num-0.5)+0.5;}return ret;}function numb(num){return parseInt(num)||0;}function arrayRemove(arr,elem){var x,newArr=new Array();for(x in arr){if(arr[x]!=elem){newArr.push(arr[x]);}}return newArr;}function canvasSupport(){var canvas_compatible=false;try{canvas_compatible=!!(document.createElement("canvas").getContext("2d"));}catch(e){canvas_compatible=!!(document.createElement("canvas").getContext);}return canvas_compatible;}function shadowSupport(){try{var userAgent=navigator.userAgent.toLowerCase();if(/webkit/.test(userAgent)){return true;}else{if(/gecko|mozilla/.test(userAgent)&&parseFloat(userAgent.match(/firefox\/(\d+(?:\.\d+)+)/)[1])>=3.1){return true;}}}catch(err){}return false;}function betweenPoint(point1,point2,dist){var y,x;if(point1.x==point2.x){y=point1.y<point2.y?point1.y+dist:point1.y-dist;return{x:point1.x,y:y};}else{if(point1.y==point2.y){x=point1.x<point2.x?point1.x+dist:point1.x-dist;return{x:x,y:point1.y};}}}function centerPoint(arcStart,corner,arcEnd){var x=corner.x==arcStart.x?arcEnd.x:arcStart.x;var y=corner.y==arcStart.y?arcEnd.y:arcStart.y;var startAngle,endAngle;if(arcStart.x<arcEnd.x){if(arcStart.y>arcEnd.y){startAngle=(Math.PI/180)*180;endAngle=(Math.PI/180)*90;}else{startAngle=(Math.PI/180)*90;endAngle=0;}}else{if(arcStart.y>arcEnd.y){startAngle=(Math.PI/180)*270;endAngle=(Math.PI/180)*180;}else{startAngle=0;endAngle=(Math.PI/180)*270;}}return{x:x,y:y,type:"center",startAngle:startAngle,endAngle:endAngle};}function findIntersect(r1x1,r1y1,r1x2,r1y2,r2x1,r2y1,r2x2,r2y2){if(r2x1==r2x2){return findIntersectY(r1x1,r1y1,r1x2,r1y2,r2x1);}if(r2y1==r2y2){return findIntersectX(r1x1,r1y1,r1x2,r1y2,r2y1);}var r1m=(r1y1-r1y2)/(r1x1-r1x2);var r1b=r1y1-(r1m*r1x1);var r2m=(r2y1-r2y2)/(r2x1-r2x2);var r2b=r2y1-(r2m*r2x1);var x=(r2b-r1b)/(r1m-r2m);var y=r1m*x+r1b;return{x:x,y:y};}function findIntersectY(r1x1,r1y1,r1x2,r1y2,x){if(r1y1==r1y2){return{x:x,y:r1y1};}var r1m=(r1y1-r1y2)/(r1x1-r1x2);var r1b=r1y1-(r1m*r1x1);var y=r1m*x+r1b;return{x:x,y:y};}function findIntersectX(r1x1,r1y1,r1x2,r1y2,y){if(r1x1==r1x2){return{x:r1x1,y:y};}var r1m=(r1y1-r1y2)/(r1x1-r1x2);var r1b=r1y1-(r1m*r1x1);var x=(y-r1b)/r1m;return{x:x,y:y};}};jQuery.fn.btPosition=function(){function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}var left=0,top=0,results;if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();offset.top-=num(this,"marginTop");offset.left-=num(this,"marginLeft");parentOffset.top+=num(offsetParent,"borderTopWidth");parentOffset.left+=num(offsetParent,"borderLeftWidth");results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};}return results;};jQuery.fn.btOuterWidth=function(margin){function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;}return this["innerWidth"]()+num(this,"borderLeftWidth")+num(this,"borderRightWidth")+(margin?num(this,"marginLeft")+num(this,"marginRight"):0);};jQuery.fn.btOn=function(){return this.each(function(index){if(jQuery.isFunction(this.btOn)){this.btOn();}});};jQuery.fn.btOff=function(){return this.each(function(index){if(jQuery.isFunction(this.btOff)){this.btOff();}});};jQuery.bt.vars={clickAnywhereStack:[],closeWhenOpenStack:[]};jQuery.bt.docClick=function(e){if(!e){var e=window.event;}if(!$(e.target).parents().andSelf().filter(".bt-wrapper, .bt-active").length&&jQuery.bt.vars.clickAnywhereStack.length){$(jQuery.bt.vars.clickAnywhereStack).btOff();$(document).unbind("click",jQuery.bt.docClick);}};jQuery.bt.defaults={trigger:"hover",clickAnywhereToClose:true,closeWhenOthersOpen:false,shrinkToFit:false,width:"200px",padding:"10px",spikeGirth:10,spikeLength:15,overlap:0,overlay:false,killTitle:true,textzIndex:9999,boxzIndex:9998,wrapperzIndex:9997,offsetParent:null,positions:["most"],fill:"rgb(255, 255, 102)",windowMargin:10,strokeWidth:1,strokeStyle:"#000",cornerRadius:5,centerPointX:0.5,centerPointY:0.5,shadow:false,shadowOffsetX:2,shadowOffsetY:2,shadowBlur:3,shadowColor:"#000",shadowOverlap:false,noShadowOpts:{strokeStyle:"#999"},cssClass:"",cssStyles:{},activeClass:"bt-active",contentSelector:"$(this).attr('title')",ajaxPath:null,ajaxError:"<strong>ERROR:</strong> <em>%error</em>",ajaxLoading:"<blink>Loading...</blink>",ajaxData:{},ajaxType:"GET",ajaxCache:true,ajaxOpts:{},preBuild:function(){},preShow:function(box){},showTip:function(box){$(box).show();},postShow:function(box){},preHide:function(box){},hideTip:function(box,callback){$(box).hide();callback();},postHide:function(){},hoverIntentOpts:{interval:300,timeout:500}};jQuery.bt.options={};})(jQuery);
/**
 * jCarouselLite - jQuery plugin to navigate images/any content in a carousel style widget.
 * @requires jQuery v1.2 or above
 *
 * http://gmarwaha.com/jquery/jcarousellite/
 *
 * Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Version: 1.0.1
 * Note: Requires jquery 1.2 or above from version 1.0.1
 */

/**
 * Creates a carousel-style navigation widget for images/any-content from a simple HTML markup.
 *
 * The HTML markup that is used to build the carousel can be as simple as...
 *
 *  <div class="carousel">
 *      <ul>
 *          <li><img src="image/1.jpg" alt="1"></li>
 *          <li><img src="image/2.jpg" alt="2"></li>
 *          <li><img src="image/3.jpg" alt="3"></li>
 *      </ul>
 *  </div>
 *
 * As you can see, this snippet is nothing but a simple div containing an unordered list of images.
 * You don't need any special "class" attribute, or a special "css" file for this plugin.
 * I am using a class attribute just for the sake of explanation here.
 *
 * To navigate the elements of the carousel, you need some kind of navigation buttons.
 * For example, you will need a "previous" button to go backward, and a "next" button to go forward.
 * This need not be part of the carousel "div" itself. It can be any element in your page.
 * Lets assume that the following elements in your document can be used as next, and prev buttons...
 *
 * <button class="prev">&lt;&lt;</button>
 * <button class="next">&gt;&gt;</button>
 *
 * Now, all you need to do is call the carousel component on the div element that represents it, and pass in the
 * navigation buttons as options.
 *
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev"
 * });
 *
 * That's it, you would have now converted your raw div, into a magnificient carousel.
 *
 * There are quite a few other options that you can use to customize it though.
 * Each will be explained with an example below.
 *
 * @param an options object - You can specify all the options shown below as an options object param.
 *
 * @option btnPrev, btnNext : string - no defaults
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev"
 * });
 * @desc Creates a basic carousel. Clicking "btnPrev" navigates backwards and "btnNext" navigates forward.
 *
 * @option btnGo - array - no defaults
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      btnGo: [".0", ".1", ".2"]
 * });
 * @desc If you don't want next and previous buttons for navigation, instead you prefer custom navigation based on
 * the item number within the carousel, you can use this option. Just supply an array of selectors for each element
 * in the carousel. The index of the array represents the index of the element. What i mean is, if the
 * first element in the array is ".0", it means that when the element represented by ".0" is clicked, the carousel
 * will slide to the first element and so on and so forth. This feature is very powerful. For example, i made a tabbed
 * interface out of it by making my navigation elements styled like tabs in css. As the carousel is capable of holding
 * any content, not just images, you can have a very simple tabbed navigation in minutes without using any other plugin.
 * The best part is that, the tab will "slide" based on the provided effect. :-)
 *
 * @option mouseWheel : boolean - default is false
 * @example
 * $(".carousel").jCarouselLite({
 *      mouseWheel: true
 * });
 * @desc The carousel can also be navigated using the mouse wheel interface of a scroll mouse instead of using buttons.
 * To get this feature working, you have to do 2 things. First, you have to include the mouse-wheel plugin from brandon.
 * Second, you will have to set the option "mouseWheel" to true. That's it, now you will be able to navigate your carousel
 * using the mouse wheel. Using buttons and mouseWheel or not mutually exclusive. You can still have buttons for navigation
 * as well. They complement each other. To use both together, just supply the options required for both as shown below.
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      mouseWheel: true
 * });
 *
 * @option auto : number - default is null, meaning autoscroll is disabled by default
 * @example
 * $(".carousel").jCarouselLite({
 *      auto: 800,
 *      speed: 500
 * });
 * @desc You can make your carousel auto-navigate itself by specfying a millisecond value in this option.
 * The value you specify is the amount of time between 2 slides. The default is null, and that disables auto scrolling.
 * Specify this value and magically your carousel will start auto scrolling.
 *
 * @option speed : number - 200 is default
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      speed: 800
 * });
 * @desc Specifying a speed will slow-down or speed-up the sliding speed of your carousel. Try it out with
 * different speeds like 800, 600, 1500 etc. Providing 0, will remove the slide effect.
 *
 * @option easing : string - no easing effects by default.
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      easing: "bounceout"
 * });
 * @desc You can specify any easing effect. Note: You need easing plugin for that. Once specified,
 * the carousel will slide based on the provided easing effect.
 *
 * @option vertical : boolean - default is false
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      vertical: true
 * });
 * @desc Determines the direction of the carousel. true, means the carousel will display vertically. The next and
 * prev buttons will slide the items vertically as well. The default is false, which means that the carousel will
 * display horizontally. The next and prev items will slide the items from left-right in this case.
 *
 * @option circular : boolean - default is true
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      circular: false
 * });
 * @desc Setting it to true enables circular navigation. This means, if you click "next" after you reach the last
 * element, you will automatically slide to the first element and vice versa. If you set circular to false, then
 * if you click on the "next" button after you reach the last element, you will stay in the last element itself
 * and similarly for "previous" button and first element.
 *
 * @option visible : number - default is 3
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      visible: 4
 * });
 * @desc This specifies the number of items visible at all times within the carousel. The default is 3.
 * You are even free to experiment with real numbers. Eg: "3.5" will have 3 items fully visible and the
 * last item half visible. This gives you the effect of showing the user that there are more images to the right.
 *
 * @option start : number - default is 0
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      start: 2
 * });
 * @desc You can specify from which item the carousel should start. Remember, the first item in the carousel
 * has a start of 0, and so on.
 *
 * @option scrool : number - default is 1
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      scroll: 2
 * });
 * @desc The number of items that should scroll/slide when you click the next/prev navigation buttons. By
 * default, only one item is scrolled, but you may set it to any number. Eg: setting it to "2" will scroll
 * 2 items when you click the next or previous buttons.
 *
 * @option beforeStart, afterEnd : function - callbacks
 * @example
 * $(".carousel").jCarouselLite({
 *      btnNext: ".next",
 *      btnPrev: ".prev",
 *      beforeStart: function(a) {
 *          alert("Before animation starts:" + a);
 *      },
 *      afterEnd: function(a) {
 *          alert("After animation ends:" + a);
 *      }
 * });
 * @desc If you wanted to do some logic in your page before the slide starts and after the slide ends, you can
 * register these 2 callbacks. The functions will be passed an argument that represents an array of elements that
 * are visible at the time of callback.
 *
 *
 * @cat Plugins/Image Gallery
 * @author Ganeshji Marwaha/ganeshread@gmail.com
 */

(function($) {                                          // Compliant with jquery.noConflict()
$.fn.jCarouselLite = function(o) {
    o = $.extend({
        btnPrev: null,
        btnNext: null,
        btnGo: null,
        mouseWheel: false,
        auto: null,
        hoverPause: false,

        speed: 200,
        easing: null,

        vertical: false,
        circular: true,
        visible: 3,
        start: 0,
        scroll: 1,

        beforeStart: null,
        afterEnd: null
    }, o || {});

    return this.each(function() {                           // Returns the element collection. Chainable.

        var running = false, animCss=o.vertical?"top":"left", sizeCss=o.vertical?"height":"width";
        var div = $(this), ul = $("ul", div), tLi = $("li", ul), tl = tLi.size(), v = o.visible;

        if(o.circular) {
            ul.prepend(tLi.slice(tl-v+1).clone())
              .append(tLi.slice(0,o.scroll).clone());
            o.start += v-1;
        }

        var li = $("li", ul), itemLength = li.size(), curr = o.start;
        div.css("visibility", "visible");

        li.css({overflow: "hidden", float: o.vertical ? "none" : "left"});
        ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"});
        div.css({overflow: "hidden", position: "relative", "z-index": "2", left: "0px"});

        var liSize = o.vertical ? height(li) : width(li);   // Full li size(incl margin)-Used for animation
        var ulSize = liSize * itemLength;                   // size of full ul(total length, not just for the visible items)
        var divSize = liSize * v;                           // size of entire div(total length for just the visible items)

        li.css({width: li.width(), height: li.height()});
        ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize));

        div.css(sizeCss, divSize+"px");                     // Width of the DIV. length of visible images

        if(o.btnPrev) {
            $(o.btnPrev).click(function() {
                return go(curr-o.scroll);
            });
            if(o.hoverPause) {
                $(o.btnPrev).hover(function(){stopAuto();}, function(){startAuto();});
            }
        }


        if(o.btnNext) {
            $(o.btnNext).click(function() {
                return go(curr+o.scroll);
            });
            if(o.hoverPause) {
                $(o.btnNext).hover(function(){stopAuto();}, function(){startAuto();});
            }
        }

        if(o.btnGo)
            $.each(o.btnGo, function(i, val) {
                $(val).click(function() {
                    return go(o.circular ? o.visible+i : i);
                });
            });

        if(o.mouseWheel && div.mousewheel)
            div.mousewheel(function(e, d) {
                return d>0 ? go(curr-o.scroll) : go(curr+o.scroll);
            });

        var autoInterval;

        function startAuto() {
          stopAuto();
          autoInterval = setInterval(function() {
                  go(curr+o.scroll);
              }, o.auto+o.speed);
        };

        function stopAuto() {
            clearInterval(autoInterval);
        };

        if(o.auto) {
            if(o.hoverPause) {
                div.hover(function(){stopAuto();}, function(){startAuto();});
            }
            startAuto();
        };

        function vis() {
            return li.slice(curr).slice(0,v);
        };

        function go(to) {
            if(!running) {

                if(o.beforeStart)
                    o.beforeStart.call(this, vis());

                if(o.circular) {            // If circular we are in first or last, then goto the other end
                    if(to<0) {           // If before range, then go around
                        ul.css(animCss, -( (curr + tl) * liSize)+"px");
                        curr = to + tl;
                    } else if(to>itemLength-v) { // If beyond range, then come around
                        ul.css(animCss, -( (curr - tl) * liSize ) + "px" );
                        curr = to - tl;
                    } else curr = to;
                } else {                    // If non-circular and to points to first or last, we just return.
                    if(to<0 || to>itemLength-v) return;
                    else curr = to;
                }                           // If neither overrides it, the curr will still be "to" and we can proceed.

                running = true;

                ul.animate(
                    animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing,
                    function() {
                        if(o.afterEnd)
                            o.afterEnd.call(this, vis());
                        running = false;
                    }
                );
                // Disable buttons when the carousel reaches the last/first, and enable when not
                if(!o.circular) {
                    $(o.btnPrev + "," + o.btnNext).removeClass("disabled");
                    $( (curr-o.scroll<0 && o.btnPrev)
                        ||
                       (curr+o.scroll > itemLength-v && o.btnNext)
                        ||
                       []
                     ).addClass("disabled");
                }

            }
            return false;
        };
    });
};

function css(el, prop) {
    return parseInt($.css(el[0], prop)) || 0;
};
function width(el) {
    return  el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
};
function height(el) {
    return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
};

})(jQuery);
/*
 * Copyright 2007-2009 by Tobia Conforto <tobia.conforto@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General
 * Public License as published by the Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License along with this program; if not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * Versions: 0.1    2007-08-19  Initial release
 *                  2008-08-21  Re-released under GPL v2
 *           0.1.1  2008-09-18  Compatibility with prototype.js
 *           0.2    2008-10-15  Linkable images, contributed by Tim Rainey <tim@zmlabs.com>
 *           0.3    2008-10-22  Added option to repeat the animation a number of times, then stop
 *           0.3.1  2008-11-11  Better error messages
 *           0.3.2  2008-11-11  Fixed a couple of CSS bugs, contributed by Erwin Bot <info@ixgcms.nl>
 *           0.3.3  2008-12-14  Added onclick option
 *           0.3.4  2009-03-12  Added shuffle option, contributed by Ralf Santbergen <ralf_santbergen@hotmail.com>
 *           0.3.5  2009-03-12  Fixed usage of href parameter in 'Ken Burns' mode
 *           0.3.6  2009-04-16  Added alt option
 *           0.3.7  2009-05-14  Fixed bug when container div doesn't have a position CSS attribute
 */

jQuery.fn.crossSlide = function(opts, plan) {
	var self = this,
			self_width = this.width(),
			self_height = this.height();

	// generic utilities
	function format(str) {
		for (var i = 1; i < arguments.length; i++)
			str = str.replace(new RegExp('\\{' + (i-1) + '}', 'g'), arguments[i]);
		return str;
	}

	function abort() {
		arguments[0] = 'crossSlide: ' + arguments[0];
		throw format.apply(null, arguments);
	}

	// first preload all the images, while getting their actual width and height
	(function(proceed) {

		var n_loaded = 0;
		function loop(i, img) {
			// for (i = 0; i < plan.length; i++) but with independent var i, img (for the closures)
			img.onload = function(e) {
				n_loaded++;
				plan[i].width = img.width;
				plan[i].height = img.height;
				if (n_loaded == plan.length)
					proceed();
			}
			img.src = plan[i].src;
			if (i + 1 < plan.length)
				loop(i + 1, new Image());
		}
		loop(0, new Image());

	})(function() {  // then proceed

		// utility to parse "from" and "to" parameters
		function parse_position_param(param) {
			var zoom = 1;
			var tokens = param.replace(/^\s*|\s*$/g, '').split(/\s+/);
			if (tokens.length > 3) throw new Error();
			if (tokens[0] == 'center')
				if (tokens.length == 1)
					tokens = ['center', 'center'];
				else if (tokens.length == 2 && tokens[1].match(/^[\d.]+x$/i))
					tokens = ['center', 'center', tokens[1]];
			if (tokens.length == 3)
				zoom = parseFloat(tokens[2].match(/^([\d.]+)x$/i)[1]);
			var pos = tokens[0] + ' ' + tokens[1];
			if (pos == 'left top'      || pos == 'top left')      return { xrel:  0, yrel:  0, zoom: zoom };
			if (pos == 'left center'   || pos == 'center left')   return { xrel:  0, yrel: .5, zoom: zoom };
			if (pos == 'left bottom'   || pos == 'bottom left')   return { xrel:  0, yrel:  1, zoom: zoom };
			if (pos == 'center top'    || pos == 'top center')    return { xrel: .5, yrel:  0, zoom: zoom };
			if (pos == 'center center')                           return { xrel: .5, yrel: .5, zoom: zoom };
			if (pos == 'center bottom' || pos == 'bottom center') return { xrel: .5, yrel:  1, zoom: zoom };
			if (pos == 'right top'     || pos == 'top right')     return { xrel:  1, yrel:  0, zoom: zoom };
			if (pos == 'right center'  || pos == 'center right')  return { xrel:  1, yrel: .5, zoom: zoom };
			if (pos == 'right bottom'  || pos == 'bottom right')  return { xrel:  1, yrel:  1, zoom: zoom };
			return {
				xrel: parseInt(tokens[0].match(/^(\d+)%$/)[1]) / 100,
				yrel: parseInt(tokens[1].match(/^(\d+)%$/)[1]) / 100,
				zoom: zoom
			};
		}

		// utility to compute the css for a given phase between p.from and p.to
		// phase = 1: begin fade-in,  2: end fade-in,  3: begin fade-out,  4: end fade-out
		function position_to_css(p, phase) {
			switch (phase) {
				case 1:
					var pos = 0;
					break;
				case 2:
					var pos = fade_ms / (p.time_ms + 2 * fade_ms);
					break;
				case 3:
					var pos = 1 - fade_ms / (p.time_ms + 2 * fade_ms);
					break;
				case 4:
					var pos = 1;
					break;
			}
			return {
				left:   Math.round(p.from.left   + pos * (p.to.left   - p.from.left  )),
				top:    Math.round(p.from.top    + pos * (p.to.top    - p.from.top   )),
				width:  Math.round(p.from.width  + pos * (p.to.width  - p.from.width )),
				height: Math.round(p.from.height + pos * (p.to.height - p.from.height))
			};
		}

		// check global params
		if (! opts.fade)
			abort('missing fade parameter.');
		if (opts.speed && opts.sleep)
			abort('you cannot set both speed and sleep at the same time.');
		// conversion from sec to ms; from px/sec to px/ms
		var fade_ms = Math.round(opts.fade * 1000);
		if (opts.sleep)
			var sleep = Math.round(opts.sleep * 1000);
		if (opts.speed)
			var speed = opts.speed / 1000,
					fade_px = Math.round(fade_ms * speed);

		// set container css
		self.empty().css({
			overflow: 'hidden',
			padding: 0
		});
		if (! /^(absolute|relative|fixed)$/.test(self.css('position')))
			self.css({ position: 'relative' });
		if (! self.width() || ! self.height())
			abort('container element does not have its own width and height');

		// random sorting
		if (opts.shuffle)
			plan.sort(function() {
				return Math.random() - 0.5;
			});

		// prepare each image
		for (var i = 0; i < plan.length; ++i) {

			var p = plan[i];
			if (! p.src)
				abort('missing src parameter in picture {0}.', i + 1);

			if (speed) { // speed/dir mode

				// check parameters and translate speed/dir mode into full mode (from/to/time)
				switch (p.dir) {
					case 'up':
						p.from = { xrel: .5, yrel: 0, zoom: 1 };
						p.to   = { xrel: .5, yrel: 1, zoom: 1 };
						var slide_px = p.height - self_height - 2 * fade_px;
						break;
					case 'down':
						p.from = { xrel: .5, yrel: 1, zoom: 1 };
						p.to   = { xrel: .5, yrel: 0, zoom: 1 };
						var slide_px = p.height - self_height - 2 * fade_px;
						break;
					case 'left':
						p.from = { xrel: 0, yrel: .5, zoom: 1 };
						p.to   = { xrel: 1, yrel: .5, zoom: 1 };
						var slide_px = p.width - self_width - 2 * fade_px;
						break;
					case 'right':
						p.from = { xrel: 1, yrel: .5, zoom: 1 };
						p.to   = { xrel: 0, yrel: .5, zoom: 1 };
						var slide_px = p.width - self_width - 2 * fade_px;
						break;
					default:
						abort('missing or malformed "dir" parameter in picture {0}.', i + 1);
				}
				if (slide_px <= 0)
					abort('picture number {0} is too short for the desired fade duration.', i + 1);
				p.time_ms = Math.round(slide_px / speed);

			} else if (! sleep) { // full mode

				// check and parse parameters
				if (! p.from || ! p.to || ! p.time)
					abort('missing either speed/sleep option, or from/to/time params in picture {0}.', i + 1);
				try {
					p.from = parse_position_param(p.from)
				} catch (e) {
					abort('malformed "from" parameter in picture {0}.', i + 1);
				}
				try {
					p.to = parse_position_param(p.to)
				} catch (e) {
					abort('malformed "to" parameter in picture {0}.', i + 1);
				}
				if (! p.time)
					abort('missing "time" parameter in picture {0}.', i + 1);
				p.time_ms = Math.round(p.time * 1000)
			}

			// precalculate left/top/width/height bounding values
			if (p.from)
				jQuery.each([ p.from, p.to ], function(i, from_to) {
					from_to.width  = Math.round(p.width  * from_to.zoom);
					from_to.height = Math.round(p.height * from_to.zoom);
					from_to.left   = Math.round((self_width  - from_to.width)  * from_to.xrel);
					from_to.top    = Math.round((self_height - from_to.height) * from_to.yrel);
				});

			// append the image (or anchor) element to the container
			var elm;
			if (p.href)
				elm = jQuery(format('<a href="{0}"><img src="{1}"/></a>', p.href, p.src));
			else
				elm = jQuery(format('<img src="{0}"/>', p.src));
			if (p.onclick)
				elm.click(p.onclick);
			if (p.alt)
				elm.find('img').attr('alt', p.alt);
			elm.appendTo(self);
		}
		speed = undefined;  // speed mode has now been translated to full mode

		// find images to animate and set initial css attributes
		var imgs = self.find('img').css({
			position: 'absolute',
			visibility: 'hidden',
			top: 0,
			left: 0,
			border: 0
		});

		// show first image
		imgs.eq(0).css({ visibility: 'visible' });
		if (! sleep)
			imgs.eq(0).css(position_to_css(plan[0], 2));

		// create animation chain
		var countdown = opts.loop;
		function create_chain(i, chainf) {
			// building the chain backwards, or inside out

			if (i % 2 == 0) {
				if (sleep) {

					// still image sleep

					var i_sleep = i / 2,
							i_hide = (i_sleep - 1 + plan.length) % plan.length,
							img_sleep = imgs.eq(i_sleep),
							img_hide = imgs.eq(i_hide);

					var newf = function() {
						img_hide.css('visibility', 'hidden');
						setTimeout(chainf, sleep);
					};

				} else {

					// single image slide

					var i_slide = i / 2,
							i_hide = (i_slide - 1 + plan.length) % plan.length,
							img_slide = imgs.eq(i_slide),
							img_hide = imgs.eq(i_hide),
							time = plan[i_slide].time_ms,
							slide_anim = position_to_css(plan[i_slide], 3);

					var newf = function() {
						img_hide.css('visibility', 'hidden');
						img_slide.animate(slide_anim, time, 'linear', chainf);
					};

				}
			} else {
				if (sleep) {

					// still image cross-fade

					var i_from = Math.floor(i / 2),
							i_to = Math.ceil(i / 2) % plan.length,
							img_from = imgs.eq(i_from),
							img_to = imgs.eq(i_to),
							from_anim = {},
							to_init = { visibility: 'visible' },
							to_anim = {};

					if (i_to > i_from) {
						to_init.opacity = 0;
						to_anim.opacity = 1;
					} else {
						from_anim.opacity = 0;
					}

					var newf = function() {
						img_to.css(to_init);
						if (from_anim.opacity != undefined)
							img_from.animate(from_anim, fade_ms, 'linear', chainf);
						else
							img_to.animate(to_anim, fade_ms, 'linear', chainf);
					};

				} else {

					// cross-slide + cross-fade

					var i_from = Math.floor(i / 2),
							i_to = Math.ceil(i / 2) % plan.length,
							img_from = imgs.eq(i_from),
							img_to = imgs.eq(i_to),
							from_anim = position_to_css(plan[i_from], 4),
							to_init = position_to_css(plan[i_to], 1),
							to_anim = position_to_css(plan[i_to], 2);

					if (i_to > i_from) {
						to_init.opacity = 0;
						to_anim.opacity = 1;
					} else {
						from_anim.opacity = 0;
					}
					to_init.visibility = 'visible';

					var newf = function() {
						img_from.animate(from_anim, fade_ms, 'linear');
						img_to.css(to_init);
						img_to.animate(to_anim, fade_ms, 'linear', chainf);
					};

				}
			}

			// if the loop option was requested, push a countdown check
			if (opts.loop && i == plan.length * 2 - 2) {
				var newf_orig = newf;
				newf = function() {
					if (--countdown) newf_orig();
				}
			}

			if (i > 0)
				return create_chain(i - 1, newf);
			else
				return newf;
		}
		var animation = create_chain(plan.length * 2 - 1, function() { return animation(); });

		// start animation
		animation();

	});

	return self;
};

/*
 * FancyBox - jQuery Plugin
 * simple and fancy lightbox alternative
 *
 * Copyright (c) 2009 Janis Skarnelis
 * Examples and documentation at: http://fancybox.net
 * 
 * Version: 1.2.5 (03/11/2009)
 * Requires: jQuery v1.3+
 * 
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

;(function($) {
    $.fn.fixPNG = function() {
        return this.each(function() {
            var image = $(this).css('backgroundImage');

            if (image.match(/^url\(["']?(.*\.png)["']?\)$/i)) {
                image = RegExp.$1;
                $(this).css({
                    'backgroundImage': 'none',
                    'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=" + ($(this).css('backgroundRepeat') == 'no-repeat' ? 'crop' : 'scale') + ", src='" + image + "')"
                }).each(function() {
                    var position = $(this).css('position');
                    if (position != 'absolute' && position != 'relative')
                        $(this).css('position', 'relative');
                });
            }
        });
    };

    var elem, opts, busy = false, imagePreloader = new Image, loadingTimer, loadingFrame = 1, imageRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i;
    var ieQuirks = null, IE6 = $.browser.msie && $.browser.version.substr(0, 1) == 6 && !window.XMLHttpRequest, oldIE = IE6 || ($.browser.msie && $.browser.version.substr(0, 1) == 7);

    $.fn.fancybox = function(o) {
        var settings = $.extend({}, $.fn.fancybox.defaults, o);
        var matchedGroup = this;

        function _initialize() {
            elem = this;
            opts = $.extend({}, settings);

            _start();

            return false;
        };

        function _start() {
            if (busy) return;

            if ($.isFunction(opts.callbackOnStart)) {
                opts.callbackOnStart();
            }

            opts.itemArray = [];
            opts.itemCurrent = 0;

            if (settings.itemArray.length > 0) {
                opts.itemArray = settings.itemArray;

            } else {
                var item = {};

                if (!elem.rel || elem.rel == '') {
                    var item = { href: elem.href, title: elem.title };

                    if ($(elem).children("img:first").length) {
                        item.orig = $(elem).children("img:first");
                    } else {
                        item.orig = $(elem);
                    }

                    if (item.title == '' || typeof item.title == 'undefined') {
                        item.title = item.orig.attr('alt');
                    }

                    opts.itemArray.push(item);

                } else {
                    var subGroup = $(matchedGroup).filter("a[rel=" + elem.rel + "]");
                    var item = {};

                    for (var i = 0; i < subGroup.length; i++) {
                        item = { href: subGroup[i].href, title: subGroup[i].title };

                        if ($(subGroup[i]).children("img:first").length) {
                            item.orig = $(subGroup[i]).children("img:first");
                        } else {
                            item.orig = $(subGroup[i]);
                        }

                        if (item.title == '' || typeof item.title == 'undefined') {
                            item.title = item.orig.attr('alt');
                        }

                        opts.itemArray.push(item);
                    }
                }
            }

            // modified - start
            //while (opts.itemArray[opts.itemCurrent] != elem.href) {
            //    opts.itemCurrent++;
            //}
            var host = window.document.location.protocol + '//' + window.document.location.hostname;

            while (opts.itemCurrent < opts.itemArray.length - 1 && opts.itemArray[opts.itemCurrent].href.toLowerCase().replace(host.toLowerCase(), '') != elem.href.toLowerCase().replace(host.toLowerCase(), '')) {
                opts.itemCurrent++;
            }
            // modified - end

            if (opts.overlayShow) {
                if (IE6) {
                    $('embed, object, select').css('visibility', 'hidden');
                    $("#fancy_overlay").css('height', $(document).height());
                }

                $("#fancy_overlay").css({
                    'background-color': opts.overlayColor,
                    'opacity': opts.overlayOpacity
                }).show();
            }

            $(window).bind("resize.fb scroll.fb", $.fn.fancybox.scrollBox);

            _change_item();
        };

        function _change_item() {
            $("#fancy_right, #fancy_left, #fancy_close, #fancy_title").hide();

            var href = opts.itemArray[opts.itemCurrent].href;

            if (href.match("iframe") || elem.className.indexOf("iframe") >= 0) {
                $.fn.fancybox.showLoading();
                _set_content('<iframe id="fancy_frame" onload="jQuery.fn.fancybox.showIframe()" name="fancy_iframe' + Math.round(Math.random() * 1000) + '" frameborder="0" hspace="0" src="' + href + '"></iframe>', opts.frameWidth, opts.frameHeight);

            } else if (href.match(/#/)) {
                var target = window.location.href.split('#')[0]; target = href.replace(target, ''); target = target.substr(target.indexOf('#'));

                _set_content('<div id="fancy_div">' + $(target).html() + '</div>', opts.frameWidth, opts.frameHeight);

            } else if (href.match(imageRegExp)) {
                imagePreloader = new Image; imagePreloader.src = href;

                if (imagePreloader.complete) {
                    _proceed_image();

                } else {
                    $.fn.fancybox.showLoading();
                    $(imagePreloader).unbind().bind('load', function() {
                        $("#fancy_loading").hide();

                        _proceed_image();
                    });
                }
            } else {
                $.fn.fancybox.showLoading();
                $.get(href, function(data) {
                    $("#fancy_loading").hide();
                    _set_content('<div id="fancy_ajax">' + data + '</div>', opts.frameWidth, opts.frameHeight);
                });
            }
        };

        function _proceed_image() {
            var width = imagePreloader.width;
            var height = imagePreloader.height;

            var horizontal_space = (opts.padding * 2) + 40;
            var vertical_space = (opts.padding * 2) + 60;

            var w = $.fn.fancybox.getViewport();

            if (opts.imageScale && (width > (w[0] - horizontal_space) || height > (w[1] - vertical_space))) {
                var ratio = Math.min(Math.min(w[0] - horizontal_space, width) / width, Math.min(w[1] - vertical_space, height) / height);

                width = Math.round(ratio * width);
                height = Math.round(ratio * height);
            }

            _set_content('<img alt="" id="fancy_img" src="' + imagePreloader.src + '" />', width, height);
        };

        function _preload_neighbor_images() {
            if ((opts.itemArray.length - 1) > opts.itemCurrent) {
                var href = opts.itemArray[opts.itemCurrent + 1].href;

                if (href.match(imageRegExp)) {
                    objNext = new Image();
                    objNext.src = href;
                }
            }

            if (opts.itemCurrent > 0) {
                var href = opts.itemArray[opts.itemCurrent - 1].href;

                if (href.match(imageRegExp)) {
                    objNext = new Image();
                    objNext.src = href;
                }
            }
        };

        function _set_content(value, width, height) {
            busy = true;

            var pad = opts.padding;

            if (oldIE || ieQuirks) {
                $("#fancy_content")[0].style.removeExpression("height");
                $("#fancy_content")[0].style.removeExpression("width");
            }

            if (pad > 0) {
                width += pad * 2;
                height += pad * 2;

                $("#fancy_content").css({
                    'top': pad + 'px',
                    'right': pad + 'px',
                    'bottom': pad + 'px',
                    'left': pad + 'px',
                    'width': 'auto',
                    'height': 'auto'
                });

                if (oldIE || ieQuirks) {
                    $("#fancy_content")[0].style.setExpression('height', '(this.parentNode.clientHeight - ' + pad * 2 + ')');
                    $("#fancy_content")[0].style.setExpression('width', '(this.parentNode.clientWidth - ' + pad * 2 + ')');
                }
            } else {
                $("#fancy_content").css({
                    'top': 0,
                    'right': 0,
                    'bottom': 0,
                    'left': 0,
                    'width': '100%',
                    'height': '100%'
                });
            }

            if ($("#fancy_outer").is(":visible") && width == $("#fancy_outer").width() && height == $("#fancy_outer").height()) {
                $("#fancy_content").fadeOut('fast', function() {
                    $("#fancy_content").empty().append($(value)).fadeIn("normal", function() {
                        _finish();
                    });
                });

                return;
            }

            var w = $.fn.fancybox.getViewport();

            var itemTop = (height + 60) > w[1] ? w[3] : (w[3] + Math.round((w[1] - height - 60) * 0.5));
            var itemLeft = (width + 40) > w[0] ? w[2] : (w[2] + Math.round((w[0] - width - 40) * 0.5));

            var itemOpts = {
                'left': itemLeft,
                'top': itemTop,
                'width': width + 'px',
                'height': height + 'px'
            };

            if ($("#fancy_outer").is(":visible")) {
                $("#fancy_content").fadeOut("normal", function() {
                    $("#fancy_content").empty();
                    $("#fancy_outer").animate(itemOpts, opts.zoomSpeedChange, opts.easingChange, function() {
                        $("#fancy_content").append($(value)).fadeIn("normal", function() {
                            _finish();
                        });
                    });
                });

            } else {

                if (opts.zoomSpeedIn > 0 && opts.itemArray[opts.itemCurrent].orig !== undefined) {
                    $("#fancy_content").empty().append($(value));

                    var orig_item = opts.itemArray[opts.itemCurrent].orig;
                    var orig_pos = $.fn.fancybox.getPosition(orig_item);

                    $("#fancy_outer").css({
                        'left': (orig_pos.left - 20 - opts.padding) + 'px',
                        'top': (orig_pos.top - 20 - opts.padding) + 'px',
                        'width': $(orig_item).width() + (opts.padding * 2),
                        'height': $(orig_item).height() + (opts.padding * 2)
                    });

                    if (opts.zoomOpacity) {
                        itemOpts.opacity = 'show';
                    }

                    $("#fancy_outer").animate(itemOpts, opts.zoomSpeedIn, opts.easingIn, function() {
                        _finish();
                    });

                } else {

                    $("#fancy_content").hide().empty().append($(value)).show();
                    $("#fancy_outer").css(itemOpts).fadeIn("normal", function() {
                        _finish();
                    });
                }
            }
        };

        function _set_navigation() {
            if (opts.itemCurrent != 0) {
                $("#fancy_left, #fancy_left_ico").unbind().bind("click", function(e) {
                    e.stopPropagation();

                    opts.itemCurrent--;
                    _change_item();

                    return false;
                });

                $("#fancy_left").show();
            }

            if (opts.itemCurrent != (opts.itemArray.length - 1)) {
                $("#fancy_right, #fancy_right_ico").unbind().bind("click", function(e) {
                    e.stopPropagation();

                    opts.itemCurrent++;
                    _change_item();

                    return false;
                });

                $("#fancy_right").show();
            }
        };

        function _finish() {
            if ($.browser.msie) {
                $("#fancy_content")[0].style.removeAttribute('filter');
                $("#fancy_outer")[0].style.removeAttribute('filter');
            }

            _set_navigation();

            _preload_neighbor_images();

            $(document).bind("keydown.fb", function(e) {
                if (e.keyCode == 27 && opts.enableEscapeButton) {
                    $.fn.fancybox.close();

                } else if (e.keyCode == 37 && opts.itemCurrent != 0) {
                    $(document).unbind("keydown.fb");
                    opts.itemCurrent--;
                    _change_item();


                } else if (e.keyCode == 39 && opts.itemCurrent != (opts.itemArray.length - 1)) {
                    $(document).unbind("keydown.fb");
                    opts.itemCurrent++;
                    _change_item();
                }
            });

            if (opts.centerOnScroll) {
                $(window).bind("resize.fb scroll.fb", $.fn.fancybox.scrollBox);
            }

            if (opts.hideOnContentClick) {
                $("#fancy_content").click($.fn.fancybox.close);
            }

            if (opts.overlayShow && opts.hideOnOverlayClick) {
                $("#fancy_overlay").bind("click", $.fn.fancybox.close);
            }

            if (opts.showCloseButton) {
                $("#fancy_close").bind("click", $.fn.fancybox.close).show();
            }

            if (typeof opts.itemArray[opts.itemCurrent].title !== 'undefined' && opts.itemArray[opts.itemCurrent].title.length > 0) {
                var pos = $("#fancy_outer").position();

                $('#fancy_title div').text(opts.itemArray[opts.itemCurrent].title).html();

                // modified - start
                // $('#fancy_title').css({
                //      'top': pos.top + $("#fancy_outer").outerHeight() - 32,
                //      'left': pos.left + (($("#fancy_outer").outerWidth() * 0.5) - ($('#fancy_title').width() * 0.5))
                // }).show();
                $('#fancy_title').css({
                    'top': pos.top + 6,
                    'left': pos.left
                }).show();

                $('#fancy_title').css({
                    'width': $('#fancy_title table').width()
                });
                // modified - end
            }

            if (opts.overlayShow && IE6) {
                $('embed, object, select', $('#fancy_content')).css('visibility', 'visible');
            }

            if ($.isFunction(opts.callbackOnShow)) {
                opts.callbackOnShow(opts.itemArray[opts.itemCurrent]);
            }

            if ($.browser.msie) {
                $("#fancy_outer")[0].style.removeAttribute('filter');
                $("#fancy_content")[0].style.removeAttribute('filter');
            }

            busy = false;
        };

        return this.unbind('click.fb').bind('click.fb', _initialize);
    };

    $.fn.fancybox.scrollBox = function() {
        var w = $.fn.fancybox.getViewport();

        if ($("#fancy_outer").is(':visible')) {
            var ow = $("#fancy_outer").outerWidth();
            var oh = $("#fancy_outer").outerHeight();

            var pos = {
                'top': (oh > w[1] ? w[3] : w[3] + Math.round((w[1] - oh) * 0.5)),
                'left': (ow > w[0] ? w[2] : w[2] + Math.round((w[0] - ow) * 0.5))
            };

            $("#fancy_outer").css(pos);

            // modified - start
            // $('#fancy_title').css({
            //      'top': pos.top + oh - 32,
            //      'left': pos.left + ((ow * 0.5) - ($('#fancy_title').width() * 0.5))
            // });
            
            $('#fancy_title').css({
                'top': pos.top + 6,
                'left': pos.left
            }).show();
            // modified - end
        }

        if (IE6 && $("#fancy_overlay").is(':visible')) {
            $("#fancy_overlay").css({
                'height': $(document).height()
            });
        }

        if ($("#fancy_loading").is(':visible')) {
            $("#fancy_loading").css({ 'left': ((w[0] - 40) * 0.5 + w[2]), 'top': ((w[1] - 40) * 0.5 + w[3]) });
        }
    };

    $.fn.fancybox.getNumeric = function(el, prop) {
        return parseInt($.curCSS(el.jquery ? el[0] : el, prop, true)) || 0;
    };

    $.fn.fancybox.getPosition = function(el) {
        var pos = el.offset();

        pos.top += $.fn.fancybox.getNumeric(el, 'paddingTop');
        pos.top += $.fn.fancybox.getNumeric(el, 'borderTopWidth');

        pos.left += $.fn.fancybox.getNumeric(el, 'paddingLeft');
        pos.left += $.fn.fancybox.getNumeric(el, 'borderLeftWidth');

        return pos;
    };

    $.fn.fancybox.showIframe = function() {
        $("#fancy_loading").hide();
        $("#fancy_frame").show();
    };

    $.fn.fancybox.getViewport = function() {
        return [$(window).width(), $(window).height(), $(document).scrollLeft(), $(document).scrollTop()];
    };

    $.fn.fancybox.animateLoading = function() {
        if (!$("#fancy_loading").is(':visible')) {
            clearInterval(loadingTimer);
            return;
        }

        $("#fancy_loading > div").css('top', (loadingFrame * -40) + 'px');

        loadingFrame = (loadingFrame + 1) % 12;
    };

    $.fn.fancybox.showLoading = function() {
        clearInterval(loadingTimer);

        var w = $.fn.fancybox.getViewport();

        $("#fancy_loading").css({ 'left': ((w[0] - 40) * 0.5 + w[2]), 'top': ((w[1] - 40) * 0.5 + w[3]) }).show();
        $("#fancy_loading").bind('click', $.fn.fancybox.close);

        loadingTimer = setInterval($.fn.fancybox.animateLoading, 66);
    };

    $.fn.fancybox.close = function() {
        busy = true;

        $(imagePreloader).unbind();

        $(document).unbind("keydown.fb");
        $(window).unbind("resize.fb scroll.fb");

        $("#fancy_overlay, #fancy_content, #fancy_close").unbind();

        $("#fancy_close, #fancy_loading, #fancy_left, #fancy_right, #fancy_title").hide();

        __cleanup = function() {
            if ($("#fancy_overlay").is(':visible')) {
                $("#fancy_overlay").fadeOut("fast");
            }

            $("#fancy_content").empty();

            if (opts.centerOnScroll) {
                $(window).unbind("resize.fb scroll.fb");
            }

            if (IE6) {
                $('embed, object, select').css('visibility', 'visible');
            }

            if ($.isFunction(opts.callbackOnClose)) {
                opts.callbackOnClose();
            }

            busy = false;
        };

        if ($("#fancy_outer").is(":visible") !== false) {
            if (opts.zoomSpeedOut > 0 && opts.itemArray[opts.itemCurrent].orig !== undefined) {
                var orig_item = opts.itemArray[opts.itemCurrent].orig;
                var orig_pos = $.fn.fancybox.getPosition(orig_item);

                var itemOpts = {
                    'left': (orig_pos.left - 20 - opts.padding) + 'px',
                    'top': (orig_pos.top - 20 - opts.padding) + 'px',
                    'width': $(orig_item).width() + (opts.padding * 2),
                    'height': $(orig_item).height() + (opts.padding * 2)
                };

                if (opts.zoomOpacity) {
                    itemOpts.opacity = 'hide';
                }

                $("#fancy_outer").stop(false, true).animate(itemOpts, opts.zoomSpeedOut, opts.easingOut, __cleanup);

            } else {
                $("#fancy_outer").stop(false, true).fadeOut('fast', __cleanup);
            }

        } else {
            __cleanup();
        }

        return false;
    };

    $.fn.fancybox.build = function() {
        var html = '';

        html += '<div id="fancy_overlay"></div>';
        html += '<div id="fancy_loading"><div></div></div>';

        html += '<div id="fancy_outer">';
        html += '<div id="fancy_inner">';

        html += '<div id="fancy_close"></div>';

        html += '<div id="fancy_bg"><div class="fancy_bg" id="fancy_bg_n"></div><div class="fancy_bg" id="fancy_bg_ne"></div><div class="fancy_bg" id="fancy_bg_e"></div><div class="fancy_bg" id="fancy_bg_se"></div><div class="fancy_bg" id="fancy_bg_s"></div><div class="fancy_bg" id="fancy_bg_sw"></div><div class="fancy_bg" id="fancy_bg_w"></div><div class="fancy_bg" id="fancy_bg_nw"></div></div>';

        html += '<a href="javascript:;" id="fancy_left"><span class="fancy_ico" id="fancy_left_ico"></span></a><a href="javascript:;" id="fancy_right"><span class="fancy_ico" id="fancy_right_ico"></span></a>';

        html += '<div id="fancy_content"></div>';

        html += '</div>';
        html += '</div>';

        html += '<div id="fancy_title"></div>';

        $(html).appendTo("body");

        $('<table cellspacing="0" cellpadding="0" border="0"><tr><td class="fancy_title" id="fancy_title_left"></td><td class="fancy_title" id="fancy_title_main"><div></div></td><td class="fancy_title" id="fancy_title_right"></td></tr></table>').appendTo('#fancy_title');

        if ($.browser.msie) {
            $(".fancy_bg").fixPNG();
        }

        if (IE6) {
            $("div#fancy_overlay").css("position", "absolute");
            $("#fancy_loading div, #fancy_close, .fancy_title, .fancy_ico").fixPNG();

            $("#fancy_inner").prepend('<iframe id="fancy_bigIframe" src="javascript:false;" scrolling="no" frameborder="0"></iframe>');

            // Get rid of the 'false' text introduced by the URL of the iframe
            var frameDoc = $('#fancy_bigIframe')[0].contentWindow.document;
            frameDoc.open();
            frameDoc.close();

        }
    };

    $.fn.fancybox.defaults = {
        padding: 10,
        imageScale: true,
        zoomOpacity: true,
        zoomSpeedIn: 0,
        zoomSpeedOut: 0,
        zoomSpeedChange: 300,
        easingIn: 'swing',
        easingOut: 'swing',
        easingChange: 'swing',
        frameWidth: 560,
        frameHeight: 340,
        overlayShow: true,
        overlayOpacity: 0.3,
        overlayColor: '#666',
        enableEscapeButton: true,
        showCloseButton: true,
        hideOnOverlayClick: true,
        hideOnContentClick: true,
        centerOnScroll: true,
        itemArray: [],
        callbackOnStart: null,
        callbackOnShow: null,
        callbackOnClose: null
    };

    $(document).ready(function() {
        ieQuirks = $.browser.msie && !$.boxModel;

        if ($("#fancy_outer").length < 1) {
            $.fn.fancybox.build();
        }
    });

})(jQuery);
/**
 * jQuery.LocalScroll - Animated scrolling navigation, using anchors.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/11/2009
 * @author Ariel Flesler
 * @version 1.2.7
 **/
;(function($){var l=location.href.replace(/#.*/,'');var g=$.localScroll=function(a){$('body').localScroll(a)};g.defaults={duration:1e3,axis:'y',event:'click',stop:true,target:window,reset:true};g.hash=function(a){if(location.hash){a=$.extend({},g.defaults,a);a.hash=false;if(a.reset){var e=a.duration;delete a.duration;$(a.target).scrollTo(0,a);a.duration=e}i(0,location,a)}};$.fn.localScroll=function(b){b=$.extend({},g.defaults,b);return b.lazy?this.bind(b.event,function(a){var e=$([a.target,a.target.parentNode]).filter(d)[0];if(e)i(a,e,b)}):this.find('a,area').filter(d).bind(b.event,function(a){i(a,this,b)}).end().end();function d(){return!!this.href&&!!this.hash&&this.href.replace(this.hash,'')==l&&(!b.filter||$(this).is(b.filter))}};function i(a,e,b){var d=e.hash.slice(1),f=document.getElementById(d)||document.getElementsByName(d)[0];if(!f)return;if(a)a.preventDefault();var h=$(b.target);if(b.lock&&h.is(':animated')||b.onBefore&&b.onBefore.call(b,a,f,h)===false)return;if(b.stop)h.stop(true);if(b.hash){var j=f.id==d?'id':'name',k=$('<a> </a>').attr(j,d).css({position:'absolute',top:$(window).scrollTop(),left:$(window).scrollLeft()});f[j]='';$('body').prepend(k);location=e.hash;k.remove();f[j]=d}h.scrollTo(f,b).trigger('notify.serialScroll',[f])}})(jQuery);
/*
 * jqModal - Minimalist Modaling with jQuery
 *   (http://dev.iceburg.net/jquery/jqModal/)
 *
 * Copyright (c) 2007,2008 Brice Burgess <bhb@iceburg.net>
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 * 
 * $Version: 03/01/2009 +r14
 */
(function($) {
$.fn.jqm=function(o){
var p={
overlay: 50,
overlayClass: 'jqmOverlay',
closeClass: 'jqmClose',
trigger: '.jqModal',
ajax: F,
ajaxText: '',
target: F,
modal: F,
toTop: F,
onShow: F,
onHide: F,
onLoad: F
};
return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
if(p.trigger)$(this).jqmAddTrigger(p.trigger);
});};

$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
$.fn.jqmShow=function(t){return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});};
$.fn.jqmHide=function(t){return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});};

$.jqm = {
hash:{},
open:function(s,t){var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-1,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
 if(c.modal) {if(!A[0])L('bind');A.push(s);}
 else if(c.overlay > 0)h.w.jqmAddClose(o);
 else o=F;

 h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
 if(ie6){$('html,body').css({height:'100%',width:'100%'});if(o){o=o.css({position:'absolute'})[0];for(var y in {Top:1,Left:1})o.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");}}

 if(c.ajax) {var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
  r.html(c.ajaxText).load(u,function(){if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
 else if(cc)h.w.jqmAddClose($(cc,h.w));

 if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);	
 (c.onShow)?c.onShow(h):h.w.show();e(h);return F;
},
close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
 if(A[0]){A.pop();if(!A[0])L('unbind');}
 if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
 if(h.c.onHide)h.c.onHide(h);else{h.w.hide();if(h.o)h.o.remove();} return F;
},
params:{}};
var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);},
f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;},
hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
 if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
})(jQuery);
/**
 * jQuery.Preload - Multifunctional preloader
 * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com
 * Dual licensed under MIT and GPL.
 * Date: 3/25/2009
 * @author Ariel Flesler
 * @version 1.0.8
 */
;(function($){var h=$.preload=function(c,d){if(c.split)c=$(c);d=$.extend({},h.defaults,d);var f=$.map(c,function(a){if(!a)return;if(a.split)return d.base+a+d.ext;var b=a.src||a.href;if(typeof d.placeholder=='string'&&a.src)a.src=d.placeholder;if(b&&d.find)b=b.replace(d.find,d.replace);return b||null}),data={loaded:0,failed:0,next:0,done:0,total:f.length};if(!data.total)return finish();var g=$(Array(d.threshold+1).join('<img/>')).load(handler).error(handler).bind('abort',handler).each(fetch);function handler(e){data.element=this;data.found=e.type=='load';data.image=this.src;data.index=this.index;var a=data.original=c[this.index];data[data.found?'loaded':'failed']++;data.done++;if(d.enforceCache)h.cache.push($('<img/>').attr('src',data.image)[0]);if(d.placeholder&&a.src)a.src=data.found?data.image:d.notFound||a.src;if(d.onComplete)d.onComplete(data);if(data.done<data.total)fetch(0,this);else{if(g&&g.unbind)g.unbind('load').unbind('error').unbind('abort');g=null;finish()}};function fetch(i,a,b){if(a.attachEvent&&data.next&&data.next%h.gap==0&&!b){setTimeout(function(){fetch(i,a,1)},0);return!1}if(data.next==data.total)return!1;a.index=data.next;a.src=f[data.next++];if(d.onRequest){data.index=a.index;data.element=a;data.image=a.src;data.original=c[data.next-1];d.onRequest(data)}};function finish(){if(d.onFinish)d.onFinish(data)}};h.gap=14;h.cache=[];h.defaults={threshold:2,base:'',ext:'',replace:''};$.fn.preload=function(a){h(this,a);return this}})(jQuery);
/*
 * tools.scrollable 1.1.2 - Scroll your HTML with eye candy.
 * 
 * Copyright (c) 2009 Tero Piirainen
 * http://flowplayer.org/tools/scrollable.html
 *
 * Dual licensed under MIT and GPL 2+ licenses
 * http://www.opensource.org/licenses
 *
 * Launch  : March 2008
 * Date: ${date}
 * Revision: ${revision} 
 */
(function(b){b.tools=b.tools||{};b.tools.scrollable={version:"1.1.2",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var c;function a(o,m){var r=this,p=b(this),d=!m.vertical,e=o.children(),k=0,i;if(!c){c=r}b.each(m,function(s,t){if(b.isFunction(t)){p.bind(s,t)}});if(e.length>1){e=b(m.items,o)}function l(t){var s=b(t);return m.globalNav?s:o.parent().find(t)}o.data("finder",l);var f=l(m.prev),h=l(m.next),g=l(m.prevPage),n=l(m.nextPage);b.extend(r,{getIndex:function(){return k},getClickIndex:function(){var s=r.getItems();return s.index(s.filter("."+m.activeClass))},getConf:function(){return m},getSize:function(){return r.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/m.size)},getPageIndex:function(){return Math.ceil(k/m.size)},getNaviButtons:function(){return f.add(h).add(g).add(n)},getRoot:function(){return o},getItemWrap:function(){return e},getItems:function(){return e.children(m.item)},getVisibleItems:function(){return r.getItems().slice(k,k+m.size)},seekTo:function(s,w,t){if(s<0){s=0}if(k===s){return r}if(b.isFunction(w)){t=w}if(s>r.getSize()-m.size){return m.loop?r.begin():this.end()}var u=r.getItems().eq(s);if(!u.length){return r}var v=b.Event("onBeforeSeek");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}if(w===undefined||b.isFunction(w)){w=m.speed}function x(){if(t){t.call(r,s)}p.trigger("onSeek",[s])}if(d){e.animate({left:-u.position().left},w,m.easing,x)}else{e.animate({top:-u.position().top},w,m.easing,x)}c=r;k=s;v=b.Event("onStart");p.trigger(v,[s]);if(v.isDefaultPrevented()){return r}f.add(g).toggleClass(m.disabledClass,s===0);h.add(n).toggleClass(m.disabledClass,s>=r.getSize()-m.size);return r},move:function(u,t,s){i=u>0;return this.seekTo(k+u,t,s)},next:function(t,s){return this.move(1,t,s)},prev:function(t,s){return this.move(-1,t,s)},movePage:function(w,v,u){i=w>0;var s=m.size*w;var t=k%m.size;if(t>0){s+=(w>0?-t:m.size-t)}return this.move(s,v,u)},prevPage:function(t,s){return this.movePage(-1,t,s)},nextPage:function(t,s){return this.movePage(1,t,s)},setPage:function(t,u,s){return this.seekTo(t*m.size,u,s)},begin:function(t,s){i=false;return this.seekTo(0,t,s)},end:function(t,s){i=true;var u=this.getSize()-m.size;return u>0?this.seekTo(u,t,s):r},reload:function(){p.trigger("onReload");return r},focus:function(){c=r;return r},click:function(u){var v=r.getItems().eq(u),s=m.activeClass,t=m.size;if(u<0||u>=r.getSize()){return r}if(t==1){if(m.loop){return r.next()}if(u===0||u==r.getSize()-1){i=(i===undefined)?true:!i}return i===false?r.prev():r.next()}if(t==2){if(u==k){u--}r.getItems().removeClass(s);v.addClass(s);return r.seekTo(u,time,fn)}if(!v.hasClass(s)){r.getItems().removeClass(s);v.addClass(s);var x=Math.floor(t/2);var w=u-x;if(w>r.getSize()-t){w=r.getSize()-t}if(w!==u){return r.seekTo(w)}}return r},bind:function(s,t){p.bind(s,t);return r},unbind:function(s){p.unbind(s);return r}});b.each("onBeforeSeek,onStart,onSeek,onReload".split(","),function(s,t){r[t]=function(u){return r.bind(t,u)}});f.addClass(m.disabledClass).click(function(){r.prev()});h.click(function(){r.next()});n.click(function(){r.nextPage()});if(r.getSize()>m.size){h.add(n).removeClass(m.disabledClass);}if(r.getSize()<=m.size){h.add(n).addClass(m.disabledClass)}g.addClass(m.disabledClass).click(function(){r.prevPage()});var j=m.hoverClass,q="keydown."+Math.random().toString().substring(10);r.onReload(function(){if(j){r.getItems().hover(function(){b(this).addClass(j)},function(){b(this).removeClass(j)})}if(m.clickable){r.getItems().each(function(s){b(this).unbind("click.scrollable").bind("click.scrollable",function(t){if(b(t.target).is("a")){return}return r.click(s)})})}if(m.keyboard){b(document).unbind(q).bind(q,function(t){if(t.altKey||t.ctrlKey){return}if(m.keyboard!="static"&&c!=r){return}var u=m.keyboardSteps;if(d&&(t.keyCode==37||t.keyCode==39)){r.move(t.keyCode==37?-u:u);return t.preventDefault()}if(!d&&(t.keyCode==38||t.keyCode==40)){r.move(t.keyCode==38?-u:u);return t.preventDefault()}return true})}else{b(document).unbind(q)}});r.reload()}b.fn.scrollable=function(d){var e=this.eq(typeof d=="number"?d:0).data("scrollable");if(e){return e}var f=b.extend({},b.tools.scrollable.conf);d=b.extend(f,d);d.keyboardSteps=d.keyboardSteps||d.size;this.each(function(){e=new a(b(this),d);b(this).data("scrollable",e)});return d.api?e:this}})(jQuery);
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
/**
 * jquery.simpletip 1.3.1. A simple tooltip plugin
 * 
 * Copyright (c) 2009 Craig Thompson
 * http://craigsworks.com
 *
 * Licensed under GPLv3
 * http://www.opensource.org/licenses/gpl-3.0.html
 *
 * Launch  : February 2009
 * Version : 1.3.1
 * Released: February 5, 2009 - 11:04am
 */
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([3-9a-zB-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(6($){6 Z(f,3){4 7=n;f=b(f);4 5=b(document.createElement(\'div\')).B(3.10).B((3.p)?3.11:\'\').B((3.C)?3.12:\'\').13(3.q).appendTo(f);a(!3.14)5.t();o 5.r();a(!3.C){f.hover(6(c){7.t(c)},6(){7.r()});a(!3.p){f.mousemove(6(c){a(5.D(\'N\')!==\'u\')7.E(c)})}}o{f.click(6(c){a(c.15===f.16(0)){a(5.D(\'N\')!==\'u\')7.r();o 7.t()}});b(v).mousedown(6(c){a(5.D(\'N\')!==\'u\'){4 17=(3.O)?b(c.15).parents(\'.5\').andSelf().filter(6(){d n===5.16(0)}).length:0;a(17===0)7.r()}})};b.18(7,{getVersion:6(){d[1,2,0]},getParent:6(){d f},getTooltip:6(){d 5},getPos:6(){d 5.i()},19:6(8,9){4 e=f.i();a(s 8==\'F\')8=G(8)+e.k;a(s 9==\'F\')9=G(9)+e.l;5.D({k:8,l:9});d 7},t:6(c){3.1a.m(7);7.E((3.p)?P:c);Q(3.1b){g\'H\':5.fadeIn(3.I);h;g\'1c\':5.slideDown(3.I,7.E);h;g\'1d\':3.1e.m(5,3.I);h;w:g\'u\':5.t();h};5.B(3.R);3.1f.m(7);d 7},r:6(){3.1g.m(7);Q(3.1h){g\'H\':5.fadeOut(3.J);h;g\'1c\':5.slideUp(3.J);h;g\'1d\':3.1i.m(5,3.J);h;w:g\'u\':5.r();h};5.removeClass(3.R);3.1j.m(7);d 7},update:6(q){5.13(q);3.q=q;d 7},1k:6(1l,K){3.1m.m(7);5.1k(1l,K,6(){3.1n.m(7)});d 7},L:6(8,9){4 1o=8+5.S();4 1p=9+5.T();4 1q=b(v).width()+b(v).scrollLeft();4 1r=b(v).height()+b(v).scrollTop();d[(1o>=1q),(1p>=1r)]},E:6(c){4 x=5.S();4 y=5.T();a(!c&&3.p){a(3.j.constructor==Array){8=G(3.j[0]);9=G(3.j[1])}o a(b(3.j).attr(\'nodeType\')===1){4 i=b(3.j).i();8=i.k;9=i.l}o{4 e=f.i();4 z=f.S();4 M=f.T();Q(3.j){g\'l\':4 8=e.k-(x/2)+(z/2);4 9=e.l-y;h;g\'bottom\':4 8=e.k-(x/2)+(z/2);4 9=e.l+M;h;g\'k\':4 8=e.k-x;4 9=e.l-(y/2)+(M/2);h;g\'right\':4 8=e.k+z;4 9=e.l-(y/2)+(M/2);h;w:g\'w\':4 8=(z/2)+e.k+20;4 9=e.l;h}}}o{4 8=c.pageX;4 9=c.pageY};a(s 3.j!=\'object\'){8=8+3.i[0];9=9+3.i[1];a(3.L){4 U=7.L(8,9);a(U[0])8=8-(x/2)-(2*3.i[0]);a(U[1])9=9-(y/2)-(2*3.i[1])}}o{a(s 3.j[0]=="F")8=1s(8);a(s 3.j[1]=="F")9=1s(9)};7.19(8,9);d 7}})};b.fn.V=6(3){4 W=b(n).eq(s 3==\'number\'?3:0).K("V");a(W)d W;4 X={q:\'A simple 5\',C:1t,O:1t,14:Y,j:\'w\',i:[0,0],L:Y,p:Y,1b:\'H\',I:1u,1e:P,1h:\'H\',J:1u,1i:P,10:\'5\',R:\'active\',11:\'p\',12:\'C\',focusClass:\'O\',1a:6(){},1f:6(){},1g:6(){},1j:6(){},1m:6(){},1n:6(){}};b.18(X,3);n.each(6(){4 el=new Z(b(n),X);b(n).K("V",el)});d n}})();',[],93,'|||conf|var|tooltip|function|self|posX|posY|if|jQuery|event|return|elemPos|elem|case|break|offset|position|left|top|call|this|else|fixed|content|hide|typeof|show|none|window|default|tooltipWidth|tooltipHeight|elemWidth||addClass|persistent|css|updatePos|string|parseInt|fade|showTime|hideTime|data|boundryCheck|elemHeight|display|focus|null|switch|activeClass|outerWidth|outerHeight|overflow|simpletip|api|defaultConf|true|Simpletip|baseClass|fixedClass|persistentClass|html|hidden|target|get|check|extend|setPos|onBeforeShow|showEffect|slide|custom|showCustom|onShow|onBeforeHide|hideEffect|hideCustom|onHide|load|uri|beforeContentLoad|onContentLoad|newX|newY|windowWidth|windowHeight|String|false|150'.split('|'),0,{}))
/*
* jQuery.splitter.js - two-pane splitter window plugin
*
* version 1.5 (2008/04/02) 
* 
* Dual licensed under the MIT and GPL licenses: 
*   http://www.opensource.org/licenses/mit-license.php 
*   http://www.gnu.org/licenses/gpl.html 
*/

/**
* The splitter() plugin implements a two-pane resizable splitter window.
* The selected elements in the jQuery object are converted to a splitter;
* each selected element should have two child elements, used for the panes
* of the splitter. The plugin adds a third child element for the splitbar.
* 
* For more details see: http://methvin.com/jquery/splitter/
*
*
* @example $('#MySplitter').splitter();
* @desc Create a vertical splitter with default settings 
*
* @example $('#MySplitter').splitter({type: 'h', accessKey: 'M'});
* @desc Create a horizontal splitter resizable via Alt+Shift+M
*
* @name splitter
* @type jQuery
* @param Object options Options for the splitter (not required)
* @cat Plugins/Splitter
* @return jQuery
* @author Dave Methvin (dave.methvin@gmail.com)
*/
; (function($) {

    $.fn.splitter = function(args) {
        args = args || {};
        return this.each(function() {
            var zombie; 	// left-behind splitbar for outline resizes
            function startSplitMouse(evt) {
                if (opts.outline)
                    zombie = zombie || bar.clone(false).insertAfter(A);
                bar.removeClass("docked");
                panes.css("-webkit-user-select", "none"); // Safari selects A/B text on a move
                bar.addClass(opts.activeClass);
                A._posSplit = A[0][opts.pxSplit] - evt[opts.eventPos];
                $(document)
				.bind("mousemove", doSplitMouse)
				.bind("mouseup", endSplitMouse);
            }
            function doSplitMouse(evt) {
                var newPos = A._posSplit + evt[opts.eventPos];
                if (opts.outline) {
                    newPos = Math.max(0, Math.min(newPos, splitter._DA - bar._DA));
                    bar.css(opts.origin, newPos);
                } else
                    resplit(newPos);
            }
            function endSplitMouse(evt) {
                bar.removeClass(opts.activeClass);
                var newPos = A._posSplit + evt[opts.eventPos];
                if (newPos < bar._DA) { //?? fix for B pane dockRight/dockBottom case
                    newPos = 0;
                    bar.addClass("docked");
                }
                if (opts.outline) {
                    zombie.remove(); zombie = null;
                    resplit(newPos);
                }
                panes.css("-webkit-user-select", "text"); // let Safari select text again
                $(document)
				.unbind("mousemove", doSplitMouse)
				.unbind("mouseup", endSplitMouse);
            }
            function resplit(newPos) {
                // Constrain new splitbar position to fit pane size limits
                newPos = Math.max(A._min, splitter._DA - B._max,
					Math.min(newPos, A._max, splitter._DA - bar._DA - B._min));
                // Resize/position the two panes
                bar._DA = bar[0][opts.pxSplit]; 	// bar size may change during dock
                bar.css(opts.origin, newPos).css(opts.fixed, splitter._DF);
                A.css(opts.origin, 0).css(opts.split, newPos).css(opts.fixed, splitter._DF);
                B.css(opts.origin, newPos + bar._DA)
				.css(opts.split, splitter._DA - bar._DA - newPos).css(opts.fixed, splitter._DF);
                // IE fires resize for us; all others pay cash
                if (!$.browser.msie)
                    panes.trigger("resize");
            }
            function dimSum(jq, dims) {
                // Opera returns -1 for missing min/max width, turn into 0
                var sum = 0;
                for (var i = 1; i < arguments.length; i++)
                    sum += Math.max(parseInt(jq.css(arguments[i])) || 0, 0);
                return sum;
            }

            // Determine settings based on incoming opts, element classes, and defaults
            var vh = (args.splitHorizontal ? 'h' : args.splitVertical ? 'v' : args.type) || 'v';
            var opts = $.extend({
                activeClass: 'active', // class name for active splitter
                dockClass: 'docked', // class name for docked splitter
                pxPerKey: 8, 		// splitter px moved per keypress
                tabIndex: 0, 		// tab order indicator
                accessKey: ''			// accessKey for splitbar
            }, {
                v: {					// Vertical splitters:
                    keyLeft: 39, keyRight: 37, cursor: "e-resize",
                    splitbarClass: "vsplitbar", outlineClass: "voutline",
                    type: 'v', eventPos: "pageX", origin: "left",
                    split: "width", pxSplit: "offsetWidth", side1: "Left", side2: "Right",
                    fixed: "height", pxFixed: "offsetHeight", side3: "Top", side4: "Bottom"
                },
                h: {					// Horizontal splitters:
                    keyTop: 40, keyBottom: 38, cursor: "n-resize",
                    splitbarClass: "hsplitbar", outlineClass: "houtline",
                    type: 'h', eventPos: "pageY", origin: "top",
                    split: "height", pxSplit: "offsetHeight", side1: "Top", side2: "Bottom",
                    fixed: "width", pxFixed: "offsetWidth", side3: "Left", side4: "Right"
                }
}[vh], args);

                // Create jQuery object closures for splitter and both panes
                var splitter = $(this).css({ position: "relative" });
                var panes = $(">*", splitter[0]).css({
                    position: "absolute", 			// positioned inside splitter container
                    "z-index": "1", 				// splitbar is positioned above
                    "-moz-outline-style": "none"	// don't show dotted outline
                });
                var A = $(panes[0]); 	// left  or top
                var B = $(panes[1]); 	// right or bottom

                // Focuser element, provides keyboard support; title is shown by Opera accessKeys
                var focuser = $('<a href="javascript:void(0)"></a>')
			.attr({ accessKey: opts.accessKey, tabIndex: opts.tabIndex, title: opts.splitbarClass })
			.bind($.browser.opera ? "click" : "focus", function() { this.focus(); bar.addClass(opts.activeClass) })
			.bind("keydown", function(e) {
			    var key = e.which || e.keyCode;
			    var dir = key == opts["key" + opts.side1] ? 1 : key == opts["key" + opts.side2] ? -1 : 0;
			    if (dir)
			        resplit(A[0][opts.pxSplit] + dir * opts.pxPerKey, false);
			})
			.bind("blur", function() { bar.removeClass(opts.activeClass) });

                // Splitbar element, can be already in the doc or we create one
                var bar = $(panes[2] || '<div></div>')
			.insertAfter(A).css("z-index", "100").append(focuser)
			.attr({ "class": opts.splitbarClass, unselectable: "on" })
			.css({ position: "absolute", "user-select": "none", "-webkit-user-select": "none",
			    "-khtml-user-select": "none", "-moz-user-select": "none"
			})
			.bind("mousedown", startSplitMouse);
                // Use our cursor unless the style specifies a non-default cursor
                if (/^(auto|default|)$/.test(bar.css("cursor")))
                    bar.css("cursor", opts.cursor);

                // Cache several dimensions for speed, rather than re-querying constantly
                bar._DA = bar[0][opts.pxSplit];
                splitter._PBF = $.boxModel ? dimSum(splitter, "border" + opts.side3 + "Width", "border" + opts.side4 + "Width") : 0;
                splitter._PBA = $.boxModel ? dimSum(splitter, "border" + opts.side1 + "Width", "border" + opts.side2 + "Width") : 0;
                A._pane = opts.side1;
                B._pane = opts.side2;
                $.each([A, B], function() {
                    this._min = opts["min" + this._pane] || dimSum(this, "min-" + opts.split);
                    this._max = opts["max" + this._pane] || dimSum(this, "max-" + opts.split) || 9999;
                    this._init = opts["size" + this._pane] === true ?
				parseInt($.curCSS(this[0], opts.split)) : opts["size" + this._pane];
                });

                // Determine initial position, get from cookie if specified
                var initPos = A._init;
                if (!isNaN(B._init))	// recalc initial B size as an offset from the top or left side
                    initPos = splitter[0][opts.pxSplit] - splitter._PBA - B._init - bar._DA;
                if (opts.cookie) {
                    if (!$.cookie)
                        alert('jQuery.splitter(): jQuery cookie plugin required');
                    initPos = parseInt($.cookie(opts.cookie));
                    $(window).bind("unload", function() {
                        var state = String(bar.css(opts.origin)); // current location of splitbar
                        $.cookie(opts.cookie, state, { expires: opts.cookieExpires || 365,
                            path: opts.cookiePath || document.location.pathname
                        });
                    });
                }
                if (isNaN(initPos))	// King Solomon's algorithm
                    initPos = Math.round((splitter[0][opts.pxSplit] - splitter._PBA - bar._DA) / 2);

                // Resize event propagation and splitter sizing
                if (opts.anchorToWindow) {
                    // Account for margin or border on the splitter container and enforce min height
                    splitter._hadjust = dimSum(splitter, "borderTopWidth", "borderBottomWidth", "marginBottom");
                    splitter._hmin = Math.max(dimSum(splitter, "minHeight"), 20);
                    $(window).bind("resize", function() {
                        var top = splitter.offset().top;
                        var wh = $(window).height();
                        splitter.css("height", Math.max(wh - top - splitter._hadjust, splitter._hmin) + "px");
                        if (!$.browser.msie) splitter.trigger("resize");
                    }).trigger("resize");
                }
                else if (opts.resizeToWidth && !$.browser.msie)
                    $(window).bind("resize", function() {
                        splitter.trigger("resize");
                    });

                // Docking support
                if (opts.dock) {
                    var isDocked = 0, undock_timer;
                    splitter
				.bind("toggleDock", function() {
				    var pw = (opts.dock == "right" ? B : A)[0][opts.pxSplit]; //??
				    splitter.trigger(pw ? "dock" : "undock");
				})
				.bind("dock", function() {
				    var pw = (opts.dock == "right" ? B : A)[0][opts.pxSplit]; 	//??
				    if (!pw) return;
				    bar._pos = pw;
				    var x = {}; x[opts.origin] = 0; // splitter[0][opts.pxSplit] - splitter._PBA - bar[0][opts.pxSplit];
				    bar.animate(x, opts.dockSpeed || 1, opts.dockEasing, function() {
				        bar.addClass(opts.dockClass);
				        resplit(0);
				    });
				})
				.bind("undock", function() {
				    var pw = (opts.dock == "right" ? B : A)[0][opts.pxSplit]; //??
				    if (pw) return;
				    var x = {}; x[opts.origin] = bar._pos + "px";
				    bar.removeClass(opts.dockClass)
						.animate(x, opts.undockSpeed || opts.dockSpeed || 1, opts.undockEasing || opts.dockEasing, function() {
						    resplit(bar._pos);
						});
				});
                    if (opts.dockKey)
                        $('<a title="' + opts.splitbarClass + ' toggle dock" href="javascript:void(0)"></a>')
					.attr({ accessKey: opts.dockKey, tabIndex: -1 }).appendTo(bar)
					.bind($.browser.opera ? "click" : "focus", function() {
					    splitter.trigger("toggleDock"); this.blur();
					});
                    bar.bind("dblclick", function() { splitter.trigger("toggleDock"); })
                }

                // Resize event handler; triggered immediately to set initial position
                splitter.bind("resize", function(e, size) {
                    // Determine new width/height of splitter container
                    splitter._DF = splitter[0][opts.pxFixed] - splitter._PBF;
                    splitter._DA = splitter[0][opts.pxSplit] - splitter._PBA;
                    // Bail if splitter isn't visible or content isn't there yet
                    if (splitter._DF <= 0 || splitter._DA <= 0) return;
                    // Re-divvy the adjustable dimension; maintain size of the preferred pane
                    resplit(!isNaN(size) ? size : (!(opts.sizeRight || opts.sizeBottom) ? A[0][opts.pxSplit] :
				splitter._DA - B[0][opts.pxSplit] - bar._DA));
                }).trigger("resize", [initPos]);
            });
        };

    })(jQuery);
(function($) {

    if (typeof $.timeout != "undefined") return;

    $.extend({
        timeout: function(func, delay) {
            // init
            if (typeof $.timeout.count == "undefined") $.timeout.count = 0;
            if (typeof $.timeout.funcs == "undefined") $.timeout.funcs = new Array();
            // set timeout
            if (typeof func == 'string') return setTimeout(func, delay);
            if (typeof func == 'function') {
                $.timeout.count++;
                $.timeout.funcs[$.timeout.count] = func;
                return setTimeout("$.timeout.funcs['" + $.timeout.count + "']();", delay);
            }
        },
        interval: function(func, delay) {
            // init
            if (typeof $.interval.count == "undefined") $.interval.count = 0;
            if (typeof $.interval.funcs == "undefined") $.interval.funcs = new Array();
            // set interval
            if (typeof func == 'string') return setInterval(func, delay);
            if (typeof func == 'function') {
                $.interval.count++;
                $.interval.funcs[$.interval.count] = func;
                return setInterval("$.interval.funcs['" + $.interval.count + "']();", delay);
            }
        },
        idle: function(func, delay) {
            // init
            if (typeof $.idle.lasttimeout == "undefined") $.idle.lasttimeout = null;
            if (typeof $.idle.lastfunc == "undefined") $.idle.lastfunc = null;
            // set idle timeout
            if ($.idle.timeout) { clearTimeout($.idle.timeout); $.idle.timeout = null; $.idle.lastfunc = null; }
            if (typeof (func) == 'string') {
                $.idle.timeout = setTimeout(func, delay);
                return $.idle.timeout;
            }
            if (typeof (func) == 'function') {
                $.idle.lastfunc = func;
                $.idle.timeout = setTimeout("$.idle.lastfunc();", delay);
                return $.idle.timeout;
            }
        },
        clear: function(countdown) {
            clearInterval(countdown);
            clearTimeout(countdown);
        }

    });


})(jQuery);

/* Copyright (c) 2006 Kelvin Luck (kelvin AT kelvinluck DOT com || http://www.kelvinluck.com)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
* 
* See http://kelvinluck.com/assets/jquery/jScrollPane/
* $Id: jScrollPane.js 19 2008-11-13 06:00:09Z kelvin.luck $
*/

/**
* Replace the vertical scroll bars on any matched elements with a fancy
* styleable (via CSS) version. With JS disabled the elements will
* gracefully degrade to the browsers own implementation of overflow:auto.
* If the mousewheel plugin has been included on the page then the scrollable areas will also
* respond to the mouse wheel.
*
* @example jQuery(".scroll-pane").jScrollPane();
*
* @name jScrollPane
* @type jQuery
* @param Object	settings	hash with options, described below.
*								scrollbarWidth	-	The width of the generated scrollbar in pixels
*								scrollbarMargin	-	The amount of space to leave on the side of the scrollbar in pixels
*								wheelSpeed		-	The speed the pane will scroll in response to the mouse wheel in pixels
*								showArrows		-	Whether to display arrows for the user to scroll with
*								arrowSize		-	The height of the arrow buttons if showArrows=true
*								animateTo		-	Whether to animate when calling scrollTo and scrollBy
*								dragMinHeight	-	The minimum height to allow the drag bar to be
*								dragMaxHeight	-	The maximum height to allow the drag bar to be
*								animateInterval	-	The interval in milliseconds to update an animating scrollPane (default 100)
*								animateStep		-	The amount to divide the remaining scroll distance by when animating (default 3)
*								maintainPosition-	Whether you want the contents of the scroll pane to maintain it's position when you re-initialise it - so it doesn't scroll as you add more content (default true)
*								scrollbarOnLeft	-	Display the scrollbar on the left side?  (needs stylesheet changes, see examples.html)
*								reinitialiseOnImageLoad - Whether the jScrollPane should automatically re-initialise itself when any contained images are loaded
* @return jQuery
* @cat Plugins/jScrollPane
* @author Kelvin Luck (kelvin AT kelvinluck DOT com || http://www.kelvinluck.com)
*/
jQuery.jScrollPane = {
    active: []
};
jQuery.fn.jScrollPane = function(settings) {
    settings = jQuery.extend({}, jQuery.fn.jScrollPane.defaults, settings);

    var rf = function() { return false; };

    return this.each(
		function() {
		    var $this = jQuery(this);
		    // Switch the element's overflow to hidden to ensure we get the size of the element without the scrollbars [http://plugins.jquery.com/node/1208]
		    $this.css('overflow', 'hidden');
		    var paneEle = this;

		    if (jQuery(this).parent().is('.jScrollPaneContainer')) {
		        var currentScrollPosition = settings.maintainPosition ? $this.offset({ relativeTo: jQuery(this).parent()[0] }).top : 0;
		        var $c = jQuery(this).parent();
		        var paneWidth = $c.innerWidth();
		        var paneHeight = $c.outerHeight();
		        var trackHeight = paneHeight;
		        jQuery('>.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown', $c).remove();
		        $this.css({ 'top': 0 });
		    } else {
		        var currentScrollPosition = 0;
		        this.originalPadding = $this.css('paddingTop') + ' ' + $this.css('paddingRight') + ' ' + $this.css('paddingBottom') + ' ' + $this.css('paddingLeft');
		        this.originalSidePaddingTotal = (parseInt($this.css('paddingLeft')) || 0) + (parseInt($this.css('paddingRight')) || 0);
		        var paneWidth = $this.innerWidth();
		        var paneHeight = $this.innerHeight();
		        var trackHeight = paneHeight;
		        $this.wrap(
					jQuery('<div></div>').attr(
						{ 'className': 'jScrollPaneContainer' }
					).css(
						{
						    'height': paneHeight + 'px',
						    'width': paneWidth + 'px'
						}
					)
				);
		        // deal with text size changes (if the jquery.em plugin is included)
		        // and re-initialise the scrollPane so the track maintains the
		        // correct size
		        jQuery(document).bind(
					'emchange',
					function(e, cur, prev) {
					    $this.jScrollPane(settings);
					}
				);

		    }

		    if (settings.reinitialiseOnImageLoad) {
		        // code inspired by jquery.onImagesLoad: http://plugins.jquery.com/project/onImagesLoad
		        // except we re-initialise the scroll pane when each image loads so that the scroll pane is always up to size...
		        // TODO: Do I even need to store it in $.data? Is a local variable here the same since I don't pass the reinitialiseOnImageLoad when I re-initialise?
		        var $imagesToLoad = $.data(paneEle, 'jScrollPaneImagesToLoad') || $('img', $this);
		        var loadedImages = [];

		        if ($imagesToLoad.length) {
		            $imagesToLoad.each(function(i, val) {
		                $(this).bind('load', function() {
		                    if (jQuery.inArray(i, loadedImages) == -1) { //don't double count images
		                        loadedImages.push(val); //keep a record of images we've seen
		                        $imagesToLoad = $.grep($imagesToLoad, function(n, i) {
		                            return n != val;
		                        });
		                        $.data(paneEle, 'jScrollPaneImagesToLoad', $imagesToLoad);
		                        settings.reinitialiseOnImageLoad = false;
		                        $this.jScrollPane(settings); // re-initialise
		                    }
		                }).each(function(i, val) {
		                    if (this.complete || this.complete === undefined) {
		                        //needed for potential cached images
		                        this.src = this.src;
		                    }
		                });
		            });
		        };
		    }

		    var p = this.originalSidePaddingTotal;

		    var cssToApply = {
		        'height': 'auto',
		        'width': paneWidth - settings.scrollbarWidth - settings.scrollbarMargin - p + 'px'
		    }

		    if (settings.scrollbarOnLeft) {
		        cssToApply.paddingLeft = settings.scrollbarMargin + settings.scrollbarWidth + 'px';
		    } else {
		        cssToApply.paddingRight = settings.scrollbarMargin + 'px';
		    }

		    $this.css(cssToApply);

		    var contentHeight = $this.outerHeight();
		    var percentInView = paneHeight / contentHeight;

		    if (percentInView < .99) {
		        var $container = $this.parent();
		        $container.append(
					jQuery('<div></div>').attr({ 'className': 'jScrollPaneTrack' }).css({ 'width': settings.scrollbarWidth + 'px' }).append(
						jQuery('<div></div>').attr({ 'className': 'jScrollPaneDrag' }).css({ 'width': settings.scrollbarWidth + 'px' }).append(
							jQuery('<div></div>').attr({ 'className': 'jScrollPaneDragTop' }).css({ 'width': settings.scrollbarWidth + 'px' }),
							jQuery('<div></div>').attr({ 'className': 'jScrollPaneDragBottom' }).css({ 'width': settings.scrollbarWidth + 'px' })
						)
					)
				);

		        var $track = jQuery('>.jScrollPaneTrack', $container);
		        var $drag = jQuery('>.jScrollPaneTrack .jScrollPaneDrag', $container);

		        if (settings.showArrows) {

		            var currentArrowButton;
		            var currentArrowDirection;
		            var currentArrowInterval;
		            var currentArrowInc;
		            var whileArrowButtonDown = function() {
		                if (currentArrowInc > 4 || currentArrowInc % 4 == 0) {
		                    positionDrag(dragPosition + currentArrowDirection * mouseWheelMultiplier);
		                }
		                currentArrowInc++;
		            };
		            var onArrowMouseUp = function(event) {
		                jQuery('html').unbind('mouseup', onArrowMouseUp);
		                currentArrowButton.removeClass('jScrollActiveArrowButton');
		                clearInterval(currentArrowInterval);
		                //console.log($(event.target));
		                //currentArrowButton.parent().removeClass('jScrollArrowUpClicked jScrollArrowDownClicked');
		            };
		            var onArrowMouseDown = function() {
		                //console.log(direction);
		                //currentArrowButton = $(this);
		                jQuery('html').bind('mouseup', onArrowMouseUp);
		                currentArrowButton.addClass('jScrollActiveArrowButton');
		                currentArrowInc = 0;
		                whileArrowButtonDown();
		                currentArrowInterval = setInterval(whileArrowButtonDown, 100);
		            };
		            $container
						.append(
							jQuery('<a></a>')
								.attr({ 'href': 'javascript:;', 'className': 'jScrollArrowUp' })
								.css({ 'width': settings.scrollbarWidth + 'px' })
								.html('Scroll up')
								.bind('mousedown', function() {
								    currentArrowButton = jQuery(this);
								    currentArrowDirection = -1;
								    onArrowMouseDown();
								    this.blur();
								    return false;
								})
								.bind('click', rf),
							jQuery('<a></a>')
								.attr({ 'href': 'javascript:;', 'className': 'jScrollArrowDown' })
								.css({ 'width': settings.scrollbarWidth + 'px' })
								.html('Scroll down')
								.bind('mousedown', function() {
								    currentArrowButton = jQuery(this);
								    currentArrowDirection = 1;
								    onArrowMouseDown();
								    this.blur();
								    return false;
								})
								.bind('click', rf)
						);
		            var $upArrow = jQuery('>.jScrollArrowUp', $container);
		            var $downArrow = jQuery('>.jScrollArrowDown', $container);
		            if (settings.arrowSize) {
		                trackHeight = paneHeight - settings.arrowSize - settings.arrowSize;
		                $track
							.css({ 'height': trackHeight + 'px', top: settings.arrowSize + 'px' })
		            } else {
		                var topArrowHeight = $upArrow.height();
		                settings.arrowSize = topArrowHeight;
		                trackHeight = paneHeight - topArrowHeight - $downArrow.height();
		                $track
							.css({ 'height': trackHeight + 'px', top: topArrowHeight + 'px' })
		            }
		        }

		        var $pane = jQuery(this).css({ 'position': 'absolute', 'overflow': 'visible' });

		        var currentOffset;
		        var maxY;
		        var mouseWheelMultiplier;
		        // store this in a seperate variable so we can keep track more accurately than just updating the css property..
		        var dragPosition = 0;
		        var dragMiddle = percentInView * paneHeight / 2;

		        // pos function borrowed from tooltip plugin and adapted...
		        var getPos = function(event, c) {
		            var p = c == 'X' ? 'Left' : 'Top';
		            return event['page' + c] || (event['client' + c] + (document.documentElement['scroll' + p] || document.body['scroll' + p])) || 0;
		        };

		        var ignoreNativeDrag = function() { return false; };

		        var initDrag = function() {
		            ceaseAnimation();
		            currentOffset = $drag.offset(false);
		            currentOffset.top -= dragPosition;
		            maxY = trackHeight - $drag[0].offsetHeight;
		            mouseWheelMultiplier = 2 * settings.wheelSpeed * maxY / contentHeight;
		        };

		        var onStartDrag = function(event) {
		            initDrag();
		            dragMiddle = getPos(event, 'Y') - dragPosition - currentOffset.top;
		            jQuery('html').bind('mouseup', onStopDrag).bind('mousemove', updateScroll);
		            if (jQuery.browser.msie) {
		                jQuery('html').bind('dragstart', ignoreNativeDrag).bind('selectstart', ignoreNativeDrag);
		            }
		            return false;
		        };
		        var onStopDrag = function() {
		            jQuery('html').unbind('mouseup', onStopDrag).unbind('mousemove', updateScroll);
		            dragMiddle = percentInView * paneHeight / 2;
		            if (jQuery.browser.msie) {
		                jQuery('html').unbind('dragstart', ignoreNativeDrag).unbind('selectstart', ignoreNativeDrag);
		            }
		        };
		        var positionDrag = function(destY) {
		            destY = destY < 0 ? 0 : (destY > maxY ? maxY : destY);
		            dragPosition = destY;
		            $drag.css({ 'top': destY + 'px' });
		            var p = destY / maxY;
		            $pane.css({ 'top': ((paneHeight - contentHeight) * p) + 'px' });
		            $this.trigger('scroll');
		            if (settings.showArrows) {
		                $upArrow[destY == 0 ? 'addClass' : 'removeClass']('disabled');
		                $downArrow[destY == maxY ? 'addClass' : 'removeClass']('disabled');
		            }
		        };
		        var updateScroll = function(e) {
		            positionDrag(getPos(e, 'Y') - currentOffset.top - dragMiddle);
		        };

		        var dragH = Math.max(Math.min(percentInView * (paneHeight - settings.arrowSize * 2), settings.dragMaxHeight), settings.dragMinHeight);

		        $drag.css(
					{ 'height': dragH + 'px' }
				).bind('mousedown', onStartDrag);

		        var trackScrollInterval;
		        var trackScrollInc;
		        var trackScrollMousePos;
		        var doTrackScroll = function() {
		            if (trackScrollInc > 8 || trackScrollInc % 4 == 0) {
		                positionDrag((dragPosition - ((dragPosition - trackScrollMousePos) / 2)));
		            }
		            trackScrollInc++;
		        };
		        var onStopTrackClick = function() {
		            clearInterval(trackScrollInterval);
		            jQuery('html').unbind('mouseup', onStopTrackClick).unbind('mousemove', onTrackMouseMove);
		        };
		        var onTrackMouseMove = function(event) {
		            trackScrollMousePos = getPos(event, 'Y') - currentOffset.top - dragMiddle;
		        };
		        var onTrackClick = function(event) {
		            initDrag();
		            onTrackMouseMove(event);
		            trackScrollInc = 0;
		            jQuery('html').bind('mouseup', onStopTrackClick).bind('mousemove', onTrackMouseMove);
		            trackScrollInterval = setInterval(doTrackScroll, 100);
		            doTrackScroll();
		        };

		        $track.bind('mousedown', onTrackClick);

		        $container.bind(
					'mousewheel',
					function(event, delta) {
					    initDrag();
					    ceaseAnimation();
					    var d = dragPosition;
					    positionDrag(dragPosition - delta * mouseWheelMultiplier);
					    var dragOccured = d != dragPosition;
					    return !dragOccured;
					}
				);

		        var _animateToPosition;
		        var _animateToInterval;
		        function animateToPosition() {
		            var diff = (_animateToPosition - dragPosition) / settings.animateStep;
		            if (diff > 1 || diff < -1) {
		                positionDrag(dragPosition + diff);
		            } else {
		                positionDrag(_animateToPosition);
		                ceaseAnimation();
		            }
		        }
		        var ceaseAnimation = function() {
		            if (_animateToInterval) {
		                clearInterval(_animateToInterval);
		                delete _animateToPosition;
		            }
		        };
		        var scrollTo = function(pos, preventAni) {
		            if (typeof pos == "string") {
		                $e = jQuery(pos, this);
		                if (!$e.length) return;
		                pos = $e.offset().top - $this.offset().top;
		            }
		            ceaseAnimation();
		            var destDragPosition = -pos / (paneHeight - contentHeight) * maxY;
		            if (preventAni || !settings.animateTo) {
		                positionDrag(destDragPosition);
		            } else {
		                _animateToPosition = destDragPosition;
		                _animateToInterval = setInterval(animateToPosition, settings.animateInterval);
		            }
		        };
		        $this[0].scrollTo = scrollTo;

		        $this[0].scrollBy = function(delta) {
		            var currentPos = -parseInt($pane.css('top')) || 0;
		            scrollTo(currentPos + delta);
		        };

		        initDrag();

		        scrollTo(-currentScrollPosition, true);

		        // Deal with it when the user tabs to a link or form element within this scrollpane
		        $('*', this).bind(
					'focus',
					function(event) {
					    var eleTop = $(this).position().top;
					    var viewportTop = -parseInt($pane.css('top')) || 0;
					    var maxVisibleEleTop = viewportTop + paneHeight;
					    var eleInView = eleTop > viewportTop && eleTop < maxVisibleEleTop;
					    if (!eleInView) {
					        $container.scrollTop(0);
					        var destPos = eleTop - settings.scrollbarMargin;
					        if (eleTop > viewportTop) { // element is below viewport - scroll so it is at bottom.
					            destPos += $(this).height() + 15 + settings.scrollbarMargin - paneHeight;
					        }
					        scrollTo(destPos);
					    }
					}
				)


		        if (location.hash) {
		            // the timeout needs to be longer in IE when not loading from cache...
		            setTimeout(function() {
		                $(location.hash, $this).trigger('focus');
		            }, $.browser.msie ? 100 : 0);
		        }

		        // use event delegation to listen for all clicks on links and hijack them if they are links to
		        // anchors within our content...
		        $(document).bind(
					'click',
					function(e) {
					    $target = $(e.target);
					    if ($target.is('a')) {
					        var h = $target.attr('href');
					        console.log(h);
					        if (h.substr(0, 1) == '#') {
					            $linkedEle = $(h, $this);
					            console.log($linkedEle);
					            if ($linkedEle.length) {
					                $linkedEle.trigger('focus');
					                return false;
					            }
					        }
					    }
					}
				);

		        jQuery.jScrollPane.active.push($this[0]);

		    } else {
		        $this.css(
					{
					    'height': paneHeight + 'px',
					    'width': paneWidth - this.originalSidePaddingTotal + 'px',
					    'padding': this.originalPadding
					}
				);
		        // remove from active list?
		    }

		}
	)
};

jQuery.fn.jScrollPane.defaults = {
    scrollbarWidth: 10,
    scrollbarMargin: 5,
    wheelSpeed: 18,
    showArrows: false,
    arrowSize: 0,
    animateTo: false,
    dragMinHeight: 1,
    dragMaxHeight: 99999,
    animateInterval: 100,
    animateStep: 3,
    maintainPosition: true,
    scrollbarOnLeft: false,
    reinitialiseOnImageLoad: false
};

// clean up the scrollTo expandos
jQuery(window)
	.bind('unload', function() {
	    var els = jQuery.jScrollPane.active;
	    for (var i = 0; i < els.length; i++) {
	        els[i].scrollTo = els[i].scrollBy = null;
	    }
	}
);

function NiftyCheck(){
if(!document.getElementById || !document.createElement)
    return(false);
isXHTML=/html\:/.test(document.getElementsByTagName('body')[0].nodeName);
if(Array.prototype.push==null){Array.prototype.push=function(){
      this[this.length]=arguments[0]; return(this.length);}}
return(true);
}

function Rounded(selector,wich,bk,color,opt){
var i,prefixt,prefixb,cn="r",ecolor="",edges=false,eclass="",b=false,t=false;

if(color=="transparent"){
    cn=cn+"x";
    ecolor=bk;
    bk="transparent";
    }
else if(opt && opt.indexOf("border")>=0){
    var optar=opt.split(" ");
    for(i=0;i<optar.length;i++)
        if(optar[i].indexOf("#")>=0) ecolor=optar[i];
    if(ecolor=="") ecolor="#666";
    cn+="e";
    edges=true;
    }
else if(opt && opt.indexOf("smooth")>=0){
    cn+="a";
    ecolor=Mix(bk,color);
    }
if(opt && opt.indexOf("small")>=0) cn+="s";
prefixt=cn;
prefixb=cn;
if(wich.indexOf("all")>=0){t=true;b=true}
else if(wich.indexOf("top")>=0) t="true";
else if(wich.indexOf("tl")>=0){
    t="true";
    if(wich.indexOf("tr")<0) prefixt+="l";
    }
else if(wich.indexOf("tr")>=0){
    t="true";
    prefixt+="r";
    }
if(wich.indexOf("bottom")>=0) b=true;
else if(wich.indexOf("bl")>=0){
    b="true";
    if(wich.indexOf("br")<0) prefixb+="l";
    }
else if(wich.indexOf("br")>=0){
    b="true";
    prefixb+="r";
    }
var v=getElementsBySelector(selector);
var l=v.length;
for(i=0;i<l;i++){
    if(edges) AddBorder(v[i],ecolor);
    if(t) AddTop(v[i],bk,color,ecolor,prefixt);
    if(b) AddBottom(v[i],bk,color,ecolor,prefixb);
    }
}

function AddBorder(el,bc){
var i;
if(!el.passed){
    if(el.childNodes.length==1 && el.childNodes[0].nodeType==3){
        var t=el.firstChild.nodeValue;
        el.removeChild(el.lastChild);
        var d=CreateEl("span");
        d.style.display="block";
        d.appendChild(document.createTextNode(t));
        el.appendChild(d);
        }
    for(i=0;i<el.childNodes.length;i++){
        if(el.childNodes[i].nodeType==1){
            el.childNodes[i].style.borderLeft="1px solid "+bc;
            el.childNodes[i].style.borderRight="1px solid "+bc;
            }
        }
    }
el.passed=true;
}
    
function AddTop(el,bk,color,bc,cn){
var i,lim=4,d=CreateEl("b");

if(cn.indexOf("s")>=0) lim=2;
if(bc) d.className="artop";
else d.className="rtop";
d.style.backgroundColor=bk;
for(i=1;i<=lim;i++){
    var x=CreateEl("b");
    x.className=cn + i;
    x.style.backgroundColor=color;
    if(bc) x.style.borderColor=bc;
    d.appendChild(x);
    }
el.style.paddingTop=0;
el.insertBefore(d,el.firstChild);
}

function AddBottom(el,bk,color,bc,cn){
var i,lim=4,d=CreateEl("b");

if(cn.indexOf("s")>=0) lim=2;
if(bc) d.className="artop";
else d.className="rtop";
d.style.backgroundColor=bk;
for(i=lim;i>0;i--){
    var x=CreateEl("b");
    x.className=cn + i;
    x.style.backgroundColor=color;
    if(bc) x.style.borderColor=bc;
    d.appendChild(x);
    }
el.style.paddingBottom=0;
el.appendChild(d);
}

function CreateEl(x){
if(isXHTML) return(document.createElementNS('http://www.w3.org/1999/xhtml',x));
else return(document.createElement(x));
}

function getElementsBySelector(selector){
var i,selid="",selclass="",tag=selector,f,s=[],objlist=[];

if(selector.indexOf(" ")>0){  //descendant selector like "tag#id tag"
    s=selector.split(" ");
    var fs=s[0].split("#");
    if(fs.length==1) return(objlist);
    f=document.getElementById(fs[1]);
    if(f) return(f.getElementsByTagName(s[1]));
    return(objlist);
    }
if(selector.indexOf("#")>0){ //id selector like "tag#id"
    s=selector.split("#");
    tag=s[0];
    selid=s[1];
    }
if(selid!=""){
    f=document.getElementById(selid);
    if(f) objlist.push(f);
    return(objlist);
    }
if(selector.indexOf(".")>0){  //class selector like "tag.class"
    s=selector.split(".");
    tag=s[0];
    selclass=s[1];
    }
var v=document.getElementsByTagName(tag);  // tag selector like "tag"
if(selclass=="")
    return(v);
for(i=0;i<v.length;i++){
    if(v[i].className.indexOf(selclass)>=0){
        objlist.push(v[i]);
        }
    }
return(objlist);
}

function Mix(c1,c2){
var i,step1,step2,x,y,r=new Array(3);
if(c1.length==4)step1=1;
else step1=2;
if(c2.length==4) step2=1;
else step2=2;
for(i=0;i<3;i++){
    x=parseInt(c1.substr(1+step1*i,step1),16);
    if(step1==1) x=16*x+x;
    y=parseInt(c2.substr(1+step2*i,step2),16);
    if(step2==1) y=16*y+y;
    r[i]=Math.floor((x*50+y*50)/100);
    }
return("#"+r[0].toString(16)+r[1].toString(16)+r[2].toString(16));
} 
function PortalX_Modules_Shared_DoPrint(strPageTitle, strStyleSheets, strElementId, strBodyCssClass)
{
    var elementToPrint = document.getElementById(strElementId);
    if (!elementToPrint)
        return true;
    
    var cWidth = elementToPrint.clientWidth;
    var cHeight = elementToPrint.clientHeight;
    var wTop = ((screen.availHeight) - cHeight) / 2;
    var wLeft = ((screen.availWidth) - cWidth) / 2;
    
    var prtWnd = window.open('', '_blank', 'scrollbars=yes,resizable=1,top=' + wTop + ',left=' + wLeft + ',width=' + cWidth + ',height=' + cHeight);
    
    if (!prtWnd)
        return true;
        
   prtWnd.document.write(
    '<html>\n' +
    '<head>\n' +
    '<base href="http://' + document.domain + '" \/>\n' +
    '<title>' + strPageTitle + '<\/title>\n' +
    strStyleSheets +
    '<\/head>\n' +
    '<body class="' + strBodyCssClass + '">' +
    elementToPrint.innerHTML +
    '<\/body>' +
    '<\/html>\n'
   );
  
   prtWnd.document.close();
   prtWnd.focus();
   prtWnd.print();
   //prtWnd.close();
   
   return true;
} // end PortalX_Modules_Shared_DoPrint
// General

function isFirefox()
{
	return (navigator.userAgent.indexOf("Firefox") != -1);
}

function isIE()
{
	return (navigator.userAgent.indexOf("MSIE") != -1);
}

function escapeString(value)
{
	return value.replace("'", "\\'");
}

function deriveID(clientID, elementName)
{
	return clientID + "_" + elementName;
}

function evalSharedState(elementID)
{
	element = document.getElementById(elementID);
	
	return eval(String(element.value));
}

function associateObjectWithEvent(object, methodName)
{
	return (function(event) {event = event || window.event; return object[methodName] (event, this);})
}

function associateObjectWithMultiEvent(sourceElement, eventName, object, methodName)
{
	if (sourceElement.attachEvent)
	{
		sourceElement.attachEvent(eventName, associateObjectWithEvent(object, methodName));
	}
	else if (sourceElement.AttachEvent)
	{
		sourceElement.AttachEvent(eventName, associateObjectWithEvent(object, methodName));
	}
	else if (sourceElement.addEventListener)
	{
		if (eventName.indexOf("on") == 0)
		{
			eventName = eventName.substring(2);
		}
		
		sourceElement.addEventListener(eventName, associateObjectWithEvent(object, methodName), false);
	}
}

function cancelEventBubble(evt)
{
	evt.cancelBubble = true;
	
	if (evt.stopPropagation)
	{
		evt.stopPropagation();
	}
}

function getObjectByID(ID)
{
	try
	{
		instance = $find(ID);
		if(instance==null)
		{
		instance = window[ID];
		}
	}
	catch(e)
	{
		instance = null;
	}
	
	return instance;
}

function isInElement(element, container)
{
	inElement = (element == container);
	
	if (!inElement)
	{
		owner = element.parentNode;
		
		while (owner != null)
		{
			inElement = (owner == container);
			 
			if (inElement)
			{
				owner = null;
			}
			else
			{
				owner = owner.parentNode;
			}
		}
	}
	
	return inElement;
}

function getElementLocation(element) 
{
	elementLeft = element.offsetLeft;
	elementTop = element.offsetTop;
	
	if (element.offsetParent != null) 
	{		
		while (element = element.offsetParent) 
		{
			elementLeft += element.offsetLeft;
			elementTop += element.offsetTop;
		}
	}
	
	return [elementLeft, elementTop];
}

function elementHasMarkerClass(element)
{
	markerClassName = "ribbonPart";
	hasMarker = (element.className.indexOf(markerClassName) != -1);
		
	return hasMarker;
}


// Global Information

function RibbonInfo()
{
	this.applicationBar = null;
	this.activeButton = null;
	this.activeGroup = null;
	this.openGroup = null;
}

RibbonInfo.getApplicationBar = function()
{
	return this.applicationBar;
}

RibbonInfo.setApplicationBar = function(applicationBar)
{
	this.applicationBar = applicationBar;
}

RibbonInfo.getActiveButton = function()
{
	return this.activeButton;
}

RibbonInfo.setActiveButton = function(button)
{
	this.activeButton = button;
}

RibbonInfo.getActiveGroup = function()
{
	return this.activeGroup;
}

RibbonInfo.setActiveGroup = function(group)
{
	this.activeGroup = group;
}

RibbonInfo.getOpenGroup = function()
{
	return this.openGroup;
}

RibbonInfo.setOpenGroup = function(group)
{
	this.openGroup = group;
}


// Ribbon Resizing Manager

function RibbonResizingManager(clientID)
{
	this.clientID = clientID;
	this.sharedStateID = deriveID(clientID, "SharedState");
	this.windowWidth = 0;
	
	//this.refreshSharedState();
	
	associateObjectWithMultiEvent(window, "onresize", this, "windowResized");
	
	
	this._resizeLoadHandler = Function.createDelegate(this,this.initialCall);
	Sys.Application.add_load(this._resizeLoadHandler)
	
}

RibbonResizingManager.prototype.initialCall = function() 
{ 
	this.refreshSharedState();
	this.windowResized();
	this.expandCollapseGroups();
}
RibbonResizingManager.prototype.getApplicationBarID = function() 
{ 
	return String(this.sharedState[0]); 
}

RibbonResizingManager.prototype.getApplicationMenuID = function() 
{ 
	return String(this.sharedState[1]); 
}

RibbonResizingManager.prototype.getRibbonTabStripID = function() 
{ 
	return String(this.sharedState[2]);
}

RibbonResizingManager.prototype.getRibbonMultiPageViewID = function()
{
	return String(this.sharedState[3]); 
}

RibbonResizingManager.prototype.getMinimumRibbonWidth = function() 
{
	return Number(this.sharedState[4]);
}

RibbonResizingManager.prototype.getRibbonHidden = function() 
{
	return Boolean(this.sharedState[5]);
}

RibbonResizingManager.prototype.setRibbonHidden = function(hidden) 
{
	this.sharedState[5] = hidden;
	this.updateSharedState();
	
	if (RibbonInfo.getOpenGroup() != null)
	{
		RibbonInfo.getOpenGroup().setOpen(false);
	}
	
	this.setAppearance();
}

RibbonResizingManager.prototype.getControlSet = function() 
{ 
	return String(this.sharedState[6]); 
}

RibbonResizingManager.prototype.expandCollapseGroups = function() 
{ 
	for (tabIndex = 0; tabIndex < this.tabsInfo.length; tabIndex++)
	{
		tabInfo = this.tabsInfo[tabIndex];
		
		for (groupsIndex = 0; groupsIndex < tabInfo.length; groupsIndex++)
		{
			windowWidth = document.documentElement.clientWidth;
			groupInfo = tabInfo[groupsIndex];
			groupID = groupInfo[0];
			group = getObjectByID(groupID);
			transitionWidth = groupInfo[3];
			expand = !(windowWidth < transitionWidth);
			
			group.setExpanded(expand);
		}
	}
}

RibbonResizingManager.prototype.lockWindowWidth = function(windowWidth)
{
	elementID = document.forms[0].id;
	element = document.getElementById(elementID);
	
	element.style.minWidth = windowWidth + "px";
}

RibbonResizingManager.prototype.windowResized = function() 
{ 	
	windowWidth = document.documentElement.clientWidth;
	
	if (windowWidth != this.windowWidth)
	{
		this.windowWidth = windowWidth;
		this.expandCollapseGroups();
		
		if (!isIE())
		{
			this.lockWindowWidth(windowWidth);
		}
	}
	
	hide = (windowWidth <= this.getMinimumRibbonWidth());
	
	if (hide != this.getRibbonHidden())
	{
		this.setRibbonHidden(hide);
	}
	
	RibbonInfo.getApplicationBar().refresh();
	
	if (RibbonInfo.getOpenGroup() != null)
	{
		RibbonInfo.getOpenGroup().refresh();
	}
}

RibbonResizingManager.prototype.refresh = function()
{
	this.setAppearance();
}

RibbonResizingManager.prototype.setAppearance = function()
{
	applicationBarElement = document.getElementById(this.getApplicationBarID());
	applicationMenuElement = document.getElementById(this.getApplicationMenuID());
	ribbonTabStripElement = document.getElementById(this.getRibbonTabStripID());
	ribbonMultiPageViewElement = document.getElementById(this.getRibbonMultiPageViewID());
	
	if (this.getRibbonHidden())
	{
		applicationBarElement.style.display = "none";
		applicationMenuElement.style.display = "none";
		ribbonTabStripElement.style.display = "none";
		ribbonMultiPageViewElement.style.display = "none";
	}
	else
	{
		applicationBarElement.style.display = "block";
		applicationMenuElement.style.display = "block";
		ribbonTabStripElement.style.display = "block";
		ribbonMultiPageViewElement.style.display = "block";
	}
}

RibbonResizingManager.prototype.refreshSharedState = function()
{
	this.sharedState = evalSharedState(this.sharedStateID);
	this.tabStrip = getObjectByID(this.getRibbonTabStripID());

	controlsInfo = eval(this.getControlSet());
	tabIndex = 0;
	index = 0;
	
	tabCount = this.tabStrip.get_allTabs().length;
	this.tabsInfo = new Array(tabCount);
	
	while (index < controlsInfo.length)
	{
		numberOfItems = controlsInfo[index++];
		groupsInfo = new Array(numberOfItems);
		
		for (groupIndex = 0; groupIndex < numberOfItems; groupIndex++)
		{
			groupID = controlsInfo[index++];
			expandedWidth = controlsInfo[index++];
			collapsedWidth = controlsInfo[index++];
			transitionWidth = controlsInfo[index++];
			
			groupInfo = new Array(5);
			groupInfo[0] = groupID;
			groupInfo[1] = expandedWidth;
			groupInfo[2] = collapsedWidth;
			groupInfo[3] = transitionWidth;
			
			groupsInfo[groupIndex] = groupInfo;
		}
		
		this.tabsInfo[tabIndex] = groupsInfo;
		
		tabIndex++;
	}
}

RibbonResizingManager.prototype.updateSharedState = function() 
{ 
	value = "['" + escapeString(this.sharedState[0]) + "','" + escapeString(this.sharedState[1]) + "','" + escapeString(this.sharedState[2]) + "','" + escapeString(this.sharedState[3]) + "'," + this.sharedState[4] + "," + this.sharedState[5] + ",'" + this.sharedState[6] + "']"; 
	document.getElementById(this.sharedStateID).value = value; 
}


// Application Bar

function ApplicationBar(clientID)
{
	this.clientID = clientID;
	this.sharedStateID = deriveID(clientID, "SharedState");
	this.textID = deriveID(clientID, "Text");
	this.tabStrip = null;
	
//	this.refreshSharedState();
	
	associateObjectWithMultiEvent(window, "onresize", this, "windowResized");
	associateObjectWithMultiEvent(document, "onclick", this, "dismissRibbon");
	
	this.windowResized();
	
	RibbonInfo.setApplicationBar(this);
	
	this._applicationLoadHandler = Function.createDelegate(this,this.refreshSharedState);
	Sys.Application.add_load(this._applicationLoadHandler)
	

}

ApplicationBar.prototype.attachTabStripEventHandler = function()
{
	this.tabStrip = getObjectByID(this.getRibbonTabStripID());

	if (this.tabStrip != null)
	{
	    var applicationBar = this;
		this.tabStrip.add_tabSelected(function () { applicationBar.tabSelected() });
	}
}

ApplicationBar.prototype.getApplicationName = function() 
{ 
	return String(this.sharedState[0]); 
}

ApplicationBar.prototype.setApplicationName = function(name) 
{ 
	this.sharedState[0] = name; 
	this.updateSharedState(); 
	this.refresh();
}

ApplicationBar.prototype.getDocumentName = function() 
{ 
	return String(this.sharedState[1]); 
}

ApplicationBar.prototype.setDocumentName = function(name) 
{ 
	this.sharedState[1] = name; 
	this.updateSharedState(); 
	this.refresh();
}

ApplicationBar.prototype.getApplicationMenuID = function() 
{ 
	return String(this.sharedState[2]); 
}

ApplicationBar.prototype.getRibbonTabStripID = function() 
{ 
	return String(this.sharedState[3]); 
}

ApplicationBar.prototype.getRibbonMultiPageViewID = function() 
{ 
	return String(this.sharedState[4]); 
}

ApplicationBar.prototype.getCustomizeMenuID = function() 
{ 
	return String(this.sharedState[5]); 
}

ApplicationBar.prototype.getMinimizeRibbon = function() 
{ 
	return Boolean(this.sharedState[6]); 
}

ApplicationBar.prototype.setMinimizeRibbon = function(minimize) 
{ 
	this.setRibbonOpen(!minimize);	
	this.sharedState[6] = minimize; 
	this.updateSharedState(); 
	this.setAppearance();
}

ApplicationBar.prototype.getRibbonOpen = function() 
{ 
	return Boolean(this.sharedState[7]); 
}

ApplicationBar.prototype.setRibbonOpen = function(open) 
{ 
	this.sharedState[7] = open; 
	this.updateSharedState(); 
}

ApplicationBar.prototype.getOriginallySelectedTabIndex = function()
{
	return Number(this.sharedState[8]); 
}

ApplicationBar.prototype.getOriginallySelectedTab = function()
{
	tab = null;
	
	if (this.tabStrip != null)
	{
		tab = this.tabStrip.get_allTabs()[this.getOriginallySelectedTabIndex()];
	}
	
	return tab;
}

ApplicationBar.prototype.setOriginallySelectedTab = function(tab)
{
 	index = -1;
	
	if (tab != null)
	{
		index = tab.get_index();
	}
	
	this.sharedState[8] = index;
	this.updateSharedState();
}

ApplicationBar.prototype.refresh = function() 
{
	text = ""; 
	applicationName = this.getApplicationName(); 
	documentName = this.getDocumentName(); 

	if ((documentName != null) && (documentName != "")) 
	{
		text += documentName;
	}
	
	if ((documentName != null) && (documentName != "") && (applicationName != null) && (applicationName != "")) 
	{
		text += " - ";
	}
	
	if ((applicationName != null) && (applicationName != "")) 
	{ 
		text += applicationName; 
	} 
	
	document.getElementById(this.textID).innerHTML = text; 
	
	this.setAppearance();
}

ApplicationBar.prototype.showRibbon = function()
{
	this.setRibbonOpen(true);
	this.updateSharedState(); 
	this.setAppearance();
}

ApplicationBar.prototype.hideRibbon = function()
{
	if (this.getMinimizeRibbon())
	{
		this.setRibbonOpen(false);
		this.updateSharedState(); 
		this.setAppearance();
	}
}

ApplicationBar.prototype.showCustomizeMenu = function(evt) 
{		
	menu = getObjectByID(this.getCustomizeMenuID());

	if ((menu != null) && ((!evt.relatedTarget) || (!menu.IsChildOf(menu.get_element(), evt.relatedTarget))))
	{
		menu.show(evt);
	}
	
	cancelEventBubble(evt);
}

ApplicationBar.prototype.setAppearance = function()
{
	if (this.tabStrip != null)
	{
		if (this.getMinimizeRibbon())
		{
			tab = this.tabStrip.get_selectedTab();
			
			if (tab == null)
			{
				tab = this.getOriginallySelectedTab();
			}
		
			if (tab != null)
			{
				multiPageView = document.getElementById(this.getRibbonMultiPageViewID());
				
				if (this.getRibbonOpen())
				{					
					multiPageView.className = "ribbonBarFloat";



				}
				else
				{	
					this.setOriginallySelectedTab(tab);
					
					tab.set_selected(false);
					multiPageView.className = "ribbonBarClosed";					
				}
			}
		}
		else
		{
			originallySelectedTab = this.getOriginallySelectedTab();
			
			if (originallySelectedTab != null)
			{
				multiPageView = document.getElementById(this.getRibbonMultiPageViewID());
				
				multiPageView.className = "ribbonBar";
				originallySelectedTab.select();
			}
		}
	}
}

ApplicationBar.prototype.windowResized = function() 
{ 	
	this.setAppearance();
}

ApplicationBar.prototype.tabSelected = function(sender, eventArgs)
{
	if ((this.getMinimizeRibbon()) && (!this.getRibbonOpen()))
	{
		this.showRibbon();
	}
	
	this.setOriginallySelectedTab(this.tabStrip.get_selectedTab());
}

ApplicationBar.prototype.dismissRibbon = function(evt)
{
	if ((this.isClickAway(evt)) && (this.getMinimizeRibbon()) && (this.getRibbonOpen()))
	{
		this.hideRibbon();
	}
}

ApplicationBar.prototype.isClickAway = function(evt)
{	
	clickedAway = false;
	tabStripId = this.getRibbonTabStripID();
	
	if ((tabStripId != null) && (this.tabStrip != null))
	{
		tabStripElement = document.getElementById(tabStripId);
		tab = this.tabStrip.get_selectedTab();
		
		if (tab != null)
		{
			eventTarget = (typeof(evt.target) != 'undefined') ? evt.target : evt.srcElement;  // FF:IE
			clickedOn = this.isPartOfRibbon(eventTarget, tabStripElement);
			clickedAway = !clickedOn;
		}
	}
	
	return clickedAway;
}

ApplicationBar.prototype.isPartOfRibbon = function(eventTarget, tabStripElement)
{	
	isRibbonPart = ((isInElement(eventTarget, tabStripElement)) || 
		(elementHasMarkerClass(eventTarget)));
	
	return isRibbonPart;
}

ApplicationBar.prototype.refreshSharedState = function()
{
	this.sharedState = evalSharedState(this.sharedStateID);
	this.attachTabStripEventHandler();
}

ApplicationBar.prototype.updateSharedState = function() 
{ 
	value = "['" + escapeString(this.sharedState[0]) + "','" + escapeString(this.sharedState[1]) + "','" + escapeString(this.sharedState[2]) + "','" + escapeString(this.sharedState[3]) + "','" + escapeString(this.sharedState[4]) + "','" + escapeString(this.sharedState[5]) + "'," + this.sharedState[6] + "," + this.sharedState[7] + "," + this.sharedState[8] + "]"; 
	document.getElementById(this.sharedStateID).value = value; 
}


// Quick Access Ribbon Button

function QuickAccessRibbonButton(clientID)
{
	this.clientID = clientID;
	this.sharedStateID = deriveID(clientID, "SharedState");
	this.imageID = deriveID(clientID, "Image");
	
	this.refreshSharedState();
	
	element = document.getElementById(this.clientID);
	associateObjectWithMultiEvent(element, "onmouseover", this, "mouseOver");
	associateObjectWithMultiEvent(element, "onmouseout", this, "mouseOut");
}

QuickAccessRibbonButton.prototype.mouseOver = function(event, element) 
{ 
	this.setAppearance(true);
	RibbonInfo.setActiveButton(this);
}

QuickAccessRibbonButton.prototype.mouseOut = function(event, element) 
{ 
	this.setAppearance(false);
	RibbonInfo.setActiveButton(null);
}	
	
QuickAccessRibbonButton.prototype.getEnabled = function() 
{ 
	return Boolean(this.sharedState[0]);
}

QuickAccessRibbonButton.prototype.setEnabled = function(enabled) 
{ 
	this.sharedState[0] = enabled; 
	this.updateSharedState(); 	
	this.setAppearance(false);
}

QuickAccessRibbonButton.prototype.getChecked = function() 
{ 
	return Boolean(this.sharedState[1]); 
}

QuickAccessRibbonButton.prototype.setChecked = function(checked) 
{ 
	this.sharedState[1] = checked; 
	this.updateSharedState(); 	
	this.setAppearance(false);
}

QuickAccessRibbonButton.prototype.getEnabledImageUrl = function() 
{ 
	return String(this.sharedState[2]); 
}

QuickAccessRibbonButton.prototype.getDisabledImageUrl = function() 
{ 
	return String(this.sharedState[3]); 
}

QuickAccessRibbonButton.prototype.refresh = function()
{
	this.setAppearance(false);
}

QuickAccessRibbonButton.prototype.setAppearance = function(over)
{ 
	element = document.getElementById(this.clientID);
	imageElement = document.getElementById(this.imageID);
	
	enabled = this.getEnabled();
	checked = this.getChecked();
	
	if ((enabled) && (over))
	{
		element.className = "quickAccessButtonHover";
	}
	else if ((enabled) && (checked))
	{
		element.className = "quickAccessButtonChecked";
	}
	else
	{
		element.className = "quickAccessButton";
	}
	
	if (enabled)
	{
		imageElement.src = this.getEnabledImageUrl();
	}
	else
	{
		imageElement.src = this.getDisabledImageUrl();
	}
}

QuickAccessRibbonButton.prototype.refreshSharedState = function()
{ 
	this.sharedState = evalSharedState(this.sharedStateID);
}

QuickAccessRibbonButton.prototype.updateSharedState = function() 
{ 
	value = "[" + this.sharedState[0] + "," + this.sharedState[1] + ",'" + escapeString(this.sharedState[2]) + "','" + escapeString(this.sharedState[3]) + "']"; 
	document.getElementById(this.sharedStateID).value = value; 
}


// Ribbon Group

function RibbonGroup(clientID)
{
	this.clientID = clientID;
	this.sharedStateID = deriveID(clientID, "SharedState");
	this.expandedID = deriveID(clientID, "E");
	this.expandedStartID = deriveID(clientID, "EStart");
	this.expandedItemID = deriveID(clientID, "EItem");
	this.expandedEndID = deriveID(clientID, "EEnd");
	this.expandedTextID = deriveID(clientID, "EText");
	this.collapsedID = deriveID(clientID, "C");
	this.collapsedStartID = deriveID(clientID, "CStart");
	this.collapsedItemID = deriveID(clientID, "CItem");
	this.collapsedEndID = deriveID(clientID, "CEnd");
	this.collapsedImageContainerID = deriveID(clientID, "CImageContainer");
	this.collapsedTextID = deriveID(clientID, "CText");
		
	this.refreshSharedState();
	
	associateObjectWithMultiEvent(document, "onclick", this, "dismissGroup");
	
//	expandedElement = document.getElementById(this.expandedID);
//	associateObjectWithMultiEvent(expandedElement, "onmouseover", this, "mouseOver");
//	associateObjectWithMultiEvent(expandedElement, "onmouseout", this, "mouseOut");
	
//	collapsedElement = document.getElementById(this.collapsedID);
//	associateObjectWithMultiEvent(collapsedElement, "onmouseover", this, "mouseOver");
//	associateObjectWithMultiEvent(collapsedElement, "onmouseout", this, "mouseOut");
}

RibbonGroup.prototype.mouseOver = function(event, element) 
{ 
	this.setAppearance(true);
	RibbonInfo.setActiveGroup(this);
}

RibbonGroup.prototype.mouseOut = function(event, element) 
{ 
	this.setAppearance(false);
	RibbonInfo.setActiveGroup(null);
}	
	
RibbonGroup.prototype.getText = function() 
{ 
	return String(this.sharedState[0]); 
}

RibbonGroup.prototype.setText = function(text) 
{ 
	this.sharedState[0] = text;
	this.updateSharedState();
	this.setAppearance(false);
}

RibbonGroup.prototype.getExpandedWidth = function()
{
	return Number(this.sharedState[1]);
}

RibbonGroup.prototype.getCollapsedWidth = function()
{
	return Number(this.sharedState[2]);
}

RibbonGroup.prototype.getExpanded = function() 
{ 
	return Boolean(this.sharedState[3]); 
}

RibbonGroup.prototype.setExpanded = function(expanded) 
{ 
	this.sharedState[3] = expanded;
	this.updateSharedState();
	
	if ((RibbonInfo.getOpenGroup() == this) && (expanded))
	{
		this.setOpen(false);
	}
	
	this.setAppearance(false);
}

RibbonGroup.prototype.getOpen = function() 
{
	return Boolean(this.sharedState[4]);
}

RibbonGroup.prototype.setOpen = function(open) 
{
	this.sharedState[4] = open;
	this.updateSharedState();

	openGroup = RibbonInfo.getOpenGroup();
	
	if ((openGroup != null) && (openGroup != this))
	{
		RibbonInfo.getOpenGroup().setOpen(false);
		RibbonInfo.setOpenGroup(null);
	}
	
	this.refresh();	
}

RibbonGroup.prototype.collapsedClicked = function(evt)
{
	this.setOpen(!this.getOpen());
	
	cancelEventBubble(evt);
}

RibbonGroup.prototype.dismissGroup = function(evt)
{
	if ((this.isClickAway(evt)) && (this.getOpen()))
	{
		this.setOpen(false);
		this.setAppearance(false);
		
		if (RibbonInfo.getActiveButton() != null)
		{
			RibbonInfo.getActiveButton().refresh();
			RibbonInfo.setActiveButton(null);
		}
	}
}

RibbonGroup.prototype.isClickAway = function(evt)
{	
	clickedAway = true;

	eventTarget = (typeof(evt.target) != 'undefined') ? evt.target : evt.srcElement;  // FF:IE
	expandedElement = document.getElementById(this.expandedID);
	
	if ((isInElement(eventTarget, expandedElement)) && (elementHasMarkerClass(eventTarget)))
	{
		clickedAway = false;
	}
	
	return clickedAway;
}

RibbonGroup.prototype.refresh = function()
{

	this.setAppearance(RibbonInfo.getActiveGroup() == this);
	
	expandedElement = document.getElementById(this.expandedID);
	collapsedElement = document.getElementById(this.collapsedID);
	
	if (this.getOpen())
	{
		windowWidth = document.documentElement.clientWidth;
		groupLocation = getElementLocation(collapsedElement);
		groupLeft = groupLocation[0] - 3;
		groupRight = groupLeft + this.getCollapsedWidth();
		groupWidth = this.getExpandedWidth();
		openLeft = groupLeft;
		openTop = groupLocation[1] + collapsedElement.offsetHeight - 3;
		
		if (groupLeft + groupWidth + 6 > windowWidth)
		{
			openLeft = groupRight - groupWidth;
			
			if (openLeft < 0)
			{
				openLeft = 0;
			}
		}
	
		expandedElement.className = "ribbonGroupFloat ribbonPart";
		expandedElement.style.left = openLeft + "px";
		expandedElement.style.top = openTop + "px";
		
		parentElement = document.forms[0];
		parentElement.appendChild(expandedElement);
		
		RibbonInfo.setOpenGroup(this);
	}
	else
	{
		expandedElement.className = "ribbonGroupContainer ribbonPart";
		
		parentElement = document.getElementById(this.clientID);
		parentElement.appendChild(expandedElement);
		
		RibbonInfo.setOpenGroup(null);
	}
}

RibbonGroup.prototype.setAppearance = function(over)
{	
	expandedElement = document.getElementById(this.expandedID);
	expandedStartElement = document.getElementById(this.expandedStartID);
	expandedItemElement = document.getElementById(this.expandedItemID);
	expandedEndElement = document.getElementById(this.expandedEndID);
	expandedTextElement = document.getElementById(this.expandedTextID);
	collapsedElement = document.getElementById(this.collapsedID);
	collapsedStartElement = document.getElementById(this.collapsedStartID);
	collapsedItemElement = document.getElementById(this.collapsedItemID);
	collapsedEndElement = document.getElementById(this.collapsedEndID);
	collapsedImageContanerElement = document.getElementById(this.collapsedImageContainerID);
	collapsedTextElement = document.getElementById(this.collapsedTextID);
	
	expandedTextElement.innerHTML = this.getText();
	collapsedTextElement.innerHTML = this.getText();
		
	if (over)
	{
		expandedStartElement.className = "ribbonGroupStartHover ribbonPart";
		expandedItemElement.className = "ribbonGroupItemHover ribbonPart";
		expandedEndElement.className = "ribbonGroupEndHover ribbonPart";
		
		collapsedStartElement.className = "ribbonGroupCollapsedStartHover ribbonPart";
		collapsedItemElement.className = "ribbonGroupCollapsedItemHover ribbonPart";
		collapsedEndElement.className = "ribbonGroupCollapsedEndHover ribbonPart";
		collapsedImageContanerElement.className = "ribbonGroupCollapsedImageContainerHover ribbonPart";
	}
	else
	{
		expandedStartElement.className = "ribbonGroupStart ribbonPart";
		expandedItemElement.className = "ribbonGroupItem ribbonPart";
		expandedEndElement.className = "ribbonGroupEnd ribbonPart";
		
		collapsedStartElement.className = "ribbonGroupCollapsedStart ribbonPart";
		collapsedItemElement.className = "ribbonGroupCollapsedItem ribbonPart";
		collapsedEndElement.className = "ribbonGroupCollapsedEnd ribbonPart";
		collapsedImageContanerElement.className = "ribbonGroupCollapsedImageContainer ribbonPart";	
	}		
		
	if (this.getExpanded())
	{
		expandedElement.style.display = "block";
		collapsedElement.style.display = "none";
	}
	else
	{
		expandedElement.style.display = "none";
		collapsedElement.style.display = "block";
	}
}

RibbonGroup.prototype.refreshSharedState = function()
{
	this.sharedState = evalSharedState(this.sharedStateID);
}

RibbonGroup.prototype.updateSharedState = function() 
{ 
	value = "['" + escapeString(this.sharedState[0]) + "'," + this.sharedState[1] + "," + this.sharedState[2] + "," + this.sharedState[3] + "," + this.sharedState[4] + "]"; 
	document.getElementById(this.sharedStateID).value = value; 
}


// Large Ribbon Button

function LargeRibbonButton(clientID)
{
	this.clientID = clientID;
	this.sharedStateID = deriveID(clientID, "SharedState");
	this.startID = deriveID(clientID, "Start");
	this.itemID = deriveID(clientID, "Item");
	this.endID = deriveID(clientID, "End");
	this.imageID = deriveID(clientID, "Image");
	this.dropDownImageID = deriveID(clientID, "DropDownMenuImage");
	this.textID = deriveID(clientID, "Text");
	
	this.refreshSharedState();
	
	element = document.getElementById(this.clientID);
	associateObjectWithMultiEvent(element, "onmouseover", this, "mouseOver");
	associateObjectWithMultiEvent(element, "onmouseout", this, "mouseOut");
}

LargeRibbonButton.prototype.mouseOver = function(event, element) 
{
	this.setAppearance(true);
	RibbonInfo.setActiveButton(this);	
}

LargeRibbonButton.prototype.mouseOut = function(event, element) 
{ 
	this.setAppearance(false);
	RibbonInfo.setActiveButton(null);
}

LargeRibbonButton.prototype.getEnabled = function() 
{ 
	return Boolean(this.sharedState[0]); 
}

LargeRibbonButton.prototype.setEnabled = function(enabled) 
{ 
	this.sharedState[0] = enabled; 
	this.updateSharedState(); 
	this.setAppearance(false);
}

LargeRibbonButton.prototype.getChecked = function() 
{ 
	return Boolean(this.sharedState[1]); 
}

LargeRibbonButton.prototype.setChecked = function(checked) 
{ 
	this.sharedState[1] = checked; 
	this.updateSharedState(); 	
	this.setAppearance(false);
}

LargeRibbonButton.prototype.getEnabledImageUrl = function() 
{ 
	return String(this.sharedState[2]); 
}

LargeRibbonButton.prototype.getDisabledImageUrl = function() 
{ 
	return String(this.sharedState[3]); 
}

LargeRibbonButton.prototype.getText = function() 
{ 
	return String(this.sharedState[4]); 
}

LargeRibbonButton.prototype.setText = function(text) 
{ 
	this.sharedState[4] = text;
	this.updateSharedState();
	this.setAppearance(false);
}

LargeRibbonButton.prototype.getDropDownMenuID = function() 
{ 
	return String(this.sharedState[5]); 
}

LargeRibbonButton.prototype.showDropDownMenu = function(evt) 
{		
	menu = getObjectByID(this.getDropDownMenuID());

	if ((!evt.relatedTarget) || (!menu.IsChildOf(menu.get_element(), evt.relatedTarget)))
	{
		menu.show(evt);
	}
	
	cancelEventBubble(evt);
}

LargeRibbonButton.prototype.refresh = function()
{
	this.setAppearance(false);
}

LargeRibbonButton.prototype.setAppearance = function(over)
{	
	imageElement = document.getElementById(this.imageID);
	textElement = document.getElementById(this.textID);
	dropDownImageElement = document.getElementById(this.dropDownImageID);
	startElement = document.getElementById(this.startID);
	itemElement = document.getElementById(this.itemID);
	endElement = document.getElementById(this.endID);
	
	enabled = this.getEnabled();
	checked = this.getChecked();
	
	textElement.innerHTML = this.getText();
	
	if (enabled)
	{
		imageElement.src = this.getEnabledImageUrl();
		textElement.className = "largeRibbonButtonText";
		
		if (dropDownImageElement != null)
		{
			dropDownImageElement.className = "largeRibbonButtonDropDownMenuArrow";
		}
	}
	else
	{
		imageElement.src = this.getDisabledImageUrl();
		textElement.className = "largeRibbonButtonTextDisabled";
		
		if (dropDownImageElement != null)
		{
			dropDownImageElement.className = "largeRibbonButtonDropDownMenuArrowDisabled";
		}
	}
	
	if ((enabled) && (over))
	{
		startElement.className = "largeRibbonButtonStartHover";
		itemElement.className = "largeRibbonButtonItemHover";
		endElement.className = "largeRibbonButtonEndHover";
	}
	else if ((enabled) && (checked))
	{
		startElement.className = "largeRibbonButtonStartChecked";
		itemElement.className = "largeRibbonButtonItemChecked";
		endElement.className = "largeRibbonButtonEndChecked";
	}
	else
	{
		startElement.className = "largeRibbonButtonStart";
		itemElement.className = "largeRibbonButtonItem";
		endElement.className = "largeRibbonButtonEnd";
	}
}

LargeRibbonButton.prototype.refreshSharedState = function()
{	
	this.sharedState = evalSharedState(this.sharedStateID);
}

LargeRibbonButton.prototype.updateSharedState = function() 
{ 
	value = "[" + this.sharedState[0] + "," + this.sharedState[1] + ",'" + escapeString(this.sharedState[2]) + "','" + escapeString(this.sharedState[3]) + "','" + escapeString(this.sharedState[4]) + "','" + escapeString(this.sharedState[5]) + "']";
	document.getElementById(this.sharedStateID).value = value; 
}


// Large Split Ribbon Button

function LargeSplitRibbonButton(clientID)
{
	this.clientID = clientID;
	this.sharedStateID = deriveID(clientID, "SharedState");
	this.topID = deriveID(clientID, "Top");
	this.topStartID = deriveID(clientID, "TopStart");
	this.topItemID = deriveID(clientID, "TopItem");
	this.topEndID = deriveID(clientID, "TopEnd");
	this.bottomID = deriveID(clientID, "Bottom");
	this.bottomStartID = deriveID(clientID, "BottomStart");
	this.bottomItemID = deriveID(clientID, "BottomItem");
	this.bottomEndID = deriveID(clientID, "BottomEnd");
	this.imageID = deriveID(clientID, "Image");
	this.dropDownImageID = deriveID(clientID, "DropDownMenuImage");
	this.textID = deriveID(clientID, "Text");
	
	this.refreshSharedState();
	
	topElement = document.getElementById(this.topID);
	bottomElement = document.getElementById(this.bottomID);
	associateObjectWithMultiEvent(topElement, "onmouseover", this, "mouseOverTop");
	associateObjectWithMultiEvent(topElement, "onmouseout", this, "mouseOut");
	associateObjectWithMultiEvent(bottomElement, "onmouseover", this, "mouseOverBottom");
	associateObjectWithMultiEvent(bottomElement, "onmouseout", this, "mouseOut");
}

LargeSplitRibbonButton.prototype.mouseOverTop = function(event, element) 
{ 
	this.setAppearance(true, true);
	RibbonInfo.setActiveButton(this);
}

LargeSplitRibbonButton.prototype.mouseOverBottom = function(event, element) 
{ 
	this.setAppearance(true, false);
	RibbonInfo.setActiveButton(this);
}

LargeSplitRibbonButton.prototype.mouseOut = function(event, element) 
{ 
	this.setAppearance(false, false);
	RibbonInfo.setActiveButton(null);
}

LargeSplitRibbonButton.prototype.getEnabled = function() 
{ 
	return Boolean(this.sharedState[0]); 
}

LargeSplitRibbonButton.prototype.setEnabled = function(enabled) 
{ 
	this.sharedState[0] = enabled; 
	this.updateSharedState(); 
	this.setAppearance(false, false);
}

LargeSplitRibbonButton.prototype.getChecked = function() 
{ 
	return Boolean(this.sharedState[1]); 
}

LargeSplitRibbonButton.prototype.getEnabledImageUrl = function() 
{ 
	return String(this.sharedState[2]); 
}

LargeSplitRibbonButton.prototype.getDisabledImageUrl = function() 
{ 
	return String(this.sharedState[3]); 
}

LargeSplitRibbonButton.prototype.getText = function() 
{ 
	return String(this.sharedState[4]); 
}

LargeSplitRibbonButton.prototype.setText = function(text) 
{ 
	this.sharedState[4] = text;
	this.updateSharedState();
	this.setAppearance(false, false);
}

LargeSplitRibbonButton.prototype.getDropDownMenuID = function() 
{ 
	return String(this.sharedState[5]); 
}

LargeSplitRibbonButton.prototype.showDropDownMenu = function(evt) 
{		
	menu = getObjectByID(this.getDropDownMenuID());

	if ((!evt.relatedTarget) || (!menu.IsChildOf(menu.DomElement, evt.relatedTarget)))
	{
		menu.show(evt);
	}
	
	cancelEventBubble(evt);
}

LargeSplitRibbonButton.prototype.refresh = function()
{
	this.setAppearance(false, false);
}

LargeSplitRibbonButton.prototype.setAppearance = function(over, top)
{	
	imageElement = document.getElementById(this.imageID);
	textElement = document.getElementById(this.textID);
	dropDownImageElement = document.getElementById(this.dropDownImageID);
	topStartElement = document.getElementById(this.topStartID);
	topItemElement = document.getElementById(this.topItemID);
	topEndElement = document.getElementById(this.topEndID);
	bottomStartElement = document.getElementById(this.bottomStartID);
	bottomItemElement = document.getElementById(this.bottomItemID);
	bottomEndElement = document.getElementById(this.bottomEndID);
	
	enabled = this.getEnabled();
	checked = this.getChecked();
	
	textElement.innerHTML = this.getText();
	
	if (enabled)
	{
		imageElement.src = this.getEnabledImageUrl();
		textElement.className = "largeSplitRibbonButtonText";
		
		dropDownImageElement.className = "largeSplitRibbonButtonDropDownMenuArrow";
	}
	else
	{
		imageElement.src = this.getDisabledImageUrl();
		textElement.className = "largeSplitRibbonButtonTextDisabled";
		
		dropDownImageElement.className = "largeSplitRibbonButtonDropDownMenuArrowDisabled";
	}
	
	if ((enabled) && (over))
	{
		if (top)
		{
			topStartElement.className = "largeSplitRibbonButtonTopStartHover";
			topItemElement.className = "largeSplitRibbonButtonTopItemHover";
			topEndElement.className = "largeSplitRibbonButtonTopEndHover";		
			bottomStartElement.className = "largeSplitRibbonButtonBottomStartHoverInactive";
			bottomItemElement.className = "largeSplitRibbonButtonBottomItemHoverInactive";
			bottomEndElement.className = "largeSplitRibbonButtonBottomEndHoverInactive";
		}
		else
		{
			topStartElement.className = "largeSplitRibbonButtonTopStartHoverInactive";
			topItemElement.className = "largeSplitRibbonButtonTopItemHoverInactive";
			topEndElement.className = "largeSplitRibbonButtonTopEndHoverInactive";	
			bottomStartElement.className = "largeSplitRibbonButtonBottomStartHover";
			bottomItemElement.className = "largeSplitRibbonButtonBottomItemHover";
			bottomEndElement.className = "largeSplitRibbonButtonBottomEndHover";
		}
	}
	else
	{
		topStartElement.className = "largeSplitRibbonButtonTopStart";
		topItemElement.className = "largeSplitRibbonButtonTopItem";
		topEndElement.className = "largeSplitRibbonButtonTopEnd";
		bottomStartElement.className = "largeSplitRibbonButtonBottomStart";
		bottomItemElement.className = "largeSplitRibbonButtonBottomItem";
		bottomEndElement.className = "largeSplitRibbonButtonBottomEnd";
	}
}

LargeSplitRibbonButton.prototype.refreshSharedState = function()
{	
	this.sharedState = evalSharedState(this.sharedStateID);
}

LargeSplitRibbonButton.prototype.updateSharedState = function() 
{ 
	value = "[" + this.sharedState[0] + "," + this.sharedState[1] + ",'" + escapeString(this.sharedState[2]) + "','" + escapeString(this.sharedState[3]) + "','" + escapeString(this.sharedState[4]) + "','" + escapeString(this.sharedState[5]) + "']";
	document.getElementById(this.sharedStateID).value = value; 
}
	

// Small Ribbon Button

function SmallRibbonButton(clientID)
{
	this.clientID = clientID;
	this.sharedStateID = deriveID(clientID, "SharedState");
	this.startID = deriveID(clientID, "Start");
	this.itemID = deriveID(clientID, "Item");
	this.endID = deriveID(clientID, "End");
	this.imageID = deriveID(clientID, "Image");
	this.dropDownImageID = deriveID(clientID, "DropDownMenuImage");
	this.textID = deriveID(clientID, "Text");
	
	this.refreshSharedState();
	
	element = document.getElementById(this.clientID);
	associateObjectWithMultiEvent(element, "onmouseover", this, "mouseOver");
	associateObjectWithMultiEvent(element, "onmouseout", this, "mouseOut");
}

SmallRibbonButton.prototype.mouseOver = function(event, element) 
{ 
	this.setAppearance(true);
	RibbonInfo.setActiveButton(this);
}

SmallRibbonButton.prototype.mouseOut = function(event, element) 
{ 
	this.setAppearance(false);
	RibbonInfo.setActiveButton(null);
}

SmallRibbonButton.prototype.getEnabled = function() 
{ 
	return Boolean(this.sharedState[0]); 
}

SmallRibbonButton.prototype.setEnabled = function(enabled) 
{ 
	this.sharedState[0] = enabled; 
	this.updateSharedState(); 
	this.setAppearance(false);
}

SmallRibbonButton.prototype.getChecked = function() 
{ 
	return Boolean(this.sharedState[1]); 
}

SmallRibbonButton.prototype.setChecked = function(checked) 
{ 
	this.sharedState[1] = checked; 
	this.updateSharedState(); 	
	this.setAppearance(false);
}

SmallRibbonButton.prototype.getEnabledImageUrl = function() 
{ 
	return String(this.sharedState[2]); 
}

SmallRibbonButton.prototype.getDisabledImageUrl = function() 
{ 
	return String(this.sharedState[3]); 
}

SmallRibbonButton.prototype.getText = function() 
{ 
	return String(this.sharedState[4]); 
}

SmallRibbonButton.prototype.setText = function(text) 
{ 
	this.sharedState[4] = text;
	this.updateSharedState();
	this.setAppearance(false);
}

SmallRibbonButton.prototype.getDropDownMenuID = function() 
{ 
	return String(this.sharedState[5]); 
}

SmallRibbonButton.prototype.showDropDownMenu = function(evt) 
{		
	menu = getObjectByID(this.getDropDownMenuID());

	if ((!evt.relatedTarget) || (!menu.IsChildOf(menu.get_element(), evt.relatedTarget)))
	{
		menu.show(evt);
	}
	
	cancelEventBubble(evt);
}

SmallRibbonButton.prototype.refresh = function()
{
	this.setAppearance(false);
}

SmallRibbonButton.prototype.setAppearance = function(over)
{	
	imageElement = document.getElementById(this.imageID);
	textElement = document.getElementById(this.textID);
	dropDownImageElement = document.getElementById(this.dropDownImageID);
	startElement = document.getElementById(this.startID);
	itemElement = document.getElementById(this.itemID);
	endElement = document.getElementById(this.endID);
	
	enabled = this.getEnabled();
	checked = this.getChecked();
	
	textElement.innerHTML = this.getText();
	
	if (enabled)
	{
		imageElement.src = this.getEnabledImageUrl();
		textElement.className = "smallRibbonButtonText";
		
		if (dropDownImageElement != null)
		{
			dropDownImageElement.className = "smallRibbonButtonDropDownMenuArrow";
		}
	}
	else
	{
		imageElement.src = this.getDisabledImageUrl();
		textElement.className = "smallRibbonButtonTextDisabled";
		
		if (dropDownImageElement != null)
		{
			dropDownImageElement.className = "smallRibbonButtonDropDownMenuArrowDisabled";
		}
	}
	
	if ((enabled) && (over))
	{
		startElement.className = "smallRibbonButtonStartHover";
		itemElement.className = "smallRibbonButtonItemHover";
		endElement.className = "smallRibbonButtonEndHover";
	}
	else if ((enabled) && (checked))
	{
		startElement.className = "smallRibbonButtonStartChecked";
		itemElement.className = "smallRibbonButtonItemChecked";
		endElement.className = "smallRibbonButtonEndChecked";
	}
	else
	{
		startElement.className = "smallRibbonButtonStart";
		itemElement.className = "smallRibbonButtonItem";
		endElement.className = "smallRibbonButtonEnd";
	}
}

SmallRibbonButton.prototype.refreshSharedState = function()
{	
	this.sharedState = evalSharedState(this.sharedStateID);
}

SmallRibbonButton.prototype.updateSharedState = function() 
{ 
	value = "[" + this.sharedState[0] + "," + this.sharedState[1] + ",'" + escapeString(this.sharedState[2]) + "','" + escapeString(this.sharedState[3]) + "','" + escapeString(this.sharedState[4]) + "','" + escapeString(this.sharedState[5]) + "']";
	document.getElementById(this.sharedStateID).value = value; 
}


// Small Split Ribbon Button

function SmallSplitRibbonButton(clientID)
{
	this.clientID = clientID;
	this.sharedStateID = deriveID(clientID, "SharedState");
	this.leftID = deriveID(clientID, "Left");
	this.leftStartID = deriveID(clientID, "LeftStart");
	this.leftItemID = deriveID(clientID, "LeftItem");
	this.rightID = deriveID(clientID, "Right");
	this.imageID = deriveID(clientID, "Image");
	this.textID = deriveID(clientID, "Text");
	
	this.refreshSharedState();
	
	leftElement = document.getElementById(this.leftID);
	rightElement = document.getElementById(this.rightID);
	associateObjectWithMultiEvent(leftElement, "onmouseover", this, "mouseOverLeft");
	associateObjectWithMultiEvent(leftElement, "onmouseout", this, "mouseOut");
	associateObjectWithMultiEvent(rightElement, "onmouseover", this, "mouseOverRight");
	associateObjectWithMultiEvent(rightElement, "onmouseout", this, "mouseOut");
}

SmallSplitRibbonButton.prototype.mouseOverLeft = function(event, element) 
{ 
	this.setAppearance(true, true);
	RibbonInfo.setActiveButton(this);
}

SmallSplitRibbonButton.prototype.mouseOverRight = function(event, element) 
{ 
	this.setAppearance(true, false);
	RibbonInfo.setActiveButton(this);
}

SmallSplitRibbonButton.prototype.mouseOut = function(event, element) 
{ 
	this.setAppearance(false, false);
	RibbonInfo.setActiveButton(null);
}

SmallSplitRibbonButton.prototype.getEnabled = function() 
{ 
	return Boolean(this.sharedState[0]); 
}

SmallSplitRibbonButton.prototype.setEnabled = function(enabled) 
{ 
	this.sharedState[0] = enabled; 
	this.updateSharedState(); 
	this.setAppearance(false, false);
}

SmallSplitRibbonButton.prototype.getChecked = function() 
{ 
	return Boolean(this.sharedState[1]); 
}

SmallSplitRibbonButton.prototype.getEnabledImageUrl = function() 
{ 
	return String(this.sharedState[2]); 
}

SmallSplitRibbonButton.prototype.getDisabledImageUrl = function() 
{ 
	return String(this.sharedState[3]); 
}

SmallSplitRibbonButton.prototype.getText = function() 
{ 
	return String(this.sharedState[4]); 
}

SmallSplitRibbonButton.prototype.setText = function(text) 
{ 
	this.sharedState[4] = text;
	this.updateSharedState();
	this.setAppearance(false, false);
}

SmallSplitRibbonButton.prototype.getDropDownMenuID = function() 
{ 
	return String(this.sharedState[5]); 
}

SmallSplitRibbonButton.prototype.showDropDownMenu = function(evt) 
{		
	menu = getObjectByID(this.getDropDownMenuID());

	if ((!evt.relatedTarget) || (!menu.IsChildOf(menu.DomElement, evt.relatedTarget)))
	{
		menu.show(evt);
	}
	
	cancelEventBubble(evt);
}

SmallSplitRibbonButton.prototype.refresh = function()
{
	this.setAppearance(false, false);
}

SmallSplitRibbonButton.prototype.setAppearance = function(over, left)
{	
	imageElement = document.getElementById(this.imageID);
	textElement = document.getElementById(this.textID);
	leftStartElement = document.getElementById(this.leftStartID);
	leftItemElement = document.getElementById(this.leftItemID);
	rightElement = document.getElementById(this.rightID);
	
	enabled = this.getEnabled();
	checked = this.getChecked();
	
	textElement.innerHTML = this.getText();
	
	if (enabled)
	{
		imageElement.src = this.getEnabledImageUrl();
		textElement.className = "smallSplitRibbonButtonText";
	}
	else
	{
		imageElement.src = this.getDisabledImageUrl();
		textElement.className = "smallSplitRibbonButtonTextDisabled";
	}
	
	if ((enabled) && (over))
	{
		if (left)
		{
			leftStartElement.className = "smallSplitRibbonButtonLeftStartHover";
			leftItemElement.className = "smallSplitRibbonButtonLeftItemHover";
			rightElement.className = "smallSplitRibbonButtonRightHoverInactive";
		}
		else
		{
			leftStartElement.className = "smallSplitRibbonButtonLeftStartHoverInactive";
			leftItemElement.className = "smallSplitRibbonButtonLeftItemHoverInactive";
			rightElement.className = "smallSplitRibbonButtonRightHover";
		}
	}
	else
	{
		leftStartElement.className = "smallSplitRibbonButtonLeftStart";
		leftItemElement.className = "smallSplitRibbonButtonLeftItem";
		
		if (enabled)
		{
			rightElement.className = "smallSplitRibbonButtonRight";
		}
		else
		{
			rightElement.className = "smallSplitRibbonButtonRightDisabled";
		}
	}
}

SmallSplitRibbonButton.prototype.refreshSharedState = function()
{	
	this.sharedState = evalSharedState(this.sharedStateID);
}

SmallSplitRibbonButton.prototype.updateSharedState = function() 
{ 
	value = "[" + this.sharedState[0] + "," + this.sharedState[1] + ",'" + escapeString(this.sharedState[2]) + "','" + escapeString(this.sharedState[3]) + "','" + escapeString(this.sharedState[4]) + "','" + escapeString(this.sharedState[5]) + "']";
	document.getElementById(this.sharedStateID).value = value; 
}
	
	
// Ribbon Separator

function RibbonSeparator(clientID)
{
	this.clientID = clientID;
}

// Adapted from Macromedia MM_preloadImages
function preloadImages(path) 
{ 
	d = document; 

	if (d.images)
	{ 
		if (!d.p)
		{
			d.p = new Array();
		}
		
		j = d.p.length;
		a = preloadImages.arguments; 
			
		for (i = 1; i < a.length; i++)
		{
			d.p[j] = new Image; 
			d.p[j++].src = path + a[i];
		}
	}
}

function preloadRibbonImages(path)
{
	preloadImages(path, 
		'ApplicationMenuActive.gif', 'ApplicationMenuHover.gif',
		'RibbonGroupStartHover.gif', 'RibbonGroupItemHover.gif', 'RibbonGroupEndHover.gif',
		'RibbonGroupCollapsedStartHover.gif', 'RibbonGroupCollapsedItemHover.gif', 'RibbonGroupCollapsedEndHover.gif', 'RibbonGroupCollapsedItemImageBackgroundHover.gif',
		'DialogLauncherHover.gif', 
		'QuickAccessButtonHover.gif', 'QuickAccessCustomizeButtonHover.gif', 
		'LargeRibbonButtonStartHover.gif', 'LargeRibbonButtonItemHover.gif', 'LargeRibbonButtonEndHover.gif',
		'SmallRibbonButtonStartHover.gif', 'SmallRibbonButtonItemHover.gif', 'SmallRibbonButtonEndHover.gif',
		'SmallSplitRibbonButtonLeftStartHover.gif', 'SmallSplitRibbonButtonLeftItemHover.gif', 'SmallSplitRibbonButtonRightHover.gif',
		'SmallSplitRibbonButtonLeftStartHoverInactive.gif', 'SmallSplitRibbonButtonLeftItemHoverInactive.gif', 'SmallSplitRibbonButtonRightHoverInactive.gif',
		'TabMiddleHover.gif');

	preloadImages(path,
		'RibbonGroupCollapsedItemImageBackground.gif',
		'DropDownMenuArrowDisabled.gif',
		'QuickAccessButtonChecked.gif',
		'LargeRibbonButtonStartChecked.gif', 'LargeRibbonButtonItemChecked.gif', 'LargeRibbonButtonEndChecked.gif',
		'SmallRibbonButtonStartChecked.gif', 'SmallRibbonButtonItemChecked.gif', 'SmallRibbonButtonEndChecked.gif',
		'SmallSplitRibbonButtonRightDisabled.gif');
}

/**
 * http://www.openjs.com/scripts/events/keyboard_shortcuts/
 * Version : 2.01.A
 * By Binny V A
 * License : BSD
 */
shortcut = {
	'all_shortcuts':{},//All the shortcuts are stored in this array
	'add': function(shortcut_combination,callback,opt) {
		//Provide a set of default options
		var default_options = {
			'type':'keydown',
			'propagate':false,
			'disable_in_input':false,
			'target':document,
			'keycode':false
		}
		if(!opt) opt = default_options;
		else {
			for(var dfo in default_options) {
				if(typeof opt[dfo] == 'undefined') opt[dfo] = default_options[dfo];
			}
		}

		var ele = opt.target
		if(typeof opt.target == 'string') ele = document.getElementById(opt.target);
		var ths = this;
		shortcut_combination = shortcut_combination.toLowerCase();

		//The function to be called at keypress
		var func = function(e) {
			e = e || window.event;
			
			if(opt['disable_in_input']) { //Don't enable shortcut keys in Input, Textarea fields
				var element;
				if(e.target) element=e.target;
				else if(e.srcElement) element=e.srcElement;
				if(element.nodeType==3) element=element.parentNode;

				if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return;
			}
	
			//Find Which key is pressed
			if (e.keyCode) code = e.keyCode;
			else if (e.which) code = e.which;
			var character = String.fromCharCode(code).toLowerCase();
			
			if(code == 188) character=","; //If the user presses , when the type is onkeydown
			if(code == 190) character="."; //If the user presses , when the type is onkeydown
	
			var keys = shortcut_combination.split("+");
			//Key Pressed - counts the number of valid keypresses - if it is same as the number of keys, the shortcut function is invoked
			var kp = 0;
			
			//Work around for stupid Shift key bug created by using lowercase - as a result the shift+num combination was broken
			var shift_nums = {
				"`":"~",
				"1":"!",
				"2":"@",
				"3":"#",
				"4":"$",
				"5":"%",
				"6":"^",
				"7":"&",
				"8":"*",
				"9":"(",
				"0":")",
				"-":"_",
				"=":"+",
				";":":",
				"'":"\"",
				",":"<",
				".":">",
				"/":"?",
				"\\":"|"
			}
			//Special Keys - and their codes
			var special_keys = {
				'esc':27,
				'escape':27,
				'tab':9,
				'space':32,
				'return':13,
				'enter':13,
				'backspace':8,
	
				'scrolllock':145,
				'scroll_lock':145,
				'scroll':145,
				'capslock':20,
				'caps_lock':20,
				'caps':20,
				'numlock':144,
				'num_lock':144,
				'num':144,
				
				'pause':19,
				'break':19,
				
				'insert':45,
				'home':36,
				'delete':46,
				'end':35,
				
				'pageup':33,
				'page_up':33,
				'pu':33,
	
				'pagedown':34,
				'page_down':34,
				'pd':34,
	
				'left':37,
				'up':38,
				'right':39,
				'down':40,
	
				'f1':112,
				'f2':113,
				'f3':114,
				'f4':115,
				'f5':116,
				'f6':117,
				'f7':118,
				'f8':119,
				'f9':120,
				'f10':121,
				'f11':122,
				'f12':123
			}
	
			var modifiers = { 
				shift: { wanted:false, pressed:false},
				ctrl : { wanted:false, pressed:false},
				alt  : { wanted:false, pressed:false},
				meta : { wanted:false, pressed:false}	//Meta is Mac specific
			};
                        
			if(e.ctrlKey)	modifiers.ctrl.pressed = true;
			if(e.shiftKey)	modifiers.shift.pressed = true;
			if(e.altKey)	modifiers.alt.pressed = true;
			if(e.metaKey)   modifiers.meta.pressed = true;
                        
			for(var i=0; k=keys[i],i<keys.length; i++) {
				//Modifiers
				if(k == 'ctrl' || k == 'control') {
					kp++;
					modifiers.ctrl.wanted = true;

				} else if(k == 'shift') {
					kp++;
					modifiers.shift.wanted = true;

				} else if(k == 'alt') {
					kp++;
					modifiers.alt.wanted = true;
				} else if(k == 'meta') {
					kp++;
					modifiers.meta.wanted = true;
				} else if(k.length > 1) { //If it is a special key
					if(special_keys[k] == code) kp++;
					
				} else if(opt['keycode']) {
					if(opt['keycode'] == code) kp++;

				} else { //The special keys did not match
					if(character == k) kp++;
					else {
						if(shift_nums[character] && e.shiftKey) { //Stupid Shift key bug created by using lowercase
							character = shift_nums[character]; 
							if(character == k) kp++;
						}
					}
				}
			}

			if(kp == keys.length && 
						modifiers.ctrl.pressed == modifiers.ctrl.wanted &&
						modifiers.shift.pressed == modifiers.shift.wanted &&
						modifiers.alt.pressed == modifiers.alt.wanted &&
						modifiers.meta.pressed == modifiers.meta.wanted) {
				callback(e);
	
				if(!opt['propagate']) { //Stop the event
					//e.cancelBubble is supported by IE - this will kill the bubbling process.
					e.cancelBubble = true;
					e.returnValue = false;
	
					//e.stopPropagation works in Firefox.
					if (e.stopPropagation) {
						e.stopPropagation();
						e.preventDefault();
					}
					return false;
				}
			}
		}
		this.all_shortcuts[shortcut_combination] = {
			'callback':func, 
			'target':ele, 
			'event': opt['type']
		};
		//Attach the function with the event
		if(ele.addEventListener) ele.addEventListener(opt['type'], func, false);
		else if(ele.attachEvent) ele.attachEvent('on'+opt['type'], func);
		else ele['on'+opt['type']] = func;
	},

	//Remove the shortcut - just specify the shortcut and I will remove the binding
	'remove':function(shortcut_combination) {
		shortcut_combination = shortcut_combination.toLowerCase();
		var binding = this.all_shortcuts[shortcut_combination];
		delete(this.all_shortcuts[shortcut_combination])
		if(!binding) return;
		var type = binding['event'];
		var ele = binding['target'];
		var callback = binding['callback'];

		if(ele.detachEvent) ele.detachEvent('on'+type, callback);
		else if(ele.removeEventListener) ele.removeEventListener(type, callback, false);
		else ele['on'+type] = false;
	}
}
function TelerikTemplatedMenu_OnClientLoad(sender)
{
    if (sender != null)
    {
        var menuWidth = sender.get_element().offsetWidth;
        var menuItems = 0;

        for (var i = 0; i < sender.get_items().get_count(); i ++)
        {
            if (sender.get_items().getItem(i).get_isSeparator())
            {
                var separatorElm = sender.get_items().getItem(i).get_element();
                menuWidth -= separatorElm.offsetWidth;
            }
            else
            {
                menuItems++;
            }
        } // end for
        
        var menuItemWidth = Math.floor(menuWidth / menuItems) - 1 + "px";
        
        for (var i = 0; i < sender.get_items().get_count(); i++)
        {
            if (!sender.get_items().getItem(i).get_isSeparator())
            {
                var itemElm = sender.get_items().getItem(i).get_element();
                itemElm.style.width = menuItemWidth;
            } // end if
        } // end for
    } // end if
} // end TelerikTemplatedMenu_OnClientLoad

var Page_ValidationVer = "125";
var Page_IsValid = true;
var Page_BlockSubmit = false;
var Page_InvalidControlToBeFocused = null;
function ValidatorUpdateDisplay(val) {
    if (typeof (val.display) == "string") {
        if (val.display == "None") {
            return;
        }
        if (val.display == "Dynamic") {
            val.style.display = val.isvalid ? "none" : "inline";
            return;
        }
    }
    if ((navigator.userAgent.indexOf("Mac") > -1) &&
        (navigator.userAgent.indexOf("MSIE") > -1)) {
        val.style.display = "inline";
    }
    val.style.visibility = val.isvalid ? "hidden" : "visible";
}
function ValidatorUpdateIsValid() {
    Page_IsValid = AllValidatorsValid(Page_Validators);
}
function AllValidatorsValid(validators) {
    if ((typeof (validators) != "undefined") && (validators != null)) {
        var i;
        for (i = 0; i < validators.length; i++) {
            if (!validators[i].isvalid) {
                return false;
            }
        }
    }
    return true;
}
function ValidatorHookupControlID(controlID, val) {
    if (typeof (controlID) != "string") {
        return;
    }
    var ctrl = document.getElementById(controlID);
    if ((typeof (ctrl) != "undefined") && (ctrl != null)) {
        ValidatorHookupControl(ctrl, val);
    }
    else {
        val.isvalid = true;
        val.enabled = false;
    }
}
function ValidatorHookupControl(control, val) {
    if (typeof (control.tagName) != "string") {
        return;
    }
    if (control.tagName != "INPUT" && control.tagName != "TEXTAREA" && control.tagName != "SELECT") {
        var i;
        for (i = 0; i < control.childNodes.length; i++) {
            ValidatorHookupControl(control.childNodes[i], val);
        }
        return;
    }
    else {
        if (typeof (control.Validators) == "undefined") {
            control.Validators = new Array;
            var eventType;
            if (control.type == "radio") {
                eventType = "onclick";
            } else {
                eventType = "onchange";
                if (typeof (val.focusOnError) == "string" && val.focusOnError == "t") {
                    ValidatorHookupEvent(control, "onblur", "ValidatedControlOnBlur(event); ");
                }
            }
            ValidatorHookupEvent(control, eventType, "ValidatorOnChange(event); ");
            if (control.type == "text" ||
                control.type == "password" ||
                control.type == "file") {
                ValidatorHookupEvent(control, "onkeypress",
                    "if (!ValidatedTextBoxOnKeyPress(event)) { event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation(); return false; } ");
            }
        }
        control.Validators[control.Validators.length] = val;
    }
}
function ValidatorHookupEvent(control, eventType, functionPrefix) {
    var ev;
    eval("ev = control." + eventType + ";");
    if (typeof (ev) == "function") {
        ev = ev.toString();
        ev = ev.substring(ev.indexOf("{") + 1, ev.lastIndexOf("}"));
    }
    else {
        ev = "";
    }
    var func;
    if (navigator.appName.toLowerCase().indexOf('explorer') > -1) {
        func = new Function(functionPrefix + " " + ev);
    }
    else {
        func = new Function("event", functionPrefix + " " + ev);
    }
    eval("control." + eventType + " = func;");
}
function ValidatorGetValue(id) {
    var control;
    control = document.getElementById(id);
    if (typeof (control.value) == "string") {
        return control.value;
    }
    return ValidatorGetValueRecursive(control);
}
function ValidatorGetValueRecursive(control) {
    if (typeof (control.value) == "string" && (control.type != "radio" || control.checked == true)) {
        return control.value;
    }
    var i, val;
    for (i = 0; i < control.childNodes.length; i++) {
        val = ValidatorGetValueRecursive(control.childNodes[i]);
        if (val != "") return val;
    }
    return "";
}
function Page_ClientValidate(validationGroup) {
    Page_InvalidControlToBeFocused = null;
    if (typeof (Page_Validators) == "undefined") {
        return true;
    }
    var i;
    for (i = 0; i < Page_Validators.length; i++) {
        ValidatorValidate(Page_Validators[i], validationGroup, null);
    }
    ValidatorUpdateIsValid();
    ValidationSummaryOnSubmit(validationGroup);
    Page_BlockSubmit = !Page_IsValid;
    return Page_IsValid;
}
function ValidatorCommonOnSubmit() {
    Page_InvalidControlToBeFocused = null;
    var result = !Page_BlockSubmit;
    if ((typeof (window.event) != "undefined") && (window.event != null)) {
        window.event.returnValue = result;
    }
    Page_BlockSubmit = false;
    return result;
}
function ValidatorEnable(val, enable) {
    val.enabled = (enable != false);
    ValidatorValidate(val);
    ValidatorUpdateIsValid();
}
function ValidatorOnChange(event) {
    if (!event) {
        event = window.event;
    }
    Page_InvalidControlToBeFocused = null;
    var targetedControl;
    if ((typeof (event.srcElement) != "undefined") && (event.srcElement != null)) {
        targetedControl = event.srcElement;
    }
    else {
        targetedControl = event.target;
    }
    var vals;
    if (typeof (targetedControl.Validators) != "undefined") {
        vals = targetedControl.Validators;
    }
    else {
        if (targetedControl.tagName.toLowerCase() == "label") {
            targetedControl = document.getElementById(targetedControl.htmlFor);
            vals = targetedControl.Validators;
        }
    }
    var i;
    for (i = 0; i < vals.length; i++) {
        ValidatorValidate(vals[i], null, event);
    }
    ValidatorUpdateIsValid();
}
function ValidatedTextBoxOnKeyPress(event) {
    if (event.keyCode == 13) {
        ValidatorOnChange(event);
        var vals;
        if ((typeof (event.srcElement) != "undefined") && (event.srcElement != null)) {
            vals = event.srcElement.Validators;
        }
        else {
            vals = event.target.Validators;
        }
        return AllValidatorsValid(vals);
    }
    return true;
}
function ValidatedControlOnBlur(event) {
    var control;
    if ((typeof (event.srcElement) != "undefined") && (event.srcElement != null)) {
        control = event.srcElement;
    }
    else {
        control = event.target;
    }
    if ((typeof (control) != "undefined") && (control != null) && (Page_InvalidControlToBeFocused == control)) {
        control.focus();
        Page_InvalidControlToBeFocused = null;
    }
}
function ValidatorValidate(val, validationGroup, event) {
    val.isvalid = true;
    if ((typeof (val.enabled) == "undefined" || val.enabled != false) && IsValidationGroupMatch(val, validationGroup)) {
        if (typeof (val.evaluationfunction) == "function") {
            val.isvalid = val.evaluationfunction(val);
            if (!val.isvalid && Page_InvalidControlToBeFocused == null &&
                typeof (val.focusOnError) == "string" && val.focusOnError == "t") {
                ValidatorSetFocus(val, event);
            }
        }
    }
    ValidatorUpdateDisplay(val);
}
function ValidatorSetFocus(val, event) {
    var ctrl;
    if (typeof (val.controlhookup) == "string") {
        var eventCtrl;
        if ((typeof (event) != "undefined") && (event != null)) {
            if ((typeof (event.srcElement) != "undefined") && (event.srcElement != null)) {
                eventCtrl = event.srcElement;
            }
            else {
                eventCtrl = event.target;
            }
        }
        if ((typeof (eventCtrl) != "undefined") && (eventCtrl != null) &&
            (typeof (eventCtrl.id) == "string") &&
            (eventCtrl.id == val.controlhookup)) {
            ctrl = eventCtrl;
        }
    }
    if ((typeof (ctrl) == "undefined") || (ctrl == null)) {
        ctrl = document.getElementById(val.controltovalidate);
    }
    if ((typeof (ctrl) != "undefined") && (ctrl != null) &&
        (ctrl.tagName.toLowerCase() != "table" || (typeof (event) == "undefined") || (event == null)) &&
        ((ctrl.tagName.toLowerCase() != "input") || (ctrl.type.toLowerCase() != "hidden")) &&
        (typeof (ctrl.disabled) == "undefined" || ctrl.disabled == null || ctrl.disabled == false) &&
        (typeof (ctrl.visible) == "undefined" || ctrl.visible == null || ctrl.visible != false) &&
        (IsInVisibleContainer(ctrl))) {
        if ((ctrl.tagName.toLowerCase() == "table" && (typeof (__nonMSDOMBrowser) == "undefined" || __nonMSDOMBrowser)) ||
            (ctrl.tagName.toLowerCase() == "span")) {
            var inputElements = ctrl.getElementsByTagName("input");
            var lastInputElement = inputElements[inputElements.length - 1];
            if (lastInputElement != null) {
                ctrl = lastInputElement;
            }
        }
        if (typeof (ctrl.focus) != "undefined" && ctrl.focus != null) {
            ctrl.focus();
            Page_InvalidControlToBeFocused = ctrl;
        }
    }
}
function IsInVisibleContainer(ctrl) {
    if (typeof (ctrl.style) != "undefined" &&
        ((typeof (ctrl.style.display) != "undefined" &&
            ctrl.style.display == "none") ||
          (typeof (ctrl.style.visibility) != "undefined" &&
            ctrl.style.visibility == "hidden"))) {
        return false;
    }
    else if (typeof (ctrl.parentNode) != "undefined" &&
             ctrl.parentNode != null &&
             ctrl.parentNode != ctrl) {
        return IsInVisibleContainer(ctrl.parentNode);
    }
    return true;
}
function IsValidationGroupMatch(control, validationGroup) {
    if ((typeof (validationGroup) == "undefined") || (validationGroup == null)) {
        return true;
    }
    var controlGroup = "";
    if (typeof (control.validationGroup) == "string") {
        controlGroup = control.validationGroup;
    }
    return (controlGroup == validationGroup);
}
function ValidatorOnLoad() {
    if (typeof (Page_Validators) == "undefined")
        return;
    var i, val;
    for (i = 0; i < Page_Validators.length; i++) {
        val = Page_Validators[i];
        if (typeof (val.evaluationfunction) == "string") {
            eval("val.evaluationfunction = " + val.evaluationfunction + ";");
        }
        if (typeof (val.isvalid) == "string") {
            if (val.isvalid == "False") {
                val.isvalid = false;
                Page_IsValid = false;
            }
            else {
                val.isvalid = true;
            }
        } else {
            val.isvalid = true;
        }
        if (typeof (val.enabled) == "string") {
            val.enabled = (val.enabled != "False");
        }
        if (typeof (val.controltovalidate) == "string") {
            ValidatorHookupControlID(val.controltovalidate, val);
        }
        if (typeof (val.controlhookup) == "string") {
            ValidatorHookupControlID(val.controlhookup, val);
        }
    }
    Page_ValidationActive = true;
}
function ValidatorConvert(op, dataType, val) {
    function GetFullYear(year) {
        var twoDigitCutoffYear = val.cutoffyear % 100;
        var cutoffYearCentury = val.cutoffyear - twoDigitCutoffYear;
        return ((year > twoDigitCutoffYear) ? (cutoffYearCentury - 100 + year) : (cutoffYearCentury + year));
    }
    var num, cleanInput, m, exp;
    if (dataType == "Integer") {
        exp = /^\s*[-\+]?\d+\s*$/;
        if (op.match(exp) == null)
            return null;
        num = parseInt(op, 10);
        return (isNaN(num) ? null : num);
    }
    else if (dataType == "Double") {
        exp = new RegExp("^\\s*([-\\+])?(\\d*)\\" + val.decimalchar + "?(\\d*)\\s*$");
        m = op.match(exp);
        if (m == null)
            return null;
        if (m[2].length == 0 && m[3].length == 0)
            return null;
        cleanInput = (m[1] != null ? m[1] : "") + (m[2].length > 0 ? m[2] : "0") + (m[3].length > 0 ? "." + m[3] : "");
        num = parseFloat(cleanInput);
        return (isNaN(num) ? null : num);
    }
    else if (dataType == "Currency") {
        var hasDigits = (val.digits > 0);
        var beginGroupSize, subsequentGroupSize;
        var groupSizeNum = parseInt(val.groupsize, 10);
        if (!isNaN(groupSizeNum) && groupSizeNum > 0) {
            beginGroupSize = "{1," + groupSizeNum + "}";
            subsequentGroupSize = "{" + groupSizeNum + "}";
        }
        else {
            beginGroupSize = subsequentGroupSize = "+";
        }
        exp = new RegExp("^\\s*([-\\+])?((\\d" + beginGroupSize + "(\\" + val.groupchar + "\\d" + subsequentGroupSize + ")+)|\\d*)"
                        + (hasDigits ? "\\" + val.decimalchar + "?(\\d{0," + val.digits + "})" : "")
                        + "\\s*$");
        m = op.match(exp);
        if (m == null)
            return null;
        if (m[2].length == 0 && hasDigits && m[5].length == 0)
            return null;
        cleanInput = (m[1] != null ? m[1] : "") + m[2].replace(new RegExp("(\\" + val.groupchar + ")", "g"), "") + ((hasDigits && m[5].length > 0) ? "." + m[5] : "");
        num = parseFloat(cleanInput);
        return (isNaN(num) ? null : num);
    }
    else if (dataType == "Date") {
        var yearFirstExp = new RegExp("^\\s*((\\d{4})|(\\d{2}))([-/]|\\. ?)(\\d{1,2})\\4(\\d{1,2})\\.?\\s*$");
        m = op.match(yearFirstExp);
        var day, month, year;
        if (m != null && (m[2].length == 4 || val.dateorder == "ymd")) {
            day = m[6];
            month = m[5];
            year = (m[2].length == 4) ? m[2] : GetFullYear(parseInt(m[3], 10))
        }
        else {
            if (val.dateorder == "ymd") {
                return null;
            }
            var yearLastExp = new RegExp("^\\s*(\\d{1,2})([-/]|\\. ?)(\\d{1,2})(?:\\s|\\2)((\\d{4})|(\\d{2}))(?:\\s\u0433\\.)?\\s*$");
            m = op.match(yearLastExp);
            if (m == null) {
                return null;
            }
            if (val.dateorder == "mdy") {
                day = m[3];
                month = m[1];
            }
            else {
                day = m[1];
                month = m[3];
            }
            year = (m[5].length == 4) ? m[5] : GetFullYear(parseInt(m[6], 10))
        }
        month -= 1;
        var date = new Date(year, month, day);
        if (year < 100) {
            date.setFullYear(year);
        }
        return (typeof (date) == "object" && year == date.getFullYear() && month == date.getMonth() && day == date.getDate()) ? date.valueOf() : null;
    }
    else {
        return op.toString();
    }
}
function ValidatorCompare(operand1, operand2, operator, val) {
    var dataType = val.type;
    var op1, op2;
    if ((op1 = ValidatorConvert(operand1, dataType, val)) == null)
        return false;
    if (operator == "DataTypeCheck")
        return true;
    if ((op2 = ValidatorConvert(operand2, dataType, val)) == null)
        return true;
    switch (operator) {
        case "NotEqual":
            return (op1 != op2);
        case "GreaterThan":
            return (op1 > op2);
        case "GreaterThanEqual":
            return (op1 >= op2);
        case "LessThan":
            return (op1 < op2);
        case "LessThanEqual":
            return (op1 <= op2);
        default:
            return (op1 == op2);
    }
}
function CompareValidatorEvaluateIsValid(val) {
    var value = ValidatorGetValue(val.controltovalidate);
    if (ValidatorTrim(value).length == 0)
        return true;
    var compareTo = "";
    if ((typeof (val.controltocompare) != "string") ||
        (typeof (document.getElementById(val.controltocompare)) == "undefined") ||
        (null == document.getElementById(val.controltocompare))) {
        if (typeof (val.valuetocompare) == "string") {
            compareTo = val.valuetocompare;
        }
    }
    else {
        compareTo = ValidatorGetValue(val.controltocompare);
    }
    var operator = "Equal";
    if (typeof (val.operator) == "string") {
        operator = val.operator;
    }
    return ValidatorCompare(value, compareTo, operator, val);
}
function CustomValidatorEvaluateIsValid(val) {
    var value = "";
    if (typeof (val.controltovalidate) == "string") {
        value = ValidatorGetValue(val.controltovalidate);
        if ((ValidatorTrim(value).length == 0) &&
            ((typeof (val.validateemptytext) != "string") || (val.validateemptytext != "true"))) {
            return true;
        }
    }
    var args = { Value: value, IsValid: true };
    if (typeof (val.clientvalidationfunction) == "string") {
        eval(val.clientvalidationfunction + "(val, args) ;");
    }
    return args.IsValid;
}
function RegularExpressionValidatorEvaluateIsValid(val) {
    var value = ValidatorGetValue(val.controltovalidate);
    if (ValidatorTrim(value).length == 0)
        return true;
    var rx = new RegExp(val.validationexpression);
    var matches = rx.exec(value);
    return (matches != null && value == matches[0]);
}
function ValidatorTrim(s) {
    var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);
    return (m == null) ? "" : m[1];
}
function RequiredFieldValidatorEvaluateIsValid(val) {
    return (ValidatorTrim(ValidatorGetValue(val.controltovalidate)) != ValidatorTrim(val.initialvalue))
}
function RangeValidatorEvaluateIsValid(val) {
    var value = ValidatorGetValue(val.controltovalidate);
    if (ValidatorTrim(value).length == 0)
        return true;
    return (ValidatorCompare(value, val.minimumvalue, "GreaterThanEqual", val) &&
            ValidatorCompare(value, val.maximumvalue, "LessThanEqual", val));
}
function ValidationSummaryOnSubmit(validationGroup) {
    if (typeof (Page_ValidationSummaries) == "undefined")
        return;
    var summary, sums, s;
    for (sums = 0; sums < Page_ValidationSummaries.length; sums++) {
        summary = Page_ValidationSummaries[sums];
        summary.style.display = "none";
        if (!Page_IsValid && IsValidationGroupMatch(summary, validationGroup)) {
            var i;
            if (summary.showsummary != "False") {
                summary.style.display = "";
                if (typeof (summary.displaymode) != "string") {
                    summary.displaymode = "BulletList";
                }
                switch (summary.displaymode) {
                    case "List":
                        headerSep = "<br>";
                        first = "";
                        pre = "";
                        post = "<br>";
                        end = "";
                        break;
                    case "BulletList":
                    default:
                        headerSep = "";
                        first = "<ul>";
                        pre = "<li>";
                        post = "</li>";
                        end = "</ul>";
                        break;
                    case "SingleParagraph":
                        headerSep = " ";
                        first = "";
                        pre = "";
                        post = " ";
                        end = "<br>";
                        break;
                }
                s = "";
                if (typeof (summary.headertext) == "string") {
                    s += summary.headertext + headerSep;
                }
                s += first;
                for (i = 0; i < Page_Validators.length; i++) {
                    if (!Page_Validators[i].isvalid && typeof (Page_Validators[i].errormessage) == "string") {
                        s += pre + Page_Validators[i].errormessage + post;
                    }
                }
                s += end;
                summary.innerHTML = s;
                window.scrollTo(0, 0);
            }
            if (summary.showmessagebox == "True") {
                s = "";
                if (typeof (summary.headertext) == "string") {
                    s += summary.headertext + "\r\n";
                }
                var lastValIndex = Page_Validators.length - 1;
                for (i = 0; i <= lastValIndex; i++) {
                    if (!Page_Validators[i].isvalid && typeof (Page_Validators[i].errormessage) == "string") {
                        switch (summary.displaymode) {
                            case "List":
                                s += Page_Validators[i].errormessage;
                                if (i < lastValIndex) {
                                    s += "\r\n";
                                }
                                break;
                            case "BulletList":
                            default:
                                s += "- " + Page_Validators[i].errormessage;
                                if (i < lastValIndex) {
                                    s += "\r\n";
                                }
                                break;
                            case "SingleParagraph":
                                s += Page_Validators[i].errormessage + " ";
                                break;
                        }
                    }
                }
                alert(s);
            }
        }
    }
}

/*
* ig_shared.js
* Version 8.2.20082.1000
* Copyright(c) 2001-2008 Infragistics, Inc. All Rights Reserved.
*/



//vs 050208
function ig_WebControl(id)
{
	if(arguments.length > 0){
		this.init(id);
	}
}
ig_WebControl.prototype.init=function(id)
{
	this._id=id;
	var o=ig_all[id];
	if(o && o._deleteMe)
		o._deleteMe();
	ig_all[id]=this;
	this._posted=this._postRequest=0;
	ig_shared._isPosted=false;
	// clientViewState
	this.postField = ig_csom.getElementById(this.getClientID() + "_Data");	
	this.clientState = ig_ClientState.createRootNode();	
	this.rootNode = ig_ClientState.addNode(this.clientState, "XMLRootNode");
}

ig_WebControl.prototype.constructor=ig_WebControl;
ig_WebControl.prototype.getElement=function(){return this._element;}
ig_WebControl.prototype.getID=function(){return this._id;}
ig_WebControl.prototype.getUniqueID=function(){return this._uniqueID;}
ig_WebControl.prototype.getClientID=function(){return this._clientID;}


ig_WebControl.prototype.updateControlState = function(propName, propValue) {
	if(this.controlState == null)
		this.controlState = ig_ClientState.addNode(this.rootNode, "ControlState");
		
	ig_ClientState.setPropertyValue(this.controlState, propName, propValue);
	if(this.postField != null)
		this.postField.value = ig_ClientState.getText(this.clientState);	
}

ig_WebControl.prototype.addStateItem  = function(name, value) {
	if(this.stateItems == null)
		this.stateItems = ig_ClientState.addNode(this.rootNode, "StateItems");
	var stateItem = ig_ClientState.addNode(this.stateItems, "StateItem");
	this.updateStateItem(stateItem, name, value);
	return stateItem;
}

ig_WebControl.prototype.updateStateItem = function(stateItem, propName, propValue) {
	ig_ClientState.setPropertyValue(stateItem, propName, propValue);
	if(this.postField != null)
		this.postField.value = ig_ClientState.getText(this.clientState);	
}

ig_WebControl.prototype.fireServerEvent = function(eventName, data)
{
	if(ig_shared._isPosted)
		return;
	if(this._postRequest == -1)
	{
		this._postRequest = 0;
		return;
	}
	this._postRequest = 0;
	try
	{
		ig_shared._isPosted = true;
		__doPostBack(this._uniqueID, eventName + ":" + data);
	}
	catch(e){}
}

ig_WebControl.prototype.removeEventListener = function(name, handler)
{
	var i, evts = this._clientEvents ? this._clientEvents[name] : null;
	if(evts != null) for(i = 0; i < evts.length; i++)
		if(evts[i] != null && evts[i]._handler == handler)
	{
		delete evts[i];
		evts[i] = null;
		return;
	}
}

ig_WebControl.prototype.addEventListener = function(name, handler, obj, post)
{
	if(typeof handler != "function")
		return;
	if(!this._clientEvents) this._clientEvents = new Object();
	var i, evts = this._clientEvents[name];
	if(evts == null)
		evts = this._clientEvents[name] = new Array();
	var i0 = evts.length;
	for(i = 0; i < evts.length; i++)
	{
		if(evts[i] == null)
			i0 = i;
		else if(evts[i]._handler == handler)
			return;
	}
	var evt = new ig_EventObject();
	evt._object = obj;
	evts[i0] = {_webcontrol:this, _eventName:name, _handler:handler, _autoPostBack:(post==true), _event:evt};
}

ig_WebControl.prototype.fireEvent = function(name, evnt)
{
	if(!name || this._isInitializing || !this._clientEvents)
		return false;
	this._postRequest = this._postAsync = 0;
	var evt, evts = this._clientEvents[name];
	var cancel = false, postAsync = 0, post = 0, i = (evts == null) ? 0 : evts.length;
	if(i == 0)
		return false;
	if(evnt == "check")
		return true;
	var args = this.fireEvent.arguments;
	while(i-- > 0)
	{
		if(evts[i] == null)
			continue;
		evt = evts[i]._event;
		evt.reset();
		evt.event=evnt;
		evt.needPostBack=evts[i]._autoPostBack;
		try
		{
			evts[i]._handler(this, evt, args[2], args[3], args[4], args[5], args[6], args[7]);
		}catch(ex){continue;}
		if(evt.cancelPostBack)
			post = -1;
		else if(post == 0)
		{
			if(evt.needPostBack)
				post = 1;
			else if(evt.needAsyncPostBack)
				postAsync = 1;
		}
		if(evt.cancel)
			cancel = true;
		evt.event = null;
	}
	if(!cancel || post < 0)
		this._postRequest = post;
	if(!cancel && post == 0)
		this._postAsync = postAsync;
	return cancel;
}
ig_WebControl.prototype._decodeProps	= function(props)
{
	for(var i = 0; i < props.length; i++)
	{
		if(props[i] != null)
		{
			if(props[i].push != null)
				this._decodeProps(props[i]);
			if(typeof props[i]=="string")
			{
					
					props[i] = decodeURI(props[i]);
					
					props[i] = unescape(props[i].replace(/\+/g," "));
					props[i] = unescape(props[i]);
			} 
		}
	}
}
ig_WebControl.prototype._initControlProps	= function(props)
{	
	this._decodeProps(props);
	this._props = props[0];
	this._uniqueID	= this._props[0];
	this._clientID = this._props[1];
	var i = props[1] ? props[1].length : 0;
	while(i-- > 0) try
	{
		this.addEventListener(props[1][i][0], eval(props[1][i][1]), null, props[1][i][2]);
	}catch(e)
	{window.status = "Can't find " + props[1][i][1];}
	this._objects = props[2];
	this._collections = props[3];
}	

//ig_initShared implements browser independent functionality
function ig_initShared()
{
	// Public Properties
	this.ScriptVersion="5.3.20053.14";
	try{this.AgentName=navigator.userAgent.toLowerCase();}catch(e){this.AgentName="";}
	this.MajorVersionNumber =parseInt(navigator.appVersion);
	//this.AgentName=navigator.userAgent.toLowerCase();
	//this.MajorVersionNumber=parseInt(navigator.appVersion);
	this.IsDom=document.getElementById?true:false;
	this.IsNetscape62=this.AgentName.indexOf("netscape6")>=0;
	var i=this.AgentName.indexOf("netscape/7.");
	this.Netscape7=(i>0)?this.AgentName.charCodeAt(i+11)-48:-1;
	this.IsNetscape=document.layers!=null;
	this.IsNetscape6=(this.IsDom&&navigator.appName=="Netscape");
	this.IsSafari=this.AgentName.indexOf("safari")>=0;
	this.IsFireFox=this.AgentName.indexOf("firefox")>=0;
	this.IsFireFox10=this.AgentName.indexOf("firefox/1.0")>=0;
	this.IsFireFox20=this.AgentName.indexOf("firefox/2.0")>=0;
	this.IsFireFox15=this.IsFireFox20||this.AgentName.indexOf("firefox/1.5")>=0;
	this.IsOpera=this.AgentName.indexOf("opera")>=0;
	this.IsMac=this.AgentName.indexOf("mac")>=0;
	this.IsIE=document.all!=null&&!this.IsOpera&&!this.IsSafari;
	this.IsIE4=this.IsIE&&!this.IsDom;
	this.IsIE4Plus=this.IsIE&&this.MajorVersionNumber>=4;
	this.IsIE5=this.IsIE&&this.IsDom;
	this.IsIE50=this.IsIE5&&this.AgentName.indexOf("msie 5.0")>0;
	this.IsWin=this.AgentName.indexOf("win")>=0;
	this.IsIEWin=this.IsIE&&this.IsWin;
	this.IsIE55=this.IsIEWin&&this.AgentName.indexOf("msie 5.5")>0;
	this.IsIE6=this.IsIEWin&&this.AgentName.indexOf("msie 6.0")>0;
	this.IsIE7=this.IsIEWin&&this.AgentName.indexOf("msie 7.0")>0;
	this.IsIE55Plus = this.IsIE55 || this.IsIE6 || this.IsIE7;
	this.IsStandardsMode=(document.compatMode=="CSS1Compat");
	this.attrID = "ig_mark";
	this._isPosted = false;
	this.isFormPosted = function(){return this._isPosted;}
	// Obtains an element object based on its Id
	this.getElementById = function (tagName)
	{
		if(this.IsIE)
			return document.all[tagName];
		else
			return document.getElementById(tagName);
	}

	this.isArray = function(a) {
		return a!=null && a.length!=null;
	}
	
	this.isEmpty = function(o) {
		return !(this.isArray(o) && o.length>0);
	}
	
	this.notEmpty = function(o) {
		return (this.isArray(o) && o.length>0);
	}
    //D.M. 8/15/2007
    //Return an elements current styles.
    this.getRuntimeStyle = function(elem)
    {
        if(!elem)
			return null;
		var s = elem.currentStyle;
		if(s)
			return s;
		var win = document.defaultView;
		if(!win)
			win = window;
		if(win.getComputedStyle)
			s = win.getComputedStyle(elem, '');
		return s ? s : elem.style;
    }
	this.getStyleValue = function(style, prop, elem)
	{
		if(!style)
			style = this.getRuntimeStyle(elem);
		if(!style)
			return null;
		var val = style[prop];
		if(!this.isEmpty(val) || !style.getPropertyValue)
			return val;
		return style.getPropertyValue(prop);
	}
	// Adds an event listener to an html element.
	this.addEventListener=function(elem,evtName,fn,flag)
	{ 
		
		try{if(elem.addEventListener){elem.addEventListener(evtName,fn,flag==true); return;}}catch(ex){}
		try{if(elem.attachEvent){elem.attachEvent("on"+evtName,fn); return;}}catch(ex){}
		eval("var old=elem.on"+evtName);
		var sF=fn.toString();
		var i=sF.indexOf("(")+1;
		try
		{
		if((typeof old =="function") && i>10)
		{
			old=old.toString();
			
			var args=old.substring(old.indexOf("(")+1,old.indexOf(")"));
			args=ig_shared.replace(args," ","");
			if(args.length>0) args=args.split(",");
			
			old=old.substring(old.indexOf("{")+1,old.lastIndexOf("}"));
			
			sF=sF.substring(9,i);
			if(old.indexOf(sF)>=0)return;
			var s="fn=new Function(";
			for(i=0;i<args.length;i++)
			{
				if(i>0)sF+=",";
				s+="\""+args[i]+"\",";
				sF+=args[i];
			}
			sF+=");"+old;
			eval(s+"sF)");
		}
		eval("elem.on"+evtName+"=fn");
		}catch(ex){}
	}

	
	this.removeEventListener = function(elem, evt, fn)
	{ 
		try
		{
			if(elem && elem.removeEventListener)
			{
				elem.removeEventListener(evt, fn);
				return;
			}
		}catch(ex){}
		try
		{
			if(elem && elem.detachEvent)
				elem.detachEvent('on' + evt, fn);
		}catch(ex){}
	}
	// Obtains the proper source element in relation to an event
	this.getSourceElement = function (evnt, o)
	{
		if(evnt.target) // This does not appear to be working for Netscape
			return evnt.target;
		else 
		if(evnt.srcElement)
			return evnt.srcElement;
		else
			return o;
	}
	
	this.getText = function (e){
		if(e==null)return "";
		var i,v=null,ii=(e.childNodes==null)?0:e.childNodes.length;
		for(i=-1;i<ii;i++)
		{
			var ei=(i<0)?e:e.childNodes[i];
			if(ei.nodeName=="#text")v=(v==null)?ei.nodeValue:v+" "+ei.nodeValue;
		}
		if(v!=null)return v;
		if((v=e.text)!=null)return v;
		try{return e.innerText;}catch(ex){}
		try{return e.innerHTML;}catch(ex){}
		return "";
	}
	
	this.setText = function (e, text)
	{
		if(e==null)return false;
		if(text==null)text="";
		var i,ii=(e.childNodes==null)?0:e.childNodes.length;
		for(i=-1;i<ii;i++)
		{
			var ei=(i<0)?e:e.childNodes[i];
			if(ei.nodeName=="#text")
			{
				if(text!=null){ei.nodeValue=text; text=null;}
				else ei.nodeValue="";
			}
		}
		if(text!=null)try
		{
			if(e.text!=null)e.text=text;
			else if(e.innerText!=null)e.innerText=text;
			else e.innerHTML=text;
			text=null;
		}catch(ex){}
		return text==null;
	}
	this.setEnabled = function (e, bEnabled)
	{
		if(this.IsIE)
			e.disabled = !bEnabled;
	}
	this.getEnabled = function (e){
		if(this.IsIE)
			return !e.disabled;
	}

	this.navigateUrl =	function (targetUrl, targetFrame)
	{
		if(targetUrl == null || targetUrl.length == 0)
			return;
		var newUrl=targetUrl.toLowerCase();
		if(newUrl.indexOf("javascript:") == 0)
			eval(targetUrl);
		else 
		if(targetFrame != null && targetFrame!="")	{
			if(ig_shared.getElementById(targetFrame) != null) 
				ig_shared.getElementById(targetFrame).src = targetUrl;
			else {
				var oFrame = ig_searchFrames(top, targetFrame);
				if(oFrame != null)
					oFrame.location=targetUrl;
				else 
				if(targetFrame == "_self" 
					|| targetFrame == "_parent"
					|| targetFrame == "_media"
					|| targetFrame == "_top"
					|| targetFrame == "_blank"
					|| targetFrame == "_search")
					window.open(targetUrl, targetFrame);
				else
					window.open(targetUrl);
			}
		}
		else {
			try {
				location.href = targetUrl;
			}
			catch (x) {
			}
		}
	}
	
	function ig_searchFrames(frame, targetFrame) {
		if(frame.frames[targetFrame] != null)
			return frame.frames[targetFrame];
		var i;
		for(i=0; i<frame.frames.length; i++) {
			var subFrame = ig_searchFrames(frame.frames[i], targetFrame);
			if(subFrame != null)
				return subFrame; 
		}
		return null;
	}
	
	this.findControl=function(startElement,idList,closestMatch){
		var item;
		var searchString="";
		var i=0;
		var partialId=idList.split(":");
		while(partialId[i+1]!=null&&partialId[i+1].length>0){
			searchString+=partialId[i]+".*";
			i++;
		}
		searchString+=partialId[i]+"$";
		var searchExp=new RegExp(searchString);
		var curElement;
		if(startElement != null)
			curElement=startElement.firstChild;
		else
			curElement = window.document.firstChild;
		while(curElement!=null){
			if(curElement.id!=null&&(curElement.id.search(searchExp))!=-1){
				ig_dispose(searchExp);
				return curElement;
			}
			item=this.findControl(curElement,idList);
			if(item!=null){
				ig_dispose(searchExp);
				return item;
			}
			curElement=curElement.nextSibling;		
		}
		ig_dispose(searchExp);
		if(closestMatch)
			return findClosestMatch(startElement,partialId);
		else return null;
	}
	this.createTransparentPanel=function (){
		if(!this.IsIE)return null;
		var transLayer=document.createElement("IFRAME");
		transLayer.style.zIndex=1000;
		transLayer.frameBorder="no";
		transLayer.scrolling="no";
		transLayer.style.filter="progid:DXImageTransform.Microsoft.Alpha(Opacity=0);";
		transLayer.style.visibility='hidden';
		transLayer.style.display='none';
		transLayer.style.position="absolute";
		transLayer.src='javascript:new String("<html></html>")';
		var e = document.body.firstChild;
		document.body.insertBefore(transLayer, e);
		return new ig_TransparentPanel(transLayer);
	}
	
	
	
	
	
	this.isInside=function(evt,container,elem,shift)
	{
		var to=evt.toElement;
		if(to==null)to=evt.relatedTarget;
		if(to!=null && shift!=-1)
		{
			while(to!=null)
			{
				if(to==container)return true;
				to=to.parentNode;
			}
			return false;
		}
		if(elem==null)elem=container; if(shift==null)shift=0;
		var z,x=-evt.clientX,y=-evt.clientY;
		var w=elem.offsetWidth,h=elem.offsetHeight;
		while(elem!=null)
		{
			if((z=elem.offsetLeft)!=null){x+=z; y+=elem.offsetTop;}
			elem=elem.offsetParent;
		}
		return x<-1 && y<-1 && 1<x+w && 2+shift<y+h;
	}
	this.createHoverBehavior= function(objectToCallBackWith,element,mouseOverHandler,mouseOutHandler){
		element.__callBackObject=objectToCallBackWith;
		element.__isEventReady=true;
		objectToCallBackWith.__onFilteredMouseOver=mouseOverHandler;
		objectToCallBackWith.__onFilteredMouseOut=mouseOutHandler;
		this.addEventListener(element,"mouseover",ig_filterMouseOverEvents,false);
		this.addEventListener(element,"mouseout",ig_filterMouseOutEvents,false);
	}
	
	
	this.getCBManager = function(form)
	{
		if(!ig_all._ig_cbManager)
			ig_all._ig_cbManager = new ig_callBackManager(form);
		return ig_all._ig_cbManager;
	}
	
	
	
	
	
	
	
	
	
	
	
	
	this.addCBEventListener = function(evalCtl, elemID)
	{
		if(!this._cbListeners)
			this._cbListeners = new Array();
		var i = -1;
		while(++i < this._cbListeners.length)
			if(this._cbListeners[i].evalCtl == evalCtl)
				return;
		this._cbListeners[i] = {evalCtl:evalCtl, elemID:elemID};
	}
	
	
	
	
	this.addCBSubmitListener = function(fn)
	{
		this.addCBEventListener(fn);
	}
	
	
	this.addCBErrorListener = function(fn)
	{
		var el = this._cbError;
		if(!el)
			el = this._cbError = new Array();
		el[el.length] = fn;
	}
	
	
	this.getForm = function()
	{
		var form = document.forms[0];
		if(!form && (form = document.form1) == null)
		{
			var i = -1, eds = document.getElementsByTagName('INPUT');
			while(!form && ++i < eds.length)
				form = eds[i].form;
		}
		return form;
	}
	
	
	
	
	this.getElement = function(id, form)
	{
		var e = document.getElementById(id);
		if(e)
			return e;
		if(!form)
			form = this.getForm();
		return form ? form[id] : null;
	}
	
	
	
	
	
	
	
	this.absPosition = function(elem, pan, pos, ie, ed)
	{
		var z, htm = null, e = elem, body = document.body;
		var i = 1, ok = 0, y = 0, x = 0, pe = e;
		var elemH = e ? e.offsetHeight : -1, elemW = e ? e.offsetWidth : 0;
		while(e != null)
		{
			if(ok < 1 || e == body)
			{
				if((z = e.offsetLeft) != null)
					x += z;
				if((z = e.offsetTop) != null)
					y += z;
			}
			if(e.nodeName == "HTML")
				htm = body = e;
			if(e == body)
				break;
			z = e.scrollLeft;
			if(z == null || z == 0)
				z = pe.scrollLeft;
			if(z != null && z > 0)
				x -= z;
			z = e.scrollTop;
			if(z == null || z == 0)
				z = pe.scrollTop;
			if(z != null && z > 0)
				y -= z;
			pe = e.parentNode;
			e = e.offsetParent;
			if(pe.tagName == "TR")
				pe = e;
			if(e == body && pe.tagName == "DIV")
			{
				e = pe;
				ok++;
			}
		}
		if(elem && document.elementFromPoint)
		{
			var xOld = x, yOld = y;
			ok = true;
			var x0 = body.scrollLeft, y0 = body.scrollTop;
			while(++i < 16)
			{
				z = (i > 2) ? ((i & 2) - 1) * (i & 14) / 2 * 5 : 2;
				e = document.elementFromPoint(x + z - x0, y + z - y0);
				if(!e || e == ed || e == elem)
					break;
			}
			if(i > 15 || !e)
				ok = false;
			x += z;
			y += z;
			i = z = 0;
			while(ok && ++i < 22)
			{
				if(z == 0) x--;
				else y--;
				e = document.elementFromPoint(x - x0, y - y0);
				if(!e || i > 20)
					ok = false;
				if(e != ed && e != elem)
					if(z > 0)
						break;
					else
					{
						i = z = 1;
						x++;
					}
			}
			if(ok)
			{
				x--;
				y--;
			}
			else
			{
				x = xOld;
				y = yOld;
			}
		}
		if(!pan)
			return {x:x, y:y};
		var zIndex = 9999;
		while(elem)
		{
			if(elem.nodeName == 'BODY' || elem.nodeName == 'FORM')
				break;
			z = this.getStyleValue(null, 'zIndex', elem);
			if(z && z.substring) z = (z.length > 4 && z.charCodeAt(0) < 58) ? parseInt(z) : 0;
			if(z && z >= zIndex) zIndex = z + 1;
			elem = elem.parentNode;
		}
		ok = pan.style;
		ok.position = 'absolute';
		ok.visibility = 'visible';
		ok.display = '';
		ok.zIndex = zIndex + 1;
		ed = ed ? 0 : 20;
		var panH = pan.offsetHeight, panW = pan.offsetWidth;
		var iH = body.clientHeight, iW = body.clientWidth, iL = body.scrollLeft, iT = body.scrollTop;
		if(!iH || iH < 50)
		{
			iH = body.offsetHeight - ed;
			iW = body.offsetWidth - ed;
		}
		z = body;
		while(!htm && (z = z.parentNode) != null)
			if(z.nodeName == 'HTML')
				htm = z;
		if(htm)
		{
			z = htm.clientHeight;
			i = htm.offsetHeight;
			if(z && z > 20 && !ig_shared.IsOpera)
			{
				iH = z;
				iW = htm.clientWidth;
				iL = htm.scrollLeft;
				iT = htm.scrollTop;
			}
		}
		if(elemH < 0)
		{
			x = ++iL;
			y = ++iT;
			elemH = --iH;
			elemW = --iW;
		}
		if(iH < 20)
			iH = 20;
		if(iW < 90)
			iW = 90;
		if(!pos)
			pos = 0;
		if(typeof pos == 'object')
		{
			if((z = pos.x) != null)
				x += z;
			if((z = pos.y) != null)
				y += z;
			pos = 0;
		}
		
		if((pos & 4) != 0)
			x += elemW;
		
		else if((pos & 3) == 3)
			x -= panW;
		
		else if((pos & 1) != 0)
			x += (elemW >> 1) - (panW >> 1);
		
		else if((pos & 2) != 0)
			x += elemW - panW;
		
		if((pos & 8) != 0)
			y += (elemH >> 1) - (panH >> 1);
		
		else if((pos & 16) != 0)
			y += elemH - panH;
		
		else if((pos & 32) != 0)
			y -= panH;
		
		else if((pos & 64) != 0)
			y += elemH;
		if(y + panH > iH + iT)
		{
			
			if((pos & 64) != 0 && y - iT - 3 > panH + elemH)
				y -= panH + elemH;
			else
				y = iH + iT - panH;
		}
		if(y < iT)
			y = iT;
		if(x + panW > iW + iL)
		{
			
			if((pos & 4) != 0 && x - iL - 3 > panW + elemW)
				x -= panW + elemW;
			else
				x = iW + iL - panW;
		}
		if(x < iL)
			x = iL;
		if(ig_csom.IsMac && (ig_csom.IsIE || ig_csom.IsSafari))
		{
			x += ig_csom.IsIE ? 5 : -5;
			y += ig_csom.IsIE ? 11 : -7;
		}
		ok.left = x + 'px';
		ok.top = y + 'px';
		if(ie && (z = ie.Element) != null)
			ie = z;
		if(!ie || (z = ie.style) == null)
			return;
		z.position = 'absolute';
		z.left = --x + 'px';
		z.top = --y + 'px';
		z.width = (panW + 2) + 'px';
		z.height = (panH + 2) + 'px';
		z.visibility = 'visible';
		z.display = '';
		z.zIndex = zIndex;
	}
	
	this.isName = function(n)
	{
		return n && n.indexOf('=') < 0 && n.indexOf(':') < 0 && n.indexOf('(') < 0 && n.indexOf(';') < 0 && n.indexOf(',') < 0 && n.indexOf('[') < 0 && n.indexOf('{') < 0 && n.indexOf('\"') < 0 && n.indexOf("'") < 0;
	}
	
	this.replace = function(txt, s0, s1)
	{
		while(txt.indexOf(s0) >= 0)
			txt = txt.replace(s0, s1);
		return txt;
	}
	
	
	this.addTabListener = function(fn)
	{
		var i, i1, tabs = this._tabListeners;
		if(!tabs)
			tabs = this._tabListeners = new Array();
		i = i1 = tabs.length;
		while(i-- > 0)
		{
			if(!tabs[i]) i1 = i;
			if(tabs[i] == fn) return;
		}
		tabs[i1] = fn;
	}
	
	this.removeTabListener = function(fn)
	{
		var t, ok = false, tabs = this._tabListeners;
		var i = tabs ? tabs.length : 0;
		while(i-- > 0)if(tabs[i])
		{
			if(tabs[i] == fn) tabs[i] = null;
			else ok = true;
		}
		if(!ok)
			this._tabListeners = null;
	}
	
	this.fireTabChange = function()
	{
		var tabs = this._tabListeners;
		var i = tabs ? tabs.length : 0;
		while(i-- > 0)if(tabs[i])
			try{eval(tabs[i]);}catch(ex){}
	}
}
function ig_delete(o){ig_dispose(o);}

function ig_filterMouseOverEvents(evt){
	var element=ig_shared.getSourceElement(evt);
	if(!element.__isEventReady){
		while(element!=null && !element.__isEventReady && element.tagName!="BODY")element=element.parentNode;
	}
	if(element && element.__isEventReady && (element._hasMouse||!ig_isMouseOverSourceAChild(evt,element))) 
	{
		element._hasMouse=true;
		element.__callBackObject.__onFilteredMouseOver(evt);
	}	
}
function ig_filterMouseOutEvents(evt){
	var element=ig_shared.getSourceElement(evt);
	if(!element.__isEventReady){
		while(element!=null && !element.__isEventReady && element.tagName!="BODY")element=element.parentNode;
	}
	if(element&&element.__isEventReady&&!ig_isMouseOutSourceAChild(evt,element)) 
	{
		element._hasMouse=false;
		element.__callBackObject.__onFilteredMouseOut(evt);
	}	
}

function ig_isMouseOverSourceAChild(evt,element){
	var evnt=evt?evt:window.event;
	if(evnt==null)return false;
	var from=evnt.fromElement&&typeof evnt.fromElement!="undefined"?evnt.fromElement:evnt.relatedTarget;
	if(from==element)return true;
	if(from==null)return false;
	return ig_isAChildOfB(from,element);
}
function ig_isMouseOutSourceAChild(evt,element){
	var evnt=window.event?window.event:evt;
	if(!evnt)return false;
	var to=evnt.toElement&&typeof evnt.toElement!="undefined"?evnt.toElement:evnt.relatedTarget;
	if(to==element)return true;
	if(to==null)return false;
	return ig_isAChildOfB(to,element);	
}
function ig_isAChildOfB(a,b){
	if(a==null||b==null)return false;
	while(a!=null){
		a=a.parentNode;
		if(a==b)return true;
	}
	return false;
}
function ig_getWebControlById(id)
{
	var i,o=null;
	if(!ig_shared.isEmpty(id))if((o=ig_all[id])==null)for(i in ig_all)
	{
		if((o=ig_all[i])!=null)if(o._id==id || o._clientID==id || o._uniqueID==id)
			return o;
		o=null;
	}
	return o;
}
if(typeof ig_all !="object")
	var ig_all=new Object();
// cancel response of browser on event
function ig_cancelEvent(e, type)
{
	if(e == null) if((e = window.event) == null) return;
	if(type && e.type != type) return;
	if(e.stopPropagation != null) e.stopPropagation();
	if(e.preventDefault != null) e.preventDefault();
	e.cancelBubble = true;
	e.returnValue = false;
}
function ig_TransparentPanel(transLayer){
	this.Element=transLayer;
	this.show=function(){
		this.Element.style.visibility="visible";
		this.Element.style.display="";
	}
	this.hide=function(){
		this.Element.style.visibility="hidden";
		this.Element.style.display="none";
	}
	this.setPosition=function(top,left,width,height){
		this.Element.style.top=top;
		this.Element.style.left=left;
		this.Element.style.width=width;
		this.Element.style.height=height;
	}
}
if(typeof ig_shared !="object")
	var ig_shared=new ig_initShared();
var ig_csom=ig_shared,ig=ig_shared;

//Emulate 'apply' if it doesn't exist.
if ((typeof Function != 'undefined')&&
    (typeof Function.prototype != 'undefined')&&
    (typeof Function.apply != 'function')) {
    Function.prototype.apply = function(obj, args){
        var result, fn = 'ig_apply'
        while(typeof obj[fn] != 'undefined') fn += fn;
        obj[fn] = this;
        var length=(((ig_shared.isArray(args))&&(typeof args == 'object'))?args.length:0);
		switch(length){
		case 0:
			result = obj[fn]();
			break;
		default:
			for(var item=0, params=''; item<args.length;item++){
			if(item!=0) params += ',';
			params += 'args[' + item +']';
			}
			result = eval('obj.'+fn+'('+params+');');
			break;
		}
        ig_dispose(obj[fn]);
        return result;
    };
}

function findClosestMatch(startElement,partialId){
	var item;
	var searchString="";
	var i=0;
	while(partialId[i+1]!=null&&partialId[i+1].length>0){
		searchString+="("+partialId[i]+")?";
		i++;
	}
	searchString+=partialId[i]+"$";
	var searchExp=new RegExp(searchString);
	var curElement=startElement.firstChild;
	while(curElement!=null){
		if(curElement.id!=null&&(curElement.id.search(searchExp))!=-1){
			return curElement;
		}
		item=findClosestMatch(curElement,partialId);
		if(item!=null)return item;
		curElement=curElement.nextSibling;		
	}
	return null;
}

function ig_EventObject(){
	this.event=null;
	this.cancel=false;
	this.cancelPostBack=false;
	this.needPostBack=false;
	this.reset=function()
	{
		this.event=null;
		this.needPostBack=false;
		this.cancel=false;
		this.cancelPostBack=false;
		this.needAsyncPostBack=false;
	}
}

function ig_fireEvent(oControl,eventName)
{
	var i, fn = eventName;
	if(!fn || !oControl) return false;
	if(ig_shared.isName(fn))
	{
		fn += "(oControl";
		for(i = 2; i < ig_fireEvent.arguments.length; i++)
			fn += ", ig_fireEvent.arguments[" + i + "]";
		fn += ");";
	}
	try{eval(fn);}
	catch(i){window.status = "Can't eval " + fn; return false;}
	return true;
}

function ig_dispose(obj)
{
	if(ig_shared.IsIE&&ig_shared.IsWin)	
		for(var item in obj)
		{
			var t = typeof obj[item];
			if(obj[item] && t != 'undefined' && !obj[item].tagName && !obj[item].disposing && t != 'boolean' && t != 'number' && t != 'string' && t != 'function')
			{
				try {
					obj[item].disposing=true;
					ig_dispose(obj[item]);
				} catch(e1) {;}
			}
			try{delete obj[item];}catch(e2){;}
		}
}

function ig_initClientState(){
	this.XmlDoc=document;
	this.createRootNode=function(){
		if(!ig_shared.IsIE){
			var str ='<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><ClientState id="vs"></ClientState></html>';
			var p = new DOMParser();
			var doc = p.parseFromString(str,"text/xml");
			this.XmlDoc=doc;
			return doc.getElementById("vs");
		}
		if(ig_shared.IsIE50)this.XmlDoc=ig_createActiveXFromProgIDs(["MSXML2.DOMDocument","Microsoft.XMLDOM"]);//~ AK 5/12/2006 new ActiveXObject("Microsoft.XMLDOM");
		return this.createNode("ClientState");
	}
	this.setPropertyValue=function(element,name,value){
		if(element!=null)element.setAttribute(name,escape(value));
	}
	this.getPropertyValue=function(element,name){
		if(element==null)return "";
		return unescape(element.getAttribute(name));
	}
	this.addNode=function(element,nodeName){
		var newNode=this.createNode(nodeName);
		if(element!=null)element.appendChild(newNode);
		return newNode;
	}
	this.removeNode=function(element,nodeName){
		var nodeToRemove=this.findNode(element,nodeName);
		if(element!=null)
			return element.removeChild(nodeToRemove);
		return null;
	}
	this.createNode=function(nodeName){
		return this.XmlDoc.createElement(nodeName);
	}
	this.findNode=function(element,node){
		if(element==null)return null;
		var curElement=element.firstChild;
		while(curElement!=null){
			if(curElement.nodeName==node || curElement==node){
				return curElement;
			}
			var item=this.findNode(curElement,node);
			if(item!=null)return item;
			curElement=curElement.nextSibling;		
		}
		return null;
	}
	this.getText=function(element){
		if(element==null)return "";
		if(ig_shared.IsIE55Plus)return escape(element.innerHTML);
		return escape(this.XmlToString(element));
	}
	this.XmlToString=function(startElem){
		var str="";
		if(!startElem)return "";
		var curElement=startElem.firstChild;
		while(curElement!=null){
			str+="<"+curElement.tagName+" ";

			for(var i=0; i<curElement.attributes.length;i++)
			{
				var attrib=curElement.attributes[i];
				str+=attrib.nodeName+"=\""+attrib.nodeValue+"\" ";
			}

			str+=">";
			str+=this.XmlToString(curElement);
			str+="</"+curElement.tagName+">";
			curElement=curElement.nextSibling;		
		}
		return str;
	}
}
//
function ig_xmlNode(name)
{
	this.lastChild = null;
	this.name = name;	
	this.getText = function(){return escape(this.toString());}
	this.childNodes = new Array();
	this.toString = function()
	{
		var i, s = (this.name == null) ? "" : "<" + this.name;
		if(this.props != null) for(i = 0; i < this.props.length; i++)
			s += " " + this.props[i].name + "=\"" + this.props[i].value + "\"";
		if(this.name != null) s += ">";
		for(i = 0; i < this.childNodes.length; i++)
			s += this.childNodes[i].toString();
		if(this.name != null) s += "</" + this.name + ">";
		return s;
	}
	this.addNode = function(node, unique)
	{
		if(node == null) return null;
		if(unique == true) if((unique = this.findNode(node)) != null) return unique;		
		if(node.name == null) node = new ig_xmlNode(node);
		node.parentNode = this;
		this.lastChild = node;
		return this.childNodes[this.childNodes.length] = node;
	}
	this.appendChild = this.addNode;
	this.setAttribute = function(name, value)
	{
		if(name == null) return;
		if(this.props == null) this.props = new Array();
		var prop, i = this.props.length;
		value = (value == null) ? "" : value;
		while(i-- > 0)
		{
			prop = this.props[i];
			if(prop.name == name){prop.value = value; return;}
		}
		prop = new Object();
		prop.name = name;
		prop.value = value;
		this.props[this.props.length] = prop;
	}
	this.setPropertyValue = function(name, value){this.setAttribute(name, (value == null) ? value : escape(value));}
	this.findNode = function(node, descendants)
	{
		if(node != null) for(var i = 0; i < this.childNodes.length; i++)
		{
			var n = this.childNodes[i];
			if(n != null)
			{
				if(n.name == node || n == node)
				{
					n.index = i;
					return n;
				}
				if(descendants == true && (n = n.findNode(node)) != null) return n;
			}
		}
		return null;
	}
	this.removeNode=function(n)
	{
		if((n=this.findNode(n))==null)return n;
		var i=-1,j=0,a=new Array(),a0=n.parentNode.childNodes;
		while(++i<a0.length)if(i!=n.index)a[j++]=a0[i];
		n.parentNode.childNodes=a;
		this.lastChild = a.length <= 0 ? null : a[a.length-1] ;
		return n;
	}
	this.getPropertyValue = function(name)
	{
		var i = (this.props == null) ? 0 : this.props.length;
		while(i-- > 0)
			if(this.props[i].name == name)
				return unescape(this.props[i].value);
		return null;
	}
}
function ig_xmlNodeStatic()
{
	this.createRootNode = function(){return new ig_xmlNode("Temp");}
	this.addNode = function(e, n){return (e == null) ? (new ig_xmlNode(n)) : e.addNode(n);}
	this.removeNode = function(e, n){return (e == null) ? e : e.removeNode(n);}
	this.findNode = function(e, n){return (e == null) ? e : e.findNode(n);}
	this.setPropertyValue = function(e, n, v){if(e != null)e.setPropertyValue(n, v);}
	this.getPropertyValue = function(e, n){return (e == null) ? "" : e.getPropertyValue(n);}
	this.getText = function(e)
	{
		var s = "", i = (e == null) ? 0 : e.childNodes.length;
		for(var j = 0; j < i; j++) s += e.childNodes[j].getText();
		return s;
	}
}

try{ig_shared.addEventListener(window, "load", ig_handleEvent);}catch(ex){}
try{ig_shared.addEventListener(window, "unload", ig_handleEvent);}catch(ex){}
try{ig_shared.addEventListener(window, "resize", ig_handleEvent);}catch(ex){}
function ig_findElemWithAttr(elem, attr)
{
	while(elem != null)
	{
		try
		{
			if(elem.getAttribute != null && !ig_shared.isEmpty(elem.getAttribute(attr)))
				return elem;
		}catch(ex){}
		elem = elem.parentNode;
	}
	return null;
}
function ig_handleEvent(evt)
{
	if(evt == null) if((evt = window.event) == null) return;
	var obj, attr = ig_shared.attrID, src = evt.target, type = evt.type;
	if(ig_shared.isEmpty(type)) return;
	var fn = "obj._on" + type.substring(0, 1).toUpperCase() + type.substring(1);
	if(!src)
		src = evt.srcElement;
	if(type == "load" || type == "unload" || type == "resize" || !src)
	{
		for(obj in ig_all)
		{
			if((obj = ig_all[obj]) == null)
				continue;
			eval("if(" + fn + "!=null){" + fn + "(src,evt); obj=null;}");
			if(obj && obj._onHandleEvent)
				obj._onHandleEvent(src, evt);
		}
		if(type == "unload")
		{
			ig_dispose(ig_all);
			for(var id in ig_all) if(ig_all[id])
				ig_all[id].base = null;
		}
		return;
	}
	var elem = ig_findElemWithAttr(src, attr);
	if(elem == null)
		elem = ig_findElemWithAttr(this, attr);
	if(elem != null && (obj = ig_getWebControlById(elem.getAttribute(attr))) != null)
	{
		eval("if(" + fn + "!=null){" + fn + "(src,evt); obj=null;}");
		if(obj != null && obj._onHandleEvent != null)
			obj._onHandleEvent(src, evt);
	}
}
function ig_handleTimer(obj)
{
	var i, all = ig_shared._timers, fn = ig_shared._timerFn;
	if(obj)
	{
		if(!obj._onTimer) return;
		if(!all) ig_shared._timers = all = new Array();
		i = all.length;
		while(i-- > 0) if(all[i] == obj) break;
		if(i < 0) all[all.length] = obj;
		if(!fn) ig_shared._timerFn = fn = window.setInterval(ig_handleTimer, 200);
		return;
	}
	if(!fn) return;
	for(i = 0; i < all.length; i++) if(all[i] && all[i]._onTimer) if(!all[i]._onTimer())
		obj = true;
	if(obj) return;
	window.clearInterval(fn);
	delete ig_shared._timerFn;
}

var ig_ClientState=null;
if(!ig_shared.IsIE55Plus||!ig_shared.IsWin) ig_ClientState = new ig_xmlNodeStatic();
else ig_ClientState=new ig_initClientState();

var _asyncSmartCallbacks = new Array();
var _inCallback = false;
        
function ig_SmartCallback(clientContext, serverContext, callbackFunction, uniqueId, control, waitResponse)
{
    var _callbackFunction;
    var _url = null;
    var _postdata = "";
    var _async = true;
    this._registeredControls = new Array();
    this._control = control;
    this._waitResponse=(waitResponse===true);
    this._progressIndicator = null;
    
    this._registeredControls[0] = {clientContext:clientContext, serverContext:serverContext, callbackFunction:callbackFunction, uniqueId:uniqueId, control:control};
    
	if(typeof XMLHttpRequest != "undefined") {
	   __xmlHttpRequest = new XMLHttpRequest();
	}
	else if(typeof ActiveXObject != "undefined")
	{
	   try{
		    __xmlHttpRequest = ig_createActiveXFromProgIDs(["MSXML2.XMLHTTP","Microsoft.XMLHTTP"]);//~ AK 5/12/2006 new ActiveXObject("Microsoft.XMLHTTP");
	   }
	   catch(e)
	   {
	   }
	}
	
	this.registerControl = function(clientContext, serverContext, callbackFunction, uniqueId, control)
	{
		this._registeredControls.push({clientContext:clientContext, serverContext:serverContext, callbackFunction:callbackFunction, uniqueId:uniqueId, control:control});
	}

	this._xmlHttpRequest = __xmlHttpRequest;
	    
    this.execute = function () 
    {
		var exec = true;
		if(this.beforeCallback != null)
				exec = this.beforeCallback();
		if(exec)try
		{
			if(this._progressIndicator != null)
				this._progressIndicator.display();
			this.formatCallbackArguments();
		    this.registerSmartCallback();
		    this._xmlHttpRequest.open("POST", this.getUrl(), !this._waitResponse);
		    this._xmlHttpRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		    this._xmlHttpRequest.onreadystatechange = this._responseComplete;
		    this._xmlHttpRequest.send(this.getCallbackArguments());
		 }catch(exec){}
    }
   
    this.getCallbackArguments = function () {
        return this._callbackArguments;
    }
    this.setCallbackArguments = function (callbackArguments) {
        this._callbackArguments = callbackArguments;
    }

    this.getUrl = function () {
        if(this._url == null) {
            return this.getForm().action;
        }
        return this._url;
    }

    this.setUrl = function (url) {
        this._url = url;
    }

    this.getForm = function () 
    {
        var form;
        
        if(document.forms.length > 1)
        {
			for(var i = 0; i < document.forms.length; i++)
			{
				if(document.forms[i].method == "post" && document.forms[i].action != "")
				{
					form = document.forms[i];
					break;
				}
			}   
			if(form == null)
				 form = document.forms[0]; 
        }
		else
			form = document.forms[0];
        if (!form) 
            form = document.form1;
        return form;
    }
    
    this.setProgressIndicator = function(value)
    {
		this._progressIndicator = value; 
    }
    
    this._responseComplete = function () 
    {
		var proccessComplete = null;
        for (var i = 0; i < _asyncSmartCallbacks.length; i++) {
            smartCallback = _asyncSmartCallbacks[i];
            if (smartCallback && smartCallback._xmlHttpRequest && (smartCallback._xmlHttpRequest.readyState == 4)) 
            {
				//if(smartCallback && smartCallback._xmlHttpRequest.status == "500")
				//	alert(smartCallback && smartCallback._xmlHttpRequest.responseText);
				_asyncSmartCallbacks[i] = null;
                smartCallback.processSmartCallback();
                proccessComplete = smartCallback;
            }
        }
        if(proccessComplete != null)
        {
            if(proccessComplete.callbackFinished != null)
				proccessComplete.callbackFinished();
			proccessComplete._control = null;
			proccessComplete._registeredControls = null;
			proccessComplete._progressIndicator = null; 
			ig_dispose(proccessComplete);
			proccessComplete = null;
        }
    }

    this.processSmartCallback = function () {
       var responseString = this._xmlHttpRequest.responseText;
       var startIndex = responseString.indexOf("_ig_start");
       var endIndex = responseString.indexOf("_ig_end");
       var length = endIndex;
       if(startIndex > -1 && endIndex > -1) {
            responseString = responseString.substring(startIndex + 9, length); 
            var response = eval(responseString);
            var index;
            for(index = 0; index < response.length; index++) 
            {
                controlResponse = response[index];
                var header = controlResponse[0];
                var payload = controlResponse[1].replace(/\ig_NL/g, "\n");
			
                for(var i = 0; i < this._registeredControls.length; i++)
                {
					if(this._registeredControls[i] != null && header == this._registeredControls[i].uniqueId)
					{
						if(payload.length > 0)
						{
							if(this._registeredControls[i].clientContext.requestType != null && this._registeredControls[i].clientContext.requestType == "styles")
								this._resolveStyles(payload);
							else if(this._registeredControls[i].callbackFunction != null)
								this._registeredControls[i].callbackFunction(payload, this._registeredControls[i].clientContext);
							else if(this._registeredControls[i].control.callbackRender != null)
								this._registeredControls[i].control.callbackRender(payload, this._registeredControls[i].clientContext);
						}
						this._registeredControls[i] = null;
						break;
					}
                }
            }
       }
       if(this._progressIndicator != null)
		this._progressIndicator.hide();
    }
    
    this._resolveStyles = function(response)
    {
		var json = eval(response.replace(/\^/g, "\""));
		var key = json[0];
		var styleBlock = eval(json[1]);
		if(styleBlock != null && styleBlock.length > 0)
		{
			var styles = document.getElementsByTagName("style");	
			for(var i = 0; i < styles.length; i++)
			{
				var rules;
				
				if(ig_shared.IsIE)
					rules = styles[i].styleSheet.rules
				else
					rules = styles[i].sheet.cssRules
					
				for(var j  = 0; j < rules.length; j++)
				{
					if(rules[j].selectorText.indexOf(key) > -1)
					{
						try
					    {
						    if(ig_shared.IsIE)
							    styles[i].styleSheet.removeRule(0);
						    else
							    styles[i].sheet.deleteRule(0);
						}catch(e){};
					}	
				}
				for(var j = 0; j < styleBlock.length; j++)
				{
					if(styleBlock[j] != null)
					{
						if(ig_shared.IsIE)
							styles[i].styleSheet.addRule(styleBlock[j][0], styleBlock[j][1], 0);
						else
							styles[i].sheet.insertRule(styleBlock[j][0] + "{" +  styleBlock[j][1] + "}", 0);
					}
				}
			}
		}
		return;	
    }
    
    this.registerSmartCallback = function () {
        var index;
        for(index = 0; index < _asyncSmartCallbacks.length; index++)
            if(!_asyncSmartCallbacks[index])
                break;
        _asyncSmartCallbacks[index] = this;
        return index;
    }
    
    this.formatCallbackArguments = function () {
        
        
        
        try{
            if(__igSubmit)
                __igSubmit();
        }catch(exec){}
            
        var form = this.getForm();
        if(!form) return;
        var count = form.elements.length;
        var element;
        for (var i = 0; i < count; i++) {
            element = form.elements[i];
            if (element.tagName.toLowerCase() == "input" && (element.type == "hidden" || element.type == 'password' || element.type == 'text' || ((element.type == "checkbox"|| element.type =='radio')&& element.checked))) 
               this.addCallbackField(element.name, element.value);
            else if(element.tagName.toLowerCase() == "textarea")
				this.addCallbackField(element.name, element.value);
			else if(element.tagName.toLowerCase() == "select")
			{
				var o = element.options.length;
				while(o-- > 0)
				{
					if(element.options[o].selected)
						this.addCallbackField(element.name, element.options[o].value);
				}
			}
            
        }   
         
        var args =  _postdata + "__EVENTTARGET=&__EVENTARGUMENT=&" + 
                            "__CALLBACKID=" + 
                           this._registeredControls[0].uniqueId +
                            //this.getServerId() +
                            "&__CALLBACKPARAM=";
        var xml = '&lt;SmartCallback&gt;';
        if(this._registeredControls!= null) {
			for(var i = 0; i < this._registeredControls.length; i++)
			{
				xml += "&lt;Control";
				var control = this._registeredControls[i];
				
				xml += " id='" + control.uniqueId + "'";
				for(property in control.serverContext)
				{
					if(control.serverContext[property] != null) {
						var value = control.serverContext[property].toString();
						while(value.indexOf("'") != -1) {
							value = value.replace("'", "^^");
						}
						
						
						xml += " " + property + "='" + escape(escape(value)) + "'";
					}
				}
				xml += "/&gt;"
			}
        }
        xml += "&lt;/SmartCallback&gt;";
        xml = escape(xml); 
        args += xml; 
        this.setCallbackArguments(args);
    }
    
    this.addCallbackField = function(name, value) {
        _postdata += name + "=" + this.encodeValue(value) + "&";
    }
    
    this.isAsynchronous = function () {
            return _async;
    }
    this.setAsynchronous = function (async) {
        _async = async;
    }
   
    this.encodeValue = function(uri) {
        if(encodeURIComponent != null) 
            return encodeURIComponent(uri);
        else
            return escape(parameter);
    }
}

ig_createCallback = function(method, context ) {
	
	return function() {
		method.apply(context, [null]);
	}
}

var ViewportOrientationEnum = new function() {
   this.Horizontal = 0;
   this.Vertical  = 1;
} 

var AnimationDirectionEnum = new function() {
   this.Up  = 1;
   this.Down  = 2; 
   this.Left = 3;
   this.Right = 4;
} 

var AnimationRateEnum = new function() {
   this.Static = 0;
   this.Accelerate  = 1;
   this.Decelerate  = 2; 
   this.AccelDecel = 3;
   this.Linear = 4;
}  

ig_viewport = function() {
	
	this.createViewport  = function(elem, orientation) {
		if(this.elem) 
			return;

		this.elem = elem;
		this.orientation = orientation;
		
		this.div = document.createElement("div");
		this.div.style.position = "relative";
		this.table = document.createElement("table");		
		var tr = document.createElement("tr");
		var tbody = document.createElement("tbody");
		this.td1 = document.createElement("td");		
		this.td2 = document.createElement("td");
		this.div.style.overflow = "hidden";
		this.div.style.width = elem.offsetWidth + "px"; 
		this.div.style.height = elem.offsetHeight + "px"; 
		this.table.cellSpacing = "0px"; 
		this.table.cellPadding = "0px";
		this.div.appendChild(this.table);								
		this.table.appendChild(tbody);
		tbody.appendChild(tr);
		tr.appendChild(this.td1);
		
		this.td1.style.verticalAlign = "top";
		this.td2.style.verticalAlign = "top";
		
		
		this.table.style.height = "100%";
		this.td1.style.height = "100%";
		this.td2.style.height = "100%";
		
		if(this.orientation == ViewportOrientationEnum.Horizontal) {
			tr.appendChild(this.td2);
		}
		else {
			tr = document.createElement("tr");
			tbody.appendChild(tr);
			tr.appendChild(this.td2);
		}
		elem.parentNode.insertBefore(this.div, elem);
		this.td1.appendChild(elem);

		this.animate = new ig_SlideAnimation();
	}
	this.transferPositionToDiv = function(elem, oldElem)
	{
		if(elem.style.position != "" && elem.style.position != "static")
		{
			this.div.style.position = elem.style.position;
			elem.style.position = "static";
			if(oldElem)
			    oldElem.style.position = "static";
		}
		this.div.style.top = elem.style.top;
		this.div.style.left = elem.style.left;
		elem.style.top = "";
		elem.style.left = "";
		if(oldElem) {
		    oldElem.style.top = "";
		    oldElem.style.left = "";
		}
	}
	this.scroll = function(eCurrent, eNew, direction, rate) {
		this.direction = direction;
		this.animate.setElement(this.table);
		this.animate.setContainer(this.div);
		this.animate.setDirection(direction);
		this.animate.setRate(rate);

		switch (this.direction) {
			case AnimationDirectionEnum.Down :
			case AnimationDirectionEnum.Right :
				if(this.td1.firstChild != null)
					this.td1.removeChild(this.td1.firstChild);
				this.td1.appendChild(eCurrent);
				if(this.td2.firstChild != null)
					this.td2.removeChild(this.td2.firstChild);
				this.td2.appendChild(eNew);
				this.animate.startPos = 0;
				this.animate.finishPos = this.td1.offsetWidth;
				break;
	
			case AnimationDirectionEnum.Up :
			case AnimationDirectionEnum.Left :
				if(this.td1.firstChild != null)
					this.td1.removeChild(this.td1.firstChild);
				this.td1.appendChild(eNew);
				if(this.td2.firstChild != null)
					this.td2.removeChild(this.td2.firstChild);
				this.td2.appendChild(eCurrent);
				this.div.scrollLeft = this.td1.offsetWidth;
				this.animate.startPos = this.div.scrollLeft;
				this.animate.finishPos = 0;
				break;
		}
		
		this.animate.play();		
	}
}


ig_WebAnimation = function() {
    
    this.timerInterval = 30;
    this.startPos = 0;
	var _inProgress;
	this.eContainer = null;
	this.duration = null; 
	this.cancel = false;
}   
 
ig_WebAnimation.prototype.getElement = function() {
        return this.element;
}
ig_WebAnimation.prototype.setElement = function(value) {
	this.element = value;
}
 ig_WebAnimation.prototype.getTimerInterval = function() {
	return timerInterval;
}
ig_WebAnimation.prototype.setTimerInterval = function(value) {
	timerInterval = value;
}
ig_WebAnimation.prototype.isInProgress = function() {
	return _inProgress;
}

ig_WebAnimation.prototype.cancelAnimation = function() {
    clearTimeout(this.timerId);
	this.cancel = true;
}

ig_WebAnimation.prototype.setContainer = function(container) {
	this.eContainer = container;
}
ig_WebAnimation.prototype.getContainer = function() {
	return this.eContainer;
}

ig_WebAnimation.prototype.onBegin = function() {
}
ig_WebAnimation.prototype.onNext = function() {
}
ig_WebAnimation.prototype.onEnd = function() {
}

ig_WebAnimation.prototype.play = function() {
	this.currentPos = this.startPos;
	this.cancel = false;
	this.begin();
	if(!this.cancel)
		this.timerId = setInterval(ig_createCallback(this.tickHandler, this, null), this.timerInterval);
}

ig_WebAnimation.prototype.tickHandler = function() {
   if(this.cancel || !this.next())
   {
      clearTimeout(this.timerId);
	  this.end();
   }
}
ig_WebAnimation.prototype.getDuration = function() {
	return this.duration; 
}
ig_WebAnimation.prototype.setDuration = function(value) {
	this.duration = value; 
}

ig_WebAnimation.prototype.calcDurationIncrement = function()
{
	return this.distance /(this.duration / this.timerInterval);
}

ig_WebAnimation.prototype.ensureContainer = function(e) {
	var parent = e.parentNode;
	if(parent.getAttribute("container") == '1')
		return;
	if(e.getAttribute("container") == '1')
		return;
	var eDiv = window.document.createElement("DIV");
	eDiv.setAttribute("container", '1');
	eDiv.cssText = 'overflow:hidden; position:absolute;z-index:12000;';

	parent.insertBefore(eDiv, e);
	parent.removeChild(e);
	eDiv.appendChild(e);

}

ig_WebAnimation.prototype.removeContainer = function() {
	var container = this._element;
	var child = container.firstChild;
	if(container.getAttribute("container") != '1'){
		container = container.parentNode;
		if(container.getAttribute("container") != '1')
			return;
	}
	var parent = container.parentNode;
	container.removeChild(child);
	parent.removeChild(container);
	delete container;
	parent.appendChild(child);

}

ig_SlideAnimation.prototype = new ig_WebAnimation();


function ig_SlideAnimation(direction, rate)
{
	this.init(direction, rate);
	return this;
}

ig_SlideAnimation.prototype.init = function(direction, rate) {
	if(direction)
		this.direction = direction;
	else
		this.direction = AnimationDirectionEnum.Right;
	if(rate)
		this.rate = rate;
	else	
		this.rate = AnimationRateEnum.Linear;
}

ig_SlideAnimation.prototype.getDirection = function() {
	return this.direction;
}
ig_SlideAnimation.prototype.setDirection = function(value) {
	this.direction = value;
}
ig_SlideAnimation.prototype.getRate = function() {
	return this.rate;
}
ig_SlideAnimation.prototype.setRate = function(value) {
	this.rate = value;
}

ig_SlideAnimation.prototype.begin = function() {
	switch (this.direction) {
		case AnimationDirectionEnum.Up :
		case AnimationDirectionEnum.Down :
			this.distance = Math.abs(this.finishPos - this.startPos);
			break;
		case AnimationDirectionEnum.Right :
		case AnimationDirectionEnum.Left :
			this.distance = Math.abs(this.finishPos - this.startPos);
			break;
	}
	switch(this.rate) {
		case AnimationRateEnum.Accelerate :
			this.increment = 1;
			break;
		case AnimationRateEnum.Decelerate :
			this.increment = .5 * Math.abs(this.distance);;
			break;
		case AnimationRateEnum.AccelDecel :
			this.midPoint = this.distance / 2;
			this.accel = true;
			this.increment = 1;
			break;
		case AnimationRateEnum.Linear :
			
			if(this.duration != null)
				this.increment = this.calcDurationIncrement();
			else
			{
				if(this.increment == null)
					this.increment = 30; 
				this._originalIncrement = this.increment; 
				this.increment = 1; 
				var totalCount = 0; 
				var temp = 1; 
				var distance = this.distance; 
				while(temp * 2 < this._originalIncrement)
				{
					temp *=2; 
					distance -= temp*2; 
					totalCount++;
				}
				this._acelCount = totalCount; 
				temp = this._originalIncrement; 
				totalCount *= 2; 
				totalCount += parseInt(distance / this._originalIncrement); 
				this._decelCount = totalCount - this._acelCount; 
				this._currentCount = 1; 
			}
				
			break;
	}
	this.onBegin();
}

ig_SlideAnimation.prototype.next = function() {
	switch (this.direction) {
		case AnimationDirectionEnum.Down :
		case AnimationDirectionEnum.Right :
			this.currentPos += this.increment;
			if(this.currentPos > this.finishPos)
				return false;
			if(this.direction == AnimationDirectionEnum.Right)
				this.getContainer().scrollLeft = this.currentPos;
			else
				this.getContainer().scrollTop = this.currentPos;
			break;
		case AnimationDirectionEnum.Up :
		case AnimationDirectionEnum.Left :
			this.currentPos -= this.increment;
			if(this.currentPos < this.finishPos)
				return false;
			if(this.direction == AnimationDirectionEnum.Left)
				this.getContainer().scrollLeft = this.currentPos;
			else
				this.getContainer().scrollTop = this.currentPos;
			break;
	}
	
	switch(this.rate) {
		case AnimationRateEnum.Accelerate :
			this.increment *= 2;
			break;
		case AnimationRateEnum.Decelerate :
			this.increment = Math.max(2, this.increment / 2);
			break;
		case AnimationRateEnum.AccelDecel :
			if(this.accel) {
				if(this.direction == AnimationDirectionEnum.Right || this.direction == AnimationDirectionEnum.Down) {
					if(this.currentPos + this.increment >= this.midPoint) {
						this.accel = false;
						this.increment = this.midPoint / 2;
					}
					else
						this.increment *= 2;
				}
				else {
					if(this.currentPos - this.increment <= this.midPoint) {
						this.accel = false;
						this.increment = this.midPoint / 2;
					}
					else
						this.increment *= 2;
				}
			}
			else {
				this.increment = Math.max(2, this.increment / 2);
			}
			break;			
		case AnimationRateEnum.Linear :
		
			if(this.duration == null)
			{
				if(this._currentCount <= this._acelCount)
					this.increment *=2; 
				else if(this._currentCount > this._decelCount)
				{
					this.increment = Math.pow(2,this._acelCount);
					if(this._acelCount > 3)
						this._acelCount--; 
				}
				else
					this.increment = this._originalIncrement; 
				
				this._currentCount++; 
			}
		
		break;
	}
	
	this.onNext();
	return true;
}

ig_SlideAnimation.prototype.end = function() {
	this.getContainer().scrollLeft = this.finishPos;
	if(this.rate == AnimationRateEnum.Linear && this.duration == null)
	{
		this._currentCount = 0; 
		this.increment = this._originalIncrement; 
	}
	this.onEnd();
}

ig_SlideRevealAnimation.prototype = new ig_SlideAnimation();


function ig_SlideRevealAnimation(direction, rate)
{
	this.init(direction, rate);
	return this;
}

ig_SlideRevealAnimation.prototype.begin = function() {
	this.eContainer.style.overflow = "hidden";
	this.element.style.position = "relative";
	
	this.distance = Math.abs(this.finishPos - this.startPos);
	this.currentPos = this.startPos; 

	switch (this.direction) {
		case AnimationDirectionEnum.Up :
			this.element.style.top  = this.currentPos.toString();
			break;
		case AnimationDirectionEnum.Down :
			this.element.style.display = "";
			this.element.style.top  = this.currentPos.toString();
			break;
		case AnimationDirectionEnum.Right :
			this.element.style.display = "";
			this.element.style.left = this.currentPos.toString();
			break;
		case AnimationDirectionEnum.Left :
			this.element.style.left = this.currentPos.toString();
			break;
	}
	switch(this.rate) {
		case AnimationRateEnum.Accelerate :
			this.increment = 1;
			break;
		case AnimationRateEnum.Decelerate :
			this.increment = .5 * Math.abs(this.distance);;
			break;
		case AnimationRateEnum.AccelDecel :
			this.midPoint = this.distance / 2;
			this.accel = true;
			this.increment = 1;
			break;
		case AnimationRateEnum.Linear :
			if(!this.increment)
				this.increment = 20;
			break;
	}
	this.onBegin();
}

ig_SlideRevealAnimation.prototype.next = function() {
	switch (this.direction) {
		case AnimationDirectionEnum.Down :
		case AnimationDirectionEnum.Right :
			this.currentPos += this.increment;
			if(this.currentPos > this.finishPos)
				return false;
			if(this.direction == AnimationDirectionEnum.Right)
				this.element.style.left = this.currentPos.toString();
			else
				this.element.style.top = this.currentPos.toString();
			break;
		case AnimationDirectionEnum.Up :
		case AnimationDirectionEnum.Left :
			this.currentPos -= this.increment;
			if(this.currentPos < this.finishPos)
				return false;
			if(this.direction == AnimationDirectionEnum.Left)
				this.element.style.left = this.currentPos.toString();
			else
				this.element.style.top = this.currentPos.toString();
			break;
	}
	switch(this.rate) {
		case AnimationRateEnum.Accelerate :
			this.increment *= 2;
			break;
		case AnimationRateEnum.Decelerate :
			this.increment = Math.max(2, this.increment / 2);
			break;
		case AnimationRateEnum.AccelDecel :
			if(this.accel) {
				if(this.direction == AnimationDirectionEnum.Right || this.direction == AnimationDirectionEnum.Down) {
					if(this.currentPos + this.increment >= this.midPoint) {
						this.accel = false;
						this.increment = this.midPoint / 2;
					}
					else
						this.increment *= 2;
				}
				else {
					if(this.currentPos - this.increment <= this.midPoint) {
						this.accel = false;
						this.increment = this.midPoint / 2;
					}
					else
						this.increment *= 2;
				}
			}
			else {
				this.increment = Math.max(2, this.increment / 2);
			}
			break;		
	
	}
	this.onNext();
	return true;
}

ig_SlideRevealAnimation.prototype.end = function() {
	if(this.cancel)
		return;
	if(this.direction == AnimationDirectionEnum.Left ||this.direction == AnimationDirectionEnum.Right)
		this.element.style.left = this.finishPos;
	else
		this.element.style.top = this.finishPos;
	this.onEnd();
}

// Reveal Animation 
ig_RevealAnimation.prototype = new ig_WebAnimation();
function ig_RevealAnimation(direction, rate)
{
	this.init(direction, rate);
	return this;
}

ig_RevealAnimation.prototype.init = function(direction, rate) {
	if(direction)
		this.direction = direction;
	else
		this.direction = AnimationDirectionEnum.Right;
	if(rate)
		this.rate = rate;
	else	
		this.rate = AnimationRateEnum.Linear;
}

ig_RevealAnimation.prototype.getDirection = function() {
	return this.direction;
}
ig_RevealAnimation.prototype.setDirection = function(value) {
	this.direction = value;
}
ig_RevealAnimation.prototype.getRate = function() {
	return this.rate;
}
ig_RevealAnimation.prototype.setRate = function(value) {
	this.rate = value;
}

ig_RevealAnimation.prototype.begin = function() {
    this.element.style.overflow = "hidden";
	this.distance = Math.abs(this.finishPos - this.startPos);
	switch (this.direction) {
		case AnimationDirectionEnum.Up :
			if(!this.startPos)
				this.startPos = this.element.scrollHeight;
			break;
		case AnimationDirectionEnum.Down :
			if(!this.startPos)
				this.startPos = 1;
			break;
	}
	switch(this.rate) {
		case AnimationRateEnum.Accelerate :
			this.increment = 1;
			break;
		case AnimationRateEnum.Decelerate :
			this.increment = .5 * Math.abs(this.distance);;
			break;
		case AnimationRateEnum.AccelDecel :
			this.midPoint = this.distance / 2;
			this.accel = true;
			this.increment = 1;
			break;
		case AnimationRateEnum.Linear :
			if(!this.increment)
				this.increment = 20;
			break;
	}
	this.onBegin();
	this.currentPos = this.startPos;
}

ig_RevealAnimation.prototype.next = function() {
	switch (this.direction) {
		case AnimationDirectionEnum.Down :
			this.currentPos += this.increment;
			if(this.currentPos > this.finishPos)
				return false;
			break;
		case AnimationDirectionEnum.Up :
			this.currentPos -= this.increment;
			if(this.currentPos < this.finishPos)
				return false;
			break;
	}
	this.element.style.height = this.currentPos;
	switch(this.rate) {
		case AnimationRateEnum.Accelerate :
			this.increment *= 2;
			break;
		case AnimationRateEnum.Decelerate :
			this.increment = Math.max(2, this.increment / 2);
			break;
		case AnimationRateEnum.AccelDecel :
			if(this.accel) {
				if(this.direction == AnimationDirectionEnum.Right || this.direction == AnimationDirectionEnum.Down) {
					if(this.currentPos + this.increment >= this.midPoint) {
						this.accel = false;
						this.increment = this.midPoint / 2;
					}
					else
						this.increment *= 2;
				}
				else {
					if(this.currentPos - this.increment <= this.midPoint) {
						this.accel = false;
						this.increment = this.midPoint / 2;
					}
					else
						this.increment *= 2;
				}
			}
			else {
				this.increment = Math.max(2, this.increment / 2);
			}
			break;		
	
	}
	this.onNext();
	return true;
}

ig_RevealAnimation.prototype.end = function() {
	switch (this.direction) {
		case AnimationDirectionEnum.Down :
			this.element.style.height = "";
			break;
		case AnimationDirectionEnum.Up :
			this.element.style.display = "none";
			break;
	}
    this.element.style.overflow = "";
	this.element.style.width = "";
	this.onEnd();
}

var ig_Location = {TopLeft:0, TopCenter:1, TopRight:2, TopInfront:3, TopBehind:4,
	MiddleLeft:8, MiddleCenter:9, MiddleRight:10, MiddleInfront:11, MiddleBehind:12,
	BottomLeft:16, BottomCenter:17, BottomRight:18, BottomInfront:19, BottomBehind:20,
	AboveLeft:32, AboveCenter:33, AboveRight:34, AboveInfront:35, AboveBehind:36,
	BelowLeft:64, BelowCenter:65, BelowRight:66, BelowInfront:67, BelowBehind:68};

function ig_progressIndicator(imageUrl, relativeContainer)
{
	this._img = imageUrl;
	this._rc = relativeContainer;
	this.setImageUrl = function(url)
	{
		
		if(this._elem)
			this._elem.parentNode.removeChild(this._elem);
		this._elem = null;
		this._img = url;
	}
	this.getImageUrl = function()
	{
		return this._img; 
	}
	this.setTemplate = function(html)
	{
		var elem = this._elem;
		this._html = html;
		if(elem)
		{
			if(elem.tagName == 'DIV' && html)
			{
				elem.innerHTML = html;
				return;
			}
			elem.parentNode.removeChild(elem);
			this._elem = null;
		}
	}
	this.getTemplate = function()
	{
		return this._html; 
	}
	this.setLocation = function(location)
	{
		this._location = location;
	}
	this.setCssStyle = function(css)
	{
		this._css = css;
	}
	this.setRelativeContainer = function(elem)
	{
		this._rc = elem;
	}
	this.display = function(rc, loc)
	{
		this.visible = true;
		var elem = this._elem;
		if(!rc)
			rc = this._rc;
		if(!elem)
		{
			var body = document.body, append = !ig_shared.IsIE || document.readyState == 'complete';
			if(this._html)
			{
				elem = document.createElement('DIV');
				if(append)
					body.appendChild(elem);
				else
				
					body.insertBefore(elem,body.firstChild);
				elem.innerHTML = this._html;
			}
			else
			{
				elem = document.createElement('IMG');
				if(append)
					body.appendChild(elem);
				else
				
					body.insertBefore(elem,body.firstChild);
				var img = this._img;
				if(!img)
					img = (typeof ig_pi_imageUrl == 'string') ? ig_pi_imageUrl : '/ig_common/images/ig_progressIndicator.gif';
				elem.src = img;
			}
			elem.unselectable = 'on';
			this._elem = elem;
		}
		if(this._css)
			elem.className = this._css;
		if(loc == null)
			if((loc = this._location) == null)
				loc = ig_Location.BottomRight;
		ig_shared.absPosition(rc, elem, loc);
	}
	this.hide = function()
	{
		this.visible = false;
		if(this._elem)
			this._elem.style.display = 'none';
	}
}

function ig_callBackManager(form)
{
	if(!form) if((form = ig_shared.getForm()) == null)
		return;
	this._onUnload = function()
	{
		var f = this._form;
		if(!f)
			return;
		this._form = this._submit = this._style = null;
		ig_shared.removeEventListener(f, 'submit', this._onFormSubmit);
		ig_shared.removeEventListener(f, 'click', this._onFormEvt);
		ig_shared.removeEventListener(f, 'mousedown', this._onFormEvt);
		ig_shared.removeEventListener(f, 'mouseup', this._onFormEvt);
		if(f._ig_cb_submit)
		{
			f.submit = f._ig_cb_submit;
			f._ig_cb_submit = null;
		}
		if(this._onsubmit)
			f.onsubmit = this._onsubmit;
	}
	
	
	
	
	
	
	
	
	
	this.addPanel = function(control, id, elemID, rc, link, ids, post, noResp)
	{
		if(!this._form || !control)
			return;
		var i = -1;
		while(++i < this._panels.length)
			if(this._panels[i].elemID == elemID)
				break;
		this._panels[i] = {control:control, id:id, elemID:elemID, rc:rc, link:link, ids:ids, post:post, noResp:noResp};
	}
	
	
	
	
	
	
	
	this.addCallBack = function(control, id, rc, flag)
	{
		var e, ee, j, form = this._form;
		if(!control || !form)
			return;
		if(!this._ok)
		{
			form.submit();
			return;
		}
		if(!id)
		{
			id = control.id;
			rc = control.rc;
			control = control.control;
		}
		var i = null, args = this._submitElem;
		if(args)
		{
			args += '&';
			this._submitElem = null;
		}
		else args = '';
		if(this._wait)
			return true;
		if(this._jsSrcs.length > 0)
		{
			if(flag == -1)
				return true;
			this._killJsSrc();
		}
		var id1 = this._elemID, id2 = this._evtElem;
		if(id2)
			id2 = id2.id;
		var triggers = [id2,this._subID,id1];
		if(!id1)
			id1 = id2;
		
		if(control.beforeCBSubmit)
			i = control.beforeCBSubmit(id1);
		var lsnrs = ig_shared._cbListeners;
		var elem, count = lsnrs ? lsnrs.length : 0;
		
		while(count-- > 0)
		{
			var fn = lsnrs[count];
			if(fn) if((fn = fn.evalCtl) != null)try
			{
				if(typeof fn == 'function')
					fn = fn(id1);
				else if(fn)
					fn = eval(fn).onCBSubmit(id1);
				if(!i)
					i = fn;
			}catch(e){}
		}
		if(i == 'fullPostBack')
		{
			form.submit();
			return;
		}
		if(i == 'cancelSubmit' || i === true)
			return;
		var resp = (i != 'cancelResponse'), request = null;
		try
		{
			if(this._ie)
				request = ig_createActiveXFromProgIDs(["MSXML2.XMLHTTP","Microsoft.XMLHTTP"]);
			else
				request = new XMLHttpRequest();
		}catch(e){}
		if(!request)
			return;
		if(resp)
		{
			id1 = this.__id(id1);
			id2 = this.__id(id2);
			ee = this._panels;
			i = ee.length;
			while(i-- > 0 && resp)
			{
				e = ee[i].noResp;
				j = e ? e.length : e;
				while(j-- > 0) if(e[j] == id1 || e[j] == id2)
					resp = false;
			}
		}
		this._wait = true;
		
		var tags = ['INPUT', 'TEXTAREA', 'SELECT'], evs = ['__EVENTTARGET', '__EVENTARGUMENT'];
		
		
		
		
		var vs = control.getCBSubmitElems ? control.getCBSubmitElems(flag) : null;
		var elems = vs ? vs : form.elements;
		var count = j = elems.length;
		if(vs)
		{
			elems = new Array();
			count = 0;
			while(j-- > 0)
			{
				e = vs[j];
				for(var t = 0; t < 3; t++) try
				{
					if(e.tagName == tags[0])
					{
						elems[count++] = e;
						break;
					}
					ee = e.getElementsByTagName(tags[t]);
					for(i = 0; i < ee.length; i++)
						elems[count++] = ee[i];
				}catch(ex){}
			}
			vs = this._vs;
			for(i = 0; i < vs.length; i += 2)
				elems[count++] = form[vs[i]];
		}
		while(count-- > 0)
		{
			if((elem = elems[count]) == null)
				continue;
			var val = null, name = elem.name;
			var tag = ig_csom.isEmpty(name) ? null : elem.tagName;
			i = 2;
			if(tag == tags[0])
			{
				var type = elem.type;
				if(type == 'text' || type == 'password' || type == 'hidden' || ((type == 'checkbox' || type == 'radio') && elem.checked))
					val = elem.value;
			}
			else if(tag == tags[1])
				val = elem.value;
			else if(tag == tags[2])
			{
				var o = elem.options;
				i = o ? o.length : 0;
				while(i-- > 0) if(o[i].selected)
					args += name + '=' + this._encode(o[i].value) + '&';
			}
			if(val != null)
			{
				args += name + '=' + this._encode(val) + '&';
				while(i-- > 0) if(name == evs[i])
				{
					elem.value = '';
					evs[i] = null;
				}
			}
		}
		i = 2;
		while(i-- > 0) if(evs[i])
			args += evs[i] + '=&';
		var postKey = '_' + Math.random(), cb = -1;
		while(++cb < this._callBacks.length)
			if(!this._callBacks[cb])
				break;
		args += '__IG_CALLBACK=' + this._encode(id + '#' + postKey);
		try
		{
			request.open('POST', form.action, true);
			try
			{
				if(this._ie || request.setRequestHeader)
					request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			}catch(e){}
			if(resp)
			{
				if(!(i = this._ie)) try
				{
					i = !request.addEventListener;
				}
				catch(e)
				{
					i = true;
				}
				if(i)
					request.onreadystatechange = this._responseEvt;
				else
					request.addEventListener('load', this._responseEvt, false);
			}
			request.send(args);
			ig_shared._isPosted = false;
			if(resp)
			{
				window.setTimeout("try{ig_all._ig_cbManager._timeOut('" + postKey + "');}catch(i){}", this._timeLimit + 1000);
				cb = this._callBacks[cb] = {request:request, id:id, postKey:postKey, control:control, timer:control._timer, time:(new Date()).getTime(), triggers:triggers};
				if(rc !== false)
				{
					cb.pis = new Array();
					if(!rc || rc.nodeName)
						cb.pis[0] = this._showPI(rc, control);
					else for(i = 0; i < rc.length; i++)
						cb.pis[i] = this._showPI(rc[i], control);
				}
			}
		}
		catch(e){}
		this._wait = false;
	}
	
	this._timeOut = function(key)
	{
		var cb, i = this._callBacks.length;
		while(i-- > 0) if((cb = this._callBacks[i]) != null)
			if(cb.postKey == key)
				break;
		if(i < 0)
			return;
		var j = cb.control;
		if(j && j.onError)
			j.onError(6);
		j = cb.pis ? cb.pis.length : 0;
		while(j-- > 0)
			cb.pis[j].hide();
		delete this._callBacks[i];
	}
	
	this._showPI = function(rc, ctl)
	{
		var pis = this._indicators;
		if(!pis)
			pis = this._indicators = new Array();
		var pi = null, j = pis.length, i = -1;
		while(++i < j)
		{
			pi = pis[i];
			if(!pi.visible)
				break;
		}
		if(i == j)
			pi = pis[j] = new ig_progressIndicator();
		if(ctl.fixPI)
			ctl.fixPI(pi);
		if(pi._rc)
			rc = null;
		pi.display(rc);
		return pi;
	}
	
	
	
	
	
	this.setHtml = function(txt, elem)
	{
		if(!txt || !elem)
			return null;
		var i = 0, css = '';
		while(ig_shared.IsOpera)
		{
			var i0 = txt.indexOf('<style ', i), i1 = txt.indexOf('<style>', i), i2 = txt.indexOf('<STYLE ', i), i3 = txt.indexOf('<STYLE>', i);
			if(i > i0 || (i1 >= i && i0 > i1))
				i0 = i1;
			if(i > i0 || (i2 >= i && i0 > i2))
				i0 = i2;
			if(i > i0 || (i3 >= i && i0 > i3))
				i0 = i3;
			i1 = txt.indexOf('>', i0);
			if(i > i0 || i0 > i1)
				break;
			i2 = txt.indexOf('</style>', i0);
			i3 = txt.indexOf('</STYLE>', i0);
			if(i1 > i2 || (i3 > i1 && i2 > i3))
				i2 = i3;
			if(i1 > i2)
				break;
			css += txt.substring(i1 + 1, i2);
			txt = txt.substring(0, i0) + txt.substring(i2 + 8);
			i = i0;
		}
		if(css.length > 5)
			this._setCss(null, css, elem.id + '_ig_css');
		i = -3;
		while((i = txt.indexOf('<&>3', i += 3)) >= 0)
			txt = txt.replace('<&>3', '<&>');
		i = 0;
		while(true)
		{
			var iLen = txt.length;
			var i1 = txt.indexOf('<script', i), i2 = txt.indexOf('<SCRIPT', i);
			if(i1 > i2 && i2 >= i)
				i1 = i2;
			if(i1 < i)
				break;
			var t = this._fixScript(txt, i1);
			if(t == null)
				i = i1 + 7;
			else
				txt = t;
		}
		this._fireBeforeResponse(elem);
		elem.innerHTML = txt;
		return txt;
	}
	
	
	
	
	
	this._fixScript = function(txt, i)
	{
		var i2 = txt.indexOf('>', i);
		if(i2 < i)
			return null;
		var i3 = txt.indexOf('</script>', i2), i4 = txt.indexOf('</SCRIPT>', i2);
		if(i3 > i4 && i4 > i)
			i3 = i4;
		var js = txt.substring(i, i2);
		if(js.toLowerCase().indexOf('javascript') < 0)
			return null;
		var first = js.indexOf('IG_FIRST') > 0;
		js = txt.substring(i2 + 1, i3);
		txt = txt.substring(0, i) + txt.substring(i3 + 9);
		if(js.length < 2)
			return txt;
		if(!this._scripts)
			this._scripts = new Array();
		i = this._scripts.length;
		this._scripts[i] = js;
		if(first)
		{
			while(i-- > 0)
				this._scripts[i + 1] = this._scripts[i];
			this._scripts[0] = js;
		}
		return txt;
	}
	
	
	
	this._fireBeforeResponse = function(elem)
	{
		var el, ec, control, i = -1, lsnrs = ig_shared._cbListeners;
		if(lsnrs) while(++i < lsnrs.length)
		{
			if((el = lsnrs[i].elemID) == null)
				continue;
			if((el = ig_shared.getElement(el, this._form)) == null)
				continue;
			try
			{
				control = eval(ec = lsnrs[i].evalCtl);
			}
			catch(ex)
			{
				continue;
			}
			while((el = el.parentNode) != null)
				if(el == elem)
			{
				if(control.onCBBeforeResponse)
					control.onCBBeforeResponse();
				var cb = this._cb;
				if(!cb || !control.onCBAfterResponse)
					continue;
				if(!cb.lsnrs)
					cb.lsnrs = new Array();
				cb.lsnrs[cb.lsnrs.length] = ec;
			}
		}
	}
	this._form = form;
	
	this._timeLimit = 20000;
	
	this._vs = ['__VIEWSTATE', null, '__EVENTVALIDATION', null];
	
	this._sep = '<&>0';
	
	this._sepLen = this._sep.length;
	this._setPan = function(p, se)
	{
		this._panelToSubmit = p;
		this._submitElem = se;
		if(p) this._panTime = (new Date()).getTime();
		else this._evtElem = null;
	}
	this._getPan = function()
	{
		var t = this._panTime;
		if(!t || t + 500 < (new Date()).getTime())
			this._submitElem = this._panelToSubmit = this._panTime = null;
		return this._panelToSubmit;
	}
	
	this._doPostBack = function(target, arg)
	{
		var me = ig_all._ig_cbManager, evt = window.event;
		if(!me || me._wait)
			return ig_cancelEvent(evt, 'submit');
		var pan = me._findPanel(target), form = me._form;
		if(!pan)
		{
			me._evtElem = null;
			me._oldPostBack(target, arg);
			return;
		}
		me._setPan(pan);
		var e = form ? form.__EVENTTARGET : null;
		if(e)
			e.value = target;
		e = form ? form.__EVENTARGUMENT : null;
		if(e)
			e.value = arg;
		me._elemID = target;
		me._onFormSubmit();
		me._elemID = null;
		ig_cancelEvent(evt, 'submit');
	}
	
	this._isMatch = function(x, v)
	{
		if(x == v)
			return true;
		var len = x ? x.length : 0;
		if(len-- < 2)
			return false;
		var wc0 = x.charCodeAt(0) == 42, wc1 = x.charCodeAt(len) == 42;
		if(wc1) x = x.substring(0, len);
		if(wc0) x = x.substring(1);
		var i = v.indexOf(x);
		if(wc0)
		{
			if(wc1) return i >= 0;
			i = v.lastIndexOf(x);
			return i >= 0 && i + len == v.length;
		}
		return wc1 && i == 0;
	}
	this.__id = function(id){return id ? id.replace(/\:/g, '_').replace(/\$/g, '_') : id;}
	
	this._findPanel = function(id, e)
	{
		var j, i, pans = this._panels.length, form = this._form;
		if(this._wait || pans < 1)
			return null;
		if(e)
			id = e.id;
		else if(!id)
			return null;
		var id0 = id;
		id = this.__id(id);
		if(!e && id)
			if((e = ig_shared.getElement(id, form)) == null)
				if((e = ig_shared.getElement(id + "_Data", form)) == null)
					if((e = ig_shared.getElement(id + "_hidden", form)) == null)
						if((e = ig_shared.getElement(id.replace(/\_/g, 'x'), form)) != null)
							if(id0 != id) if((e = ig_shared.getElement(id0, form)) == null)
								e = ig_shared.getElement(id0 + "_Data", form);
		id0 = id;
		while(e || id)
		{
			if(id || (e && e.id)) for(i = 0; i < pans; i++)
			{
				var p = this._panels[i];
				if(e && p.elemID == e.id)
				{
					if(p.post) for(j = 0; j < p.post.length; j++)
						if(this._isMatch(p.post[j], id0))
							return null;
					return p;
				}
				if(p.ids && id) for(j = 0; j < p.ids.length; j++)
					if(this._isMatch(p.ids[j], id0))
						return p;
				if(p.noResp && id) for(j = 0; j < p.noResp.length; j++)
					if(this._isMatch(p.noResp[j], id0))
						return p;
			}
			id = null;
			if(e)
				e = e.parentNode;
		}
		return null;
	}
	
	this._onFormEvt = function(evt)
	{
		if(!evt)
			if((evt = window.event) == null)
				return;
		var elem = evt.target;
		if(!elem)
			if((elem = evt.srcElement) == null)
				elem = this;
		var me = ig_all._ig_cbManager, type = elem.type, tag = elem.tagName, name = elem.name;
		if(!me)
			return;
		me._evtElem = elem;
		me._evtTime = (new Date()).getTime();
		if(evt.type != 'click' || elem.disabled)
			return;
		me._subID = me._submitElem = null;
		var pan = me._findPanel(null, elem);
		if(!pan)
			return;
		var val = null, x = evt.offsetX;
		if(type == 'image' && tag == 'INPUT')
			val = name + '.x=' + (x ? x : 1) + '&' + name + '.y=' + (x ? evt.offsetY : 1);
		else if(type == 'submit' && (tag == 'BUTTON' || tag == 'INPUT'))
			val = name + '=' + me._encode(elem.value);
		else
			return;
		me._setPan(pan, ig_csom.isEmpty(me._subID = name) ? null : val);
	}
	
	this._encode = function(val)
	{
		return (typeof encodeURIComponent == 'function') ? encodeURIComponent(val) : escape(val);
	}
	
	this._restore = function()
	{
		for(var i = 0; i < 3; i += 2)
		{
			var val = this._vs[i + 1], e = ig_shared.getElement(this._vs[i], this._form);
			if(e && val)
				e.value = val;
		}
	}
	
	
	this._onFormSubmit = function(evt, me)
	{
		var my = me && me._vs;
		if(!my)
		{
			me = ig_all._ig_cbManager;
			if(!evt)
				evt = window.event;
		}
		if(me && me._wait)
			me = null;
		if(me && me._onsubmit && !my)
		{
			try
			{
				me._onsubTime = (new Date()).getTime();
				if(me._onsubmit() === false)
					me = null;
			}catch(ex)
			{
				me = null;
			}
			if(evt && evt.returnValue == false && evt.type == 'submit')
				me = null;
		}
		if(!me)
			return ig_cancelEvent(evt, 'submit');
		var form = me._form, pan = me._getPan(), pp = me._panels;
		if(!pan || !form || form.action != form._ig_cb_act)
			return true;
		ig_cancelEvent(evt, 'submit');
		
		var p, rc = pan.rc, i = pp.length, id = pan.link;
		if(id) while(i-- > 0)
			if((p = pp[i]) != null)
				if(p.elemID == id || p.id == id)
					pan = p;
		if(pan)
			me.addCallBack(pan.control, pan.id, rc ? rc : pan.rc);
		me._setPan(null);
		return false;
	}
	
	this._responseEvt = function()
	{
		var me = ig_all._ig_cbManager;
		if(!me || me._wait)
			return;
		for(var i = 0; i < me._callBacks.length; i++)
		{
			var j = -1, cb = me._callBacks[i];
			if(cb && me._doResponse(cb))
			{
				if(cb.pis)
					j = cb.pis.length;
				while(j-- > 0)
					cb.pis[j].hide();
				me._cb = me._scripts = null;
				delete me._callBacks[i];
				if(!me._jsWait && cb.timer)
					me._timer(cb.id, true);
			}
		}
	}
	
	this._doCss = function(e, v)
	{
		e.cssText = v;
		var e1, ss = document.styleSheets;
		var i = ss.length;
		while(i-- > 0)
		{
			e1 = ss[i];
			if(e1 == e)
				return;
			if(!e1.readOnly && !e1.disabled && e1.type == 'text/css')
				break;
		}
		if(i < 0)
			return;
		
	}
	
	this._doResponse = function(cb)
	{
		var request = cb.request;
		if(!request || request.readyState != 4)
			return false;
		var txt = request.responseText, sep = this._sep, sepLen = this._sepLen;
		if(!txt)
			return (new Date()).getTime() - cb.time > this._timeLimit;
		this.serverError = null;
		var e, i, i0 = txt.indexOf(sep);
		var iID = txt.indexOf(sep, i0 + sepLen);
		var iKey = txt.indexOf(sep, iID + sepLen);
		if(i0 < 0 || iID < 0 || iKey < 0)
			return false;
		this.triggers = cb.triggers;
		this._jsWait = false;
		var id = txt.substring(i0 + sepLen, iID), postKey = txt.substring(iID + sepLen, iKey);
		this._error = 0;
		if(postKey.indexOf('<error>') == 0)
		{
			i = this._panels.length;
			this.serverError = txt.split(this._sep)[3];
			while(i-- > 0)
			{
				e = this._panels[i].control;
				if(e && e.onError)
					e.onError(1);
			}
			var lsnrs = ig_shared._cbError;
			i = lsnrs ? lsnrs.length : 0;
			
			while(i-- > 0)try
			{
				lsnrs[i](cb.control,cb.triggers,this.serverError);
			}catch(e){}
			this._restore();
			try
			{
				this._submit(9);
			}catch(e){}
			return true;
		}
		if(id == cb.id && postKey == cb.postKey)
		{
			if(this._cb)
			{
				window.setTimeout("try{ig_all._ig_cbManager._responseEvt();}catch(i){}", 1);
				return this._killCB++ > 20;
			}
			this._cb = cb;
			this._killCB = 0;
			txt = txt.substring(iKey + sepLen);
			var vals = txt.split(sep), old = this._vs;
			for(i = 2; i < vals.length - 1; i += 2)
			{
				var index = -1, v0 = vals[i], v1 = vals[i + 1];
				if(v0 == old[2])
					index = 2;
				else if(v0 == old[0])
					index = 0;
				else if(v0 && v0.indexOf('<') != 0)
					continue;
				vals[i] = vals[i + 1] = null;
				if(index > -1)
				{
					e = ig_shared.getElement(v0, this._form);
					if(e)
					{
						old[index + 1] = e.value;
						e.value = v1;
					}
				}
				else if(v0 == '<script>')
					this._scripts = new Array(v1);
				else if(v0 == '<jssrc>')
				{
					e = document.scripts;
					if(!e || e.length < 2)
						e = document.getElementsByTagName('SCRIPT');
					if(!e)
						continue;
					var s, x = -1, src = '';
					while(++x < e.length) if(e[x]) if((s = e[x].src) != null)
						src += s;
					v1 = v1.split('|');
					this._scriptCount = 0; x = -1;
					while(++x < v1.length)
					{
						s = v1[x].replace('&amp;','&');
						if(src.indexOf((s.charCodeAt(0) < 47) ? s.substring(1) : s) < 0)
							this._addJS(this._runScript(s, true), s, cb);
					}
				}
				else if(v0 == '<style>')
					this._setCss(this._style, v1);
			}
			var ctl = cb.control;
			
			if(vals[0] == '<error>')
			{
				this.serverError = vals[1];
				this._error = 2;
			}
			else if(ctl && ctl.doResponse) try
			{
				ctl.doResponse(vals, this);
			}catch(e){this._error |= 4;}
			cb._js = this._scripts;
			if(this._jsWait)
				window.setTimeout("try{ig_all._ig_cbManager._killJsSrc('" + id + "');}catch(i){}", 3000);
			else
				this._jsDelay(cb);
			if(this._error > 0 && ctl.onError)
				ctl.onError(this._error);
			return true;
		}

		return false;
	}
	
	
	
	
	this._setCss = function(e, v, id, bad)
	{
		try
		{
			if((!id || bad) && document.createStyleSheet)
			{
				var e0 = e ? e.owningElement : null;
				e = e0 ? e0.parentElement : null;
				if(e && e.parentNode)
					e.removeChild(e0);
				e0 = document.createStyleSheet();
				if(!bad) this._style = e0;
				this._doCss(e0, v);
				return e0;
			}
			if(id)
				e = document.getElementById(id);
			if(!e)
			{
				e = document.createElement('STYLE');
				e.type = 'text/css';
				var h = document.getElementsByTagName('HEAD');
				h = (h && h.length > 0) ? h[0] : document.body;
				h.appendChild(e);
				if(id)
					e.id = id;
				else if(!bad)
					this._style = e;
			}
			e.innerHTML = v;
			return e;
		}catch(e)
		{
			this._error |= 32;
		}
	}
	
	this._jsDelay = function(cb)
	{
		if(!cb)
			return;
		var i, ctl = cb.control, js = cb._js;
		cb.control = cb._js = null;
		if(js) for(i = 0; i < js.length; i++)
			this._runScript(js[i]);
		
		
		if(cb.lsnrs) for(i = 0; i < cb.lsnrs.length; i++) try
		{
			eval(cb.lsnrs[i]).onCBAfterResponse();
		}catch(ex){}
		cb.lsnrs = null;
		
		if(ctl && ctl.afterCBResponse)
			ctl.afterCBResponse();
	}
	
	
	
	
	this._addJS = function(se, src, cb)
	{
		if(!se)
			return;
		this._jsWait = true;
		var js = this._jsSrcs;
		var j = -1, jL = js.length;
		while(++j < jL) if(js[j].src == src)
		{
			js[j].cb[js[j].cb.length] = cb;
			return;
		}
		js[jL] = {se:se,src:src,cb:[cb]};
		ig_shared.addEventListener(se, 'readystatechange', this._removeJS);
	}
	
	
	
	this._removeJS = function(se)
	{
		var me = ig_all._ig_cbManager;
		if(!me || !se)
			return;
		var e = se.srcElement;
		if(e)
		{
			if(e.readyState != 'loaded')
				return;
			se = e;
		}
		ig_shared.removeEventListener(se, 'readystatechange', me._removeJS);
		var js = me._jsSrcs;
		var x, i, cbx, cb = null, j = -1, jL = js ? js.length : 0;
		while(++j < jL) if(js[j].se == se)
		{
			cb = js[j].cb;
			js[j].se = null;
		}
		i = cb ? cb.length : 0;
		while(i-- > 0)
		{
			var cbi = cb[i];
			j = jL;
			while(j-- > 0 && cbi) if(js[j].se)
			{
				cbx = js[j].cb;
				x = cbx.length;
				while(x-- > 0) if(cbx[x] == cbi)
				{
					cbi = null;
					break;
				}
			}
			if(!cbi)
				continue;
			j = jL;
			while(j-- > 0)
			{
				if(js[j].se)
					se = null;
				cbx = js[j].cb;
				x = cbx.length;
				while(x-- > 0) if(cbx[x] == cbi)
					delete cbx[x];
			}
			if(se)
			{
				while(++j < jL)
					delete js[j];
				me._jsSrcs = new Array();
			}
			me._jsDelay(cbi);
			if(cbi.timer)
				me._timer(cbi.id, true);
		}
	}
	
	this._killJsSrc = function(id)
	{
		var me = ig_all._ig_cbManager;
		var js = me ? me._jsSrcs : null;
		var j = js ? js.length : 0;
		while(j-- > 0)
		{
			var x = -1, cbx = js[j].cb;
			while(++x < cbx.length)
				if(cbx[x] && (cbx[x].id == id || !id))
					me._removeJS(js[j].se);
		}
		if(!id && this._jsSrcs.length > 0)
			this._jsSrcs = new Array();
	}
	
	
	
	this._timer = function(id, wait)
	{
		var me = ig_all._ig_cbManager;
		var pan, cb = me ? me._callBacks : null;
		var i = cb ? cb.length : 0;
		while(i-- > 0) if(cb[i] && cb[i].id == id)
			return;
		i = me._panels.length;
		while(i-- > 0)
		{
			pan = me._panels[i];
			if(pan.id == id)
				break;
		}
		if(i >= 0)
			i = pan.control._timer;
		if(!i || i < 1)
			return;
		if(!wait)
		{
			pan.wait = false;
			if(!me.addCallBack(pan, null, null, -1))
				return;
		}
		if(!pan.wait)
			window.setTimeout("try{ig_all._ig_cbManager._timer('" + id + "');}catch(i){}", i);
		pan.wait = true;
	}
	
	this._runScript = function(js, src)
	{
		var e = document.getElementsByTagName('HEAD');
		e = (e && e.length > 0) ? e[0] : document.body;
		if(js && js.length > 1) try
		{
			if(!src)
			{
				
				try
				{
					eval(js);
					return;
				} 
				catch(ex){}
			}
			var se = document.createElement('SCRIPT');
			se.type = 'text/javascript';
			if(src)
				se.src = js;
			else
				se.text = js;
			e.appendChild(se);
			if(src && document.all)
				return se;
		}
		catch(ex)
		{
			this._error |= 16;
		}
	}
	
	this.newPanel = function(id, uid, ids, prop, post, noResp)
	{
		var elem = document.getElementById(id);
		if(!elem)
			return;
		var o = ig_all[id];
		if(o)
			ig_dispose(o);
		var pi = {loc:ig_Location.MiddleCenter};
		pi.setImageUrl = function(v){this.url = v;}
		pi.getImageUrl = function(){return this.url;}
		pi.setTemplate = function(v){this.html = v;}
		pi.getTemplate = function(){return this.html;}
		pi.setLocation = function(v){this.loc = v;}
		pi.getLocation = function(){return this.loc;}
		pi.setRelativeContainer = function(v){this.rc = v;}
		pi.getRelativeContainer = function(){return this.rc;}
		o = ig_all[id] = {_id:id, _uniqueID:uid, _element:elem, _pi:pi, _evts:prop};
		var t = o._timer = prop[5] ? prop[5] : 0;
		o.getTimer = function(){return this._timer;}
		o.setTimer = function(v){this._timer = v;}
		o.getID = function(){return this._id;}
		o.getUniqueID = function(){return this._uniqueID;}
		o.getElement = function(){return this._element;}
		o.getProgressIndicator = function(){return this._pi;}
		o.findControl = function(id){return ig_shared.findControl(this._element, id);}
		o._fire = function(evt, p3)
		{
			evt = this._evts ? this._evts[evt] : null;
			if(!evt)
				return false;
			var evtO = new ig_EventObject();
			ig_fireEvent(this, ig_shared.replace(evt, "&quot;", "'"), evtO, p3);
			if(evtO.cancelResponse)
				return 'cancelResponse';
			if(evtO.fullPostBack)
				return 'fullPostBack';
			return evtO.cancel;
		}
		o.beforeCBSubmit = function(src){return this._fire(1, src);}
		o.afterCBResponse = function(){this._fire(3);}
		o.onError = function(flags){this._fire(4, flags);}
		o.doResponse = function(vals, man)
		{
			if(!this._fire(2)) for(var i = 0; i + 1 < vals.length; i += 2)
			{
				var e, v, v0 = vals[i], v1 = vals[i + 1];
				if(!v0)
					continue;
				if(v0.indexOf('-') == 0)
				{
					e = ig_shared.getElement(v = v0.substring(2), man._form);
					if(!e)
						e = ig_shared.getElement(man.__id(v), man._form);
					if(e)
						v0 = v0.charCodeAt(1);
					if(v0 == 51)
						e.innerHTML = v1;
					else if(v1 == '&nbsp;')
						v1 = '';
					if(v0 == 48)
						e.value = v1;
					if(v0 == 49)
						e.checked = v1.toLowerCase() == 'true';
					if(v0 == 50)
						e.selectedIndex = parseInt(v1);
					if(v0 == 52)
						e.src = v1;
					continue;
				}
				e = ig_getWebControlById(v0);
				if(e)
				{
					man.setHtml(v1, e._element);
					continue;
				}
				try
				{
					var multi = v0.indexOf('+') == 0;
					e = eval(multi ? v0.substring(1) : v0);
					if(e && e.doResponse)
					{
						if(multi)
						{
							v1 = parseInt(v1);
							v0 = new Array();
							while(v1-- > 0)
							{
								v0[v0.length] = vals[i += 2];
								v0[v0.length] = vals[i + 1];
							}
						}
						else
							v0 = [v0,v1];
						e.doResponse(v0, man);
					}
				}catch(e){man._error |= 8;}
			}
		}
		o.fixPI = function(pi)
		{
			var p = this._pi;
			pi.setLocation(p.loc);
			if(pi._html != p.html)
				pi.setTemplate(p.html);
			if(pi._img != p.url)
				pi.setImageUrl(p.url);
			pi._rc = p.rc;
		}
		o.refresh = function()
		{
			try
			{
				ig_all._ig_cbManager.addCallBack(this, this._uniqueID, this._element, -1);
			}catch(e){}
		}
		this.addPanel(o, uid, id, elem, null, ids, post, noResp);
		o._fire(0);
		if(t > 0)
			window.setTimeout("try{ig_all._ig_cbManager._timer('" + uid + "');}catch(i){}", t);
	}
	
	
	this._submit = function(flag)
	{
		var me = ig_all._ig_cbManager;
		if(!me)
			return;
		var pan = me._getPan(), elem = me._evtElem, f = me._form;
		if(!pan && elem && flag != 9)
		{
			if((new Date()).getTime() < me._evtTime + ((elem.nodeName == 'A') ? 200 : 30))
				me._setPan(pan = me._findPanel(null, elem));
			if(pan)
				if(!me._onFormSubmit(null, me))
					return;
			me._setPan(null);
		}
		if(f && f._ig_cb_submit)try
		{
			pan = me._onsubTime;
			if(pan && (new Date()).getTime() - pan > 100)
				pan = null;
			if(me._onsubmit && !flag && !pan)try
			{
				if(me._onsubmit() === false)
					return;
			}catch(ex){}
			f._ig_cb_submit();
		}catch(me){}
	}
	
	this._callBacks = new Array();
	
	
	this._panels = new Array();
	
	this._jsSrcs = new Array();
	this._ie = typeof ActiveXObject != 'undefined';
	this._ok = this._ie || typeof XMLHttpRequest != 'undefined';
	if(!this._ok)
		return;
	form._ig_cb_act = form.action;
	this._onsubmit = form.onsubmit;
	form.onsubmit = null;
	form._ig_cb_submit = form.submit;
	form.submit = this._submit;
	ig_shared.addEventListener(form, 'submit', this._onFormSubmit, true);
	ig_shared.addEventListener(form, 'click', this._onFormEvt, true);
	ig_shared.addEventListener(form, 'mousedown', this._onFormEvt, true);
	ig_shared.addEventListener(form, 'mouseup', this._onFormEvt, true);
	this._oldPostBack = window.__doPostBack;
	if(this._oldPostBack)
		window.__doPostBack = this._doPostBack;
}

function ig_createActiveXFromProgIDs(progIDs)
{
	var e;
	for(var i=0;i<progIDs.length;i++)
	{
		try
		{
			var activeX=new ActiveXObject(progIDs[i]);
			return activeX;
		}
		catch (e){;}
	}
	return null;
}

function ig$(id)
{
	var o = null;
	if(typeof ig_getWebControlById == "function")
		o = ig_getWebControlById(id);
	if(o)
		return o;
	if(typeof igedit_getById == "function")
		o = igedit_getById(id);
	if(o)
		return o;
	if(typeof igtab_getTabById == "function")
		o = igtab_getTabById(id);
	if(o)
		return o;
	if(typeof igcal_getCalendarById == "function")
		o = igcal_getCalendarById(id);
	if(o)
		return o;
	if(typeof igdrp_getComboById == "function")
		o = igdrp_getComboById(id);
	if(o)
		return o;
	if(typeof iged_getById == "function")
		o = iged_getById(id);
	if(o)
		return o;
	if(typeof iglbar_getListbarById == "function")
		o = iglbar_getListbarById(id);
	if(o)
		return o;
	if(typeof igcmbo_getComboById == "function")
		o = igcmbo_getComboById(id);
	if(o)
		return o;
	if(typeof igtbl_getGridById == "function")
		o = igtbl_getGridById(id);
	if(o)
		return o;
	if(typeof igtbar_getToolbarById == "function")
		o = igtbar_getToolbarById(id);
	if(o)
		return o;
	if(typeof igmenu_getMenuById == "function")
		o = igmenu_getMenuById(id);
	if(o)
		return o;
	if(typeof igtree_getTreeById == "function")
		o = igtree_getTreeById(id);
	return o;
}


//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjax.js
Function.__typeName="Function";Function.__class=true;Function.createCallback=function(b,a){return function(){var e=arguments.length;if(e>0){var d=[];for(var c=0;c<e;c++)d[c]=arguments[c];d[e]=a;return b.apply(this,d)}return b.call(this,a)}};Function.createDelegate=function(a,b){return function(){return b.apply(a,arguments)}};Function.emptyFunction=Function.emptyMethod=function(){};Function._validateParams=function(e,c){var a;a=Function._validateParameterCount(e,c);if(a){a.popStackFrame();return a}for(var b=0;b<e.length;b++){var d=c[Math.min(b,c.length-1)],f=d.name;if(d.parameterArray)f+="["+(b-c.length+1)+"]";a=Function._validateParameter(e[b],d,f);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(e,a){var c=a.length,d=0;for(var b=0;b<a.length;b++)if(a[b].parameterArray)c=Number.MAX_VALUE;else if(!a[b].optional)d++;if(e.length<d||e.length>c){var f=Error.parameterCount();f.popStackFrame();return f}return null};Function._validateParameter=function(c,a,h){var b,g=a.type,l=!!a.integer,k=!!a.domElement,m=!!a.mayBeNull;b=Function._validateParameterType(c,g,l,k,m,h);if(b){b.popStackFrame();return b}var e=a.elementType,f=!!a.elementMayBeNull;if(g===Array&&typeof c!=="undefined"&&c!==null&&(e||!f)){var j=!!a.elementInteger,i=!!a.elementDomElement;for(var d=0;d<c.length;d++){var n=c[d];b=Function._validateParameterType(n,e,j,i,f,h+"["+d+"]");if(b){b.popStackFrame();return b}}}return null};Function._validateParameterType=function(a,c,n,m,k,d){var b;if(typeof a==="undefined")if(k)return null;else{b=Error.argumentUndefined(d);b.popStackFrame();return b}if(a===null)if(k)return null;else{b=Error.argumentNull(d);b.popStackFrame();return b}if(c&&c.__enum){if(typeof a!=="number"){b=Error.argumentType(d,Object.getType(a),c);b.popStackFrame();return b}if(a%1===0){var e=c.prototype;if(!c.__flags||a===0){for(var i in e)if(e[i]===a)return null}else{var l=a;for(var i in e){var f=e[i];if(f===0)continue;if((f&a)===f)l-=f;if(l===0)return null}}}b=Error.argumentOutOfRange(d,a,String.format(Sys.Res.enumInvalidValue,a,c.getName()));b.popStackFrame();return b}if(m){var h;if(typeof a.nodeType!=="number"){var g=a.ownerDocument||a.document||a;if(g!=a){var j=g.defaultView||g.parentWindow;h=j!=a&&!(j.document&&a.document&&j.document===a.document)}else h=typeof g.body==="undefined"}else h=a.nodeType===3;if(h){b=Error.argument(d,Sys.Res.argumentDomElement);b.popStackFrame();return b}}if(c&&!c.isInstanceOfType(a)){b=Error.argumentType(d,Object.getType(a),c);b.popStackFrame();return b}if(c===Number&&n)if(a%1!==0){b=Error.argumentOutOfRange(d,a,Sys.Res.argumentInteger);b.popStackFrame();return b}return null};Error.__typeName="Error";Error.__class=true;Error.create=function(d,b){var a=new Error(d);a.message=d;if(b)for(var c in b)a[c]=b[c];a.popStackFrame();return a};Error.argument=function(a,c){var b="Sys.ArgumentException: "+(c?c:Sys.Res.argument);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentException",paramName:a});d.popStackFrame();return d};Error.argumentNull=function(a,c){var b="Sys.ArgumentNullException: "+(c?c:Sys.Res.argumentNull);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentNullException",paramName:a});d.popStackFrame();return d};Error.argumentOutOfRange=function(c,a,d){var b="Sys.ArgumentOutOfRangeException: "+(d?d:Sys.Res.argumentOutOfRange);if(c)b+="\n"+String.format(Sys.Res.paramName,c);if(typeof a!=="undefined"&&a!==null)b+="\n"+String.format(Sys.Res.actualValue,a);var e=Error.create(b,{name:"Sys.ArgumentOutOfRangeException",paramName:c,actualValue:a});e.popStackFrame();return e};Error.argumentType=function(d,c,b,e){var a="Sys.ArgumentTypeException: ";if(e)a+=e;else if(c&&b)a+=String.format(Sys.Res.argumentTypeWithTypes,c.getName(),b.getName());else a+=Sys.Res.argumentType;if(d)a+="\n"+String.format(Sys.Res.paramName,d);var f=Error.create(a,{name:"Sys.ArgumentTypeException",paramName:d,actualType:c,expectedType:b});f.popStackFrame();return f};Error.argumentUndefined=function(a,c){var b="Sys.ArgumentUndefinedException: "+(c?c:Sys.Res.argumentUndefined);if(a)b+="\n"+String.format(Sys.Res.paramName,a);var d=Error.create(b,{name:"Sys.ArgumentUndefinedException",paramName:a});d.popStackFrame();return d};Error.format=function(a){var c="Sys.FormatException: "+(a?a:Sys.Res.format),b=Error.create(c,{name:"Sys.FormatException"});b.popStackFrame();return b};Error.invalidOperation=function(a){var c="Sys.InvalidOperationException: "+(a?a:Sys.Res.invalidOperation),b=Error.create(c,{name:"Sys.InvalidOperationException"});b.popStackFrame();return b};Error.notImplemented=function(a){var c="Sys.NotImplementedException: "+(a?a:Sys.Res.notImplemented),b=Error.create(c,{name:"Sys.NotImplementedException"});b.popStackFrame();return b};Error.parameterCount=function(a){var c="Sys.ParameterCountException: "+(a?a:Sys.Res.parameterCount),b=Error.create(c,{name:"Sys.ParameterCountException"});b.popStackFrame();return b};Error.prototype.popStackFrame=function(){if(typeof this.stack==="undefined"||this.stack===null||typeof this.fileName==="undefined"||this.fileName===null||typeof this.lineNumber==="undefined"||this.lineNumber===null)return;var a=this.stack.split("\n"),c=a[0],e=this.fileName+":"+this.lineNumber;while(typeof c!=="undefined"&&c!==null&&c.indexOf(e)===-1){a.shift();c=a[0]}var d=a[1];if(typeof d==="undefined"||d===null)return;var b=d.match(/@(.*):(\d+)$/);if(typeof b==="undefined"||b===null)return;this.fileName=b[1];this.lineNumber=parseInt(b[2]);a.shift();this.stack=a.join("\n")};Object.__typeName="Object";Object.__class=true;Object.getType=function(b){var a=b.constructor;if(!a||typeof a!=="function"||!a.__typeName||a.__typeName==="Object")return Object;return a};Object.getTypeName=function(a){return Object.getType(a).getName()};String.__typeName="String";String.__class=true;String.prototype.endsWith=function(a){return this.substr(this.length-a.length)===a};String.prototype.startsWith=function(a){return this.substr(0,a.length)===a};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};String.prototype.trimEnd=function(){return this.replace(/\s+$/,"")};String.prototype.trimStart=function(){return this.replace(/^\s+/,"")};String.format=function(){return String._toFormattedString(false,arguments)};String.localeFormat=function(){return String._toFormattedString(true,arguments)};String._toFormattedString=function(l,j){var c="",e=j[0];for(var a=0;true;){var f=e.indexOf("{",a),d=e.indexOf("}",a);if(f<0&&d<0){c+=e.slice(a);break}if(d>0&&(d<f||f<0)){c+=e.slice(a,d+1);a=d+2;continue}c+=e.slice(a,f);a=f+1;if(e.charAt(a)==="{"){c+="{";a++;continue}if(d<0)break;var h=e.substring(a,d),g=h.indexOf(":"),k=parseInt(g<0?h:h.substring(0,g),10)+1,i=g<0?"":h.substring(g+1),b=j[k];if(typeof b==="undefined"||b===null)b="";if(b.toFormattedString)c+=b.toFormattedString(i);else if(l&&b.localeFormat)c+=b.localeFormat(i);else if(b.format)c+=b.format(i);else c+=b.toString();a=d+1}return c};Boolean.__typeName="Boolean";Boolean.__class=true;Boolean.parse=function(b){var a=b.trim().toLowerCase();if(a==="false")return false;if(a==="true")return true};Date.__typeName="Date";Date.__class=true;Date._appendPreOrPostMatch=function(e,b){var d=0,a=false;for(var c=0,g=e.length;c<g;c++){var f=e.charAt(c);switch(f){case "'":if(a)b.append("'");else d++;a=false;break;case "\\":if(a)b.append("\\");a=!a;break;default:b.append(f);a=false}}return d};Date._expandFormat=function(a,b){if(!b)b="F";if(b.length===1)switch(b){case "d":return a.ShortDatePattern;case "D":return a.LongDatePattern;case "t":return a.ShortTimePattern;case "T":return a.LongTimePattern;case "F":return a.FullDateTimePattern;case "M":case "m":return a.MonthDayPattern;case "s":return a.SortableDateTimePattern;case "Y":case "y":return a.YearMonthPattern;default:throw Error.format(Sys.Res.formatInvalidString)}return b};Date._expandYear=function(c,a){if(a<100){var b=(new Date).getFullYear();a+=b-b%100;if(a>c.Calendar.TwoDigitYearMax)return a-100}return a};Date._getParseRegExp=function(b,e){if(!b._parseRegExp)b._parseRegExp={};else if(b._parseRegExp[e])return b._parseRegExp[e];var c=Date._expandFormat(b,e);c=c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var a=new Sys.StringBuilder("^"),j=[],f=0,i=0,h=Date._getTokenRegExp(),d;while((d=h.exec(c))!==null){var l=c.slice(f,d.index);f=h.lastIndex;i+=Date._appendPreOrPostMatch(l,a);if(i%2===1){a.append(d[0]);continue}switch(d[0]){case "dddd":case "ddd":case "MMMM":case "MMM":a.append("(\\D+)");break;case "tt":case "t":a.append("(\\D*)");break;case "yyyy":a.append("(\\d{4})");break;case "fff":a.append("(\\d{3})");break;case "ff":a.append("(\\d{2})");break;case "f":a.append("(\\d)");break;case "dd":case "d":case "MM":case "M":case "yy":case "y":case "HH":case "H":case "hh":case "h":case "mm":case "m":case "ss":case "s":a.append("(\\d\\d?)");break;case "zzz":a.append("([+-]?\\d\\d?:\\d{2})");break;case "zz":case "z":a.append("([+-]?\\d\\d?)")}Array.add(j,d[0])}Date._appendPreOrPostMatch(c.slice(f),a);a.append("$");var k=a.toString().replace(/\s+/g,"\\s+"),g={"regExp":k,"groups":j};b._parseRegExp[e]=g;return g};Date._getTokenRegExp=function(){return /dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z/g};Date.parseLocale=function(a){return Date._parse(a,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(a){return Date._parse(a,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(g,c,h){var e=false;for(var a=1,i=h.length;a<i;a++){var f=h[a];if(f){e=true;var b=Date._parseExact(g,f,c);if(b)return b}}if(!e){var d=c._getDateTimeFormats();for(var a=0,i=d.length;a<i;a++){var b=Date._parseExact(g,d[a],c);if(b)return b}}return null};Date._parseExact=function(s,y,j){s=s.trim();var m=j.dateTimeFormat,v=Date._getParseRegExp(m,y),x=(new RegExp(v.regExp)).exec(s);if(x===null)return null;var w=v.groups,f=null,c=null,h=null,g=null,d=0,n=0,o=0,e=0,k=null,r=false;for(var p=0,z=w.length;p<z;p++){var a=x[p+1];if(a)switch(w[p]){case "dd":case "d":h=parseInt(a,10);if(h<1||h>31)return null;break;case "MMMM":c=j._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=j._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":var c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":f=Date._expandYear(m,parseInt(a,10));if(f<0||f>9999)return null;break;case "yyyy":f=parseInt(a,10);if(f<0||f>9999)return null;break;case "h":case "hh":d=parseInt(a,10);if(d===12)d=0;if(d<0||d>11)return null;break;case "H":case "HH":d=parseInt(a,10);if(d<0||d>23)return null;break;case "m":case "mm":n=parseInt(a,10);if(n<0||n>59)return null;break;case "s":case "ss":o=parseInt(a,10);if(o<0||o>59)return null;break;case "tt":case "t":var u=a.toUpperCase();r=u===m.PMDesignator.toUpperCase();if(!r&&u!==m.AMDesignator.toUpperCase())return null;break;case "f":e=parseInt(a,10)*100;if(e<0||e>999)return null;break;case "ff":e=parseInt(a,10)*10;if(e<0||e>999)return null;break;case "fff":e=parseInt(a,10);if(e<0||e>999)return null;break;case "dddd":g=j._getDayIndex(a);if(g<0||g>6)return null;break;case "ddd":g=j._getAbbrDayIndex(a);if(g<0||g>6)return null;break;case "zzz":var q=a.split(/:/);if(q.length!==2)return null;var i=parseInt(q[0],10);if(i<-12||i>13)return null;var l=parseInt(q[1],10);if(l<0||l>59)return null;k=i*60+(a.startsWith("-")?-l:l);break;case "z":case "zz":var i=parseInt(a,10);if(i<-12||i>13)return null;k=i*60}}var b=new Date;if(f===null)f=b.getFullYear();if(c===null)c=b.getMonth();if(h===null)h=b.getDate();b.setFullYear(f,c,h);if(b.getDate()!==h)return null;if(g!==null&&b.getDay()!==g)return null;if(r&&d<12)d+=12;b.setHours(d,n,o,e);if(k!==null){var t=b.getMinutes()-(k+b.getTimezoneOffset());b.setHours(b.getHours()+parseInt(t/60,10),t%60)}return b};Date.prototype.format=function(a){return this._toFormattedString(a,Sys.CultureInfo.InvariantCulture)};Date.prototype.localeFormat=function(a){return this._toFormattedString(a,Sys.CultureInfo.CurrentCulture)};Date.prototype._toFormattedString=function(e,h){if(!e||e.length===0||e==="i")if(h&&h.name.length>0)return this.toLocaleString();else return this.toString();var d=h.dateTimeFormat;e=Date._expandFormat(d,e);var a=new Sys.StringBuilder,b;function c(a){if(a<10)return "0"+a;return a.toString()}function g(a){if(a<10)return "00"+a;if(a<100)return "0"+a;return a.toString()}var j=0,i=Date._getTokenRegExp();for(;true;){var l=i.lastIndex,f=i.exec(e),k=e.slice(l,f?f.index:e.length);j+=Date._appendPreOrPostMatch(k,a);if(!f)break;if(j%2===1){a.append(f[0]);continue}switch(f[0]){case "dddd":a.append(d.DayNames[this.getDay()]);break;case "ddd":a.append(d.AbbreviatedDayNames[this.getDay()]);break;case "dd":a.append(c(this.getDate()));break;case "d":a.append(this.getDate());break;case "MMMM":a.append(d.MonthNames[this.getMonth()]);break;case "MMM":a.append(d.AbbreviatedMonthNames[this.getMonth()]);break;case "MM":a.append(c(this.getMonth()+1));break;case "M":a.append(this.getMonth()+1);break;case "yyyy":a.append(this.getFullYear());break;case "yy":a.append(c(this.getFullYear()%100));break;case "y":a.append(this.getFullYear()%100);break;case "hh":b=this.getHours()%12;if(b===0)b=12;a.append(c(b));break;case "h":b=this.getHours()%12;if(b===0)b=12;a.append(b);break;case "HH":a.append(c(this.getHours()));break;case "H":a.append(this.getHours());break;case "mm":a.append(c(this.getMinutes()));break;case "m":a.append(this.getMinutes());break;case "ss":a.append(c(this.getSeconds()));break;case "s":a.append(this.getSeconds());break;case "tt":a.append(this.getHours()<12?d.AMDesignator:d.PMDesignator);break;case "t":a.append((this.getHours()<12?d.AMDesignator:d.PMDesignator).charAt(0));break;case "f":a.append(g(this.getMilliseconds()).charAt(0));break;case "ff":a.append(g(this.getMilliseconds()).substr(0,2));break;case "fff":a.append(g(this.getMilliseconds()));break;case "z":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+Math.floor(Math.abs(b)));break;case "zz":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+c(Math.floor(Math.abs(b))));break;case "zzz":b=this.getTimezoneOffset()/60;a.append((b<=0?"+":"-")+c(Math.floor(Math.abs(b)))+d.TimeSeparator+c(Math.abs(this.getTimezoneOffset()%60)))}}return a.toString()};Number.__typeName="Number";Number.__class=true;Number.parseLocale=function(a){return Number._parse(a,Sys.CultureInfo.CurrentCulture)};Number.parseInvariant=function(a){return Number._parse(a,Sys.CultureInfo.InvariantCulture)};Number._parse=function(b,o){b=b.trim();if(b.match(/^[+-]?infinity$/i))return parseFloat(b);if(b.match(/^0x[a-f0-9]+$/i))return parseInt(b);var a=o.numberFormat,g=Number._parseNumberNegativePattern(b,a,a.NumberNegativePattern),h=g[0],e=g[1];if(h===""&&a.NumberNegativePattern!==1){g=Number._parseNumberNegativePattern(b,a,1);h=g[0];e=g[1]}if(h==="")h="+";var j,d,f=e.indexOf("e");if(f<0)f=e.indexOf("E");if(f<0){d=e;j=null}else{d=e.substr(0,f);j=e.substr(f+1)}var c,k,m=d.indexOf(a.NumberDecimalSeparator);if(m<0){c=d;k=null}else{c=d.substr(0,m);k=d.substr(m+a.NumberDecimalSeparator.length)}c=c.split(a.NumberGroupSeparator).join("");var n=a.NumberGroupSeparator.replace(/\u00A0/g," ");if(a.NumberGroupSeparator!==n)c=c.split(n).join("");var l=h+c;if(k!==null)l+="."+k;if(j!==null){var i=Number._parseNumberNegativePattern(j,a,1);if(i[0]==="")i[0]="+";l+="e"+i[0]+i[1]}if(l.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/))return parseFloat(l);return Number.NaN};Number._parseNumberNegativePattern=function(a,d,e){var b=d.NegativeSign,c=d.PositiveSign;switch(e){case 4:b=" "+b;c=" "+c;case 3:if(a.endsWith(b))return ["-",a.substr(0,a.length-b.length)];else if(a.endsWith(c))return ["+",a.substr(0,a.length-c.length)];break;case 2:b+=" ";c+=" ";case 1:if(a.startsWith(b))return ["-",a.substr(b.length)];else if(a.startsWith(c))return ["+",a.substr(c.length)];break;case 0:if(a.startsWith("(")&&a.endsWith(")"))return ["-",a.substr(1,a.length-2)]}return ["",a]};Number.prototype.format=function(a){return this._toFormattedString(a,Sys.CultureInfo.InvariantCulture)};Number.prototype.localeFormat=function(a){return this._toFormattedString(a,Sys.CultureInfo.CurrentCulture)};Number.prototype._toFormattedString=function(d,j){if(!d||d.length===0||d==="i")if(j&&j.name.length>0)return this.toLocaleString();else return this.toString();var o=["n %","n%","%n"],n=["-n %","-n%","-%n"],p=["(n)","-n","- n","n-","n -"],m=["$n","n$","$ n","n $"],l=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function g(a,c,d){for(var b=a.length;b<c;b++)a=d?"0"+a:a+"0";return a}function i(j,i,l,n,p){var h=l[0],k=1,o=Math.pow(10,i),m=Math.round(j*o)/o;if(!isFinite(m))m=j;j=m;var b=j.toString(),a="",c,e=b.split(/e/i);b=e[0];c=e.length>1?parseInt(e[1]):0;e=b.split(".");b=e[0];a=e.length>1?e[1]:"";var q;if(c>0){a=g(a,c,false);b+=a.slice(0,c);a=a.substr(c)}else if(c<0){c=-c;b=g(b,c+1,true);a=b.slice(-c,b.length)+a;b=b.slice(0,-c)}if(i>0){if(a.length>i)a=a.slice(0,i);else a=g(a,i,false);a=p+a}else a="";var d=b.length-1,f="";while(d>=0){if(h===0||h>d)if(f.length>0)return b.slice(0,d+1)+n+f+a;else return b.slice(0,d+1)+a;if(f.length>0)f=b.slice(d-h+1,d+1)+n+f;else f=b.slice(d-h+1,d+1);d-=h;if(k<l.length){h=l[k];k++}}return b.slice(0,d+1)+n+f+a}var a=j.numberFormat,e=Math.abs(this);if(!d)d="D";var b=-1;if(d.length>1)b=parseInt(d.slice(1),10);var c;switch(d.charAt(0)){case "d":case "D":c="n";if(b!==-1)e=g(""+e,b,true);if(this<0)e=-e;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;e=i(Math.abs(this),b,a.CurrencyGroupSizes,a.CurrencyGroupSeparator,a.CurrencyDecimalSeparator);break;case "n":case "N":if(this<0)c=p[a.NumberNegativePattern];else c="n";if(b===-1)b=a.NumberDecimalDigits;e=i(Math.abs(this),b,a.NumberGroupSizes,a.NumberGroupSeparator,a.NumberDecimalSeparator);break;case "p":case "P":if(this<0)c=n[a.PercentNegativePattern];else c=o[a.PercentPositivePattern];if(b===-1)b=a.PercentDecimalDigits;e=i(Math.abs(this)*100,b,a.PercentGroupSizes,a.PercentGroupSeparator,a.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var k=/n|\$|-|%/g,f="";for(;true;){var q=k.lastIndex,h=k.exec(c);f+=c.slice(q,h?h.index:c.length);if(!h)break;switch(h[0]){case "n":f+=e;break;case "$":f+=a.CurrencySymbol;break;case "-":f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};RegExp.__typeName="RegExp";RegExp.__class=true;Array.__typeName="Array";Array.__class=true;Array.add=Array.enqueue=function(a,b){a[a.length]=b};Array.addRange=function(a,b){a.push.apply(a,b)};Array.clear=function(a){a.length=0};Array.clone=function(a){if(a.length===1)return [a[0]];else return Array.apply(null,a)};Array.contains=function(a,b){return Array.indexOf(a,b)>=0};Array.dequeue=function(a){return a.shift()};Array.forEach=function(b,e,d){for(var a=0,f=b.length;a<f;a++){var c=b[a];if(typeof c!=="undefined")e.call(d,c,a,b)}};Array.indexOf=function(d,e,a){if(typeof e==="undefined")return -1;var c=d.length;if(c!==0){a=a-0;if(isNaN(a))a=0;else{if(isFinite(a))a=a-a%1;if(a<0)a=Math.max(0,c+a)}for(var b=a;b<c;b++)if(typeof d[b]!=="undefined"&&d[b]===e)return b}return -1};Array.insert=function(a,b,c){a.splice(b,0,c)};Array.parse=function(value){if(!value)return [];return eval(value)};Array.remove=function(b,c){var a=Array.indexOf(b,c);if(a>=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};if(!window)this.window=this;window.Type=Function;Type.prototype.callBaseMethod=function(a,d,b){var c=this.getBaseMethod(a,d);if(!b)return c.apply(a);else return c.apply(a,b)};Type.prototype.getBaseMethod=function(d,c){var b=this.getBaseType();if(b){var a=b.prototype[c];return a instanceof Function?a:null}return null};Type.prototype.getBaseType=function(){return typeof this.__baseType==="undefined"?null:this.__baseType};Type.prototype.getInterfaces=function(){var a=[],b=this;while(b){var c=b.__interfaces;if(c)for(var d=0,f=c.length;d<f;d++){var e=c[d];if(!Array.contains(a,e))a[a.length]=e}b=b.__baseType}return a};Type.prototype.getName=function(){return typeof this.__typeName==="undefined"?"":this.__typeName};Type.prototype.implementsInterface=function(d){this.resolveInheritance();var c=d.getName(),a=this.__interfaceCache;if(a){var e=a[c];if(typeof e!=="undefined")return e}else a=this.__interfaceCache={};var b=this;while(b){var f=b.__interfaces;if(f)if(Array.indexOf(f,d)!==-1)return a[c]=true;b=b.__baseType}return a[c]=false};Type.prototype.inheritsFrom=function(b){this.resolveInheritance();var a=this.__baseType;while(a){if(a===b)return true;a=a.__baseType}return false};Type.prototype.initializeBase=function(a,b){this.resolveInheritance();if(this.__baseType)if(!b)this.__baseType.apply(a);else this.__baseType.apply(a,b);return a};Type.prototype.isImplementedBy=function(a){if(typeof a==="undefined"||a===null)return false;var b=Object.getType(a);return !!(b.implementsInterface&&b.implementsInterface(this))};Type.prototype.isInstanceOfType=function(b){if(typeof b==="undefined"||b===null)return false;if(b instanceof this)return true;var a=Object.getType(b);return !!(a===this)||a.inheritsFrom&&a.inheritsFrom(this)||a.implementsInterface&&a.implementsInterface(this)};Type.prototype.registerClass=function(c,b,d){this.prototype.constructor=this;this.__typeName=c;this.__class=true;if(b){this.__baseType=b;this.__basePrototypePending=true}Sys.__upperCaseTypes[c.toUpperCase()]=this;if(d){this.__interfaces=[];for(var a=2,f=arguments.length;a<f;a++){var e=arguments[a];this.__interfaces.push(e)}}return this};Type.prototype.registerInterface=function(a){Sys.__upperCaseTypes[a.toUpperCase()]=this;this.prototype.constructor=this;this.__typeName=a;this.__interface=true;return this};Type.prototype.resolveInheritance=function(){if(this.__basePrototypePending){var b=this.__baseType;b.resolveInheritance();for(var a in b.prototype){var c=b.prototype[a];if(!this.prototype[a])this.prototype[a]=c}delete this.__basePrototypePending}};Type.getRootNamespaces=function(){return Array.clone(Sys.__rootNamespaces)};Type.isClass=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__class};Type.isInterface=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__interface};Type.isNamespace=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__namespace};Type.parse=function(typeName,ns){var fn;if(ns){fn=Sys.__upperCaseTypes[ns.getName().toUpperCase()+"."+typeName.toUpperCase()];return fn||null}if(!typeName)return null;if(!Type.__htClasses)Type.__htClasses={};fn=Type.__htClasses[typeName];if(!fn){fn=eval(typeName);Type.__htClasses[typeName]=fn}return fn};Type.registerNamespace=function(f){var d=window,c=f.split(".");for(var b=0;b<c.length;b++){var e=c[b],a=d[e];if(!a){a=d[e]={__namespace:true,__typeName:c.slice(0,b+1).join(".")};if(b===0)Sys.__rootNamespaces[Sys.__rootNamespaces.length]=a;a.getName=function(){return this.__typeName}}d=a}};window.Sys={__namespace:true,__typeName:"Sys",getName:function(){return "Sys"},__upperCaseTypes:{}};Sys.__rootNamespaces=[Sys];Sys.IDisposable=function(){};Sys.IDisposable.prototype={};Sys.IDisposable.registerInterface("Sys.IDisposable");Sys.StringBuilder=function(a){this._parts=typeof a!=="undefined"&&a!==null&&a!==""?[a.toString()]:[];this._value={};this._len=0};Sys.StringBuilder.prototype={append:function(a){this._parts[this._parts.length]=a},appendLine:function(a){this._parts[this._parts.length]=typeof a==="undefined"||a===null||a===""?"\r\n":a+"\r\n"},clear:function(){this._parts=[];this._value={};this._len=0},isEmpty:function(){if(this._parts.length===0)return true;return this.toString()===""},toString:function(a){a=a||"";var b=this._parts;if(this._len!==b.length){this._value={};this._len=b.length}var d=this._value;if(typeof d[a]==="undefined"){if(a!=="")for(var c=0;c<b.length;)if(typeof b[c]==="undefined"||b[c]===""||b[c]===null)b.splice(c,1);else c++;d[a]=this._parts.join(a)}return d[a]}};Sys.StringBuilder.registerClass("Sys.StringBuilder");if(!window.XMLHttpRequest)window.XMLHttpRequest=function(){var b=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var a=0,c=b.length;a<c;a++)try{return new ActiveXObject(b[a])}catch(d){}return null};Sys.Browser={};Sys.Browser.InternetExplorer={};Sys.Browser.Firefox={};Sys.Browser.Safari={};Sys.Browser.Opera={};Sys.Browser.agent=null;Sys.Browser.hasDebuggerStatement=false;Sys.Browser.name=navigator.appName;Sys.Browser.version=parseFloat(navigator.appVersion);Sys.Browser.documentMode=0;if(navigator.userAgent.indexOf(" MSIE ")>-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);if(Sys.Browser.version>=8)if(document.documentMode>=7)Sys.Browser.documentMode=document.documentMode;Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" AppleWebKit/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else if(navigator.userAgent.indexOf("Opera/")>-1)Sys.Browser.agent=Sys.Browser.Opera;Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(a){if(typeof Debug!=="undefined"&&Debug.writeln)Debug.writeln(a);if(window.console&&window.console.log)window.console.log(a);if(window.opera)window.opera.postError(a);if(window.debugService)window.debugService.trace(a)},_appendTrace:function(b){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value+=b+"\n"},assert:function(c,a,b){if(!c){a=b&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,a,this.assert.caller):String.format(Sys.Res.assertFailed,a);if(confirm(String.format(Sys.Res.breakIntoDebugger,a)))this.fail(a)}},clearTrace:function(){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value=""},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement)eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){var c=this._traceDump(a,b,true)},_traceDump:function(a,c,f,b,d){c=c?c:"traceDump";b=b?b:"";if(a===null){this.trace(b+c+": null");return}switch(typeof a){case "undefined":this.trace(b+c+": Undefined");break;case "number":case "string":case "boolean":this.trace(b+c+": "+a);break;default:if(Date.isInstanceOfType(a)||RegExp.isInstanceOfType(a)){this.trace(b+c+": "+a.toString());break}if(!d)d=[];else if(Array.contains(d,a)){this.trace(b+c+": ...");return}Array.add(d,a);if(a==window||a===document||window.HTMLElement&&a instanceof HTMLElement||typeof a.nodeName==="string"){var k=a.tagName?a.tagName:"DomElement";if(a.id)k+=" - "+a.id;this.trace(b+c+" {"+k+"}")}else{var i=Object.getTypeName(a);this.trace(b+c+(typeof i==="string"?" {"+i+"}":""));if(b===""||f){b+="    ";var e,j,l,g,h;if(Array.isInstanceOfType(a)){j=a.length;for(e=0;e<j;e++)this._traceDump(a[e],"["+e+"]",f,b,d)}else for(g in a){h=a[g];if(!Function.isInstanceOfType(h))this._traceDump(h,g,f,b,d)}}}Array.remove(d,a)}}};Sys._Debug.registerClass("Sys._Debug");Sys.Debug=new Sys._Debug;Sys.Debug.isDebug=false;function Sys$Enum$parse(c,e){var a,b,i;if(e){a=this.__lowerCaseValues;if(!a){this.__lowerCaseValues=a={};var g=this.prototype;for(var f in g)a[f.toLowerCase()]=g[f]}}else a=this.prototype;if(!this.__flags){i=e?c.toLowerCase():c;b=a[i.trim()];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c,this.__typeName));return b}else{var h=(e?c.toLowerCase():c).split(","),j=0;for(var d=h.length-1;d>=0;d--){var k=h[d].trim();b=a[k];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c.split(",")[d].trim(),this.__typeName));j|=b}return j}}function Sys$Enum$toString(c){if(typeof c==="undefined"||c===null)return this.__string;var d=this.prototype,a;if(!this.__flags||c===0){for(a in d)if(d[a]===c)return a}else{var b=this.__sortedValues;if(!b){b=[];for(a in d)b[b.length]={key:a,value:d[a]};b.sort(function(a,b){return a.value-b.value});this.__sortedValues=b}var e=[],g=c;for(a=b.length-1;a>=0;a--){var h=b[a],f=h.value;if(f===0)continue;if((f&c)===f){e[e.length]=h.key;g-=f;if(g===0)break}}if(e.length&&g===0)return e.reverse().join(", ")}return ""}Type.prototype.registerEnum=function(b,c){Sys.__upperCaseTypes[b.toUpperCase()]=this;for(var a in this.prototype)this[a]=this.prototype[a];this.__typeName=b;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=c;this.__enum=true};Type.isEnum=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__enum};Type.isFlags=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__flags};Sys.EventHandlerList=function(){this._list={}};Sys.EventHandlerList.prototype={addHandler:function(b,a){Array.add(this._getEvent(b,true),a)},removeHandler:function(c,b){var a=this._getEvent(c);if(!a)return;Array.remove(a,b)},getHandler:function(b){var a=this._getEvent(b);if(!a||a.length===0)return null;a=Array.clone(a);return function(c,d){for(var b=0,e=a.length;b<e;b++)a[b](c,d)}},_getEvent:function(a,b){if(!this._list[a]){if(!b)return null;this._list[a]=[]}return this._list[a]}};Sys.EventHandlerList.registerClass("Sys.EventHandlerList");Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Sys.INotifyPropertyChange=function(){};Sys.INotifyPropertyChange.prototype={};Sys.INotifyPropertyChange.registerInterface("Sys.INotifyPropertyChange");Sys.PropertyChangedEventArgs=function(a){Sys.PropertyChangedEventArgs.initializeBase(this);this._propertyName=a};Sys.PropertyChangedEventArgs.prototype={get_propertyName:function(){return this._propertyName}};Sys.PropertyChangedEventArgs.registerClass("Sys.PropertyChangedEventArgs",Sys.EventArgs);Sys.INotifyDisposing=function(){};Sys.INotifyDisposing.prototype={};Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing");Sys.Component=function(){if(Sys.Application)Sys.Application.registerDisposableObject(this)};Sys.Component.prototype={_id:null,_initialized:false,_updating:false,get_events:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_id:function(){return this._id},set_id:function(a){this._id=a},get_isInitialized:function(){return this._initialized},get_isUpdating:function(){return this._updating},add_disposing:function(a){this.get_events().addHandler("disposing",a)},remove_disposing:function(a){this.get_events().removeHandler("disposing",a)},add_propertyChanged:function(a){this.get_events().addHandler("propertyChanged",a)},remove_propertyChanged:function(a){this.get_events().removeHandler("propertyChanged",a)},beginUpdate:function(){this._updating=true},dispose:function(){if(this._events){var a=this._events.getHandler("disposing");if(a)a(this,Sys.EventArgs.Empty)}delete this._events;Sys.Application.unregisterDisposableObject(this);Sys.Application.removeComponent(this)},endUpdate:function(){this._updating=false;if(!this._initialized)this.initialize();this.updated()},initialize:function(){this._initialized=true},raisePropertyChanged:function(b){if(!this._events)return;var a=this._events.getHandler("propertyChanged");if(a)a(this,new Sys.PropertyChangedEventArgs(b))},updated:function(){}};Sys.Component.registerClass("Sys.Component",null,Sys.IDisposable,Sys.INotifyPropertyChange,Sys.INotifyDisposing);function Sys$Component$_setProperties(a,i){var d,j=Object.getType(a),e=j===Object||j===Sys.UI.DomElement,h=Sys.Component.isInstanceOfType(a)&&!a.get_isUpdating();if(h)a.beginUpdate();for(var c in i){var b=i[c],f=e?null:a["get_"+c];if(e||typeof f!=="function"){var k=a[c];if(!b||typeof b!=="object"||e&&!k)a[c]=b;else Sys$Component$_setProperties(k,b)}else{var l=a["set_"+c];if(typeof l==="function")l.apply(a,[b]);else if(b instanceof Array){d=f.apply(a);for(var g=0,m=d.length,n=b.length;g<n;g++,m++)d[m]=b[g]}else if(typeof b==="object"&&Object.getType(b)===Object){d=f.apply(a);Sys$Component$_setProperties(d,b)}}}if(h)a.endUpdate()}function Sys$Component$_setReferences(c,b){for(var a in b){var e=c["set_"+a],d=$find(b[a]);e.apply(c,[d])}}var $create=Sys.Component.create=function(h,f,d,c,g){var a=g?new h(g):new h,b=Sys.Application,i=b.get_isCreatingComponents();a.beginUpdate();if(f)Sys$Component$_setProperties(a,f);if(d)for(var e in d)a["add_"+e](d[e]);if(a.get_id())b.addComponent(a);if(i){b._createdComponents[b._createdComponents.length]=a;if(c)b._addComponentToSecondPass(a,c);else a.endUpdate()}else{if(c)Sys$Component$_setReferences(a,c);a.endUpdate()}return a};Sys.UI.MouseButton=function(){throw Error.notImplemented()};Sys.UI.MouseButton.prototype={leftButton:0,middleButton:1,rightButton:2};Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton");Sys.UI.Key=function(){throw Error.notImplemented()};Sys.UI.Key.prototype={backspace:8,tab:9,enter:13,esc:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:127};Sys.UI.Key.registerEnum("Sys.UI.Key");Sys.UI.Point=function(a,b){this.x=a;this.y=b};Sys.UI.Point.registerClass("Sys.UI.Point");Sys.UI.Bounds=function(c,d,b,a){this.x=c;this.y=d;this.height=a;this.width=b};Sys.UI.Bounds.registerClass("Sys.UI.Bounds");Sys.UI.DomEvent=function(e){var a=e,b=this.type=a.type.toLowerCase();this.rawEvent=a;this.altKey=a.altKey;if(typeof a.button!=="undefined")this.button=typeof a.which!=="undefined"?a.button:a.button===4?Sys.UI.MouseButton.middleButton:a.button===2?Sys.UI.MouseButton.rightButton:Sys.UI.MouseButton.leftButton;if(b==="keypress")this.charCode=a.charCode||a.keyCode;else if(a.keyCode&&a.keyCode===46)this.keyCode=127;else this.keyCode=a.keyCode;this.clientX=a.clientX;this.clientY=a.clientY;this.ctrlKey=a.ctrlKey;this.target=a.target?a.target:a.srcElement;if(!b.startsWith("key"))if(typeof a.offsetX!=="undefined"&&typeof a.offsetY!=="undefined"){this.offsetX=a.offsetX;this.offsetY=a.offsetY}else if(this.target&&this.target.nodeType!==3&&typeof a.clientX==="number"){var c=Sys.UI.DomElement.getLocation(this.target),d=Sys.UI.DomElement._getWindow(this.target);this.offsetX=(d.pageXOffset||0)+a.clientX-c.x;this.offsetY=(d.pageYOffset||0)+a.clientY-c.y}this.screenX=a.screenX;this.screenY=a.screenY;this.shiftKey=a.shiftKey};Sys.UI.DomEvent.prototype={preventDefault:function(){if(this.rawEvent.preventDefault)this.rawEvent.preventDefault();else if(window.event)this.rawEvent.returnValue=false},stopPropagation:function(){if(this.rawEvent.stopPropagation)this.rawEvent.stopPropagation();else if(window.event)this.rawEvent.cancelBubble=true}};Sys.UI.DomEvent.registerClass("Sys.UI.DomEvent");var $addHandler=Sys.UI.DomEvent.addHandler=function(a,d,e){if(!a._events)a._events={};var c=a._events[d];if(!c)a._events[d]=c=[];var b;if(a.addEventListener){b=function(b){return e.call(a,new Sys.UI.DomEvent(b))};a.addEventListener(d,b,false)}else if(a.attachEvent){b=function(){var b={};try{b=Sys.UI.DomElement._getWindow(a).event}catch(c){}return e.call(a,new Sys.UI.DomEvent(b))};a.attachEvent("on"+d,b)}c[c.length]={handler:e,browserHandler:b}},$addHandlers=Sys.UI.DomEvent.addHandlers=function(e,d,c){for(var b in d){var a=d[b];if(c)a=Function.createDelegate(c,a);$addHandler(e,b,a)}},$clearHandlers=Sys.UI.DomEvent.clearHandlers=function(a){if(a._events){var e=a._events;for(var b in e){var d=e[b];for(var c=d.length-1;c>=0;c--)$removeHandler(a,b,d[c].handler)}a._events=null}},$removeHandler=Sys.UI.DomEvent.removeHandler=function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b<g;b++)if(c[b].handler===f){d=c[b].browserHandler;break}if(a.removeEventListener)a.removeEventListener(e,d,false);else if(a.detachEvent)a.detachEvent("on"+e,d);c.splice(b,1)};Sys.UI.DomElement=function(){};Sys.UI.DomElement.registerClass("Sys.UI.DomElement");Sys.UI.DomElement.addCssClass=function(a,b){if(!Sys.UI.DomElement.containsCssClass(a,b))if(a.className==="")a.className=b;else a.className+=" "+b};Sys.UI.DomElement.containsCssClass=function(b,a){return Array.contains(b.className.split(" "),a)};Sys.UI.DomElement.getBounds=function(a){var b=Sys.UI.DomElement.getLocation(a);return new Sys.UI.Bounds(b.x,b.y,a.offsetWidth||0,a.offsetHeight||0)};var $get=Sys.UI.DomElement.getElementById=function(f,e){if(!e)return document.getElementById(f);if(e.getElementById)return e.getElementById(f);var c=[],d=e.childNodes;for(var b=0;b<d.length;b++){var a=d[b];if(a.nodeType==1)c[c.length]=a}while(c.length){a=c.shift();if(a.id==f)return a;d=a.childNodes;for(b=0;b<d.length;b++){a=d[b];if(a.nodeType==1)c[c.length]=a}}return null};switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:Sys.UI.DomElement.getLocation=function(a){if(a.self||a.nodeType===9)return new Sys.UI.Point(0,0);var b=a.getBoundingClientRect();if(!b)return new Sys.UI.Point(0,0);var d=a.ownerDocument.documentElement,e=b.left-2+d.scrollLeft,f=b.top-2+d.scrollTop;try{var c=a.ownerDocument.parentWindow.frameElement||null;if(c){var g=c.frameBorder==="0"||c.frameBorder==="no"?2:0;e+=g;f+=g}}catch(h){}return new Sys.UI.Point(e,f)};break;case Sys.Browser.Safari:Sys.UI.DomElement.getLocation=function(c){if(c.window&&c.window===c||c.nodeType===9)return new Sys.UI.Point(0,0);var f=0,g=0,j=null,e=null,b;for(var a=c;a;j=a,(e=b,a=a.offsetParent)){b=Sys.UI.DomElement._getCurrentStyle(a);var d=a.tagName?a.tagName.toUpperCase():null;if((a.offsetLeft||a.offsetTop)&&(d!=="BODY"||(!e||e.position!=="absolute"))){f+=a.offsetLeft;g+=a.offsetTop}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(var a=c.parentNode;a;a=a.parentNode){d=a.tagName?a.tagName.toUpperCase():null;if(d!=="BODY"&&d!=="HTML"&&(a.scrollLeft||a.scrollTop)){f-=a.scrollLeft||0;g-=a.scrollTop||0}b=Sys.UI.DomElement._getCurrentStyle(a);var i=b?b.position:null;if(i&&i==="absolute")break}return new Sys.UI.Point(f,g)};break;case Sys.Browser.Opera:Sys.UI.DomElement.getLocation=function(b){if(b.window&&b.window===b||b.nodeType===9)return new Sys.UI.Point(0,0);var d=0,e=0,i=null;for(var a=b;a;i=a,a=a.offsetParent){var f=a.tagName;d+=a.offsetLeft||0;e+=a.offsetTop||0}var g=b.style.position,c=g&&g!=="static";for(var a=b.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)&&(c&&(a.style.overflow==="scroll"||a.style.overflow==="auto"))){d-=a.scrollLeft||0;e-=a.scrollTop||0}var h=a&&a.style?a.style.position:null;c=c||h&&h!=="static"}return new Sys.UI.Point(d,e)};break;default:Sys.UI.DomElement.getLocation=function(d){if(d.window&&d.window===d||d.nodeType===9)return new Sys.UI.Point(0,0);var e=0,f=0,i=null,g=null,b=null;for(var a=d;a;i=a,(g=b,a=a.offsetParent)){var c=a.tagName?a.tagName.toUpperCase():null;b=Sys.UI.DomElement._getCurrentStyle(a);if((a.offsetLeft||a.offsetTop)&&!(c==="BODY"&&(!g||g.position!=="absolute"))){e+=a.offsetLeft;f+=a.offsetTop}if(i!==null&&b){if(c!=="TABLE"&&c!=="TD"&&c!=="HTML"){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}if(c==="TABLE"&&(b.position==="relative"||b.position==="absolute")){e+=parseInt(b.marginLeft)||0;f+=parseInt(b.marginTop)||0}}}b=Sys.UI.DomElement._getCurrentStyle(d);var h=b?b.position:null;if(!h||h!=="absolute")for(var a=d.parentNode;a;a=a.parentNode){c=a.tagName?a.tagName.toUpperCase():null;if(c!=="BODY"&&c!=="HTML"&&(a.scrollLeft||a.scrollTop)){e-=a.scrollLeft||0;f-=a.scrollTop||0;b=Sys.UI.DomElement._getCurrentStyle(a);if(b){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}}}return new Sys.UI.Point(e,f)}}Sys.UI.DomElement.removeCssClass=function(d,c){var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()};Sys.UI.DomElement.setLocation=function(b,c,d){var a=b.style;a.position="absolute";a.left=c+"px";a.top=d+"px"};Sys.UI.DomElement.toggleCssClass=function(b,a){if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);else Sys.UI.DomElement.addCssClass(b,a)};Sys.UI.DomElement.getVisibilityMode=function(a){return a._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(a,b){Sys.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==b){a._visibilityMode=b;if(Sys.UI.DomElement.getVisible(a)===false)if(a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none";a._visibilityMode=b}};Sys.UI.DomElement.getVisible=function(b){var a=b.currentStyle||Sys.UI.DomElement._getCurrentStyle(b);if(!a)return true;return a.visibility!=="hidden"&&a.display!=="none"};Sys.UI.DomElement.setVisible=function(a,b){if(b!==Sys.UI.DomElement.getVisible(a)){Sys.UI.DomElement._ensureOldDisplayMode(a);a.style.visibility=b?"visible":"hidden";if(b||a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none"}};Sys.UI.DomElement._ensureOldDisplayMode=function(a){if(!a._oldDisplayMode){var b=a.currentStyle||Sys.UI.DomElement._getCurrentStyle(a);a._oldDisplayMode=b?b.display:null;if(!a._oldDisplayMode||a._oldDisplayMode==="none")switch(a.tagName.toUpperCase()){case "DIV":case "P":case "ADDRESS":case "BLOCKQUOTE":case "BODY":case "COL":case "COLGROUP":case "DD":case "DL":case "DT":case "FIELDSET":case "FORM":case "H1":case "H2":case "H3":case "H4":case "H5":case "H6":case "HR":case "IFRAME":case "LEGEND":case "OL":case "PRE":case "TABLE":case "TD":case "TH":case "TR":case "UL":a._oldDisplayMode="block";break;case "LI":a._oldDisplayMode="list-item";break;default:a._oldDisplayMode="inline"}}};Sys.UI.DomElement._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(a){if(a.nodeType===3)return null;var c=Sys.UI.DomElement._getWindow(a);if(a.documentElement)a=a.documentElement;var b=c&&a!==c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle||a.style;if(!b&&Sys.Browser.agent===Sys.Browser.Safari&&a.style){var g=a.style.display,f=a.style.position;a.style.position="absolute";a.style.display="block";var e=c.getComputedStyle(a,null);a.style.display=g;a.style.position=f;b={};for(var d in e)b[d]=e[d];b.display="none"}return b};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys._ScriptLoader=function(){this._scriptsToLoad=null;this._sessions=[];this._scriptLoadedDelegate=Function.createDelegate(this,this._scriptLoadedHandler)};Sys._ScriptLoader.prototype={dispose:function(){this._stopSession();this._loading=false;if(this._events)delete this._events;this._sessions=null;this._currentSession=null;this._scriptLoadedDelegate=null},loadScripts:function(d,b,c,a){var e={allScriptsLoadedCallback:b,scriptLoadFailedCallback:c,scriptLoadTimeoutCallback:a,scriptsToLoad:this._scriptsToLoad,scriptTimeout:d};this._scriptsToLoad=null;this._sessions[this._sessions.length]=e;if(!this._loading)this._nextSession()},notifyScriptLoaded:function(){if(!this._loading)return;this._currentTask._notified++;if(Sys.Browser.agent===Sys.Browser.Safari)if(this._currentTask._notified===1)window.setTimeout(Function.createDelegate(this,function(){this._scriptLoadedHandler(this._currentTask.get_scriptElement(),true)}),0)},queueCustomScriptTag:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,a)},queueScriptBlock:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{text:a})},queueScriptReference:function(a){if(!this._scriptsToLoad)this._scriptsToLoad=[];Array.add(this._scriptsToLoad,{src:a})},_createScriptElement:function(c){var a=document.createElement("script");a.type="text/javascript";for(var b in c)a[b]=c[b];return a},_loadScriptsInternal:function(){var b=this._currentSession;if(b.scriptsToLoad&&b.scriptsToLoad.length>0){var c=Array.dequeue(b.scriptsToLoad),a=this._createScriptElement(c);if(a.text&&Sys.Browser.agent===Sys.Browser.Safari){a.innerHTML=a.text;delete a.text}if(typeof c.src==="string"){this._currentTask=new Sys._ScriptLoaderTask(a,this._scriptLoadedDelegate);this._currentTask.execute()}else{document.getElementsByTagName("head")[0].appendChild(a);Sys._ScriptLoader._clearScript(a);this._loadScriptsInternal()}}else{this._stopSession();var d=b.allScriptsLoadedCallback;if(d)d(this);this._nextSession()}},_nextSession:function(){if(this._sessions.length===0){this._loading=false;this._currentSession=null;return}this._loading=true;var a=Array.dequeue(this._sessions);this._currentSession=a;if(a.scriptTimeout>0)this._timeoutCookie=window.setTimeout(Function.createDelegate(this,this._scriptLoadTimeoutHandler),a.scriptTimeout*1000);this._loadScriptsInternal()},_raiseError:function(a){var c=this._currentSession.scriptLoadFailedCallback,b=this._currentTask.get_scriptElement();this._stopSession();if(c){c(this,b,a);this._nextSession()}else{this._loading=false;throw Sys._ScriptLoader._errorScriptLoadFailed(b.src,a)}},_scriptLoadedHandler:function(a,b){if(b&&this._currentTask._notified)if(this._currentTask._notified>1)this._raiseError(true);else{Array.add(Sys._ScriptLoader._getLoadedScripts(),a.src);this._currentTask.dispose();this._currentTask=null;this._loadScriptsInternal()}else this._raiseError(false)},_scriptLoadTimeoutHandler:function(){var a=this._currentSession.scriptLoadTimeoutCallback;this._stopSession();if(a)a(this);this._nextSession()},_stopSession:function(){if(this._timeoutCookie){window.clearTimeout(this._timeoutCookie);this._timeoutCookie=null}if(this._currentTask){this._currentTask.dispose();this._currentTask=null}}};Sys._ScriptLoader.registerClass("Sys._ScriptLoader",null,Sys.IDisposable);Sys._ScriptLoader.getInstance=function(){var a=Sys._ScriptLoader._activeInstance;if(!a)a=Sys._ScriptLoader._activeInstance=new Sys._ScriptLoader;return a};Sys._ScriptLoader.isScriptLoaded=function(b){var a=document.createElement("script");a.src=b;return Array.contains(Sys._ScriptLoader._getLoadedScripts(),a.src)};Sys._ScriptLoader.readLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){var b=Sys._ScriptLoader._referencedScripts=[],c=document.getElementsByTagName("script");for(i=c.length-1;i>=0;i--){var d=c[i],a=d.src;if(a.length)if(!Array.contains(b,a))Array.add(b,a)}}};Sys._ScriptLoader._clearScript=function(a){if(!Sys.Debug.isDebug)a.parentNode.removeChild(a)};Sys._ScriptLoader._errorScriptLoadFailed=function(b,d){var a;if(d)a=Sys.Res.scriptLoadMultipleCallbacks;else a=Sys.Res.scriptLoadFailed;var e="Sys.ScriptLoadFailedException: "+String.format(a,b),c=Error.create(e,{name:"Sys.ScriptLoadFailedException","scriptUrl":b});c.popStackFrame();return c};Sys._ScriptLoader._getLoadedScripts=function(){if(!Sys._ScriptLoader._referencedScripts){Sys._ScriptLoader._referencedScripts=[];Sys._ScriptLoader.readLoadedScripts()}return Sys._ScriptLoader._referencedScripts};Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a;this._notified=0};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoader._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_addScriptElementHandlers:function(){this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(Sys.Browser.agent!==Sys.Browser.InternetExplorer){this._scriptElement.readyState="loaded";$addHandler(this._scriptElement,"load",this._scriptLoadDelegate)}else $addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate);if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var a=this.get_scriptElement();if(Sys.Browser.agent!==Sys.Browser.InternetExplorer)$removeHandler(a,"load",this._scriptLoadDelegate);else $removeHandler(a,"readystatechange",this._scriptLoadDelegate);if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(a.readyState!=="loaded"&&a.readyState!=="complete")return;var b=this;window.setTimeout(function(){b._completedCallback(a,true)},0)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys.ApplicationLoadEventArgs=function(b,a){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=b;this._isPartialLoad=a};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys.HistoryEventArgs=function(a){Sys.HistoryEventArgs.initializeBase(this);this._state=a};Sys.HistoryEventArgs.prototype={get_state:function(){return this._state}};Sys.HistoryEventArgs.registerClass("Sys.HistoryEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._appLoadHandler=null;this._beginRequestHandler=null;this._clientId=null;this._currentEntry="";this._endRequestHandler=null;this._history=null;this._enableHistory=false;this._historyFrame=null;this._historyInitialized=false;this._historyInitialLength=0;this._historyLength=0;this._historyPointIsNew=false;this._ignoreTimer=false;this._initialState=null;this._state={};this._timerCookie=0;this._timerHandler=null;this._uniqueId=null;this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);this._loadHandlerDelegate=Function.createDelegate(this,this._loadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);Sys.UI.DomEvent.addHandler(window,"load",this._loadHandlerDelegate)};Sys._Application.prototype={_creatingComponents:false,_disposing:false,get_isCreatingComponents:function(){return this._creatingComponents},get_stateString:function(){var a=window.location.hash;if(this._isSafari2()){var b=this._getHistory();if(b)a=b[window.history.length-this._historyInitialLength]}if(a.length>0&&a.charAt(0)==="#")a=a.substring(1);if(Sys.Browser.agent===Sys.Browser.Firefox)a=this._serializeState(this._deserializeState(a,true));return a},get_enableHistory:function(){return this._enableHistory},set_enableHistory:function(a){this._enableHistory=a},add_init:function(a){if(this._initialized)a(this,Sys.EventArgs.Empty);else this.get_events().addHandler("init",a)},remove_init:function(a){this.get_events().removeHandler("init",a)},add_load:function(a){this.get_events().addHandler("load",a)},remove_load:function(a){this.get_events().removeHandler("load",a)},add_navigate:function(a){this.get_events().addHandler("navigate",a)},remove_navigate:function(a){this.get_events().removeHandler("navigate",a)},add_unload:function(a){this.get_events().addHandler("unload",a)},remove_unload:function(a){this.get_events().removeHandler("unload",a)},addComponent:function(a){this._components[a.get_id()]=a},addHistoryPoint:function(c,f){this._ensureHistory();var b=this._state;for(var a in c){var d=c[a];if(d===null){if(typeof b[a]!=="undefined")delete b[a]}else b[a]=d}var e=this._serializeState(b);this._historyPointIsNew=true;this._setState(e,f);this._raiseNavigate()},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}if(this._endRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);delete this._endRequestHandler}if(this._beginRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);delete this._beginRequestHandler}if(window.pageUnload)window.pageUnload(this,Sys.EventArgs.Empty);var c=this.get_events().getHandler("unload");if(c)c(this,Sys.EventArgs.Empty);var b=Array.clone(this._disposableObjects);for(var a=0,e=b.length;a<e;a++)b[a].dispose();Array.clear(this._disposableObjects);Sys.UI.DomEvent.removeHandler(window,"unload",this._unloadHandlerDelegate);if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}var d=Sys._ScriptLoader.getInstance();if(d)d.dispose();Sys._Application.callBaseMethod(this,"dispose")}},endCreateComponents:function(){var b=this._secondPassComponents;for(var a=0,d=b.length;a<d;a++){var c=b[a].component;Sys$Component$_setReferences(c,b[a].references);c.endUpdate()}this._secondPassComponents=[];this._creatingComponents=false},findComponent:function(b,a){return a?Sys.IContainer.isInstanceOfType(a)?a.findComponent(b):a[b]||null:Sys.Application._components[b]||null},getComponents:function(){var a=[],b=this._components;for(var c in b)a[a.length]=b[c];return a},initialize:function(){if(!this._initialized&&!this._initializing){this._initializing=true;window.setTimeout(Function.createDelegate(this,this._doInitialize),0)}},notifyScriptLoaded:function(){var a=Sys._ScriptLoader.getInstance();if(a)a.notifyScriptLoaded()},registerDisposableObject:function(a){if(!this._disposing)this._disposableObjects[this._disposableObjects.length]=a},raiseLoad:function(){var b=this.get_events().getHandler("load"),a=new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents),!this._initializing);if(b)b(this,a);if(window.pageLoad)window.pageLoad(this,a);this._createdComponents=[]},removeComponent:function(b){var a=b.get_id();if(a)delete this._components[a]},setServerId:function(a,b){this._clientId=a;this._uniqueId=b},setServerState:function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)},unregisterDisposableObject:function(a){if(!this._disposing)Array.remove(this._disposableObjects,a)},_addComponentToSecondPass:function(b,a){this._secondPassComponents[this._secondPassComponents.length]={component:b,references:a}},_deserializeState:function(a,i){var e={};a=a||"";var b=a.indexOf("&&");if(b!==-1&&b+2<a.length){e.__s=a.substr(b+2);a=a.substr(0,b)}var g=a.split("&");for(var f=0,k=g.length;f<k;f++){var d=g[f],c=d.indexOf("=");if(c!==-1&&c+1<d.length){var j=d.substr(0,c),h=d.substr(c+1);e[j]=i?h:decodeURIComponent(h)}}return e},_doInitialize:function(){Sys._Application.callBaseMethod(this,"initialize");var b=this.get_events().getHandler("init");if(b){this.beginCreateComponents();b(this,Sys.EventArgs.Empty);this.endCreateComponents()}if(Sys.WebForms){this._beginRequestHandler=Function.createDelegate(this,this._onPageRequestManagerBeginRequest);Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler);this._endRequestHandler=Function.createDelegate(this,this._onPageRequestManagerEndRequest);Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler)}var a=this.get_stateString();if(a!==this._currentEntry)this._navigate(a);this.raiseLoad();this._initializing=false},_enableHistoryInScriptManager:function(){this._enableHistory=true},_ensureHistory:function(){if(!this._historyInitialized&&this._enableHistory){if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.documentMode<8){this._historyFrame=document.getElementById("__historyFrame");this._ignoreIFrame=true}if(this._isSafari2()){var a=document.getElementById("__history");this._setHistory([window.location.hash]);this._historyInitialLength=window.history.length}this._timerHandler=Function.createDelegate(this,this._onIdle);this._timerCookie=window.setTimeout(this._timerHandler,100);try{this._initialState=this._deserializeState(this.get_stateString())}catch(b){}this._historyInitialized=true}},_getHistory:function(){var a=document.getElementById("__history");if(!a)return "";var b=a.value;return b?Sys.Serialization.JavaScriptSerializer.deserialize(b,true):""},_isSafari2:function(){return Sys.Browser.agent===Sys.Browser.Safari&&Sys.Browser.version<=419.3},_loadHandler:function(){if(this._loadHandlerDelegate){Sys.UI.DomEvent.removeHandler(window,"load",this._loadHandlerDelegate);this._loadHandlerDelegate=null}this.initialize()},_navigate:function(c){this._ensureHistory();var b=this._deserializeState(c);if(this._uniqueId){var d=this._state.__s||"",a=b.__s||"";if(a!==d){this._updateHiddenField(a);__doPostBack(this._uniqueId,a);this._state=b;return}}this._setState(c);this._state=b;this._raiseNavigate()},_onIdle:function(){delete this._timerCookie;var a=this.get_stateString();if(a!==this._currentEntry){if(!this._ignoreTimer){this._historyPointIsNew=false;this._navigate(a);this._historyLength=window.history.length}}else this._ignoreTimer=false;this._timerCookie=window.setTimeout(this._timerHandler,100)},_onIFrameLoad:function(a){this._ensureHistory();if(!this._ignoreIFrame){this._historyPointIsNew=false;this._navigate(a)}this._ignoreIFrame=false},_onPageRequestManagerBeginRequest:function(){this._ignoreTimer=true},_onPageRequestManagerEndRequest:function(e,d){var b=d.get_dataItems()[this._clientId],a=document.getElementById("__EVENTTARGET");if(a&&a.value===this._uniqueId)a.value="";if(typeof b!=="undefined"){this.setServerState(b);this._historyPointIsNew=true}else this._ignoreTimer=false;var c=this._serializeState(this._state);if(c!==this._currentEntry){this._ignoreTimer=true;this._setState(c);this._raiseNavigate()}},_raiseNavigate:function(){var c=this.get_events().getHandler("navigate"),b={};for(var a in this._state)if(a!=="__s")b[a]=this._state[a];var d=new Sys.HistoryEventArgs(b);if(c)c(this,d)},_serializeState:function(d){var b=[];for(var a in d){var e=d[a];if(a==="__s")var c=e;else b[b.length]=a+"="+encodeURIComponent(e)}return b.join("&")+(c?"&&"+c:"")},_setHistory:function(b){var a=document.getElementById("__history");if(a)a.value=Sys.Serialization.JavaScriptSerializer.serialize(b)},_setState:function(a,c){a=a||"";if(a!==this._currentEntry){if(window.theForm){var e=window.theForm.action,f=e.indexOf("#");window.theForm.action=(f!==-1?e.substring(0,f):e)+"#"+a}if(this._historyFrame&&this._historyPointIsNew){this._ignoreIFrame=true;this._historyPointIsNew=false;var d=this._historyFrame.contentWindow.document;d.open("javascript:'<html></html>'");d.write("<html><head><title>"+(c||document.title)+"</title><scri"+'pt type="text/javascript">parent.Sys.Application._onIFrameLoad(\''+a+"');</scri"+"pt></head><body></body></html>");d.close()}this._ignoreTimer=false;var h=this.get_stateString();this._currentEntry=a;if(a!==h){if(this._isSafari2()){var g=this._getHistory();g[window.history.length-this._historyInitialLength+1]=a;this._setHistory(g);this._historyLength=window.history.length+1;var b=document.createElement("form");b.method="get";b.action="#"+a;document.appendChild(b);b.submit();document.removeChild(b)}else window.location.hash=a;if(typeof c!=="undefined"&&c!==null)document.title=c}}},_unloadHandler:function(){this.dispose()},_updateHiddenField:function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Type.registerNamespace("Sys.Net");Sys.Net.WebRequestExecutor=function(){this._webRequest=null;this._resultObject=null};Sys.Net.WebRequestExecutor.prototype={get_webRequest:function(){return this._webRequest},_set_webRequest:function(a){this._webRequest=a},get_started:function(){throw Error.notImplemented()},get_responseAvailable:function(){throw Error.notImplemented()},get_timedOut:function(){throw Error.notImplemented()},get_aborted:function(){throw Error.notImplemented()},get_responseData:function(){throw Error.notImplemented()},get_statusCode:function(){throw Error.notImplemented()},get_statusText:function(){throw Error.notImplemented()},get_xml:function(){throw Error.notImplemented()},get_object:function(){if(!this._resultObject)this._resultObject=Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData());return this._resultObject},executeRequest:function(){throw Error.notImplemented()},abort:function(){throw Error.notImplemented()},getResponseHeader:function(){throw Error.notImplemented()},getAllResponseHeaders:function(){throw Error.notImplemented()}};Sys.Net.WebRequestExecutor.registerClass("Sys.Net.WebRequestExecutor");Sys.Net.XMLDOM=function(d){if(!window.DOMParser){var c=["Msxml2.DOMDocument.3.0","Msxml2.DOMDocument"];for(var b=0,f=c.length;b<f;b++)try{var a=new ActiveXObject(c[b]);a.async=false;a.loadXML(d);a.setProperty("SelectionLanguage","XPath");return a}catch(g){}}else try{var e=new window.DOMParser;return e.parseFromString(d,"text/xml")}catch(g){}return null};Sys.Net.XMLHttpExecutor=function(){Sys.Net.XMLHttpExecutor.initializeBase(this);var a=this;this._xmlHttpRequest=null;this._webRequest=null;this._responseAvailable=false;this._timedOut=false;this._timer=null;this._aborted=false;this._started=false;this._onReadyStateChange=function(){if(a._xmlHttpRequest.readyState===4){try{if(typeof a._xmlHttpRequest.status==="undefined")return}catch(b){return}a._clearTimer();a._responseAvailable=true;try{a._webRequest.completed(Sys.EventArgs.Empty)}finally{if(a._xmlHttpRequest!=null){a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;a._xmlHttpRequest=null}}}};this._clearTimer=function(){if(a._timer!=null){window.clearTimeout(a._timer);a._timer=null}};this._onTimeout=function(){if(!a._responseAvailable){a._clearTimer();a._timedOut=true;a._xmlHttpRequest.onreadystatechange=Function.emptyMethod;a._xmlHttpRequest.abort();a._webRequest.completed(Sys.EventArgs.Empty);a._xmlHttpRequest=null}}};Sys.Net.XMLHttpExecutor.prototype={get_timedOut:function(){return this._timedOut},get_started:function(){return this._started},get_responseAvailable:function(){return this._responseAvailable},get_aborted:function(){return this._aborted},executeRequest:function(){this._webRequest=this.get_webRequest();var c=this._webRequest.get_body(),a=this._webRequest.get_headers();this._xmlHttpRequest=new XMLHttpRequest;this._xmlHttpRequest.onreadystatechange=this._onReadyStateChange;var e=this._webRequest.get_httpVerb();this._xmlHttpRequest.open(e,this._webRequest.getResolvedUrl(),true);if(a)for(var b in a){var f=a[b];if(typeof f!=="function")this._xmlHttpRequest.setRequestHeader(b,f)}if(e.toLowerCase()==="post"){if(a===null||!a["Content-Type"])this._xmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");if(!c)c=""}var d=this._webRequest.get_timeout();if(d>0)this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),d);this._xmlHttpRequest.send(c);this._started=true},getResponseHeader:function(b){var a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a="";return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var a=this._xmlHttpRequest.responseXML;if(!a||!a.documentElement){a=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!a||!a.documentElement)return null}else if(navigator.userAgent.indexOf("MSIE")!==-1)a.setProperty("SelectionLanguage","XPath");if(a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&a.documentElement.tagName==="parsererror")return null;if(a.documentElement.firstChild&&a.documentElement.firstChild.tagName==="parsererror")return null;return a},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut)return;this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(a){this._get_eventHandlerList().addHandler("invokingRequest",a)},remove_invokingRequest:function(a){this._get_eventHandlerList().removeHandler("invokingRequest",a)},add_completedRequest:function(a){this._get_eventHandlerList().addHandler("completedRequest",a)},remove_completedRequest:function(a){this._get_eventHandlerList().removeHandler("completedRequest",a)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted())return;var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler)handler(this,evArgs);if(!evArgs.get_cancel())executor.executeRequest()}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(a){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(a){this._get_eventHandlerList().addHandler("completed",a)},remove_completed:function(a){this._get_eventHandlerList().removeHandler("completed",a)},completed:function(b){var a=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(a)a(this._executor,b);a=this._get_eventHandlerList().getHandler("completed");if(a)a(this._executor,b)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null)return "GET";return "POST"}return this._httpVerb},set_httpVerb:function(a){this._httpVerb=a},get_body:function(){return this._body},set_body:function(a){this._body=a},get_userContext:function(){return this._userContext},set_userContext:function(a){this._userContext=a},get_executor:function(){return this._executor},set_executor:function(a){this._executor=a;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0)return Sys.Net.WebRequestManager.get_defaultTimeout();return this._timeout},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(b,a){if(b&&b.indexOf("://")!==-1)return b;if(!a||a.length===0){var d=document.getElementsByTagName("base")[0];if(d&&d.href&&d.href.length>0)a=d.href;else a=document.URL}var c=a.indexOf("?");if(c!==-1)a=a.substr(0,c);c=a.indexOf("#");if(c!==-1)a=a.substr(0,c);a=a.substr(0,a.lastIndexOf("/")+1);if(!b||b.length===0)return a;if(b.charAt(0)==="/"){var e=a.indexOf("://"),g=a.indexOf("/",e+3);return a.substr(0,g)+b}else{var f=a.lastIndexOf("/");return a.substr(0,f+1)+b}};Sys.Net.WebRequest._createQueryString=function(d,b){if(!b)b=encodeURIComponent;var a=new Sys.StringBuilder,f=0;for(var c in d){var e=d[c];if(typeof e==="function")continue;var g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(f!==0)a.append("&");a.append(c);a.append("=");a.append(b(g));f++}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b){if(!b)return a;var d=Sys.Net.WebRequest._createQueryString(b);if(d.length>0){var c="?";if(a&&a.indexOf("?")!==-1)c="&";return a+c+d}else return a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed},set_defaultFailedCallback:function(a){this._failed=a},get_path:function(){return this._path},set_path:function(a){this._path=a},_invoke:function(d,e,g,f,c,b,a){if(c===null||typeof c==="undefined")c=this.get_defaultSucceededCallback();if(b===null||typeof b==="undefined")b=this.get_defaultFailedCallback();if(a===null||typeof a==="undefined")a=this.get_defaultUserContext();return Sys.Net.WebServiceProxy.invoke(d,e,g,f,c,b,a,this.get_timeout())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(k,a,j,d,i,c,f,h){var b=new Sys.Net.WebRequest;b.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!d)d={};var g=d;if(!j||!g)g={};b.set_url(Sys.Net.WebRequest._createUrl(k+"/"+encodeURIComponent(a),g));var e=null;if(!j){e=Sys.Serialization.JavaScriptSerializer.serialize(d);if(e==="{}")e=""}b.set_body(e);b.add_completed(l);if(h&&h>0)b.set_timeout(h);b.invoke();function l(d){if(d.get_responseAvailable()){var g=d.get_statusCode(),b=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))b=d.get_object();else if(e.startsWith("text/xml"))b=d.get_xml();else b=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(b)b=new Sys.Net.WebServiceError(false,b.Message,b.StackTrace,b.ExceptionType)}else if(e.startsWith("application/json"))b=b.d;if(g<200||g>=300||h){if(c){if(!b||!h)b=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a),"","");b._statusCode=g;c(b,f,a)}}else if(i)i(b,f,a)}else{var j;if(d.get_timedOut())j=String.format(Sys.Res.webServiceTimedOut,a);else j=String.format(Sys.Res.webServiceFailedNoMsg,a);if(c)c(new Sys.Net.WebServiceError(d.get_timedOut(),j,"",""),f,a)}}return b};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys.Net.WebServiceError=function(c,d,b,a){this._timedOut=c;this._message=d;this._stackTrace=b;this._exceptionType=a;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace},get_exceptionType:function(){return this._exceptionType}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError");Type.registerNamespace("Sys.Services");Sys.Services._ProfileService=function(){Sys.Services._ProfileService.initializeBase(this);this.properties={}};Sys.Services._ProfileService.DefaultWebServicePath="";Sys.Services._ProfileService.prototype={_defaultLoadCompletedCallback:null,_defaultSaveCompletedCallback:null,_path:"",_timeout:0,get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(a){this._defaultLoadCompletedCallback=a},get_defaultSaveCompletedCallback:function(){return this._defaultSaveCompletedCallback},set_defaultSaveCompletedCallback:function(a){this._defaultSaveCompletedCallback=a},get_path:function(){return this._path||""},load:function(c,d,e,f){var b,a;if(!c){a="GetAllPropertiesForCurrentUser";b={authenticatedUserOnly:false}}else{a="GetPropertiesForCurrentUser";b={properties:this._clonePropertyNames(c),authenticatedUserOnly:false}}this._invoke(this._get_path(),a,false,b,Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[d,e,f])},save:function(d,b,c,e){var a=this._flattenProperties(d,this.properties);this._invoke(this._get_path(),"SetPropertiesForCurrentUser",false,{values:a.value,authenticatedUserOnly:false},Function.createDelegate(this,this._onSaveComplete),Function.createDelegate(this,this._onSaveFailed),[b,c,e,a.count])},_clonePropertyNames:function(e){var c=[],d={};for(var b=0;b<e.length;b++){var a=e[b];if(!d[a]){Array.add(c,a);d[a]=true}}return c},_flattenProperties:function(a,i,j){var b={},e,d,g=0;if(a&&a.length===0)return {value:b,count:0};for(var c in i){e=i[c];d=j?j+"."+c:c;if(Sys.Services.ProfileGroup.isInstanceOfType(e)){var k=this._flattenProperties(a,e,d),h=k.value;g+=k.count;for(var f in h){var l=h[f];b[f]=l}}else if(!a||Array.indexOf(a,d)!==-1){b[d]=e;g++}}return {value:b,count:g}},_get_path:function(){var a=this.get_path();if(!a.length)a=Sys.Services._ProfileService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_onLoadComplete:function(a,e,g){if(typeof a!=="object")throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,g,"Object"));var c=this._unflattenProperties(a);for(var b in c)this.properties[b]=c[b];var d=e[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(d){var f=e[2]||this.get_defaultUserContext();d(a.length,f,"Sys.Services.ProfileService.load")}},_onLoadFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.ProfileService.load")}},_onSaveComplete:function(a,b,f){var c=b[3];if(a!==null)if(a instanceof Array)c-=a.length;else if(typeof a==="number")c=a;else throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Array"));var d=b[0]||this.get_defaultSaveCompletedCallback()||this.get_defaultSucceededCallback();if(d){var e=b[2]||this.get_defaultUserContext();d(c,e,"Sys.Services.ProfileService.save")}},_onSaveFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.ProfileService.save")}},_unflattenProperties:function(e){var c={},d,f,h=0;for(var a in e){h++;f=e[a];d=a.indexOf(".");if(d!==-1){var g=a.substr(0,d);a=a.substr(d+1);var b=c[g];if(!b||!Sys.Services.ProfileGroup.isInstanceOfType(b)){b=new Sys.Services.ProfileGroup;c[g]=b}b[a]=f}else c[a]=f}e.length=h;return c}};Sys.Services._ProfileService.registerClass("Sys.Services._ProfileService",Sys.Net.WebServiceProxy);Sys.Services.ProfileService=new Sys.Services._ProfileService;Sys.Services.ProfileGroup=function(a){if(a)for(var b in a)this[b]=a[b]};Sys.Services.ProfileGroup.registerClass("Sys.Services.ProfileGroup");Sys.Services._AuthenticationService=function(){Sys.Services._AuthenticationService.initializeBase(this)};Sys.Services._AuthenticationService.DefaultWebServicePath="";Sys.Services._AuthenticationService.prototype={_defaultLoginCompletedCallback:null,_defaultLogoutCompletedCallback:null,_path:"",_timeout:0,_authenticated:false,get_defaultLoginCompletedCallback:function(){return this._defaultLoginCompletedCallback},set_defaultLoginCompletedCallback:function(a){this._defaultLoginCompletedCallback=a},get_defaultLogoutCompletedCallback:function(){return this._defaultLogoutCompletedCallback},set_defaultLogoutCompletedCallback:function(a){this._defaultLogoutCompletedCallback=a},get_isLoggedIn:function(){return this._authenticated},get_path:function(){return this._path||""},login:function(c,b,a,h,f,d,e,g){this._invoke(this._get_path(),"Login",false,{userName:c,password:b,createPersistentCookie:a},Function.createDelegate(this,this._onLoginComplete),Function.createDelegate(this,this._onLoginFailed),[c,b,a,h,f,d,e,g])},logout:function(c,a,b,d){this._invoke(this._get_path(),"Logout",false,{},Function.createDelegate(this,this._onLogoutComplete),Function.createDelegate(this,this._onLogoutFailed),[c,a,b,d])},_get_path:function(){var a=this.get_path();if(!a.length)a=Sys.Services._AuthenticationService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_onLoginComplete:function(e,c,f){if(typeof e!=="boolean")throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Boolean"));var b=c[4],d=c[7]||this.get_defaultUserContext(),a=c[5]||this.get_defaultLoginCompletedCallback()||this.get_defaultSucceededCallback();if(e){this._authenticated=true;if(a)a(true,d,"Sys.Services.AuthenticationService.login");if(typeof b!=="undefined"&&b!==null)window.location.href=b}else if(a)a(false,d,"Sys.Services.AuthenticationService.login")},_onLoginFailed:function(d,b){var a=b[6]||this.get_defaultFailedCallback();if(a){var c=b[7]||this.get_defaultUserContext();a(d,c,"Sys.Services.AuthenticationService.login")}},_onLogoutComplete:function(f,a,e){if(f!==null)throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,e,"null"));var b=a[0],d=a[3]||this.get_defaultUserContext(),c=a[1]||this.get_defaultLogoutCompletedCallback()||this.get_defaultSucceededCallback();this._authenticated=false;if(c)c(null,d,"Sys.Services.AuthenticationService.logout");if(!b)window.location.reload();else window.location.href=b},_onLogoutFailed:function(c,b){var a=b[2]||this.get_defaultFailedCallback();if(a)a(c,b[3],"Sys.Services.AuthenticationService.logout")},_setAuthenticated:function(a){this._authenticated=a}};Sys.Services._AuthenticationService.registerClass("Sys.Services._AuthenticationService",Sys.Net.WebServiceProxy);Sys.Services.AuthenticationService=new Sys.Services._AuthenticationService;Sys.Services._RoleService=function(){Sys.Services._RoleService.initializeBase(this);this._roles=[]};Sys.Services._RoleService.DefaultWebServicePath="";Sys.Services._RoleService.prototype={_defaultLoadCompletedCallback:null,_rolesIndex:null,_timeout:0,_path:"",get_defaultLoadCompletedCallback:function(){return this._defaultLoadCompletedCallback},set_defaultLoadCompletedCallback:function(a){this._defaultLoadCompletedCallback=a},get_path:function(){return this._path||""},get_roles:function(){return Array.clone(this._roles)},isUserInRole:function(a){var b=this._get_rolesIndex()[a.trim().toLowerCase()];return !!b},load:function(a,b,c){Sys.Net.WebServiceProxy.invoke(this._get_path(),"GetRolesForCurrentUser",false,{},Function.createDelegate(this,this._onLoadComplete),Function.createDelegate(this,this._onLoadFailed),[a,b,c],this.get_timeout())},_get_path:function(){var a=this.get_path();if(!a||!a.length)a=Sys.Services._RoleService.DefaultWebServicePath;if(!a||!a.length)throw Error.invalidOperation(Sys.Res.servicePathNotSet);return a},_get_rolesIndex:function(){if(!this._rolesIndex){var b={};for(var a=0;a<this._roles.length;a++)b[this._roles[a].toLowerCase()]=true;this._rolesIndex=b}return this._rolesIndex},_onLoadComplete:function(a,c,f){if(a&&!(a instanceof Array))throw Error.invalidOperation(String.format(Sys.Res.webServiceInvalidReturnType,f,"Array"));this._roles=a;this._rolesIndex=null;var b=c[0]||this.get_defaultLoadCompletedCallback()||this.get_defaultSucceededCallback();if(b){var e=c[2]||this.get_defaultUserContext(),d=Array.clone(a);b(d,e,"Sys.Services.RoleService.load")}},_onLoadFailed:function(d,b){var a=b[1]||this.get_defaultFailedCallback();if(a){var c=b[2]||this.get_defaultUserContext();a(d,c,"Sys.Services.RoleService.load")}}};Sys.Services._RoleService.registerClass("Sys.Services._RoleService",Sys.Net.WebServiceProxy);Sys.Services.RoleService=new Sys.Services._RoleService;Type.registerNamespace("Sys.Serialization");Sys.Serialization.JavaScriptSerializer=function(){};Sys.Serialization.JavaScriptSerializer.registerClass("Sys.Serialization.JavaScriptSerializer");Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs=[];Sys.Serialization.JavaScriptSerializer._charsToEscape=[];Sys.Serialization.JavaScriptSerializer._dateRegEx=new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"',"g");Sys.Serialization.JavaScriptSerializer._escapeChars={};Sys.Serialization.JavaScriptSerializer._escapeRegEx=new RegExp('["\\\\\\x00-\\x1F]',"i");Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal=new RegExp('["\\\\\\x00-\\x1F]',"g");Sys.Serialization.JavaScriptSerializer._jsonRegEx=new RegExp("[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]","g");Sys.Serialization.JavaScriptSerializer._jsonStringRegEx=new RegExp('"(\\\\.|[^"\\\\])*"',"g");Sys.Serialization.JavaScriptSerializer._serverTypeFieldName="__type";Sys.Serialization.JavaScriptSerializer._init=function(){var c=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000b","\\f","\\r","\\u000e","\\u000f","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001a","\\u001b","\\u001c","\\u001d","\\u001e","\\u001f"];Sys.Serialization.JavaScriptSerializer._charsToEscape[0]="\\";Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs["\\"]=new RegExp("\\\\","g");Sys.Serialization.JavaScriptSerializer._escapeChars["\\"]="\\\\";Sys.Serialization.JavaScriptSerializer._charsToEscape[1]='"';Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"']=new RegExp('"',"g");Sys.Serialization.JavaScriptSerializer._escapeChars['"']='\\"';for(var a=0;a<32;a++){var b=String.fromCharCode(a);Sys.Serialization.JavaScriptSerializer._charsToEscape[a+2]=b;Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b]=new RegExp(b,"g");Sys.Serialization.JavaScriptSerializer._escapeChars[b]=c[a]}};Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder=function(b,a){a.append(b.toString())};Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder=function(a,b){if(isFinite(a))b.append(String(a));else throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers)};Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder=function(a,c){c.append('"');if(Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(a)){if(Sys.Serialization.JavaScriptSerializer._charsToEscape.length===0)Sys.Serialization.JavaScriptSerializer._init();if(a.length<128)a=a.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal,function(a){return Sys.Serialization.JavaScriptSerializer._escapeChars[a]});else for(var d=0;d<34;d++){var b=Sys.Serialization.JavaScriptSerializer._charsToEscape[d];if(a.indexOf(b)!==-1)if(Sys.Browser.agent===Sys.Browser.Opera||Sys.Browser.agent===Sys.Browser.FireFox)a=a.split(b).join(Sys.Serialization.JavaScriptSerializer._escapeChars[b]);else a=a.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[b],Sys.Serialization.JavaScriptSerializer._escapeChars[b])}}c.append(a);c.append('"')};Sys.Serialization.JavaScriptSerializer._serializeWithBuilder=function(b,a,i,g){var c;switch(typeof b){case "object":if(b)if(Number.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b,a);else if(Boolean.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b,a);else if(String.isInstanceOfType(b))Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b,a);else if(Array.isInstanceOfType(b)){a.append("[");for(c=0;c<b.length;++c){if(c>0)a.append(",");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c],a,false,g)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(');a.append(b.getTime());a.append(')\\/"');break}var d=[],f=0;for(var e in b){if(e.startsWith("$"))continue;if(e===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&f!==0){d[f++]=d[0];d[0]=e}else d[f++]=e}if(i)d.sort();a.append("{");var j=false;for(c=0;c<f;c++){var h=b[d[c]];if(typeof h!=="undefined"&&typeof h!=="function"){if(j)a.append(",");else j=true;Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(d[c],a,i,g);a.append(":");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(h,a,i,g)}}a.append("}")}else a.append("null");break;case "number":Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(b,a);break;case "string":Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(b,a);break;case "boolean":Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(b,a);break;default:a.append("null")}};Sys.Serialization.JavaScriptSerializer.serialize=function(b){var a=new Sys.StringBuilder;Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b,a,false);return a.toString()};Sys.Serialization.JavaScriptSerializer.deserialize=function(data,secure){if(data.length===0)throw Error.argument("data",Sys.Res.cannotDeserializeEmptyString);try{var exp=data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx,"$1new Date($2)");if(secure&&Sys.Serialization.JavaScriptSerializer._jsonRegEx.test(exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx,"")))throw null;return eval("("+exp+")")}catch(a){throw Error.argument("data",Sys.Res.cannotDeserializeInvalidJson)}};Sys.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var a=this.dateTimeFormat;this._dateTimeFormats=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getMonthIndex:function(a){if(!this._upperMonths)this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);return Array.indexOf(this._upperMonths,this._toUpper(a))},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths)this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);return Array.indexOf(this._upperAbbrMonths,this._toUpper(a))},_getDayIndex:function(a){if(!this._upperDays)this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames);return Array.indexOf(this._upperDays,this._toUpper(a))},_getAbbrDayIndex:function(a){if(!this._upperAbbrDays)this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);return Array.indexOf(this._upperAbbrDays,this._toUpper(a))},_toUpperArray:function(c){var b=[];for(var a=0,d=c.length;a<d;a++)b[a]=this._toUpper(c[a]);return b},_toUpper:function(a){return a.split("\u00a0").join(" ").toUpperCase()}};Sys.CultureInfo._parse=function(b){var a=Sys.Serialization.JavaScriptSerializer.deserialize(b);return new Sys.CultureInfo(a.name,a.numberFormat,a.dateTimeFormat)};Sys.CultureInfo.registerClass("Sys.CultureInfo");Sys.CultureInfo.InvariantCulture=Sys.CultureInfo._parse('{"name":"","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":true,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"\u00a4","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":true},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, dd MMMM yyyy HH:mm:ss","LongDatePattern":"dddd, dd MMMM yyyy","LongTimePattern":"HH:mm:ss","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"MM/dd/yyyy","ShortTimePattern":"HH:mm","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"yyyy MMMM","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":true,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}');if(typeof __cultureInfo==="undefined")var __cultureInfo='{"name":"en-US","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":false,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"$","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":false},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, MMMM dd, yyyy h:mm:ss tt","LongDatePattern":"dddd, MMMM dd, yyyy","LongTimePattern":"h:mm:ss tt","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"M/d/yyyy","ShortTimePattern":"h:mm tt","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"MMMM, yyyy","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":false,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]}}';Sys.CultureInfo.CurrentCulture=Sys.CultureInfo._parse(__cultureInfo);delete __cultureInfo;Sys.UI.Behavior=function(b){Sys.UI.Behavior.initializeBase(this);this._element=b;var a=b._behaviors;if(!a)b._behaviors=[this];else a[a.length]=this};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(a)return a;if(!this._element||!this._element.id)return "";return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name)return this._name;var a=Object.getTypeName(this),b=a.lastIndexOf(".");if(b!=-1)a=a.substr(b+1);if(!this.get_isInitialized())this._name=a;return a},set_name:function(a){this._name=a},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var a=this.get_name();if(a)this._element[a]=this},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");if(this._element){var a=this.get_name();if(a)this._element[a]=null;Array.remove(this._element._behaviors,this);delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(b,c){var a=b[c];return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null};Sys.UI.Behavior.getBehaviors=function(a){if(!a._behaviors)return [];return Array.clone(a._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(d,e){var a=d._behaviors,c=[];if(a)for(var b=0,f=a.length;b<f;b++)if(e.isInstanceOfType(a[b]))c[c.length]=a[b];return c};Sys.UI.VisibilityMode=function(){throw Error.notImplemented()};Sys.UI.VisibilityMode.prototype={hide:0,collapse:1};Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode");Sys.UI.Control=function(a){Sys.UI.Control.initializeBase(this);this._element=a;a.control=this};Sys.UI.Control.prototype={_parent:null,_visibilityMode:Sys.UI.VisibilityMode.hide,get_element:function(){return this._element},get_id:function(){if(!this._element)return "";return this._element.id},set_id:function(){throw Error.invalidOperation(Sys.Res.cantSetId)},get_parent:function(){if(this._parent)return this._parent;if(!this._element)return null;var a=this._element.parentNode;while(a){if(a.control)return a.control;a=a.parentNode}return null},set_parent:function(a){this._parent=a},get_visibilityMode:function(){return Sys.UI.DomElement.getVisibilityMode(this._element)},set_visibilityMode:function(a){Sys.UI.DomElement.setVisibilityMode(this._element,a)},get_visible:function(){return Sys.UI.DomElement.getVisible(this._element)},set_visible:function(a){Sys.UI.DomElement.setVisible(this._element,a)},addCssClass:function(a){Sys.UI.DomElement.addCssClass(this._element,a)},dispose:function(){Sys.UI.Control.callBaseMethod(this,"dispose");if(this._element){this._element.control=undefined;delete this._element}if(this._parent)delete this._parent},onBubbleEvent:function(){return false},raiseBubbleEvent:function(b,c){var a=this.get_parent();while(a){if(a.onBubbleEvent(b,c))return;a=a.get_parent()}},removeCssClass:function(a){Sys.UI.DomElement.removeCssClass(this._element,a)},toggleCssClass:function(a){Sys.UI.DomElement.toggleCssClass(this._element,a)}};Sys.UI.Control.registerClass("Sys.UI.Control",Sys.Component);
Type.registerNamespace('Sys');Sys.Res={"argumentInteger":"Value must be an integer.","scriptLoadMultipleCallbacks":"The script \u0027{0}\u0027 contains multiple calls to Sys.Application.notifyScriptLoaded(). Only one is allowed.","invokeCalledTwice":"Cannot call invoke more than once.","webServiceFailed":"The server method \u0027{0}\u0027 failed with the following error: {1}","webServiceInvalidJsonWrapper":"The server method \u0027{0}\u0027 returned invalid data. The \u0027d\u0027 property is missing from the JSON wrapper.","argumentType":"Object cannot be converted to the required type.","argumentNull":"Value cannot be null.","controlCantSetId":"The id property can\u0027t be set on a control.","formatBadFormatSpecifier":"Format specifier was invalid.","webServiceFailedNoMsg":"The server method \u0027{0}\u0027 failed.","argumentDomElement":"Value must be a DOM element.","invalidExecutorType":"Could not create a valid Sys.Net.WebRequestExecutor from: {0}.","cannotCallBeforeResponse":"Cannot call {0} when responseAvailable is false.","actualValue":"Actual value was {0}.","enumInvalidValue":"\u0027{0}\u0027 is not a valid value for enum {1}.","scriptLoadFailed":"The script \u0027{0}\u0027 could not be loaded.","parameterCount":"Parameter count mismatch.","cannotDeserializeEmptyString":"Cannot deserialize empty string.","formatInvalidString":"Input string was not in a correct format.","invalidTimeout":"Value must be greater than or equal to zero.","cannotAbortBeforeStart":"Cannot abort when executor has not started.","argument":"Value does not fall within the expected range.","cannotDeserializeInvalidJson":"Cannot deserialize. The data does not correspond to valid JSON.","invalidHttpVerb":"httpVerb cannot be set to an empty or null string.","nullWebRequest":"Cannot call executeRequest with a null webRequest.","eventHandlerInvalid":"Handler was not added through the Sys.UI.DomEvent.addHandler method.","cannotSerializeNonFiniteNumbers":"Cannot serialize non finite numbers.","argumentUndefined":"Value cannot be undefined.","webServiceInvalidReturnType":"The server method \u0027{0}\u0027 returned an invalid type. Expected type: {1}","servicePathNotSet":"The path to the web service has not been set.","argumentTypeWithTypes":"Object of type \u0027{0}\u0027 cannot be converted to type \u0027{1}\u0027.","cannotCallOnceStarted":"Cannot call {0} once started.","badBaseUrl1":"Base URL does not contain ://.","badBaseUrl2":"Base URL does not contain another /.","badBaseUrl3":"Cannot find last / in base URL.","setExecutorAfterActive":"Cannot set executor after it has become active.","paramName":"Parameter name: {0}","cannotCallOutsideHandler":"Cannot call {0} outside of a completed event handler.","cannotSerializeObjectWithCycle":"Cannot serialize object with cyclic reference within child properties.","format":"One of the identified items was in an invalid format.","assertFailedCaller":"Assertion Failed: {0}\r\nat {1}","argumentOutOfRange":"Specified argument was out of the range of valid values.","webServiceTimedOut":"The server method \u0027{0}\u0027 timed out.","notImplemented":"The method or operation is not implemented.","assertFailed":"Assertion Failed: {0}","invalidOperation":"Operation is not valid due to the current state of the object.","breakIntoDebugger":"{0}\r\n\r\nBreak into debugger?"};
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
/* Shared */
function Ajax_GenericFailedCallback(error) {
    Ajax_SetNormalCursor();
    alert("Ajax error: " + error.get_message());
}

function Ajax_SetWaitCursor() {
    document.body.style.cursor = "wait";
}

function Ajax_SetNormalCursor() {
    document.body.style.cursor = "default";
}

/* StockRequest */
function StockRequest_Begin(req) {
    if (req) {
        Ajax_SetWaitCursor();
        NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.GetStock(req, StockRequest_Succeeded, Ajax_GenericFailedCallback);
    }
    else {
        alert('Empty request!');
    }
} // end StockRequest_Begin

function StockRequest_AddProduct(req, catalogGuid, productId, unitCode, containerClientId, quantityInputClientId, buttonClientIds) {
    if (req) {

        var intIndex = req.Items.length;
        req.Items[intIndex] = new NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockRequestItem();
        req.Items[intIndex].CatalogGuid = catalogGuid;
        req.Items[intIndex].ProductId = productId;
        req.Items[intIndex].UnitCode = unitCode;
        req.Items[intIndex].ContainerClientId = containerClientId;
        req.Items[intIndex].QuantityInputClientId = quantityInputClientId;
        req.Items[intIndex].ButtonClientIds = buttonClientIds;
    } // end if
} // end StockRequest_AddProduct

function StockRequest_Succeeded(res, eventArgs) {
    Ajax_SetNormalCursor();
    
    if (res && res.Items) {
        var noneExpectedTemplate;
        var oneExpectedTemplate;
        var multipleExpectedTemplate;

        if (res.NoneExpectedTemplateId && res.NoneExpectedTemplateId != '')
            noneExpectedTemplate = $(res.NoneExpectedTemplateId);
            
        if (res.OneExpectedTemplateId && res.OneExpectedTemplateId != '')
            oneExpectedTemplate = $(res.OneExpectedTemplateId);

        if (res.MultipleExpectedTemplateId && res.MultipleExpectedTemplateId != '')
            multipleExpectedTemplate = $(res.MultipleExpectedTemplateId);

        for (var i = 0; i < res.Items.length; i++) {
            if (res.Items[i].StockInfo) {
                var templateElementId = '';
                
                if (res.Items[i].StockInfo.ExpectedStocks && res.Items[i].StockInfo.ExpectedStocks.length > 1 && multipleExpectedTemplate) {
                    templateElementId = res.MultipleExpectedTemplateId;
                }
                else if (res.Items[i].StockInfo.ExpectedStocks && res.Items[i].StockInfo.ExpectedStocks.length == 1 && oneExpectedTemplate) {
                    templateElementId = res.OneExpectedTemplateId;
                }
                else if (noneExpectedTemplate) {
                    templateElementId = res.NoneExpectedTemplateId;
                } // end if

                if (!res.Items[i].Sellable) {
                    if (res.Items[i].QuantityInputClientId && res.Items[i].QuantityInputClientId != '') {
                        var quantityInputElement = $('#' + res.Items[i].QuantityInputClientId);

                        if (quantityInputElement)
                            quantityInputElement.attr('disabled', 'false');
                    }

                    if (res.Items[i].ButtonClientIds && res.Items[i].ButtonClientIds != '') {
                        var split = res.Items[i].ButtonClientIds.split(',');

                        for (var b = 0; b < split.length; b++) {
                            var buttonElement = $('#' + split[b]);

                            if (buttonElement)
                                buttonElement.attr('disabled', 'false');
                        } // end for
                    } // end if
                } // end if

                if (templateElementId && res.Items[i].ContainerClientId != '') {
                    var containerElement = $('#' + res.Items[i].ContainerClientId);
                    var templateElement = $('#' + templateElementId);

                    if (containerElement && templateElement) {
                        try
                        {
                            containerElement.setTemplateElement(templateElementId);
                            containerElement.processTemplate(res.Items[i]);
                            }
                            catch (err) {
                            }
                    } // end if
                } // end if
            } // end if
        } // end for
    } // end if
} // end StockRequest_Succeeded

function ToggleUserViewType_Begin() {
    if (gUserGuid) {
        NeXTPortal.Modules.PSEParts.Resources.Services.Profile.ToggleUserViewType(gUserGuid, ToggleUserViewType_Succeeded, Ajax_GenericFailedCallback);
    } // end if
}

function ToggleUserViewType_Succeeded(res, eventArgs) {
    if (res) {
        document.location.href = document.location.href;
    } // end if
}

/* NeXTPortal.Modules.PSEParts.WebControls.CatalogSystem.ProductDetails */
//var eNextProductImageControlClientId = 'ctl00_wpm_wp1768788471_wcProductFamily_wcProductFamilyCompactView_ctl00_ProductDetailsControl_ctl00_NextProductImageImage';
//var ePreviousProductImageControlClientId = 'ctl00_wpm_wp1768788471_wcProductFamily_wcProductFamilyCompactView_ctl00_ProductDetailsControl_ctl00_PreviousProductImageImage';
//var eProductNameControlClientId = 'ctl00_wpm_wp1768788471_wcProductFamily_wcProductFamilyCompactView_ctl00_ProductDetailsControl_ctl00_ProductNameLabel';
//var eProductIdControlClientId = 'ctl00_wpm_wp1768788471_wcProductFamily_wcProductFamilyCompactView_ctl00_ProductDetailsControl_ctl00_ProductIdLabel';
//var eUnitPriceControlClientId = 'ctl00_wpm_wp1768788471_wcProductFamily_wcProductFamilyCompactView_ctl00_ProductDetailsControl_ctl00_ProductFamilySelector_ctl00_UnitPriceLabel';
//var eToggleProductInfoControlClientId = 'ctl00_wpm_wp1768788471_wcProductFamily_wcProductFamilyCompactView_ctl00_ProductDetailsControl_ctl00_ToggleProductInfoHyperLink';
//var eProductInfoControlClientId = 'ctl00_wpm_wp1768788471_wcProductFamily_wcProductFamilyCompactView_ctl00_ProductDetailsControl_ctl00_ProductInfoPanel';
//var eQuantityInputControlClientId = 'ctl00_wpm_wp1768788471_wcProductFamily_wcProductFamilyCompactView_ctl00_ProductDetailsControl_ctl00_ProductFamilySelector_ctl00_QuantityInputControl';

//var eCarouselContainerControlCliendId = 'carouselContainer';
//var eCarouselControlClientId = 'carousel';

//var sThumbnailImageSize = 'FoxXSmall';
//var sProductImageSize = 'FoxMedium';

$(document).ready(function() {
});

function ProductDetails_SetLastProductViewed() {
    if (typeof(currentProductDetailsInfo) !== 'undefined')
    {
        NeXTPortal.Modules.PSEParts.Resources.Services.Profile.SetLastProductViewed(gUserGuid, currentProductDetailsInfo.VirtualCatalogId, currentProductDetailsInfo.CatalogGuid, currentProductDetailsInfo.ProductId);
    }
}

function ProductDetails_ShareOnFacebook() {
    if (typeof (currentProductDetailsInfo) !== 'undefined' && currentProductDetailsInfo != null) {
        var u = $.url.attr('protocol') + "://" + $.url.attr('host') + $.url.attr('path') + "?pid=" + currentProductDetailsInfo.ProductId + "&uilcid=" + intUiLcid;
        var t = currentProductDetailsInfo.ProductName;

        if (currentProductDetailsInfo.CatalogGuid != gDefaultCatalogGuid)
            u += "&cguid=" + currentProductDetailsInfo.CatalogGuid;
            
        window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + "&t=" + encodeURIComponent(t));
    } // end if
} // end ProductDetails_ShareOnFacebook

function ProductDetails_TipAFriend() {
    if (typeof (currentProductDetailsInfo) !== 'undefined' && currentProductDetailsInfo != null) {
        if (typeof (sTipAFriendPageUrl) !== 'undefined' && sTipAFriendPageUrl != null && sTipAFriendPageUrl != '') {
            var u = $.url.attr('protocol') + "://" + $.url.attr('host') + $.url.attr('path') + "?pid=" + currentProductDetailsInfo.ProductId;

            if (currentProductDetailsInfo.CatalogGuid != gDefaultCatalogGuid)
                u += "&cguid=" + currentProductDetailsInfo.CatalogGuid;

            ShowSharedRadWindow(sTipAFriendPageUrl + "?pu=" + encodeURIComponent(u), eSharedRadWindowClientId, 500, 330);
        } // end if
    } // end if
}

function ProductDetails_AddToFavorites() {
    if (typeof (currentProductDetailsInfo) !== 'undefined' && currentProductDetailsInfo != null) {
        AddProductToFavorites_Begin(gShopGuid, gUserGuid, currentProductDetailsInfo.VirtualCatalogId, currentProductDetailsInfo.CatalogGuid, currentProductDetailsInfo.ProductId, intCatalogLcid);
    }
}

/* GetProducDetails */
var currentProductDetailsInfo = null;
var currentProductDetailsImageIndex = 0;
var currentProductDetailsImageUrl = '';

function GetProductDetails_Begin(gVirtualCatalogId, gCatalogGuid, sProductId) {
    Ajax_SetWaitCursor();
    
    $('.imagePreviewContainer').hide();
    NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.GetProductDetails(gShopGuid, gUserGuid, gVirtualCatalogId, gCatalogGuid, sProductId, sThumbnailImageSize, sProductImageSize, intCatalogLcid, GetProductDetails_Succeeded, Ajax_GenericFailedCallback);
}

function GetProductDetails_Succeeded(res, eventArgs) {
    Ajax_SetNormalCursor();
    
    if (typeof (res) === 'undefined' || res == null)
        return;
            
    if (typeof(eProductNameControlClientId) !== 'undefined')
        $('#' + eProductNameControlClientId).html(res.ProductName);
    
    if (typeof(eProductIdControlClientId) !== 'undefined')
        $('#' + eProductIdControlClientId).html(res.ProductId);
        
    if (typeof(eUnitPriceControlClientId) !== 'undefined')
        $('#' + eUnitPriceControlClientId).html(res.UnitPrice);

    if (typeof(eRelatedProductsFrameId) !== 'undefined') {
        var eRelatedProductsFrame = $('#' + eRelatedProductsFrameId);

        if (res.RelatedProductsCount > 0 && typeof (sRelatedProductsFramedPageUrl) !== 'undefined' && sRelatedProductsFramedPageUrl != null && sRelatedProductsFramedPageUrl != '') {
            eRelatedProductsFrame.show();
            eRelatedProductsFrame.attr('src', sRelatedProductsFramedPageUrl + '?pid=' + res.ProductId);
        }
        else {
            eRelatedProductsFrame.attr('src', '');
            eRelatedProductsFrame.hide();
        }
    }

    if (typeof(res.ProductInfo) !== 'undefined' && res.ProductInfo != null && res.ProductInfo != '') {

        if (typeof(eToggleProductInfoControlClientId) !== 'undefined')
            $('#' + eToggleProductInfoControlClientId).show();
            
        if (typeof(eProductInfoControlClientId) !== 'undefined')
            $('#' + eProductInfoControlClientId).html(res.productInfo);
    }
    else {
        if (typeof (eProductInfoControlClientId) !== 'undefined') {
            $('#' + eProductInfoControlClientId).html('');
            $('#' + eProductInfoControlClientId).hide();
        }
        
        if (typeof(eToggleProductInfoControlClientId) !== 'undefined')
            $('#' + eToggleProductInfoControlClientId).hide();
    }

    if (res.PictureId != currentProductDetailsInfo.PictureId) {
        GetProductDetails_ProcessImages(res);
    }

    GetProductDetails_ProcessColors(res);
    GetProductDetails_ProcessSizes(res);

    currentProductDetailsInfo = res;

    ProductDetails_SetLastProductViewed();
}

function GetProductDetails_ProcessImages(res) {
    if (typeof (eCarouselControlClientId) === 'undefined' || typeof(eCarouselContainerControlCliendId) === 'undefined')
        return;

    // Clear current jCarousel
    var carousel = $('#' + eCarouselControlClientId).data('jcarousel');

    if (typeof (carousel) === 'undefined')
        return;

    //carousel.reset();

    $('#' + eCarouselControlClientId).data('jcarousel', null);

    // Clear jCarousel container
    var container = $('#' + eCarouselContainerControlCliendId);

    if (typeof (container) === 'undefined')
        return;

    container.html('');
    container.hide();

    if (typeof(res) !== 'undefined' && typeof(res.ImageInfos) !== 'undefined' && res.ImageInfos.length > 0) {

        var ul$ = $('<ul/>').attr('id', eCarouselControlClientId);

        if (typeof (sCarouselSkinName) !== 'undefined' && sCarouselSkinName != null && sCarouselSkinName != '') {
            ul$.addClass(sCarouselSkinName);
        }

        
        for (var i = 0; i < res.ImageInfos.length; i++) {

            var li$ = $("<li />");

            if (res.ImageInfos[i].ThumbnailDimensions.Height > 0) {
                li$.height(res.ImageInfos[i].ThumbnailDimensions.Height + 'px');
            }

            var img$ = jQuery("<img />").attr("src", res.ImageInfos[i].ThumbnailUrl);
            img$.attr("onclick", "ProductDetails_ShowProductImage('" + res.ImageInfos[i].ImageUrl + "', " + i + "); ProductDetails_SetPreviousNextImageStates(currentProductDetailsInfo); ");

            li$.append(img$.outerHTML());
            ul$.append(li$);
        } // end for

        container.append(ul$).ready(function() {
            container.show();

            jQuery('#carousel').jcarousel({
                vertical: true
            });

            currentProductDetailsImageIndex = 0;
            ProductDetails_SetPreviousNextImageStates(res);
            ProductDetails_ShowProductImage(res.ImageInfos[currentProductDetailsImageIndex].ImageUrl, currentProductDetailsImageIndex);
        });

    } // end if
}

function GetProductDetails_ProcessSizes(res) {
    if (aSizeMatrixButtonPanels != undefined && res.SizeInfos != undefined && res.SizeInfos.length > 0) {
        $.each(aSizeMatrixButtonPanels, function() {
            var buttonPanel = $('#' + this);
            if (buttonPanel) {
                var size = buttonPanel.text().trim().toLowerCase();

                $.each(res.SizeInfos, function() {
                    if (size == this.SizeText.toLowerCase()) {
                        var sizeInfo = this;

                        buttonPanel.removeClass('Disabled').removeClass('Active').addClass(sizeInfo.ExtraCssClass);
                        buttonPanel.unbind();
                        
                        if (sizeInfo.Clickable || ( typeof(bUnavailableSizeIsClickable) !== 'undefined' && bUnavailableSizeIsClickable) ) {
                            buttonPanel.click(function() {
                                GetProductDetails_Begin(sizeInfo.VirtualCatalogId, sizeInfo.CatalogGuid, sizeInfo.ProductId);
                            });
                        }
                    }
                });
            } // end if
        });
    }
}

function GetProductDetails_ProcessColors(res) {
    if (typeof(aColorMatrixImages) !== 'undefined') {
        $.each(aColorMatrixImages, function() {
            var matrixImage = $('#' + this);
            if (res.Color.toLowerCase() == matrixImage.attr('title').trim().toLowerCase()) {
                matrixImage.removeClass('Active').addClass('Active');
            }
            else {
                matrixImage.removeClass('Active');
            }
        });
    }
}

function ProductDetails_ShowNextImage() {
    if (typeof(currentProductDetailsInfo) !== 'undefined' && typeof(currentProductDetailsInfo.ImageInfos) !== 'undefined' && currentProductDetailsImageIndex < (currentProductDetailsInfo.ImageInfos.length - 1)) {
        currentProductDetailsImageIndex++;
        ProductDetails_SetPreviousNextImageStates(currentProductDetailsInfo);
        ProductDetails_ShowProductImage(currentProductDetailsInfo.ImageInfos[currentProductDetailsImageIndex].ImageUrl, currentProductDetailsImageIndex);
    }
}

function ProductDetails_ShowPreviousImage() {
    if (typeof(currentProductDetailsInfo) !== 'undefined' && typeof(currentProductDetailsInfo.ImageInfos) !== 'undefined' && currentProductDetailsImageIndex > 0) {
        currentProductDetailsImageIndex--;
        ProductDetails_SetPreviousNextImageStates(currentProductDetailsInfo);
        ProductDetails_ShowProductImage(currentProductDetailsInfo.ImageInfos[currentProductDetailsImageIndex].ImageUrl, currentProductDetailsImageIndex);
    }
}

function ProductDetails_SetPreviousNextImageStates(res) {
    if (typeof (res) !== 'undefined' && typeof (res.ImageInfos) !== 'undefined') {

        if (typeof (eNextProductImageControlClientId) !== 'undefined') {
            var next$ = $('#' + eNextProductImageControlClientId);
            if (typeof (next$) !== 'undefined') {
                if (currentProductDetailsImageIndex < (res.ImageInfos.length - 1))
                    next$.show();
                else
                    next$.hide();
            } // end if
        } // end if

        if (typeof (ePreviousProductImageControlClientId) !== 'undefined') {
            var previous$ = $('#' + ePreviousProductImageControlClientId);
            if (typeof (previous$) !== 'undefined') {
                if (currentProductDetailsImageIndex > 0)
                    previous$.show();
                else
                    previous$.hide();
            } // end if
        } // end if
    } // end if
}

/* AddToBasket */
$(document).ready(function() {
});

function AddToBasket_Begin() {
    if (typeof (currentProductDetailsInfo) === 'undefined')
        return;

    var iQuantity = 1;
    if (typeof (eQuantityInputControlClientId) !== 'undefined') {
        var quantity$ = $('#' + eQuantityInputControlClientId);
        if (typeof (quantity$) !== 'undefined' && quantity$ != null)
            iQuantity = parseInt(quantity$.val());
    } // end if

    if (isNaN(iQuantity))
        iQuantity = 1;

    AddToBasket_Execute(currentProductDetailsInfo.VirtualCatalogId, currentProductDetailsInfo.CatalogGuid, currentProductDetailsInfo.ProductId, iQuantity, '');
    //NeXTPortal.Modules.PSEParts.Resources.Services.Order.AddToUserBasket(gUserGuid, currentProductDetailsInfo.VirtualCatalogId, currentProductDetailsInfo.CatalogGuid, currentProductDetailsInfo.ProductId, iQuantity, '', intCatalogLcid, AddToBasket_Succeeded, Ajax_GenericFailedCallback);
}

function AddToBasket_Execute(gVirtualCatalogId, gCatalogGuid, sProductId, iQuantity, sComments) {
    NeXTPortal.Modules.PSEParts.Resources.Services.Order.AddToUserBasket(gUserGuid, gVirtualCatalogId, gCatalogGuid, sProductId, iQuantity, sComments, intCatalogLcid, AddToBasket_Succeeded, Ajax_GenericFailedCallback);
}

function AddToBasket_Succeeded(res, eventArgs) {
    if (typeof(res) === 'undefined')
        return;

    if (res.Success) {
        BasketInfo_Update(res.BasketInfo);
        AddToBasket_Notify(res);
    }
    else {
        Ajax_GenericFailedCallback(res.Message);
    }
}

function AddToBasket_Notify(res) {
    var templateElement = $('#ProductAddedToBasketMessageTemplate');

    containerElement = $('<div/>');

    if (typeof (templateElement) !== 'undefined' && templateElement.length) {
        containerElement.setTemplateElement('ProductAddedToBasketMessageTemplate');
        containerElement.processTemplate(res);
    } // end if

    containerElement.achtung({ timeout: 3, className: 'achtungInfo' });

//        containerElement.slideDown('fast').delay(2000).slideUp('fast');

//        var headline = $('#ProductAddedToBasketNotificationHeader');
//        if (typeof(headline) !== 'undefined' && headline.length)
//            headline.delay(500).blink();
}

/* BasketInfo */
//var eBasketInfoNoOfProductsControlClientId = 'ctl00_wpm_wp1235306407_wcBasketInfo_ctl00_NoOfProductsLabel';
//var eBasketInfoTotalPriceControlClientId = 'ctl00_wpm_wp1235306407_wcBasketInfo_ctl00_TotalPriceLabel';

function BasketInfo_Update(basketInfo) {
    if (typeof (eBasketInfoNoOfProductsControlClientId) !== 'undefined') {
        $('#' + eBasketInfoNoOfProductsControlClientId).html(basketInfo.NoOfProducts);
    }

    if (typeof (eBasketInfoTotalPriceControlClientId) !== 'undefined') {
        $('#' + eBasketInfoTotalPriceControlClientId).html(basketInfo.PricesInclVat ? basketInfo.TotalInclVatString : basketInfo.TotalExclVatString);
    }
}

/* Favorites */

function AddFavoriteToBasket_Begin(gVirtualCatalogId, gCatalogGuid, sProductId, eQuantityInputControlClientId) {
    var iQuantity = 1;
    if (eQuantityInputControlClientId != '') {
        var quantity$ = $('#' + eQuantityInputControlClientId);
        if (typeof (quantity$) !== 'undefined' && quantity$ != null)
            iQuantity = parseInt(quantity$.val());
    }

    AddToBasket_Execute(gVirtualCatalogId, gCatalogGuid, sProductId, iQuantity, '');
}

function AddProductToFavorites_Begin(gShopGuid, gUserGuid, gVirtualCatalogId, gCatalogGuid, sProductId, intLcid) {
    Ajax_SetWaitCursor();
    NeXTPortal.Modules.PSEParts.Resources.Services.Profile.AddProductToFavorites(gShopGuid, gUserGuid, gVirtualCatalogId, gCatalogGuid, sProductId, intLcid, AddProductToFavorites_Succeeded, Ajax_GenericFailedCallback);
}

function AddProductToFavorites_Succeeded(res, eventArgs) {
    Ajax_SetNormalCursor();

    if (typeof (res) !== 'undefined' && res.Success && typeof (res.ProductDetailsInfo) !== 'undefined' && res.ProductDetailsInfo != null) {
        AddProductToFavorites_Notify(res);
    }
    
//    var message = $('#ProductAddedToFavoritesMessage');
//    if (typeof (message) !== 'undefined' && message != null) {
//        message.achtung({ timeout: 3, className: 'achtungInfo' });
//        //message.slideDown('fast').delay(500).blink().slideUp('fast');
//    } // end if
}

function AddProductToFavorites_Notify(res) {
    var templateElement = $('#ProductAddedToFavoritesMessageTemplate');

    containerElement = $('<div/>');

    if (typeof (templateElement) !== 'undefined' && templateElement.length) {
        containerElement.setTemplateElement('ProductAddedToFavoritesMessageTemplate');
        containerElement.processTemplate(res);
    } // end if

    containerElement.achtung({ timeout: 3, className: 'achtungInfo' });
}
try{if(Sys.Browser.agent==Sys.Browser.InternetExplorer){document.execCommand("BackgroundImageCache",false,true);
}}catch(err){}Type.registerNamespace("Telerik.Web.UI");
window.$telerik=window.TelerikCommonScripts=Telerik.Web.CommonScripts={cloneJsObject:function(b,a){if(!a){a={};
}for(var c in b){var d=b[c];
a[c]=(d instanceof Array)?Array.clone(d):d;
}return a;
},isCloned:function(){return this._isCloned;
},cloneControl:function(a,c,b){if(!a){return null;
}if(!c){c=Object.getType(a);
}var d=a.__clonedProperties__;
if(null==d){d=a.__clonedProperties__=$telerik._getPropertiesParameter(a,c);
}if(!b){b=a.get_element().cloneNode(true);
b.removeAttribute("control");
b.removeAttribute("id");
}var f=$create(c,d,null,null,b);
var e=$telerik.cloneJsObject(a.get_events());
f._events=e;
f._events._list=$telerik.cloneJsObject(f._events._list);
f._isCloned=true;
f.isCloned=$telerik.isCloned;
return f;
},_getPropertiesParameter:function(a,g){var c={};
var d=g.prototype;
for(var h in d){var e=a[h];
if(typeof(e)=="function"&&h.indexOf("get_")==0){var b=h.substring(4);
if(null==a["set_"+b]){continue;
}var f=e.call(a);
if(null==f){continue;
}c[b]=f;
}}delete c.clientStateFieldID;
delete c.id;
return c;
},getOuterSize:function(c){var b=$telerik.getSize(c);
var a=$telerik.getMarginBox(c);
return{width:b.width+a.left+a.right,height:b.height+a.top+a.bottom};
},getOuterBounds:function(c){var b=$telerik.getBounds(c);
var a=$telerik.getMarginBox(c);
return{x:b.x-a.left,y:b.y-a.top,width:b.width+a.left+a.right,height:b.height+a.top+a.bottom};
},getInvisibleParent:function(a){while(a&&a!=document){if("none"==$telerik.getCurrentStyle(a,"display","")){return a;
}a=a.parentNode;
}return null;
},scrollIntoView:function(a){if(!a||!a.parentNode){return;
}var b=null;
var c=0;
var d=a.parentNode;
while(d!=null){if(d.tagName=="BODY"){var e=d.ownerDocument;
if(!$telerik.isIE&&e.defaultView&&e.defaultView.frameElement){c=e.defaultView.frameElement.offsetHeight;
}b=d;
break;
}var f=$telerik.getCurrentStyle(d,"overflowY");
if(f=="scroll"||f=="auto"){b=d;
break;
}d=d.parentNode;
}if(!b){return;
}if(!c){c=b.offsetHeight;
}if(c<a.offsetTop+a.offsetHeight){b.scrollTop=(a.offsetTop+a.offsetHeight)-c;
}else{if(a.offsetTop<b.scrollTop){b.scrollTop=a.offsetTop;
}}},isRightToLeft:function(a){while(a&&a.nodeType!==9){var b=$telerik.getCurrentStyle(a,"direction");
if(a.dir=="rtl"||b=="rtl"){return true;
}if(a.dir=="ltr"||b=="ltr"){return false;
}a=a.parentNode;
}return false;
},getCorrectScrollLeft:function(a){if($telerik.isRightToLeft(a)){return -(a.scrollWidth-a.offsetWidth-Math.abs(a.scrollLeft));
}else{return a.scrollLeft;
}},_borderStyleNames:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],_borderWidthNames:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],_paddingWidthNames:["paddingTop","paddingRight","paddingBottom","paddingLeft"],_marginWidthNames:["marginTop","marginRight","marginBottom","marginLeft"],radControls:[],registerControl:function(a){if(!Array.contains(this.radControls,a)){Array.add(this.radControls,a);
}},unregisterControl:function(a){Array.remove(this.radControls,a);
},repaintChildren:function(a){var b=a.get_element?a.get_element():a;
for(var e=0,c=this.radControls.length;
e<c;
e++){var d=this.radControls[e];
if(d.repaint&&this.isDescendant(b,d.get_element())){d.repaint();
}}},_borderThickness:function(){$telerik._borderThicknesses={};
var a=document.createElement("div");
var b=document.createElement("div");
a.style.visibility="hidden";
a.style.position="absolute";
a.style.fontSize="1px";
b.style.height="0px";
b.style.overflow="hidden";
document.body.appendChild(a).appendChild(b);
var c=a.offsetHeight;
b.style.borderTop="solid black";
b.style.borderTopWidth="thin";
$telerik._borderThicknesses.thin=a.offsetHeight-c;
b.style.borderTopWidth="medium";
$telerik._borderThicknesses.medium=a.offsetHeight-c;
b.style.borderTopWidth="thick";
$telerik._borderThicknesses.thick=a.offsetHeight-c;
if(typeof(a.removeChild)!=="undefined"){a.removeChild(b);
}document.body.removeChild(a);
if(!$telerik.isSafari){b.outerHTML=null;
}if(!$telerik.isSafari){a.outerHTML=null;
}a=null;
b=null;
},getCurrentStyle:function(d,e,c){var b=null;
if(d){if(d.currentStyle){b=d.currentStyle[e];
}else{if(document.defaultView&&document.defaultView.getComputedStyle){var a=document.defaultView.getComputedStyle(d,null);
if(a){b=a[e];
}}}if(!b&&d.style.getPropertyValue){b=d.style.getPropertyValue(e);
}else{if(!b&&d.style.getAttribute){b=d.style.getAttribute(e);
}}}if((!b||b==""||typeof(b)==="undefined")){if(typeof(c)!="undefined"){b=c;
}else{b=null;
}}return b;
},getLocation:function(a){if(a===document.documentElement){return new Sys.UI.Point(0,0);
}if(Sys.Browser.agent==Sys.Browser.InternetExplorer){if(a.window===a||a.nodeType===9||!a.getClientRects||!a.getBoundingClientRect){return new Sys.UI.Point(0,0);
}var B=a.getClientRects();
if(!B||!B.length){return new Sys.UI.Point(0,0);
}var j=B[0];
var C=0;
var o=0;
var v=false;
try{v=a.ownerDocument.parentWindow.frameElement;
}catch(f){v=true;
}if(v){var c=a.getBoundingClientRect();
if(!c){return new Sys.UI.Point(0,0);
}var y=j.left;
var p=j.top;
for(var l=1;
l<B.length;
l++){var m=B[l];
if(m.left<y){y=m.left;
}if(m.top<p){p=m.top;
}}C=y-c.left;
o=p-c.top;
}var x=a.document.documentElement;
var e=0;
if(Sys.Browser.version<8||$telerik.quirksMode){var D=1;
if(v&&v.getAttribute){var g=v.getAttribute("frameborder");
if(g!=null){D=parseInt(g,10);
if(isNaN(D)){D=g.toLowerCase()=="no"?0:1;
}}}e=2*D;
}var H=new Sys.UI.Point(j.left-e-C+$telerik.getCorrectScrollLeft(x),j.top-e-o+x.scrollTop);
if($telerik.quirksMode){H.x+=$telerik.getCorrectScrollLeft(document.body);
H.y+=document.body.scrollTop;
}return H;
}var H=Sys.UI.DomElement.getLocation(a);
if($telerik.isOpera){var d=$telerik.getCurrentStyle(a,"display");
if(d!="inline"){var A=a.parentNode;
}else{var A=a.offsetParent;
}while(A){var b=A.tagName.toUpperCase();
if(b=="BODY"||b=="HTML"){break;
}if(b=="TABLE"&&A.parentNode&&A.parentNode.style.display=="inline-block"){var E=A.offsetLeft;
var h=A.style.display;
A.style.display="inline-block";
if(A.offsetLeft>E){H.x+=A.offsetLeft-E;
}A.style.display=h;
}H.x-=$telerik.getCorrectScrollLeft(A);
H.y-=A.scrollTop;
if(d!="inline"){A=A.parentNode;
}else{A=A.offsetParent;
}}}if(!$telerik.isOpera){var F=a.offsetParent;
while(F){if($telerik.getCurrentStyle(F,"position")=="fixed"){H.y+=Math.max(document.documentElement.scrollTop,document.body.scrollTop);
H.x+=Math.max(document.documentElement.scrollLeft,document.body.scrollLeft);
break;
}F=F.offsetParent;
}}if($telerik.isSafari){var z=document.body.scrollTop;
var s=document.body.scrollLeft;
if(z>0||s>0){var w=document.documentElement.getElementsByTagName("form");
if(w&&w.length>0){var k=Sys.UI.DomElement.getLocation(w[0]);
if(k.y&&k.y<0){H.y+=z;
}if(k.x&&k.x<0){H.x+=s;
}}}var A=a.parentNode;
var q=null;
var t=null;
while(A&&A.tagName.toUpperCase()!="BODY"&&A.tagName.toUpperCase()!="HTML"){if(A.tagName.toUpperCase()=="TD"){q=A;
}else{if(A.tagName.toUpperCase()=="TABLE"){t=A;
}else{var n=$telerik.getCurrentStyle(A,"position");
if(n=="absolute"||n=="relative"){var u=$telerik.getCurrentStyle(A,"borderTopWidth",0);
var G=$telerik.getCurrentStyle(A,"borderLeftWidth",0);
H.x+=parseInt(u);
H.y+=parseInt(G);
}}}var n=$telerik.getCurrentStyle(A,"position");
if(n=="absolute"||n=="relative"){H.x-=A.scrollLeft;
H.y-=A.scrollTop;
}if(q&&t){H.x+=parseInt($telerik.getCurrentStyle(t,"borderTopWidth"),0);
H.y+=parseInt($telerik.getCurrentStyle(t,"borderLeftWidth",0));
if($telerik.getCurrentStyle(t,"borderCollapse")!="collapse"){H.x+=parseInt($telerik.getCurrentStyle(q,"borderTopWidth",0));
H.y+=parseInt($telerik.getCurrentStyle(q,"borderLeftWidth",0));
}q=null;
t=null;
}else{if(t){if($telerik.getCurrentStyle(t,"borderCollapse")!="collapse"){H.x+=parseInt($telerik.getCurrentStyle(t,"borderTopWidth",0));
H.y+=parseInt($telerik.getCurrentStyle(t,"borderLeftWidth",0));
}t=null;
}}A=A.parentNode;
}}return H;
},setLocation:function(a,b){Sys.UI.DomElement.setLocation(a,b.x,b.y);
},findControl:function(e,d){var c=e.getElementsByTagName("*");
for(var a=0,b=c.length;
a<b;
a++){var f=c[a].id;
if(f&&f.endsWith(d)){return $find(f);
}}return null;
},findElement:function(e,d){var c=e.getElementsByTagName("*");
for(var a=0,b=c.length;
a<b;
a++){var f=c[a].id;
if(f&&f.endsWith(d)){return $get(f);
}}return null;
},getContentSize:function(d){if(!d){throw Error.argumentNull("element");
}var c=$telerik.getSize(d);
var b=$telerik.getBorderBox(d);
var a=$telerik.getPaddingBox(d);
return{width:c.width-b.horizontal-a.horizontal,height:c.height-b.vertical-a.vertical};
},getSize:function(a){if(!a){throw Error.argumentNull("element");
}return{width:a.offsetWidth,height:a.offsetHeight};
},setContentSize:function(d,c){if(!d){throw Error.argumentNull("element");
}if(!c){throw Error.argumentNull("size");
}if($telerik.getCurrentStyle(d,"MozBoxSizing")=="border-box"||$telerik.getCurrentStyle(d,"BoxSizing")=="border-box"){var b=$telerik.getBorderBox(d);
var a=$telerik.getPaddingBox(d);
c={width:c.width+b.horizontal+a.horizontal,height:c.height+b.vertical+a.vertical};
}d.style.width=c.width.toString()+"px";
d.style.height=c.height.toString()+"px";
},setSize:function(e,c){if(!e){throw Error.argumentNull("element");
}if(!c){throw Error.argumentNull("size");
}var b=$telerik.getBorderBox(e);
var a=$telerik.getPaddingBox(e);
var d={width:c.width-b.horizontal-a.horizontal,height:c.height-b.vertical-a.vertical};
$telerik.setContentSize(e,d);
},getBounds:function(a){var b=$telerik.getLocation(a);
return new Sys.UI.Bounds(b.x,b.y,a.offsetWidth||0,a.offsetHeight||0);
},setBounds:function(a,b){if(!a){throw Error.argumentNull("element");
}if(!b){throw Error.argumentNull("bounds");
}$telerik.setSize(a,b);
$telerik.setLocation(a,b);
},getClientBounds:function(){var b;
var a;
switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:b=document.documentElement.clientWidth;
a=document.documentElement.clientHeight;
if(b==0&&a==0){b=document.body.clientWidth;
a=document.body.clientHeight;
}break;
case Sys.Browser.Safari:b=window.innerWidth;
a=window.innerHeight;
break;
case Sys.Browser.Opera:if(Sys.Browser.version>=9.5){b=Math.min(window.innerWidth,document.documentElement.clientWidth);
a=Math.min(window.innerHeight,document.documentElement.clientHeight);
}else{b=Math.min(window.innerWidth,document.body.clientWidth);
a=Math.min(window.innerHeight,document.body.clientHeight);
}break;
default:b=Math.min(window.innerWidth,document.documentElement.clientWidth);
a=Math.min(window.innerHeight,document.documentElement.clientHeight);
break;
}return new Sys.UI.Bounds(0,0,b,a);
},getMarginBox:function(a){if(!a){throw Error.argumentNull("element");
}var b={top:$telerik.getMargin(a,Telerik.Web.BoxSide.Top),right:$telerik.getMargin(a,Telerik.Web.BoxSide.Right),bottom:$telerik.getMargin(a,Telerik.Web.BoxSide.Bottom),left:$telerik.getMargin(a,Telerik.Web.BoxSide.Left)};
b.horizontal=b.left+b.right;
b.vertical=b.top+b.bottom;
return b;
},getPaddingBox:function(a){if(!a){throw Error.argumentNull("element");
}var b={top:$telerik.getPadding(a,Telerik.Web.BoxSide.Top),right:$telerik.getPadding(a,Telerik.Web.BoxSide.Right),bottom:$telerik.getPadding(a,Telerik.Web.BoxSide.Bottom),left:$telerik.getPadding(a,Telerik.Web.BoxSide.Left)};
b.horizontal=b.left+b.right;
b.vertical=b.top+b.bottom;
return b;
},getBorderBox:function(a){if(!a){throw Error.argumentNull("element");
}var b={top:$telerik.getBorderWidth(a,Telerik.Web.BoxSide.Top),right:$telerik.getBorderWidth(a,Telerik.Web.BoxSide.Right),bottom:$telerik.getBorderWidth(a,Telerik.Web.BoxSide.Bottom),left:$telerik.getBorderWidth(a,Telerik.Web.BoxSide.Left)};
b.horizontal=b.left+b.right;
b.vertical=b.top+b.bottom;
return b;
},isBorderVisible:function(c,b){if(!c){throw Error.argumentNull("element");
}if(b<Telerik.Web.BoxSide.Top||b>Telerik.Web.BoxSide.Left){throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,b,"Telerik.Web.BoxSide"));
}var a=$telerik._borderStyleNames[b];
var d=$telerik.getCurrentStyle(c,a);
return d!="none";
},getMargin:function(c,b){if(!c){throw Error.argumentNull("element");
}if(b<Telerik.Web.BoxSide.Top||b>Telerik.Web.BoxSide.Left){throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,b,"Telerik.Web.BoxSide"));
}var a=$telerik._marginWidthNames[b];
var d=$telerik.getCurrentStyle(c,a);
try{return $telerik.parsePadding(d);
}catch(e){return 0;
}},getBorderWidth:function(c,b){if(!c){throw Error.argumentNull("element");
}if(b<Telerik.Web.BoxSide.Top||b>Telerik.Web.BoxSide.Left){throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,b,"Telerik.Web.BoxSide"));
}if(!$telerik.isBorderVisible(c,b)){return 0;
}var a=$telerik._borderWidthNames[b];
var d=$telerik.getCurrentStyle(c,a);
return $telerik.parseBorderWidth(d);
},getPadding:function(c,b){if(!c){throw Error.argumentNull("element");
}if(b<Telerik.Web.BoxSide.Top||b>Telerik.Web.BoxSide.Left){throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,b,"Telerik.Web.BoxSide"));
}var a=$telerik._paddingWidthNames[b];
var d=$telerik.getCurrentStyle(c,a);
return $telerik.parsePadding(d);
},parseBorderWidth:function(b){if(b){switch(b){case"thin":case"medium":case"thick":return $telerik._borderThicknesses[b];
case"inherit":return 0;
}var a=$telerik.parseUnit(b);
return a.size;
}return 0;
},parsePadding:function(b){if(b){if(b=="auto"||b=="inherit"){return 0;
}var a=$telerik.parseUnit(b);
return a.size;
}return 0;
},parseUnit:function(a){if(!a){throw Error.argumentNull("value");
}a=a.trim().toLowerCase();
var c=a.length;
var g=-1;
for(var b=0;
b<c;
b++){var d=a.substr(b,1);
if((d<"0"||d>"9")&&d!="-"&&d!="."&&d!=","){break;
}g=b;
}if(g==-1){throw Error.create("No digits");
}var f;
var e;
if(g<(c-1)){f=a.substring(g+1).trim();
}else{f="px";
}e=parseFloat(a.substr(0,g+1));
if(f=="px"){e=Math.floor(e);
}return{size:e,type:f};
},containsPoint:function(c,b,a){return b>=c.x&&b<=(c.x+c.width)&&a>=c.y&&a<=(c.y+c.height);
},isDescendant:function(c,a){try{for(var d=a.parentNode;
d!=null;
d=d.parentNode){if(d==c){return true;
}}}catch(b){}return false;
},isDescendantOrSelf:function(a,b){if(a===b){return true;
}return $telerik.isDescendant(a,b);
},addCssClasses:function(c,a){for(var b=0;
b<a.length;
b++){Sys.UI.DomElement.addCssClass(c,a[b]);
}},removeCssClasses:function(c,a){for(var b=0;
b<a.length;
b++){Sys.UI.DomElement.removeCssClass(c,a[b]);
}},getScrollOffset:function(c,b){var e=0;
var d=0;
var a=c;
while(a!=null&&a.scrollLeft!=null){e+=$telerik.getCorrectScrollLeft(a);
d+=a.scrollTop;
if(!b||(a==document.body&&(a.scrollLeft!=0||a.scrollTop!=0))){break;
}a=a.parentNode;
}return{x:e,y:d};
},getElementByClassName:function(c,g,d){var a=null;
if(d){a=c.getElementsByTagName(d);
}else{a=c.getElementsByTagName("*");
}for(var b=0,f=a.length;
b<f;
b++){var e=a[b];
if(Sys.UI.DomElement.containsCssClass(e,g)){return e;
}}return null;
},addExternalHandler:function(c,b,a){if(c.addEventListener){c.addEventListener(b,a,false);
}else{if(c.attachEvent){c.attachEvent("on"+b,a);
}}},removeExternalHandler:function(c,b,a){if(c.addEventListener){c.removeEventListener(b,a,false);
}else{if(c.detachEvent){c.detachEvent("on"+b,a);
}}},cancelRawEvent:function(a){if(!a){return false;
}if(a.preventDefault){a.preventDefault();
}if(a.stopPropagation){a.stopPropagation();
}a.cancelBubble=true;
a.returnValue=false;
return false;
},getOuterHtml:function(b){if(b.outerHTML){return b.outerHTML;
}else{var a=b.cloneNode(true);
var c=b.ownerDocument.createElement("DIV");
c.appendChild(a);
return c.innerHTML;
}},setVisible:function(a,b){if(!a){return;
}if(b!=$telerik.getVisible(a)){if(b){if(a.style.removeAttribute){a.style.removeAttribute("display");
}else{a.style.removeProperty("display");
}}else{a.style.display="none";
}a.style.visibility=b?"visible":"hidden";
}},getVisible:function(a){if(!a){return false;
}return(("none"!=$telerik.getCurrentStyle(a,"display"))&&("hidden"!=$telerik.getCurrentStyle(a,"visibility")));
},getViewPortSize:function(){var b=0;
var a=0;
var c=document.body;
if(!$telerik.quirksMode&&!$telerik.isSafari){c=document.documentElement;
}if(window.innerWidth){b=window.innerWidth;
a=window.innerHeight;
}else{b=c.clientWidth;
a=c.clientHeight;
}b+=c.scrollLeft;
a+=c.scrollTop;
return{width:b-6,height:a-6};
},elementOverflowsTop:function(c,a){var b=a||$telerik.getLocation(c);
return b.y<0;
},elementOverflowsLeft:function(c,a){var b=a||$telerik.getLocation(c);
return b.x<0;
},elementOverflowsBottom:function(c,d,a){var e=a||$telerik.getLocation(d);
var b=e.y+d.offsetHeight;
return b>c.height;
},elementOverflowsRight:function(c,d,a){var e=a||$telerik.getLocation(d);
var b=e.x+d.offsetWidth;
return b>c.width;
},getDocumentRelativeCursorPosition:function(f){var c=document.documentElement;
var a=document.body;
var b=f.clientX+($telerik.getCorrectScrollLeft(c)+$telerik.getCorrectScrollLeft(a));
var d=f.clientY+(c.scrollTop+a.scrollTop);
if($telerik.isIE&&Sys.Browser.version<8){b-=2;
d-=2;
}return{left:b,top:d};
},evalScriptCode:function(c){if($telerik.isSafari){c=c.replace(/^\s*<!--((.|\n)*)-->\s*$/mi,"$1");
}var b=document.createElement("script");
b.setAttribute("type","text/javascript");
b.text=c;
var a=document.getElementsByTagName("head")[0];
a.appendChild(b);
b.parentNode.removeChild(b);
},isScriptRegistered:function(a,b){if(!a){return 0;
}if(!b){b=document;
}if($telerik._uniqueScripts==null){$telerik._uniqueScripts={};
}var f=document.getElementsByTagName("script");
var g=0;
var k=a.indexOf("?d=");
var j=a.indexOf("&");
var d=k>0&&j>k?a.substring(k+3,j):a;
if($telerik._uniqueScripts[d]!=null){return 2;
}for(var c=0,e=f.length;
c<e;
c++){var h=f[c];
if(h.src){if(h.getAttribute("src",2).indexOf(d)!=-1){$telerik._uniqueScripts[d]=true;
if(!$telerik.isDescendant(b,h)){g++;
}}}}return g;
},evalScripts:function(b,d){$telerik.registerSkins(b);
var h=b.getElementsByTagName("script");
var g=0,e=0;
var m=function(o,n){if(o-e>0&&($telerik.isIE||$telerik.isSafari)){window.setTimeout(function(){m(o,n);
},5);
}else{var i=document.createElement("script");
i.setAttribute("type","text/javascript");
document.getElementsByTagName("head")[0].appendChild(i);
i.loadFinished=false;
i.onload=function(){if(!this.loadFinished){this.loadFinished=true;
e++;
}};
i.onreadystatechange=function(){if("loaded"===this.readyState&&!this.loadFinished){this.loadFinished=true;
e++;
}};
i.setAttribute("src",n);
}};
var j=[];
for(var c=0,f=h.length;
c<f;
c++){var k=h[c];
if(k.src){var a=k.getAttribute("src",2);
if(!$telerik.isScriptRegistered(a,b)){m(g++,a);
}}else{Array.add(j,k.innerHTML);
}}var l=function(){if(g-e>0){window.setTimeout(l,20);
}else{for(var i=0;
i<j.length;
i++){$telerik.evalScriptCode(j[i]);
}if(d){d();
}}};
l();
},registerSkins:function(b){if(!b){b=document.body;
}var g=b.getElementsByTagName("link");
if(g&&g.length>0){var a=document.getElementsByTagName("head")[0];
if(a){for(var c=0,h=g.length;
c<h;
c++){var f=g[c];
if(f.className=="Telerik_stylesheet"){var l=a.getElementsByTagName("link");
if(f.href.indexOf("ie7CacheFix")>=0){try{f.href=f.href.replace("&ie7CacheFix","");
f.href=f.href.replace("?ie7CacheFix","");
}catch(k){}}if(l&&l.length>0){var d=l.length-1;
while(d>=0&&l[d--].href!=f.href){}if(d>=0){continue;
}}if($telerik.isIE){f.parentNode.removeChild(f);
f=f.cloneNode(true);
}a.appendChild(f);
if(h>g.length){h=g.length;
c--;
}}}}}},getFirstChildByTagName:function(d,b,c){if(!d||!d.childNodes){return null;
}var a=d.childNodes[c]||d.firstChild;
while(a){if(a.nodeType==1&&a.tagName.toLowerCase()==b){return a;
}a=a.nextSibling;
}return null;
},getChildByClassName:function(a,d,c){var b=a.childNodes[c]||a.firstChild;
while(b){if(b.nodeType==1&&b.className.indexOf(d)>-1){return b;
}b=b.nextSibling;
}return null;
},getChildrenByTagName:function(b,d){var a=new Array();
var e=b.childNodes;
if($telerik.isIE){e=b.children;
}for(var c=0,g=e.length;
c<g;
c++){var f=e[c];
if(f.nodeType==1&&f.tagName.toLowerCase()==d){Array.add(a,f);
}}return a;
},getChildrenByClassName:function(d,g){var a=new Array();
var b=d.childNodes;
if($telerik.isIE){b=d.children;
}for(var c=0,f=b.length;
c<f;
c++){var e=b[c];
if(e.nodeType==1&&e.className.indexOf(g)>-1){Array.add(a,e);
}}return a;
},mergeElementAttributes:function(d,b,a){if(!d||!b){return;
}if(d.mergeAttributes){b.mergeAttributes(d,a);
}else{for(var c=0;
c<d.attributes.length;
c++){var e=d.attributes[c].nodeValue;
b.setAttribute(d.attributes[c].nodeName,e);
}if(""==b.getAttribute("style")){b.removeAttribute("style");
}}},isMouseOverElement:function(c,d){var b=$telerik.getBounds(c);
var a=$telerik.getDocumentRelativeCursorPosition(d);
return $telerik.containsPoint(b,a.left,a.top);
},isMouseOverElementEx:function(a,g){var d=null;
try{d=$telerik.getOuterBounds(a);
}catch(g){return false;
}if(g&&g.target){var c=g.target.tagName;
if(c=="SELECT"||c=="OPTION"){return true;
}if(g.clientX<0||g.clientY<0){return true;
}}var b=$telerik.getDocumentRelativeCursorPosition(g);
d.x+=2;
d.y+=2;
d.width-=4;
d.height-=4;
var f=$telerik.containsPoint(d,b.left,b.top);
return f;
},getPreviousHtmlNode:function(a){if(!a||!a.previousSibling){return null;
}while(a.previousSibling){if(a.previousSibling.nodeType==1){return a.previousSibling;
}a=a.previousSibling;
}},getNextHtmlNode:function(a){if(!a||!a.nextSibling){return null;
}while(a.nextSibling){if(a.nextSibling.nodeType==1){return a.nextSibling;
}a=a.nextSibling;
}},disposeElement:function(a){if(typeof(Sys.WebForms)=="undefined"){return;
}var b=Sys.WebForms.PageRequestManager.getInstance();
if(b&&b._destroyTree){b._destroyTree(a);
}else{if(Sys.Application.disposeElement){Sys.Application.disposeElement(a,true);
}}}};
if(typeof(Sys.Browser.WebKit)=="undefined"){Sys.Browser.WebKit={};
}if(typeof(Sys.Browser.Chrome)=="undefined"){Sys.Browser.Chrome={};
}if(navigator.userAgent.indexOf("Chrome")>-1){Sys.Browser.version=parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
Sys.Browser.agent=Sys.Browser.Chrome;
Sys.Browser.name="Chrome";
}else{if(navigator.userAgent.indexOf("WebKit/")>-1){Sys.Browser.version=parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);
if(Sys.Browser.version<500){Sys.Browser.agent=Sys.Browser.Safari;
Sys.Browser.name="Safari";
}else{Sys.Browser.agent=Sys.Browser.WebKit;
Sys.Browser.name="WebKit";
}}}$telerik.isChrome=Sys.Browser.agent==Sys.Browser.Chrome;
$telerik.isSafari4=Sys.Browser.agent==Sys.Browser.WebKit&&Sys.Browser.version>=526;
$telerik.isSafari3=Sys.Browser.agent==Sys.Browser.WebKit&&Sys.Browser.version<526&&Sys.Browser.version>500;
$telerik.isSafari2=Sys.Browser.agent==Sys.Browser.Safari;
$telerik.isSafari=$telerik.isSafari2||$telerik.isSafari3||$telerik.isSafari4||$telerik.isChrome;
$telerik.isIE=Sys.Browser.agent==Sys.Browser.InternetExplorer;
$telerik.isIE6=$telerik.isIE&&Sys.Browser.version<7;
$telerik.isIE7=$telerik.isIE&&(Sys.Browser.version==7||(document.documentMode&&document.documentMode<8));
$telerik.isIE8=$telerik.isIE&&Sys.Browser.version==8&&document.documentMode&&document.documentMode==8;
$telerik.isOpera=Sys.Browser.agent==Sys.Browser.Opera;
$telerik.isFirefox=Sys.Browser.agent==Sys.Browser.Firefox;
$telerik.isFirefox2=$telerik.isFirefox&&Sys.Browser.version<3;
$telerik.isFirefox3=$telerik.isFirefox&&Sys.Browser.version>=3;
$telerik.quirksMode=$telerik.isIE&&document.compatMode!="CSS1Compat";
$telerik.standardsMode=!$telerik.quirksMode;
Sys.Application.add_init(function(){try{$telerik._borderThickness();
}catch(a){}});
Sys.Application.add_load(function(){if(!$telerik.isFirefox){return;
}var d="_TSM";
var b=document.getElementsByTagName("input");
for(var a=0,c=b.length;
a<c;
a++){var e=b[a];
if(e.type!="hidden"){continue;
}if(e.name.indexOf(d)==e.length-d.length){continue;
}e.setAttribute("autocomplete","off");
return;
}});
Telerik.Web.UI.Orientation=function(){throw Error.invalidOperation();
};
Telerik.Web.UI.Orientation.prototype={Horizontal:0,Vertical:1};
Telerik.Web.UI.Orientation.registerEnum("Telerik.Web.UI.Orientation",false);
Telerik.Web.UI.RadWebControl=function(a){Telerik.Web.UI.RadWebControl.initializeBase(this,[a]);
this._clientStateFieldID=null;
};
Telerik.Web.UI.RadWebControl.prototype={initialize:function(){Telerik.Web.UI.RadWebControl.callBaseMethod(this,"initialize");
$telerik.registerControl(this);
if(!this.get_clientStateFieldID()){return;
}var a=$get(this.get_clientStateFieldID());
if(!a){return;
}a.setAttribute("autocomplete","off");
},dispose:function(){$telerik.unregisterControl(this);
var b=this.get_element();
Telerik.Web.UI.RadWebControl.callBaseMethod(this,"dispose");
if(b){b.control=null;
var a=true;
if(b._events){for(var c in b._events){if(b._events[c].length>0){a=false;
break;
}}if(a){b._events=null;
}}}},raiseEvent:function(b,c){var a=this.get_events().getHandler(b);
if(a){if(!c){c=Sys.EventArgs.Empty;
}a(this,c);
}},updateClientState:function(){this.set_clientState(this.saveClientState());
},saveClientState:function(){return null;
},get_clientStateFieldID:function(){return this._clientStateFieldID;
},set_clientStateFieldID:function(a){if(this._clientStateFieldID!=a){this._clientStateFieldID=a;
this.raisePropertyChanged("ClientStateFieldID");
}},get_clientState:function(){if(this._clientStateFieldID){var a=document.getElementById(this._clientStateFieldID);
if(a){return a.value;
}}return null;
},set_clientState:function(b){if(this._clientStateFieldID){var a=document.getElementById(this._clientStateFieldID);
if(a){a.value=b;
}}},_getChildElement:function(a){return $get(this.get_id()+"_"+a);
},_findChildControl:function(a){return $find(this.get_id()+"_"+a);
}};
Telerik.Web.UI.RadWebControl.registerClass("Telerik.Web.UI.RadWebControl",Sys.UI.Control);
Telerik.Web.Timer=function(){Telerik.Web.Timer.initializeBase(this);
this._interval=1000;
this._enabled=false;
this._timer=null;
this._timerCallbackDelegate=Function.createDelegate(this,this._timerCallback);
};
Telerik.Web.Timer.prototype={get_interval:function(){return this._interval;
},set_interval:function(a){if(this._interval!==a){this._interval=a;
this.raisePropertyChanged("interval");
if(!this.get_isUpdating()&&(this._timer!==null)){this._stopTimer();
this._startTimer();
}}},get_enabled:function(){return this._enabled;
},set_enabled:function(a){if(a!==this.get_enabled()){this._enabled=a;
this.raisePropertyChanged("enabled");
if(!this.get_isUpdating()){if(a){this._startTimer();
}else{this._stopTimer();
}}}},add_tick:function(a){this.get_events().addHandler("tick",a);
},remove_tick:function(a){this.get_events().removeHandler("tick",a);
},dispose:function(){this.set_enabled(false);
this._stopTimer();
Telerik.Web.Timer.callBaseMethod(this,"dispose");
},updated:function(){Telerik.Web.Timer.callBaseMethod(this,"updated");
if(this._enabled){this._stopTimer();
this._startTimer();
}},_timerCallback:function(){var a=this.get_events().getHandler("tick");
if(a){a(this,Sys.EventArgs.Empty);
}},_startTimer:function(){this._timer=window.setInterval(this._timerCallbackDelegate,this._interval);
},_stopTimer:function(){window.clearInterval(this._timer);
this._timer=null;
}};
Telerik.Web.Timer.registerClass("Telerik.Web.Timer",Sys.Component);
Telerik.Web.BoxSide=function(){};
Telerik.Web.BoxSide.prototype={Top:0,Right:1,Bottom:2,Left:3};
Telerik.Web.BoxSide.registerEnum("Telerik.Web.BoxSide",false);
Telerik.Web.UI.WebServiceLoaderEventArgs=function(a){Telerik.Web.UI.WebServiceLoaderEventArgs.initializeBase(this);
this._context=a;
};
Telerik.Web.UI.WebServiceLoaderEventArgs.prototype={get_context:function(){return this._context;
}};
Telerik.Web.UI.WebServiceLoaderEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderEventArgs",Sys.EventArgs);
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs=function(a,b){Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.initializeBase(this,[b]);
this._data=a;
};
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.prototype={get_data:function(){return this._data;
}};
Telerik.Web.UI.WebServiceLoaderSuccessEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderSuccessEventArgs",Telerik.Web.UI.WebServiceLoaderEventArgs);
Telerik.Web.UI.WebServiceLoaderErrorEventArgs=function(a,b){Telerik.Web.UI.WebServiceLoaderErrorEventArgs.initializeBase(this,[b]);
this._message=a;
};
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.prototype={get_message:function(){return this._message;
}};
Telerik.Web.UI.WebServiceLoaderErrorEventArgs.registerClass("Telerik.Web.UI.WebServiceLoaderErrorEventArgs",Telerik.Web.UI.WebServiceLoaderEventArgs);
Telerik.Web.UI.WebServiceLoader=function(a){this._webServiceSettings=a;
this._events=null;
this._onWebServiceSuccessDelegate=Function.createDelegate(this,this._onWebServiceSuccess);
this._onWebServiceErrorDelegate=Function.createDelegate(this,this._onWebServiceError);
this._currentRequest=null;
};
Telerik.Web.UI.WebServiceLoader.prototype={get_webServiceSettings:function(){return this._webServiceSettings;
},get_events:function(){if(!this._events){this._events=new Sys.EventHandlerList();
}return this._events;
},loadData:function(c,a){var b=this.get_webServiceSettings();
this.invokeMethod(this._webServiceSettings.get_method(),c,a);
},invokeMethod:function(e,a,d){var c=this.get_webServiceSettings();
if(c.get_isEmpty()){alert("Please, specify valid web service and method.");
return;
}this._raiseEvent("loadingStarted",new Telerik.Web.UI.WebServiceLoaderEventArgs(d));
var f=c.get_path();
var b=c.get_useHttpGet();
this._currentRequest=Sys.Net.WebServiceProxy.invoke(f,e,b,a,this._onWebServiceSuccessDelegate,this._onWebServiceErrorDelegate,d);
},add_loadingStarted:function(a){this.get_events().addHandler("loadingStarted",a);
},add_loadingError:function(a){this.get_events().addHandler("loadingError",a);
},add_loadingSuccess:function(a){this.get_events().addHandler("loadingSuccess",a);
},_serializeDictionaryAsKeyValuePairs:function(a){var b=[];
for(var c in a){b[b.length]={Key:c,Value:a[c]};
}return b;
},_onWebServiceSuccess:function(b,a){var c=new Telerik.Web.UI.WebServiceLoaderSuccessEventArgs(b,a);
this._raiseEvent("loadingSuccess",c);
},_onWebServiceError:function(c,a){var b=new Telerik.Web.UI.WebServiceLoaderErrorEventArgs(c.get_message(),a);
this._raiseEvent("loadingError",b);
},_raiseEvent:function(b,c){var a=this.get_events().getHandler(b);
if(a){if(!c){c=Sys.EventArgs.Empty;
}a(this,c);
}}};
Telerik.Web.UI.WebServiceLoader.registerClass("Telerik.Web.UI.WebServiceLoader");
Telerik.Web.UI.WebServiceSettings=function(a){this._path=null;
this._method=null;
this._useHttpGet=false;
if(!a){a={};
}if(typeof(a.path)!="undefined"){this._path=a.path;
}if(typeof(a.method)!="undefined"){this._method=a.method;
}if(typeof(a.useHttpGet)!="undefined"){this._useHttpGet=a.useHttpGet;
}};
Telerik.Web.UI.WebServiceSettings.prototype={get_isWcf:function(){return/\.svc$/.test(this._path);
},get_path:function(){return this._path;
},set_path:function(a){this._path=a;
},get_method:function(){return this._method;
},set_method:function(a){this._method=a;
},get_useHttpGet:function(){return this._useHttpGet;
},set_useHttpGet:function(a){this._useHttpGet=a;
},get_isEmpty:function(){var a=this.get_path();
var b=this.get_method();
return(!(a&&b));
}};
Telerik.Web.UI.WebServiceSettings.registerClass("Telerik.Web.UI.WebServiceSettings");
Telerik.Web.UI.ActionsManager=function(a){Telerik.Web.UI.ActionsManager.initializeBase(this);
this._actions=[];
this._currentActionIndex=-1;
};
Telerik.Web.UI.ActionsManager.prototype={get_actions:function(){return this._actions;
},shiftPointerLeft:function(){this._currentActionIndex--;
},shiftPointerRight:function(){this._currentActionIndex++;
},get_currentAction:function(){return this.get_actions()[this._currentActionIndex];
},get_nextAction:function(){return this.get_actions()[this._currentActionIndex+1];
},addAction:function(a){if(a){var b=new Telerik.Web.UI.ActionsManagerEventArgs(a);
this.raiseEvent("executeAction",b);
this._clearActionsToRedo();
Array.add(this._actions,a);
this._currentActionIndex=this._actions.length-1;
return true;
}return false;
},undo:function(c){if(c==null){c=1;
}if(c>this._actions.length){c=this._actions.length;
}var d=0;
var b=null;
while(0<c--&&0<=this._currentActionIndex&&this._currentActionIndex<this._actions.length){b=this._actions[this._currentActionIndex--];
if(b){var a=new Telerik.Web.UI.ActionsManagerEventArgs(b);
this.raiseEvent("undoAction",a);
d++;
}}},redo:function(c){if(c==null){c=1;
}if(c>this._actions.length){c=this._actions.length;
}var d=0;
var b=null;
var e=this._currentActionIndex+1;
while(0<c--&&0<=e&&e<this._actions.length){b=this._actions[e];
if(b){var a=new Telerik.Web.UI.ActionsManagerEventArgs(b);
this.raiseEvent("redoAction",a);
this._currentActionIndex=e;
d++;
}e++;
}},removeActionAt:function(a){this._actions.splice(a,1);
if(this._currentActionIndex>=a){this._currentActionIndex--;
}},canUndo:function(){return(-1<this._currentActionIndex);
},canRedo:function(){return(this._currentActionIndex<this._actions.length-1);
},getActionsToUndo:function(){if(this.canUndo()){return(this._actions.slice(0,this._currentActionIndex+1)).reverse();
}return[];
},getActionsToRedo:function(){if(this.canRedo()){return this._actions.slice(this._currentActionIndex+1);
}return[];
},_clearActionsToRedo:function(){if(this.canRedo()){this._actions.splice(this._currentActionIndex+1,this._actions.length-this._currentActionIndex);
}},add_undoAction:function(a){this.get_events().addHandler("undoAction",a);
},remove_undoAction:function(a){this.get_events().removeHandler("undoAction",a);
},add_redoAction:function(a){this.get_events().addHandler("redoAction",a);
},remove_redoAction:function(a){this.get_events().removeHandler("redoAction",a);
},add_executeAction:function(a){this.get_events().addHandler("executeAction",a);
},remove_executeAction:function(a){this.get_events().removeHandler("executeAction",a);
},raiseEvent:function(b,c){var a=this.get_events().getHandler(b);
if(a){a(this,c);
}}};
Telerik.Web.UI.ActionsManager.registerClass("Telerik.Web.UI.ActionsManager",Sys.Component);
Telerik.Web.UI.ActionsManagerEventArgs=function(a){Telerik.Web.UI.ActionsManagerEventArgs.initializeBase(this);
this._action=a;
};
Telerik.Web.UI.ActionsManagerEventArgs.prototype={get_action:function(){return this._action;
}};
Telerik.Web.UI.ActionsManagerEventArgs.registerClass("Telerik.Web.UI.ActionsManagerEventArgs",Sys.CancelEventArgs);
Telerik.Web.StringBuilder=function(a){this._buffer=a||[];
},Telerik.Web.StringBuilder.prototype={append:function(b){for(var a=0;
a<arguments.length;
a++){this._buffer[this._buffer.length]=arguments[a];
}return this;
},toString:function(){return this._buffer.join("");
},get_buffer:function(){return this._buffer;
}};

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadInputControl=function(a){Telerik.Web.UI.RadInputControl.initializeBase(this,[a]);
this._autoPostBack=false;
this._enabled=true;
this._showButton=false;
this._invalidStyleDuration=100;
this._emptyMessage="";
this._selectionOnFocus=Telerik.Web.UI.SelectionOnFocus.None;
this._postBackEventReferenceScript="";
this._styles=null;
this._isEnterPressed=false;
this._isDroped=false;
this._enableOldBoxModel=false;
this._shouldResetWidthInPixels=true;
this._reducedPixelWidthFlag=false;
this._originalTextBoxWidth=null;
this._originalCellPadding=null;
this._originalDisplay=null;
this._onTextBoxKeyUpDelegate=null;
this._onTextBoxKeyPressDelegate=null;
this._onTextBoxBlurDelegate=null;
this._onTextBoxFocusDelegate=null;
this._onTextBoxDragEnterDelegate=null;
this._onTextBoxDragLeaveDelegate=null;
this._onTextBoxDropDelegate=null;
this._onTextBoxMouseOutDelegate=null;
this._onTextBoxMouseOverDelegate=null;
this._onTextBoxKeyDownDelegate=null;
this._onTextBoxMouseWheelDelegate=null;
this._onTextBoxDragDropDelegate=null;
this._onFormResetDelegate=null;
if($telerik.isSafari){this._onTextBoxMouseUpDelegate=null;
}this._focused=false;
this._allowApplySelection=true;
};
Telerik.Web.UI.RadInputControl.prototype={initialize:function(){Telerik.Web.UI.RadInputControl.callBaseMethod(this,"initialize");
this._clientID=this.get_id();
this._wrapperElementID=this.get_id()+"_wrapper";
this._textBoxElement=$get(this.get_id()+"_text");
this._originalTextBoxCssText=this._textBoxElement.style.cssText;
if(this._originalTextBoxCssText.lastIndexOf(";")!=this._originalTextBoxCssText.length-1){this._originalTextBoxCssText+=";";
}if($telerik.isIE7){var b=$get(this._wrapperElementID);
if(b.style.display=="inline-block"){b.style.display="inline";
b.style.zoom=1;
}else{if(document.documentMode&&document.documentMode>7&&b.style.display=="inline"){b.style.display="inline-block";
}}}this.repaint();
this._originalMaxLength=this._textBoxElement.maxLength;
if(this._originalMaxLength==-1){this._originalMaxLength=2147483647;
}this._initializeHiddenElement(this.get_id());
this._initializeValidationField(this.get_id());
this._selectionEnd=0;
this._selectionStart=0;
this._isInFocus=true;
this._hovered=false;
this._invalid=false;
this._attachEventHandlers();
this.updateCssClass();
this._initializeButtons();
this._initialValue=this.get_value();
if(($telerik.isFirefox2||$telerik.isSafari)&&this.isEmpty()&&this.get_emptyMessage().length>this._originalMaxLength){this.updateDisplayValue();
}this.raise_load(Sys.EventArgs.Empty);
if(this._focused){var a=this;
setTimeout(function(){a._updateStateOnFocus();
},0);
}},dispose:function(){Telerik.Web.UI.RadInputControl.callBaseMethod(this,"dispose");
if(this.Button){if(this._onButtonClickDelegate){$removeHandler(this.Button,"click",this._onButtonClickDelegate);
this._onButtonClickDelegate=null;
}}if($telerik.isIE){if(this._onTextBoxPasteDelegate){$removeHandler(this._textBoxElement,"paste",this._onTextBoxPasteDelegate);
this._onTextBoxPasteDelegate=null;
}}else{if(this._onTextBoxInputDelegate){$removeHandler(this._textBoxElement,"input",this._onTextBoxInputDelegate);
this._onTextBoxInputDelegate=null;
}}if(this._onTextBoxKeyDownDelegate){$removeHandler(this._textBoxElement,"keydown",this._onTextBoxKeyDownDelegate);
this._onTextBoxKeyDownDelegate=null;
}if(this._onTextBoxKeyPressDelegate){$removeHandler(this._textBoxElement,"keypress",this._onTextBoxKeyPressDelegate);
this._onTextBoxKeyPressDelegate=null;
}if(this._onTextBoxKeyUpDelegate){$removeHandler(this._textBoxElement,"keyup",this._onTextBoxKeyUpDelegate);
this._onTextBoxKeyUpDelegate=null;
}if(this._onTextBoxBlurDelegate){$removeHandler(this._textBoxElement,"blur",this._onTextBoxBlurDelegate);
this._onTextBoxBlurDelegate=null;
}if(this._onTextBoxFocusDelegate){$removeHandler(this._textBoxElement,"focus",this._onTextBoxFocusDelegate);
this._onTextBoxFocusDelegate=null;
}if(this._onTextBoxDragEnterDelegate){$removeHandler(this._textBoxElement,"dragenter",this._onTextBoxDragEnterDelegate);
this._onTextBoxDragEnterDelegate=null;
}if(this._onTextBoxDragLeaveDelegate){if($telerik.isFirefox){$removeHandler(this._textBoxElement,"dragexit",this._onTextBoxDragLeaveDelegate);
}else{$removeHandler(this._textBoxElement,"dragleave",this._onTextBoxDragLeaveDelegate);
}this._onTextBoxDragLeaveDelegate=null;
}if(this._onTextBoxDropDelegate){if($telerik.isFirefox){$removeHandler(this._textBoxElement,"dragdrop",this._onTextBoxDropDelegate);
}this._onTextBoxDropDelegate=null;
}if(this._onTextBoxMouseOutDelegate){$removeHandler(this._textBoxElement,"mouseout",this._onTextBoxMouseOutDelegate);
this._onTextBoxMouseOutDelegate=null;
}if(this._onTextBoxMouseOverDelegate){$removeHandler(this._textBoxElement,"mouseover",this._onTextBoxMouseOverDelegate);
this._onTextBoxMouseOverDelegate=null;
}if(this._onTextBoxMouseUpDelegate){$removeHandler(this._textBoxElement,"mouseup",this._onTextBoxMouseUpDelegate);
this._onTextBoxMouseUpDelegate=null;
}if(this._onFormResetDelegate){if(this._textBoxElement.form){$removeHandler(this._textBoxElement.form,"reset",this._onFormResetDelegate);
}this._onFormResetDelegate=null;
}if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){if(this._onTextBoxMouseWheelDelegate){if((!$telerik.isSafari2&&$telerik.isSafari)||$telerik.isOpera){$removeHandler(this._textBoxElement,"mousewheel",this._onTextBoxMouseWheelDelegate);
}else{$removeHandler(this._textBoxElement,"DOMMouseScroll",this._onTextBoxMouseWheelDelegate);
}this._onTextBoxMouseWheelDelegate=null;
}if(this._onTextBoxDragDropDelegate){$removeHandler(this._textBoxElement,"dragdrop",this._onTextBoxDragDropDelegate);
this._onTextBoxDragDropDelegate=null;
}}else{if(this._onTextBoxMouseWheelDelegate){$removeHandler(this._textBoxElement,"mousewheel",this._onTextBoxMouseWheelDelegate);
this._onTextBoxMouseWheelDelegate=null;
}if(this._onTextBoxDragDropDelegate){$removeHandler(this._textBoxElement,"drop",this._onTextBoxDragDropDelegate);
this._onTextBoxDragDropDelegate=null;
}}if(this._textBoxElement){this._textBoxElement._events=null;
}},clear:function(){this.set_value("");
},disable:function(){this.set_enabled(false);
this._textBoxElement.disabled="disabled";
this.updateCssClass();
this.updateClientState();
this.raise_disable(Sys.EventArgs.Empty);
},enable:function(){this.set_enabled(true);
this._textBoxElement.disabled="";
this.updateCssClass();
this.updateClientState();
this.raise_enable(Sys.EventArgs.Empty);
},focus:function(){this._textBoxElement.focus();
},blur:function(){this._textBoxElement.blur();
},isEmpty:function(){return this._hiddenElement.value=="";
},isNegative:function(){return false;
},isReadOnly:function(){return this._textBoxElement.readOnly||!this._enabled;
},isMultiLine:function(){return this._textBoxElement.tagName.toUpperCase()=="TEXTAREA";
},updateDisplayValue:function(){if(this._focused){this._textBoxElement.maxLength=this._originalMaxLength;
if(this.get_editValue()!=this.get_textBoxValue()){if($telerik.isIE){var a=this.get_caretPosition();
this.set_textBoxValue(this.get_editValue());
if(a>0){this.set_caretPosition(a);
}else{this._textBoxElement.select();
}}else{this.set_textBoxValue(this.get_editValue());
}}}else{if(this.isEmpty()&&this.get_emptyMessage()){this._textBoxElement.maxLength=2147483647;
this._isEmptyMessage=true;
this.set_textBoxValue(this.get_emptyMessage());
}else{this._textBoxElement.maxLength=this._originalMaxLength;
this._isEmptyMessage=false;
this.set_textBoxValue(this.get_displayValue());
}}},__isEmptyMessage:function(){return this.isEmpty()&&this.get_emptyMessage();
},repaint:function(){this._updatePercentageHeight();
if(this._shouldResetWidthInPixels){this._resetWidthInPixels();
}if(!this._reducedPixelWidthFlag&&this._enableOldBoxModel){this._reducePixelWidthByPaddings();
}},updateCssClass:function(){var a="";
if(this._enabled&&(!this.__isEmptyMessage())&&(!this.isNegative())){this._textBoxElement.style.cssText=this._originalTextBoxCssText+this.updateCssText(this.get_styles()["EnabledStyle"][0]);
a=this.get_styles()["EnabledStyle"][1];
if(a!=""){this._textBoxElement.className=a;
}}if(this._enabled&&(!this.__isEmptyMessage())&&this.isNegative()){this._textBoxElement.style.cssText=this._originalTextBoxCssText+this.updateCssText(this.get_styles()["NegativeStyle"][0]);
a=this.get_styles()["NegativeStyle"][1];
if(a!=""){this._textBoxElement.className=a;
}}if(this._enabled&&this.__isEmptyMessage()){this._textBoxElement.style.cssText=this._originalTextBoxCssText+this.updateCssText(this.get_styles()["EmptyMessageStyle"][0]);
a=this.get_styles()["EmptyMessageStyle"][1];
if(a!=""){this._textBoxElement.className=a;
}}if(this._hovered){this._textBoxElement.style.cssText=this._originalTextBoxCssText+this.updateCssText(this.get_styles()["HoveredStyle"][0]);
a=this.get_styles()["HoveredStyle"][1];
if(a!=""){this._textBoxElement.className=a;
}}if(this._focused){this._textBoxElement.style.cssText=this._originalTextBoxCssText+this.updateCssText(this.get_styles()["FocusedStyle"][0]);
a=this.get_styles()["FocusedStyle"][1];
if(a!=""){this._textBoxElement.className=a;
}}if(this._invalid){this._textBoxElement.style.cssText=this._originalTextBoxCssText+this.updateCssText(this.get_styles()["InvalidStyle"][0]);
a=this.get_styles()["InvalidStyle"][1];
if(a!=""){this._textBoxElement.className=a;
}}if(this._textBoxElement.readOnly&&this.__isEmptyMessage()){this._textBoxElement.style.cssText=this._originalTextBoxCssText+this.updateCssText(this.get_styles()["EmptyMessageStyle"][0]);
a=this.get_styles()["EmptyMessageStyle"][1];
if(a!=""){this._textBoxElement.className=a;
}}else{if(this._textBoxElement.readOnly){this._textBoxElement.style.cssText=this._originalTextBoxCssText+this.updateCssText(this.get_styles()["ReadOnlyStyle"][0]);
a=this.get_styles()["ReadOnlyStyle"][1];
if(a!=""){this._textBoxElement.className=a;
}}}if(!this._enabled){this._textBoxElement.style.cssText=this._originalTextBoxCssText+this.updateCssText(this.get_styles()["DisabledStyle"][0]);
a=this.get_styles()["DisabledStyle"][1];
if(a!=""){this._textBoxElement.className=a;
}}if(a==""&&this._textBoxElement.className&&this._textBoxElement.className==""){this._textBoxElement.removeAttribute("class");
}},updateCssText:function(f){var a=f.split(";");
var c;
var e="";
for(c=0;
c<a.length;
c++){var b=a[c].split(":");
if(b.length==2){var d=""+b[0].toLowerCase();
if(d!="width"&&d!="height"){e+=a[c]+";";
}}}return e;
},selectText:function(b,a){this._selectionStart=b;
this._selectionEnd=a;
this._applySelection();
},selectAllText:function(){if(this._textBoxElement.value.length>0){this.selectText(0,this._textBoxElement.value.length);
return true;
}return false;
},get_value:function(){return this._hiddenElement.value;
},set_value:function(a){var c=new Telerik.Web.UI.InputValueChangingEventArgs(a,this._initialValue);
this.raise_valueChanging(c);
if(c.get_cancel()==true){this._SetValue(this._initialValue);
return false;
}if(c.get_newValue()){a=c.get_newValue();
}var b=this._setHiddenValue(a);
if(b==false){a="";
}if(typeof(b)=="undefined"||b==true){this._triggerDomEvent("change",this._getValidationField());
this.raise_valueChanged(a,this._initialValue);
this.set_textBoxValue(this.get_editValue());
this.updateDisplayValue();
this.updateCssClass();
}},get_displayValue:function(){return this._hiddenElement.value;
},get_editValue:function(){return this._hiddenElement.value;
},set_caretPosition:function(a){if(this._textBoxElement.tagName.toLowerCase()=="textarea"&&this._textBoxElement.value.length<a){return;
}this._selectionStart=a;
this._selectionEnd=a;
this._applySelection();
},get_caretPosition:function(){this._calculateSelection();
if(this._selectionStart!=this._selectionEnd){return new Array(this._selectionStart,this._selectionEnd);
}else{if(this._textBoxElement.selectionStart){return this._textBoxElement.selectionStart;
}else{return this._selectionStart;
}}},raisePostBackEvent:function(){eval(this._postBackEventReferenceScript);
},get_wrapperElement:function(){return $get(this._wrapperElementID);
},get_textBoxValue:function(){return this._textBoxElement.value;
},set_textBoxValue:function(a){this._textBoxElement.value=a;
},get_autoPostBack:function(){return this._autoPostBack;
},set_autoPostBack:function(a){if(this._autoPostBack!==a){this._autoPostBack=a;
this.raisePropertyChanged("autoPostBack");
}},get_emptyMessage:function(){return this._emptyMessage;
},set_emptyMessage:function(a){if(this._emptyMessage!==a){this._emptyMessage=a;
this._isEmptyMessage=(a!="");
this.updateClientState();
this.raisePropertyChanged("emptyMessage");
}},get_selectionOnFocus:function(){return this._selectionOnFocus;
},set_selectionOnFocus:function(a){if(this._selectionOnFocus!==a){this._selectionOnFocus=a;
this.raisePropertyChanged("selectionOnFocus");
}},get_showButton:function(){return this._showButton;
},set_showButton:function(a){if(this._showButton!==a){this._showButton=a;
this.raisePropertyChanged("showButton");
}},get_invalidStyleDuration:function(){return this._invalidStyleDuration;
},set_invalidStyleDuration:function(a){if(this._invalidStyleDuration!==a){this._invalidStyleDuration=a;
this.raisePropertyChanged("invalidStyleDuration");
}},get_enabled:function(){return this._enabled;
},set_enabled:function(a){if(this._enabled!==a){this._enabled=a;
this.raisePropertyChanged("enabled");
}},get_styles:function(){return this._styles;
},set_styles:function(a){if(this._styles!==a){this._styles=a;
this.raisePropertyChanged("styles");
}},saveClientState:function(a){var e=["enabled","emptyMessage"];
if(a){for(var b=0,c=a.length;
b<c;
b++){e[e.length]=a[b];
}}var d={};
for(var b=0;
b<e.length;
b++){d[e[b]]=this["get_"+e[b]]();
}return Sys.Serialization.JavaScriptSerializer.serialize(d);
},get_visible:function(){if(this.get_wrapperElement().style.display=="none"){return false;
}else{return true;
}},set_visible:function(a){if(a==true&&this._originalDisplay!=null){this.get_wrapperElement().style.display=this._originalDisplay;
this.repaint();
}else{if(a==false&&this.get_visible()){this._originalDisplay=this.get_wrapperElement().style.display;
this.get_wrapperElement().style.display="none";
}}},_reducePixelWidthByPaddings:function(){if(this._textBoxElement.offsetWidth>0&&this._textBoxElement.parentNode.tagName.toLowerCase()=="span"&&this._textBoxElement.parentNode.parentNode.className!="rcInputCell"&&this._textBoxElement.style.width&&this._textBoxElement.style.width.indexOf("%")==-1&&(!this._originalTextBoxWidth||this._originalTextBoxWidth.indexOf("%")==-1)){var g=0;
if(document.defaultView&&document.defaultView.getComputedStyle){g=parseInt(document.defaultView.getComputedStyle(this._textBoxElement,null).getPropertyValue("border-left-width"))+parseInt(document.defaultView.getComputedStyle(this._textBoxElement,null).getPropertyValue("padding-left"))+parseInt(document.defaultView.getComputedStyle(this._textBoxElement,null).getPropertyValue("padding-right"))+parseInt(document.defaultView.getComputedStyle(this._textBoxElement,null).getPropertyValue("border-right-width"));
}else{if(this._textBoxElement.currentStyle){if(!$telerik.isIE||(document.compatMode&&document.compatMode!="BackCompat")){g=parseInt(this._textBoxElement.currentStyle.borderLeftWidth)+parseInt(this._textBoxElement.currentStyle.paddingLeft)+parseInt(this._textBoxElement.currentStyle.paddingRight)+parseInt(this._textBoxElement.currentStyle.borderRightWidth);
}}}var d=parseInt(this._textBoxElement.style.width)-g;
if(g==0||d<=0){return;
}this._textBoxElement.style.width=d+"px";
var c="";
var a=this._originalTextBoxCssText.split(";");
for(var b=0;
b<a.length;
b++){var e=a[b].split(":");
if(e.length==2){var f=""+e[0].toLowerCase();
if(f!="width"){c+=a[b]+";";
}else{c+="width:"+d+"px;";
if(!this._originalTextBoxWidth){this._originalTextBoxWidth=a[b].split(":")[1].trim();
}}}}this._originalTextBoxCssText=c;
this._reducedPixelWidthFlag=true;
}},_updatePercentageHeight:function(){var a=$get(this._wrapperElementID);
if(a.style.height.indexOf("%")!=-1&&a.offsetHeight>0){var b=0;
if(this._textBoxElement.currentStyle){b=parseInt(this._textBoxElement.currentStyle.borderTopWidth)+parseInt(this._textBoxElement.currentStyle.borderBottomWidth)+parseInt(this._textBoxElement.currentStyle.paddingTop)+parseInt(this._textBoxElement.currentStyle.paddingBottom);
}else{if(window.getComputedStyle){b=parseInt(window.getComputedStyle(this._textBoxElement,null).getPropertyValue("border-top-width"))+parseInt(window.getComputedStyle(this._textBoxElement,null).getPropertyValue("border-bottom-width"))+parseInt(window.getComputedStyle(this._textBoxElement,null).getPropertyValue("padding-top"))+parseInt(window.getComputedStyle(this._textBoxElement,null).getPropertyValue("padding-bottom"));
}}this._textBoxElement.style.height="1px";
this._textBoxElement.style.cssText=this._textBoxElement.style.cssText;
this._textBoxElement.style.height=a.offsetHeight-b+"px";
if(this._originalTextBoxCssText.search(/(^|[^-])height/)!=-1){this._originalTextBoxCssText=this._originalTextBoxCssText.replace(/(^|[^-])height(\s*):(\s*)([^;]+);/i,"$1height:"+(a.offsetHeight-b)+"px;");
}else{this._originalTextBoxCssText+="height:"+(a.offsetHeight-b)+"px;";
}}},_resetWidthInPixels:function(){if(($telerik.isIE7||$telerik.isIE6)&&this._textBoxElement.offsetWidth>0&&(this._textBoxElement.parentNode.tagName.toLowerCase()=="td"||(this._textBoxElement.parentNode.parentNode.tagName.toLowerCase()=="td"&&this._textBoxElement.parentNode.parentNode.className=="rcInputCell")||(this._textBoxElement.parentNode.tagName.toLowerCase()=="span"&&this._textBoxElement.parentNode.parentNode.className!="rcInputCell"&&(this._textBoxElement.currentStyle.width.indexOf("%")!=-1||(this._originalTextBoxWidth&&this._originalTextBoxWidth.indexOf("%")!=-1))))){var g=this._textBoxElement.value;
var f;
var h;
var c="";
if(g!=""){this._textBoxElement.value="";
}if(this._originalCellPadding&&this._textBoxElement.parentNode.tagName.toLowerCase()=="td"){this._textBoxElement.parentNode.style.paddingRight=this._originalCellPadding;
}else{if(this._originalCellPadding&&this._textBoxElement.parentNode.parentNode.tagName.toLowerCase()=="td"&&this._textBoxElement.parentNode.parentNode.className=="rcInputCell"){this._textBoxElement.parentNode.parentNode.style.paddingRight=this._originalCellPadding;
}}if(this._originalTextBoxWidth){this._textBoxElement.style.width=this._originalTextBoxWidth;
}else{if(g!=""){this._textBoxElement.style.cssText=this._textBoxElement.style.cssText;
}}f=parseInt(this._textBoxElement.currentStyle.paddingLeft)+parseInt(this._textBoxElement.currentStyle.paddingRight);
h=this._textBoxElement.clientWidth-f;
if(h>0){this._textBoxElement.style.width=h+"px";
if(this._textBoxElement.parentNode.tagName.toLowerCase()=="td"){if(!this._originalCellPadding){this._originalCellPadding=this._textBoxElement.parentNode.currentStyle.paddingRight;
}this._textBoxElement.parentNode.style.paddingRight="0px";
}else{if(this._textBoxElement.parentNode.parentNode.tagName.toLowerCase()=="td"&&this._textBoxElement.parentNode.parentNode.className=="rcInputCell"){if(!this._originalCellPadding){this._originalCellPadding=this._textBoxElement.parentNode.parentNode.currentStyle.paddingRight;
}this._textBoxElement.parentNode.parentNode.style.paddingRight="0px";
}}var a=this._originalTextBoxCssText.split(";");
for(var b=0;
b<a.length;
b++){var e=a[b].split(":");
if(e.length==2){var d=""+e[0].toLowerCase();
if(d!="width"){c+=a[b]+";";
}else{c+="width:"+h+"px;";
if(!this._originalTextBoxWidth){this._originalTextBoxWidth=a[b].split(":")[1].trim();
}}}}this._originalTextBoxCssText=c;
}if(g!=""){this._textBoxElement.value=g;
}}},_initializeHiddenElement:function(a){this._hiddenElement=$get(a);
},_initializeValidationField:function(a){},_initializeButtons:function(){this._onButtonClickDelegate=Function.createDelegate(this,this._onButtonClickHandler);
this.Button=null;
var b=$get(this._wrapperElementID);
var a=b.getElementsByTagName("a");
for(i=0;
i<a.length;
i++){if(a[i].parentNode.className.indexOf("riBtn")!=(-1)){this.Button=a[i];
$addHandler(this.Button,"click",this._onButtonClickDelegate);
}}},_attachEventHandlers:function(){this._onTextBoxKeyUpDelegate=Function.createDelegate(this,this._onTextBoxKeyUpHandler);
this._onTextBoxKeyPressDelegate=Function.createDelegate(this,this._onTextBoxKeyPressHandler);
this._onTextBoxBlurDelegate=Function.createDelegate(this,this._onTextBoxBlurHandler);
this._onTextBoxFocusDelegate=Function.createDelegate(this,this._onTextBoxFocusHandler);
this._onTextBoxKeyDownDelegate=Function.createDelegate(this,this._onTextBoxKeyDownHandler);
this._onTextBoxDragEnterDelegate=Function.createDelegate(this,this._onTextBoxDragEnterHandler);
this._onTextBoxDragLeaveDelegate=Function.createDelegate(this,this._onTextBoxDragLeaveHandler);
this._onTextBoxDropDelegate=Function.createDelegate(this,this._onTextBoxDropHandler);
$addHandler(this._textBoxElement,"keydown",this._onTextBoxKeyDownDelegate);
$addHandler(this._textBoxElement,"keypress",this._onTextBoxKeyPressDelegate);
$addHandler(this._textBoxElement,"keyup",this._onTextBoxKeyUpDelegate);
$addHandler(this._textBoxElement,"blur",this._onTextBoxBlurDelegate);
$addHandler(this._textBoxElement,"focus",this._onTextBoxFocusDelegate);
$addHandler(this._textBoxElement,"dragenter",this._onTextBoxDragEnterDelegate);
if($telerik.isFirefox){$addHandler(this._textBoxElement,"dragexit",this._onTextBoxDragLeaveDelegate);
}else{$addHandler(this._textBoxElement,"dragleave",this._onTextBoxDragLeaveDelegate);
}if($telerik.isFirefox){$addHandler(this._textBoxElement,"dragdrop",this._onTextBoxDropDelegate);
}if($telerik.isIE||$telerik.isSafari){this._onTextBoxPasteDelegate=Function.createDelegate(this,this._onTextBoxPasteHandler);
$addHandler(this._textBoxElement,"paste",this._onTextBoxPasteDelegate);
}else{this._onTextBoxInputDelegate=Function.createDelegate(this,this._onTextBoxInputHandler);
$addHandler(this._textBoxElement,"input",this._onTextBoxInputDelegate);
}if(this._textBoxElement&&this._textBoxElement.form){this._onFormResetDelegate=Function.createDelegate(this,this._onFormResetHandler);
$addHandler(this._textBoxElement.form,"reset",this._onFormResetDelegate);
}this._attachMouseEventHandlers();
},_onTextBoxPasteHandler:function(f){if(this.isMultiLine()&&this._maxLength>0){if($telerik.isSafari){var c=this;
window.setTimeout(function(){c._textBoxElement.value=c._textBoxElement.value.substr(0,c._maxLength);
},1);
}else{if(!f){var f=window.event;
}if(f.preventDefault){f.preventDefault();
}var b=this._textBoxElement.document.selection.createRange();
var d=this._maxLength-this._textBoxElement.value.length+b.text.length;
var a=this._escapeNewLineChars(window.clipboardData.getData("Text"),"%0A").substr(0,d);
b.text=a;
}}},_onTextBoxInputHandler:function(a){if(this.isMultiLine()&&this._maxLength>0&&this._textBoxElement.value.length>this._maxLength){this._textBoxElement.value=this._textBoxElement.value.substr(0,this._maxLength);
}},_attachMouseEventHandlers:function(){if($telerik.isSafari||$telerik.isFirefox){this._onTextBoxMouseUpDelegate=Function.createDelegate(this,this._onTextBoxMouseUpHandler);
$addHandler(this._textBoxElement,"mouseup",this._onTextBoxMouseUpDelegate);
}this._onTextBoxMouseOutDelegate=Function.createDelegate(this,this._onTextBoxMouseOutHandler);
this._onTextBoxMouseOverDelegate=Function.createDelegate(this,this._onTextBoxMouseOverHandler);
this._onTextBoxMouseWheelDelegate=Function.createDelegate(this,this._onTextBoxMouseWheelHandler);
this._onTextBoxDragDropDelegate=Function.createDelegate(this,this._onTextBoxDragDropHandler);
$addHandler(this._textBoxElement,"mouseout",this._onTextBoxMouseOutDelegate);
$addHandler(this._textBoxElement,"mouseover",this._onTextBoxMouseOverDelegate);
if(Sys.Browser.agent!=Sys.Browser.InternetExplorer){if((!$telerik.isSafari2&&$telerik.isSafari)||$telerik.isOpera){$addHandler(this._textBoxElement,"mousewheel",this._onTextBoxMouseWheelDelegate);
}else{$addHandler(this._textBoxElement,"DOMMouseScroll",this._onTextBoxMouseWheelDelegate);
}$addHandler(this._textBoxElement,"dragdrop",this._onTextBoxDragDropDelegate);
}else{$addHandler(this._textBoxElement,"mousewheel",this._onTextBoxMouseWheelDelegate);
$addHandler(this._textBoxElement,"drop",this._onTextBoxDragDropDelegate);
}},_onTextBoxMouseUpHandler:function(a){if(($telerik.isSafari||$telerik.isFirefox)&&this._allowApplySelection){this._allowApplySelection=false;
this._updateSelectionOnFocus();
a.preventDefault();
a.stopPropagation();
}},_onTextBoxKeyPressHandler:function(d){var c=new Telerik.Web.UI.InputKeyPressEventArgs(d,d.charCode,String.fromCharCode(d.charCode));
this.raise_keyPress(c);
if(c.get_cancel()){d.stopPropagation();
d.preventDefault();
return false;
}if((d.charCode==13)&&!this.isMultiLine()){var a=this._initialValue;
var b=this.get_textBoxValue();
if(b.toString()!=a.toString()){this.set_value(b);
}else{if(this.get_autoPostBack()){this._isEnterPressed=true;
this.raisePostBackEvent();
d.stopPropagation();
d.preventDefault();
}}return true;
}},_onTextBoxKeyUpHandler:function(a){this._updateHiddenValueOnKeyPress(a);
},_onTextBoxBlurHandler:function(b){if(!this._isInFocus||this.isReadOnly()){b.preventDefault();
b.stopPropagation();
return false;
}this._isInFocus=false;
this._focused=false;
var a=this.get_textBoxValue();
if(this._initialValue+""!==a){this.set_value(a);
}else{this._setHiddenValue(this._initialValue);
this.updateDisplayValue();
this.updateCssClass();
}this.raise_blur(Sys.EventArgs.Empty);
this._triggerDomEvent("blur",this._getValidationField());
},_onTextBoxFocusHandler:function(b){if(!this.isReadOnly()){this._allowApplySelection=true;
this._updateStateOnFocus();
this._triggerDomEvent("focus",this._getValidationField());
}if(($telerik.isSafari||$telerik.isFirefox)&&this.get_selectionOnFocus()!=Telerik.Web.UI.SelectionOnFocus.None&&this.get_selectionOnFocus()!=Telerik.Web.UI.SelectionOnFocus.SelectAll){var a=this;
window.setTimeout(function(){a._triggerDomEvent("mouseup",a._textBoxElement);
},1);
}},_onTextBoxDragEnterHandler:function(a){if(this.isEmpty()&&this.get_emptyMessage()!=""){this.set_textBoxValue("");
}},_onTextBoxDragLeaveHandler:function(a){if(this.isEmpty()&&this.get_emptyMessage()!=""&&!$telerik.isMouseOverElement(this._textBoxElement,a)){this.set_textBoxValue(this.get_emptyMessage());
}},_onTextBoxDropHandler:function(a){var b=this;
window.setTimeout(function(){b._textBoxElement.focus();
},1);
},_updateStateOnFocus:function(){if(this._isDroped){this._updateHiddenValue();
this._isDroped=false;
}this._isInFocus=true;
this._focused=true;
this.updateDisplayValue();
this.updateCssClass();
this._updateSelectionOnFocus();
this.raise_focus(Sys.EventArgs.Empty);
},_onTextBoxMouseOutHandler:function(a){this._hovered=false;
this.updateCssClass();
this.raise_mouseOut(Sys.EventArgs.Empty);
},_onTextBoxMouseOverHandler:function(a){this._hovered=true;
this.updateCssClass();
this.raise_mouseOver(Sys.EventArgs.Empty);
},_onTextBoxKeyDownHandler:function(b){if(b.keyCode==27&&!$telerik.isIE){var a=this;
window.setTimeout(function(){a.set_textBoxValue(a.get_editValue());
},0);
}},_onTextBoxMouseWheelHandler:function(b){var a;
if(this._focused){if(b.rawEvent.wheelDelta){a=b.rawEvent.wheelDelta/120;
if(window.opera){a=-a;
}}else{if(b.detail){a=-b.rawEvent.detail/3;
}else{if(b.rawEvent&&b.rawEvent.detail){a=-b.rawEvent.detail/3;
}}}if(a>0){this._handleWheel(false);
}else{this._handleWheel(true);
}b.stopPropagation();
b.preventDefault();
}},_onButtonClickHandler:function(a){var b=new Telerik.Web.UI.InputButtonClickEventArgs(Telerik.Web.UI.InputButtonType.Button);
this.raise_buttonClick(b);
},_onTextBoxDragDropHandler:function(a){this._isDroped=true;
},_onFormResetHandler:function(a){this._resetInputValue();
},_resetInputValue:function(){if(this._initialValue==null){this._initialValue="";
}this._setHiddenValue(this._initialValue);
var a=this;
window.setTimeout(function(){a.updateDisplayValue();
if($telerik.isIE){a._textBoxElement.defaultValue=a.get_displayValue();
}},1);
},_getValidationField:function(){return this._hiddenElement;
},_calculateSelection:function(){if((Sys.Browser.agent==Sys.Browser.Opera)||!document.selection){this._selectionEnd=this._textBoxElement.selectionEnd;
this._selectionStart=this._textBoxElement.selectionStart;
return;
}var b=end=0;
try{b=Math.abs(document.selection.createRange().moveStart("character",-10000000));
if(b>0){b=this._calculateSelectionInternal(b);
}end=Math.abs(document.selection.createRange().moveEnd("character",-10000000));
if(end>0){end=this._calculateSelectionInternal(end);
}}catch(a){}this._selectionEnd=end;
this._selectionStart=b;
},_calculateSelectionInternal:function(a){if(!this.isMultiLine()){return a;
}var d=Math.abs(this._textBoxElement.createTextRange().moveEnd("character",-10000000));
var c=document.body.createTextRange();
c.moveToElementText(this._textBoxElement);
var e=Math.abs(c.moveStart("character",-10000000));
var b=Math.abs(c.moveEnd("character",-10000000));
if(b-d==e){a-=e;
}return a;
},_SetValue:function(a){var b=this._setHiddenValue(a);
if(typeof(b)=="undefined"||b==true){this.set_textBoxValue(this.get_editValue());
}},_triggerDomEvent:function(c,a){if(!c||c==""||!a){return;
}if(a.fireEvent&&document.createEventObject){var d=document.createEventObject();
a.fireEvent(String.format("on{0}",c),d);
}else{if(a.dispatchEvent){var b=true;
var d=document.createEvent("HTMLEvents");
d.initEvent(c,b,true);
a.dispatchEvent(d);
}}},_updateSelectionOnFocus:function(){if(!this.get_textBoxValue()){this.set_caretPosition(0);
}switch(this.get_selectionOnFocus()){case Telerik.Web.UI.SelectionOnFocus.None:break;
case Telerik.Web.UI.SelectionOnFocus.CaretToBeginning:this.set_caretPosition(0);
break;
case Telerik.Web.UI.SelectionOnFocus.CaretToEnd:if(this._textBoxElement.value.length>0){if($telerik.isIE){this.set_caretPosition(this._textBoxElement.value.replace(/\r/g,"").length);
}else{this.set_caretPosition(this._textBoxElement.value.length);
}}break;
case Telerik.Web.UI.SelectionOnFocus.SelectAll:this.selectAllText();
break;
default:this.set_caretPosition(0);
break;
}},_isInVisibleContainer:function(a){var b=a;
while((typeof(b)!="undefined")&&(b!=null)){if(b.disabled||(typeof(b.style)!="undefined"&&((typeof(b.style.display)!="undefined"&&b.style.display=="none")||(typeof(b.style.visibility)!="undefined"&&b.style.visibility=="hidden")))){return false;
}if(typeof(b.parentNode)!="undefined"&&b.parentNode!=null&&b.parentNode!=b&&b.parentNode.tagName.toLowerCase()!="body"){b=b.parentNode;
}else{return true;
}}return true;
},_applySelection:function(){if(!this._isInVisibleContainer(this._textBoxElement)){return;
}var a=this;
if((Sys.Browser.agent==Sys.Browser.Opera)||!document.selection){this._textBoxElement.selectionStart=a._selectionStart;
this._textBoxElement.selectionEnd=a._selectionEnd;
return;
}this._textBoxElement.select();
sel=document.selection.createRange();
sel.collapse();
sel.moveStart("character",this._selectionStart);
sel.collapse();
sel.moveEnd("character",this._selectionEnd-this._selectionStart);
sel.select();
},_clearHiddenValue:function(){this._hiddenElement.value="";
},_handleWheel:function(a){},_setHiddenValue:function(a){if(a==null){a="";
}if(this._hiddenElement.value!=a.toString()){this._hiddenElement.value=a;
}this._setValidationField(a);
return true;
},_setValidationField:function(a){},_updateHiddenValueOnKeyPress:function(){this._updateHiddenValue();
},_updateHiddenValue:function(){if(!this._textBoxElement.readOnly){return this._setHiddenValue(this._textBoxElement.value);
}},_escapeNewLineChars:function(b,a){b=escape(b);
while(b.indexOf("%0D%0A")!=-1){b=b.replace("%0D%0A",a);
}if(a!="%0A"){while(b.indexOf("%0A")!=-1){b=b.replace("%0A",a);
}}if(a!="%0D"){while(b.indexOf("%0D")!=-1){b=b.replace("%0D",a);
}}return unescape(b);
},_isNormalChar:function(a){if(($telerik.isFirefox&&a.rawEvent.keyCode!=0&&a.rawEvent.keyCode!=13)||($telerik.isOpera&&a.rawEvent.which==0)||($telerik.isSafari&&(a.charCode<Sys.UI.Key.space||a.charCode>60000))){return false;
}return true;
},add_blur:function(a){this.get_events().addHandler("blur",a);
},remove_blur:function(a){this.get_events().removeHandler("blur",a);
},raise_blur:function(a){this.raiseEvent("blur",a);
},add_mouseOut:function(a){this.get_events().addHandler("mouseOut",a);
},remove_mouseOut:function(a){this.get_events().removeHandler("mouseOut",a);
},raise_mouseOut:function(a){this.raiseEvent("mouseOut",a);
},add_valueChanged:function(a){this.get_events().addHandler("valueChanged",a);
},remove_valueChanged:function(a){this.get_events().removeHandler("valueChanged",a);
},raise_valueChanged:function(b,a){if(typeof(b)!="undefined"&&b!=null&&typeof(a)!="undefined"&&a!=null&&b.toString()==a.toString()){return false;
}var d=true;
if(typeof(b)!="undefined"&&b!=null&&typeof(a)!="undefined"&&a!=null&&b.toString()!=a.toString()){this._initialValue=this.get_value();
var c=new Telerik.Web.UI.InputValueChangedEventArgs(b,a);
this.raiseEvent("valueChanged",c);
d=!c.get_cancel();
}if(this.get_autoPostBack()&&d){this.raisePostBackEvent();
}},add_error:function(a){this.get_events().addHandler("error",a);
},remove_error:function(a){this.get_events().removeHandler("error",a);
},raise_error:function(c){if(this.InEventRaise){return;
}this.InEventRaise=true;
this.raiseEvent("error",c);
if(!c.get_cancel()){this._invalid=true;
this._errorHandlingCanceled=false;
this.updateCssClass();
var d=this._isIncrementing?true:false;
var b=this;
var a=function(e){b._invalid=false;
b.updateCssClass(e);
};
setTimeout(function(){a(d);
},this.get_invalidStyleDuration());
}else{this._errorHandlingCanceled=true;
this._invalid=false;
this.updateCssClass();
}this.InEventRaise=false;
},add_load:function(a){this.get_events().addHandler("load",a);
},remove_load:function(a){this.get_events().removeHandler("load",a);
},raise_load:function(a){this.raiseEvent("load",a);
},add_mouseOver:function(a){this.get_events().addHandler("mouseOver",a);
},remove_mouseOver:function(a){this.get_events().removeHandler("mouseOver",a);
},raise_mouseOver:function(a){this.raiseEvent("mouseOver",a);
},add_focus:function(a){this.get_events().addHandler("focus",a);
},remove_focus:function(a){this.get_events().removeHandler("focus",a);
},raise_focus:function(a){this.raiseEvent("focus",a);
},add_disable:function(a){this.get_events().addHandler("disable",a);
},remove_disable:function(a){this.get_events().removeHandler("disable",a);
},raise_disable:function(a){this.raiseEvent("disable",a);
},add_enable:function(a){this.get_events().addHandler("enable",a);
},remove_enable:function(a){this.get_events().removeHandler("enable",a);
},raise_enable:function(a){this.raiseEvent("enable",a);
},add_keyPress:function(a){this.get_events().addHandler("keyPress",a);
},remove_keyPress:function(a){this.get_events().removeHandler("keyPress",a);
},raise_keyPress:function(a){this.raiseEvent("keyPress",a);
},add_enumerationChanged:function(a){this.get_events().addHandler("enumerationChanged",a);
},remove_enumerationChanged:function(a){this.get_events().removeHandler("enumerationChanged",a);
},raise_enumerationChanged:function(a){this.raiseEvent("enumerationChanged",a);
},add_moveUp:function(a){this.get_events().addHandler("moveUp",a);
},remove_moveUp:function(a){this.get_events().removeHandler("moveUp",a);
},raise_moveUp:function(a){this.raiseEvent("moveUp",a);
},add_moveDown:function(a){this.get_events().addHandler("moveDown",a);
},remove_moveDown:function(a){this.get_events().removeHandler("moveDown",a);
},raise_moveDown:function(a){this.raiseEvent("moveDown",a);
},add_buttonClick:function(a){this.get_events().addHandler("buttonClick",a);
},remove_buttonClick:function(a){this.get_events().removeHandler("buttonClick",a);
},raise_buttonClick:function(a){this.raiseEvent("buttonClick",a);
},add_valueChanging:function(a){this.get_events().addHandler("valueChanging",a);
},remove_valueChanging:function(a){this.get_events().removeHandler("valueChanging",a);
},raise_valueChanging:function(a){this.raiseEvent("valueChanging",a);
}};
Telerik.Web.UI.RadInputControl.registerClass("Telerik.Web.UI.RadInputControl",Telerik.Web.UI.RadWebControl);
if(typeof(ValidatorSetFocus)=="function"){ValidatorSetFocus=function(d,a){var g;
if(typeof(d.controlhookup)=="string"){var f;
if((typeof(a)!="undefined")&&(a!=null)){if((typeof(a.srcElement)!="undefined")&&(a.srcElement!=null)){f=a.srcElement;
}else{f=a.target;
}}if((typeof(f)!="undefined")&&(f!=null)&&(typeof(f.id)=="string")&&(f.id==d.controlhookup)){g=f;
}}if((typeof(g)=="undefined")||(g==null)){g=document.getElementById(d.controltovalidate);
}var c=false;
if((g.style)&&(typeof(g.style.visibility)!="undefined")&&(g.style.visibility=="hidden")&&(typeof(g.style.width)!="undefined")&&(document.getElementById(g.id+"_text")||document.getElementById(g.id+"_dateInput_text"))&&(g.tagName.toLowerCase()=="input"||g.tagName.toLowerCase()=="textarea")){c=true;
}if((typeof(g)!="undefined")&&(g!=null)&&(g.tagName.toLowerCase()!="table"||(typeof(a)=="undefined")||(a==null))&&((g.tagName.toLowerCase()!="input")||(g.type.toLowerCase()!="hidden"))&&(typeof(g.disabled)=="undefined"||g.disabled==null||g.disabled==false)&&(typeof(g.visible)=="undefined"||g.visible==null||g.visible!=false)&&(IsInVisibleContainer(g)||c)){if(g.tagName.toLowerCase()=="table"&&(typeof(__nonMSDOMBrowser)=="undefined"||__nonMSDOMBrowser)){var e=g.getElementsByTagName("input");
var b=e[e.length-1];
if(b!=null){g=b;
}}if(typeof(g.focus)!="undefined"&&g.focus!=null){if(c&&document.getElementById(g.id+"_text")){document.getElementById(g.id+"_text").focus();
}else{if(c&&document.getElementById(g.id+"_dateInput_text")){document.getElementById(g.id+"_dateInput_text").focus();
}else{g.focus();
}}Page_InvalidControlToBeFocused=g;
}}};
}if(typeof(ValidatedControlOnBlur)=="function"){ValidatedControlOnBlur=function(c){var b;
if((typeof(c.srcElement)!="undefined")&&(c.srcElement!=null)){b=c.srcElement;
}else{b=c.target;
}var a=false;
if((b.style)&&(typeof(b.style.visibility)!="undefined")&&(b.style.visibility=="hidden")&&(typeof(b.style.width)!="undefined")&&(document.getElementById(b.id+"_text")||document.getElementById(b.id+"_dateInput_text"))&&(b.tagName.toLowerCase()=="input"||b.tagName.toLowerCase()=="textarea")){a=true;
}if((typeof(b)!="undefined")&&(b!=null)&&(Page_InvalidControlToBeFocused==b)){if(a&&document.getElementById(b.id+"_text")){document.getElementById(b.id+"_text").focus();
}else{if(a&&document.getElementById(b.id+"_dateInput_text")){document.getElementById(b.id+"_dateInput_text").focus();
}else{b.focus();
}}Page_InvalidControlToBeFocused=null;
}};
}Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.InputErrorReason=function(){};
Telerik.Web.UI.InputErrorReason.prototype={ParseError:1,OutOfRange:2};
Telerik.Web.UI.InputErrorReason.registerEnum("Telerik.Web.UI.InputErrorReason",false);
Telerik.Web.UI.SelectionOnFocus=function(){};
Telerik.Web.UI.SelectionOnFocus.prototype={None:0,CaretToBeginning:1,CaretToEnd:2,SelectAll:3};
Telerik.Web.UI.SelectionOnFocus.registerEnum("Telerik.Web.UI.SelectionOnFocus",false);
Telerik.Web.UI.InputButtonType=function(){};
Telerik.Web.UI.InputButtonType.prototype={Button:1,MoveUpButton:2,MoveDownButton:3};
Telerik.Web.UI.InputButtonType.registerEnum("Telerik.Web.UI.InputButtonType",false);
Telerik.Web.UI.DisplayFormatPosition=function(){};
Telerik.Web.UI.DisplayFormatPosition.prototype={Left:1,Right:2};
Telerik.Web.UI.DisplayFormatPosition.registerEnum("Telerik.Web.UI.DisplayFormatPosition",false);
Telerik.Web.UI.InputSettingValidateOnEvent=function(){};
Telerik.Web.UI.InputSettingValidateOnEvent.prototype={Blur:0,Submit:1,All:2};
Telerik.Web.UI.InputSettingValidateOnEvent.registerEnum("Telerik.Web.UI.InputSettingValidateOnEvent",false);
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.InputValueChangedEventArgs=function(b,a){Telerik.Web.UI.InputValueChangedEventArgs.initializeBase(this);
this._newValue=b;
this._oldValue=a;
};
Telerik.Web.UI.InputValueChangedEventArgs.prototype={get_oldValue:function(){return this._oldValue;
},get_newValue:function(){return this._newValue;
}};
Telerik.Web.UI.InputValueChangedEventArgs.registerClass("Telerik.Web.UI.InputValueChangedEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.InputValueChangingEventArgs=function(b,a){Telerik.Web.UI.InputValueChangingEventArgs.initializeBase(this,[b,a]);
};
Telerik.Web.UI.InputValueChangingEventArgs.prototype={set_newValue:function(a){if(this._newValue!==a){this._newValue=a;
}}};
Telerik.Web.UI.InputValueChangingEventArgs.registerClass("Telerik.Web.UI.InputValueChangingEventArgs",Telerik.Web.UI.InputValueChangedEventArgs);
Telerik.Web.UI.MaskedTextBoxEventArgs=function(b,a,c){Telerik.Web.UI.MaskedTextBoxEventArgs.initializeBase(this);
this._newValue=b;
this._oldValue=a;
this._chunk=c;
};
Telerik.Web.UI.MaskedTextBoxEventArgs.prototype={get_oldValue:function(){return this._oldValue;
},get_newValue:function(){return this._newValue;
},get_currentPart:function(){return this._chunk;
}};
Telerik.Web.UI.MaskedTextBoxEventArgs.registerClass("Telerik.Web.UI.MaskedTextBoxEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.InputKeyPressEventArgs=function(c,b,a){Telerik.Web.UI.InputKeyPressEventArgs.initializeBase(this);
this._domEvent=c;
this._keyCode=b;
this._keyCharacter=a;
};
Telerik.Web.UI.InputKeyPressEventArgs.prototype={get_domEvent:function(){return this._domEvent;
},get_keyCode:function(){return this._keyCode;
},get_keyCharacter:function(){return this._keyCharacter;
}};
Telerik.Web.UI.InputKeyPressEventArgs.registerClass("Telerik.Web.UI.InputKeyPressEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.InputButtonClickEventArgs=function(a){Telerik.Web.UI.InputButtonClickEventArgs.initializeBase(this);
this._buttonType=a;
};
Telerik.Web.UI.InputButtonClickEventArgs.prototype={get_buttonType:function(){return this._buttonType;
}};
Telerik.Web.UI.InputButtonClickEventArgs.registerClass("Telerik.Web.UI.InputButtonClickEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.InputErrorEventArgs=function(a,b){Telerik.Web.UI.InputErrorEventArgs.initializeBase(this);
this._reason=a;
this._inputText=b;
};
Telerik.Web.UI.InputErrorEventArgs.prototype={get_reason:function(){return this._reason;
},get_inputText:function(){return this._inputText;
}};
Telerik.Web.UI.InputErrorEventArgs.registerClass("Telerik.Web.UI.InputErrorEventArgs",Sys.CancelEventArgs);
Telerik.Web.UI.NumericInputErrorEventArgs=function(c,a,d,b){Telerik.Web.UI.NumericInputErrorEventArgs.initializeBase(this,[c,a]);
this._keyCode=d;
this._keyCharacter=b;
};
Telerik.Web.UI.NumericInputErrorEventArgs.prototype={get_reason:function(){return this._reason;
},get_inputText:function(){return this._inputText;
},get_keyCode:function(){return this._keyCode;
},get_keyCharacter:function(){return this._keyCharacter;
}};
Telerik.Web.UI.NumericInputErrorEventArgs.registerClass("Telerik.Web.UI.NumericInputErrorEventArgs",Telerik.Web.UI.InputErrorEventArgs);
Telerik.Web.UI.InputManagerKeyPressEventArgs=function(d,b,a,c){Telerik.Web.UI.InputManagerKeyPressEventArgs.initializeBase(this,[d,b,a]);
this._targetInput=c;
};
Telerik.Web.UI.InputManagerKeyPressEventArgs.prototype={get_targetInput:function(){return this._targetInput;
}};
Telerik.Web.UI.InputManagerKeyPressEventArgs.registerClass("Telerik.Web.UI.InputManagerKeyPressEventArgs",Telerik.Web.UI.InputKeyPressEventArgs);
Telerik.Web.UI.InputManagerEventArgs=function(b,a){Telerik.Web.UI.InputManagerEventArgs.initializeBase(this);
this._targetInput=b;
this._domEvent=a;
};
Telerik.Web.UI.InputManagerEventArgs.prototype={get_targetInput:function(){return this._targetInput;
},get_domEvent:function(){return this._domEvent;
}};
Telerik.Web.UI.InputManagerEventArgs.registerClass("Telerik.Web.UI.InputManagerEventArgs",Sys.EventArgs);
Telerik.Web.UI.InputManagerErrorEventArgs=function(c,a,b){Telerik.Web.UI.InputManagerErrorEventArgs.initializeBase(this,[c,a]);
this._targetInput=b;
};
Telerik.Web.UI.InputManagerErrorEventArgs.prototype={get_targetInput:function(){return this._targetInput;
},set_inputText:function(a){this._inputText=a;
}};
Telerik.Web.UI.InputManagerErrorEventArgs.registerClass("Telerik.Web.UI.InputManagerErrorEventArgs",Telerik.Web.UI.InputErrorEventArgs);
Telerik.Web.UI.NumericInputManagerErrorEventArgs=function(c,a,e,b,d){Telerik.Web.UI.NumericInputManagerErrorEventArgs.initializeBase(this,[c,a,e,b]);
this._targetInput=d;
};
Telerik.Web.UI.NumericInputManagerErrorEventArgs.prototype={get_targetInput:function(){return this._targetInput;
}};
Telerik.Web.UI.NumericInputManagerErrorEventArgs.registerClass("Telerik.Web.UI.NumericInputManagerErrorEventArgs",Telerik.Web.UI.NumericInputErrorEventArgs);
Telerik.Web.UI.InputManagerValidatingEventArgs=function(a){Telerik.Web.UI.InputManagerValidatingEventArgs.initializeBase(this);
this._input=a;
this._isValid=true;
this._context=null;
};
Telerik.Web.UI.InputManagerValidatingEventArgs.prototype={get_input:function(){return this._input;
},get_isValid:function(){return this._isValid;
},set_isValid:function(a){this._isValid=a;
},get_context:function(){return this._context;
},set_context:function(a){this._context=a;
}};
Telerik.Web.UI.InputManagerValidatingEventArgs.registerClass("Telerik.Web.UI.InputManagerValidatingEventArgs",Sys.CancelEventArgs);
$telerik.findTextBox=$find;
$telerik.toTextBox=function(a){return a;
};
Telerik.Web.UI.RadTextBox=function(a){Telerik.Web.UI.RadTextBox.initializeBase(this,[a]);
this._maxLength=0;
};
Telerik.Web.UI.RadTextBox.prototype={initialize:function(){Telerik.Web.UI.RadTextBox.callBaseMethod(this,"initialize");
if(this._textBoxElement&&this._textBoxElement.type=="password"){this._clearHiddenValue();
this.updateDisplayValue();
this.updateCssClass();
}if(this._textBoxElement&&this._textBoxElement.nodeName&&(this._textBoxElement.nodeName.toUpperCase()=="TEXTAREA")){this.updateDisplayValue();
}},dispose:function(){Telerik.Web.UI.RadTextBox.callBaseMethod(this,"dispose");
},_onTextBoxKeyPressHandler:function(a){Telerik.Web.UI.RadTextBox.callBaseMethod(this,"_onTextBoxKeyPressHandler",[a]);
var b=this._escapeNewLineChars(this._textBoxElement.value," ");
if((this.get_maxLength()>0)&&(b.length>=this.get_maxLength())&&(this._isNormalChar(a))){a.stopPropagation();
a.preventDefault();
return false;
}if((a.charCode==13)&&!this.isMultiLine()){if(this._initialValue!==b){this.set_value(b);
}else{this.updateDisplayValue();
this.updateCssClass();
}return true;
}},_onTextBoxMouseWheelHandler:function(a){return true;
},get_maxLength:function(){return this._maxLength;
},set_maxLength:function(a){if(this._maxLength!==a){this._maxLength=a;
this.raisePropertyChanged("maxLength");
}}};
Telerik.Web.UI.RadTextBox.registerClass("Telerik.Web.UI.RadTextBox",Telerik.Web.UI.RadInputControl);

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
Type.registerNamespace("Telerik.Web");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ModalExtender=function(a){this._windowResizeDelegate=null;
this._windowScrollDelegate=null;
this._xCoordinate=-1;
this._yCoordinate=-1;
this._backgroundElement=null;
this._foregroundElement=a;
this._saveTabIndexes=new Array();
this._saveDesableSelect=new Array();
this._tagWithTabIndex=new Array("A","AREA","BUTTON","INPUT","OBJECT","SELECT","TEXTAREA","IFRAME");
};
Telerik.Web.UI.ModalExtender.prototype={dispose:function(){this.hide();
this._backgroundElement=null;
this._foregroundElement=null;
},show:function(){this._attachWindowHandlers(true);
var c=this._getModalOverlay();
var b=this._foregroundElement;
b.parentNode.appendChild(c);
var a=$telerik.getCurrentStyle(b,"zIndex");
if(!isNaN(parseInt(a))){c.style.zIndex=a-1;
}c.style.display="";
this._disableTab();
this._updatePageLayout();
this._updatePageLayout();
},_storeBrowserPosition:function(){var a=document.body;
var b=document.documentElement;
this._browserTop=a.scrollTop>b.scrollTop?a.scrollTop:b.scrollTop;
this._browserLeft=a.scrollLeft>b.scrollLeft?a.scrollTop:b.scrollLeft;
},_restoreBrowserPosition:function(b,d){try{if(null==b){b=this._browserLeft;
}if(null==d){d=this._browserTop;
}var e=document.body;
var c=document.documentElement;
e.scrollTop=d;
e.scrollLeft=b;
c.scrollTop=d;
c.scrollLeft=b;
}catch(a){}},hide:function(){this._restoreTab();
this._attachWindowHandlers(false);
var a=this._backgroundElement;
if(a){if(a.parentNode){a.parentNode.removeChild(a);
}this._backgroundElement=null;
}},_enableScroll:function(a){if(a){document.body.style.overflow=null!=this._overflow?this._overflow:"";
document.documentElement.style.overflow=null!=this._documentOverflow?this._documentOverflow:"";
document.body.style.marginRight="";
}else{this._overflow=document.body.style.overflow;
document.body.style.overflow="hidden";
this._documentOverflow=document.documentElement.style.overflow;
document.documentElement.style.overflow="hidden";
document.body.style.marginRight="18px";
}},_getModalOverlay:function(){if(!this._backgroundElement){var a=document.createElement("div");
a.style.display="none";
a.style.position="absolute";
if($telerik.isRightToLeft(this._foregroundElement)){a.style.right="0px";
}else{a.style.left="0px";
}a.style.top="0px";
a.style.zIndex=10000;
a.style.backgroundColor="#aaaaaa";
a.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=50)";
a.style.opacity=".5";
a.style.MozOpacity=".5";
a.setAttribute("unselectable","on");
a.className="TelerikModalOverlay";
this._backgroundElement=a;
}return this._backgroundElement;
},_attachWindowHandlers:function(b){var a=window;
if(true==b){this._windowResizeDelegate=Function.createDelegate(this,this._updatePageLayout);
$addHandler(a,"resize",this._windowResizeDelegate);
this._windowScrollDelegate=Function.createDelegate(this,this._updatePageLayout);
$addHandler(a,"scroll",this._windowScrollDelegate);
}else{if(this._windowResizeDelegate){$removeHandler(a,"resize",this._windowResizeDelegate);
}this._windowResizeDelegate=null;
if(this._windowScrollDelegate){$removeHandler(a,"scroll",this._windowScrollDelegate);
}this._windowScrollDelegate=null;
}},_updatePageLayout:function(){var f=(document.documentElement.scrollLeft?$telerik.getCorrectScrollLeft(document.documentElement):$telerik.getCorrectScrollLeft(document.body));
var e=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);
var c=$telerik.getClientBounds();
var a=c.width;
var d=c.height;
var b=this._getModalOverlay();
b.style.width=Math.max(Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),a)+"px";
b.style.height=Math.max(Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),d)+"px";
},_disableTab:function(){var d=0;
var a;
var f=new Array();
Array.clear(this._saveTabIndexes);
for(var b=0;
b<this._tagWithTabIndex.length;
b++){a=this._foregroundElement.getElementsByTagName(this._tagWithTabIndex[b]);
for(var c=0;
c<a.length;
c++){f[d]=a[c];
d++;
}}d=0;
for(var b=0;
b<this._tagWithTabIndex.length;
b++){a=document.getElementsByTagName(this._tagWithTabIndex[b]);
for(var c=0;
c<a.length;
c++){if(Array.indexOf(f,a[c])==-1){this._saveTabIndexes[d]={tag:a[c],index:a[c].tabIndex};
a[c].tabIndex="-1";
d++;
}}}d=0;
if((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7)){var e=new Array();
for(var b=0;
b<this._tagWithTabIndex.length;
b++){a=this._foregroundElement.getElementsByTagName("SELECT");
for(var c=0;
c<a.length;
c++){e[d]=a[c];
d++;
}}d=0;
Array.clear(this._saveDesableSelect);
a=document.getElementsByTagName("SELECT");
for(var c=0;
c<a.length;
c++){if(Array.indexOf(e,a[c])==-1){this._saveDesableSelect[d]={tag:a[c],visib:$telerik.getCurrentStyle(a[c],"visibility")};
a[c].style.visibility="hidden";
d++;
}}}},_restoreTab:function(){for(var b=0;
b<this._saveTabIndexes.length;
b++){this._saveTabIndexes[b].tag.tabIndex=this._saveTabIndexes[b].index;
}if((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7)){for(var a=0;
a<this._saveDesableSelect.length;
a++){this._saveDesableSelect[a].tag.style.visibility=this._saveDesableSelect[a].visib;
}}}};
Telerik.Web.UI.ModalExtender.registerClass("Telerik.Web.UI.ModalExtender",null);
Type.registerNamespace("Telerik.Web");
Telerik.Web.PositioningMode=function(){throw Error.invalidOperation();
};
Telerik.Web.PositioningMode.prototype={Absolute:0,Center:1,BottomLeft:2,BottomRight:3,TopLeft:4,TopRight:5};
Telerik.Web.PositioningMode.registerEnum("Telerik.Web.PositioningMode");
Telerik.Web.PopupBehavior=function(a){Telerik.Web.PopupBehavior.initializeBase(this,[a]);
this._x=0;
this._y=0;
this._positioningMode=Telerik.Web.PositioningMode.Absolute;
this._parentElement=null;
this._parentElementID=null;
this._moveHandler=null;
this._firstPopup=true;
this._originalParent=null;
this._overlay=false;
this._keepInScreenBounds=true;
this._manageVisibility=true;
};
Telerik.Web.PopupBehavior._ie6pinnedList={};
Telerik.Web.PopupBehavior.prototype={getPageOffset:function(){var a={x:($telerik.getCorrectScrollLeft(document.documentElement)||$telerik.getCorrectScrollLeft(document.body)),y:(document.documentElement.scrollTop||document.body.scrollTop)};
return a;
},pin:function(c){var a=this.get_elementToShow();
var d=this.getPageOffset();
if($telerik.isIE6){var e=this.get_id();
if(c){if(Telerik.Web.PopupBehavior._ie6pinnedList[e]){return;
}var b=$telerik.getBounds(a);
Telerik.Web.PopupBehavior._ie6pinnedList[e]=window.setInterval(Function.createDelegate(this,function(){var h=this.getPageOffset();
var j=b.x-d.x+h.x;
var k=b.y-d.y+h.y;
var i=this.get_parentElement();
this.set_parentElement(document.documentElement);
this.set_x(j);
this.set_y(k);
this.show();
this.set_parentElement(i);
}),130);
}else{var g=Telerik.Web.PopupBehavior._ie6pinnedList[e];
if(g){window.clearInterval(g);
}delete Telerik.Web.PopupBehavior._ie6pinnedList[e];
}}else{var f=c?"fixed":"absolute";
if(a.style.position==f){return;
}var b=$telerik.getBounds(a);
if(c&&(d.x||d.y)){this._x=b.x-d.x;
this._y=b.y-d.y;
$telerik.setLocation(a,{x:this._x,y:this._y});
}a.style.position=f;
}},center:function(){var c=this.get_elementToShow();
if(this._manageVisibility){$telerik.setVisible(c,true);
}var d=$telerik.getClientBounds();
var f=$telerik.getBounds(c);
var a=parseInt((d.width-f.width)/2);
var b=parseInt((d.height-f.height)/2);
var e=this.get_parentElement();
this.set_parentElement(document.documentElement);
this.set_x(a);
this.set_y(b);
this.show();
this.set_parentElement(e);
},get_parentElement:function(){if(!this._parentElement&&this._parentElementID){this.set_parentElement($get(this._parentElementID));
Sys.Debug.assert(this._parentElement!=null,String.format('Couldn\'t find parent element "{0}"',this._parentElementID));
}return this._parentElement;
},set_parentElement:function(a){this._parentElement=a;
},get_parentElementID:function(){if(this._parentElement){return this._parentElement.id;
}return this._parentElementID;
},set_parentElementID:function(a){this._parentElementID=a;
if(this.get_isInitialized()){this.set_parentElement($get(a));
}},get_positioningMode:function(){return this._positioningMode;
},set_positioningMode:function(a){this._positioningMode=a;
},get_x:function(){return this._x;
},set_x:function(a){if(a!=this._x){this._x=a;
if($telerik.getVisible(this.get_elementToShow())&&this._manageVisibility){this.show();
}}},get_y:function(){return this._y;
},set_y:function(a){if(a!=this._y){this._y=a;
if($telerik.getVisible(this.get_elementToShow())&&this._manageVisibility){this.show();
}}},get_overlay:function(){return this._overlay;
},set_overlay:function(a){this._overlay=a;
this._attachWindowHandlers(false);
if(this._overlay){this._attachWindowHandlers(true);
}else{if(!((Sys.Browser.agent===Sys.Browser.InternetExplorer)&&(Sys.Browser.version<7))){var c=this.get_elementToShow();
var b=c._hideWindowedElementsIFrame;
if(b){b.style.display="none";
}}}},get_manageVisibility:function(){return this._manageVisibility;
},set_manageVisibility:function(a){this._manageVisibility=a;
},get_keepInScreenBounds:function(){return this._keepInScreenBounds;
},set_keepInScreenBounds:function(a){this._keepInScreenBounds=a;
},get_elementToShow:function(){return this._elementToShow?this._elementToShow:this.get_element();
},set_elementToShow:function(a){if(this._elementToShow){this._detachElementToShow();
}this._elementToShow=a;
},_detachElementToShow:function(){var c=this.get_elementToShow();
if(this._moveHandler){$telerik.removeExternalHandler(c,"move",this._moveHandler);
this._moveHandler=null;
}var d=c._hideWindowedElementsIFrame;
if(d){var a=d.parentNode;
var b=d.nextSibling;
if(a){a.removeChild(d);
if(b){a.insertBefore(document.createElement("SPAN"),b);
}else{a.appendChild(document.createElement("SPAN"));
}}}},hide:function(){var b=this.get_elementToShow();
if(this._manageVisibility){$telerik.setVisible(b,false);
}if(b.originalWidth){b.style.width=b.originalWidth+"px";
b.originalWidth=null;
}if(Sys.Browser.agent===Sys.Browser.InternetExplorer||this._overlay){var a=b._hideWindowedElementsIFrame;
if(a){a.style.display="none";
}}},show:function(){var a=this.get_elementToShow();
a.style.position="absolute";
var i=document.documentElement;
if($telerik.isFirefox){var k=$telerik.getCurrentStyle(i,"overflow");
if("hidden"==k){a.style.left=i.scrollLeft+"px";
a.style.top=i.scrollLeft+"px";
}}var h=a.offsetParent||i;
var f;
var e;
if(this._parentElement){e=$telerik.getBounds(this._parentElement);
var j=this._getOffsetParentLocation(a);
f={x:e.x-j.x,y:e.y-j.y};
}else{e=$telerik.getBounds(h);
f={x:0,y:0};
}if(this._manageVisibility){$telerik.setVisible(a,true);
}var c=a.offsetWidth-(a.clientLeft?a.clientLeft*2:0);
var b=a.offsetHeight-(a.clientTop?a.clientTop*2:0);
var g;
switch(this._positioningMode){case Telerik.Web.PositioningMode.Center:g={x:Math.round(e.width/2-c/2),y:Math.round(e.height/2-b/2)};
break;
case Telerik.Web.PositioningMode.BottomLeft:g={x:0,y:e.height};
break;
case Telerik.Web.PositioningMode.BottomRight:g={x:e.width-c,y:e.height};
break;
case Telerik.Web.PositioningMode.TopLeft:g={x:0,y:-a.offsetHeight};
break;
case Telerik.Web.PositioningMode.TopRight:g={x:e.width-c,y:-a.offsetHeight};
break;
default:g={x:0,y:0};
}g.x+=this._x+f.x;
g.y+=this._y+f.y;
$telerik.setLocation(a,g);
if(this._firstPopup){a.style.width=c+"px";
}this._firstPopup=false;
var d=this._fixPositionInBounds();
this._createOverlay(d);
},_getViewportBounds:function(){var c=$telerik.getClientBounds();
var b=document.documentElement;
var a=document.body;
c.scrollLeft=($telerik.getCorrectScrollLeft(b)||$telerik.getCorrectScrollLeft(a));
c.scrollTop=(b.scrollTop||a.scrollTop);
return c;
},_getOffsetParentLocation:function(a){var c=a.offsetParent;
if(c&&c.tagName.toUpperCase()!="BODY"&&c.tagName.toUpperCase()!="HTML"){var b=$telerik.getLocation(c);
var d=$telerik.getBorderBox(c);
b.x+=d.top;
b.y+=d.left;
b.x-=$telerik.getCorrectScrollLeft(c);
b.y-=c.scrollTop;
return b;
}return{x:0,y:0};
},_fixPositionInBounds:function(){var c=this.get_elementToShow();
var l=$telerik.getBounds(c);
if(!this._keepInScreenBounds){return l;
}var k=this._getViewportBounds();
var a=false;
var j=(k.width>l.width);
var m=(k.height>l.height);
var d=k.scrollTop;
var i=k.height+d;
var b=k.scrollLeft;
var e=k.width+b;
if(($telerik.isIE8||$telerik.isOpera||$telerik.isSafari)&&$telerik.isRightToLeft(document.body)){var g=c.style.display;
if($telerik.isOpera){c.style.display="none";
}var f=document.documentElement.scrollWidth;
e=f?f:document.body.scrollWidth;
if($telerik.isOpera){c.style.display=g;
}}if(l.x<b||!j){l.x=b;
a=true;
}if(l.y<d||!m){l.y=d;
a=true;
}if(j&&(l.x+l.width>e)){l.x=e-l.width;
a=true;
}if(m&&(i<l.y+l.height)){l.y=i-l.height;
a=true;
}if(a){var h=this._getOffsetParentLocation(c);
l.y-=h.y;
l.x-=h.x;
$telerik.setLocation(c,l);
}return l;
},_createOverlay:function(a){if(!$telerik.isIE6&&!this._overlay){return;
}var d=this.get_elementToShow();
var b=d._hideWindowedElementsIFrame;
if(!b){b=document.createElement("iframe");
b.src="javascript:'<html></html>';";
b.style.position="absolute";
b.style.display="none";
b.scrolling="no";
b.frameBorder="0";
b.tabIndex="-1";
b.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
d.parentNode.insertBefore(b,d);
d._hideWindowedElementsIFrame=b;
this._moveHandler=Function.createDelegate(this,this._onMove);
$telerik.addExternalHandler(d,"move",this._moveHandler);
}$telerik.setBounds(b,a);
if($telerik.isFirefox){var e=this._getViewportBounds();
b.style.top=parseInt(a.y)-e.scrollTop+"px";
b.style.left=parseInt(a.x)-e.scrollLeft+"px";
b.style.position="fixed";
}if($telerik.quirksMode){return;
}b.style.display=d.style.display;
var c=$telerik.getCurrentStyle(d,"zIndex");
if(c){b.style.zIndex=c;
}},_setCoordinates:function(b,c){var a=false;
if(b!=this._x){this._x=b;
a=true;
}if(c!=this._y){this._y=c;
a=true;
}if($telerik.getVisible(this.get_elementToShow())&&a&&this._manageVisibility){this.show();
}},initialize:function(){Telerik.Web.PopupBehavior.callBaseMethod(this,"initialize");
this.hide();
},dispose:function(){var a=this.get_elementToShow();
if(a){this._attachWindowHandlers(false);
if($telerik.getVisible(a)&&this._manageVisibility){this.hide();
}if(this._originalParent){a.parentNode.removeChild(a);
this._originalParent.appendChild(a);
this._originalParent=null;
}this._detachElementToShow();
}this._parentElement=null;
Telerik.Web.PopupBehavior.callBaseMethod(this,"dispose");
if(a&&a._behaviors&&a._behaviors.length==0){a._behaviors=null;
}a=null;
},_onMove:function(){var a=this.get_elementToShow();
var b=a._hideWindowedElementsIFrame;
if(b){if(Sys.Browser.agent===Sys.Browser.Firefox){var c=this._getViewportBounds();
b.style.top=parseInt(a.style.top)-c.scrollTop+"px";
b.style.left=parseInt(a.style.left)-c.scrollLeft+"px";
b.style.position="fixed";
}else{b.style.top=a.style.top;
b.style.left=a.style.left;
}}},_handleElementResize:function(){var b=this.get_elementToShow();
var c=b._hideWindowedElementsIFrame;
if(c){var a=$telerik.getBounds(b);
$telerik.setBounds(c,a);
}},_attachWindowHandlers:function(b){if(!Sys.Browser.agent===Sys.Browser.Firefox){return;
}var a=window;
if(true==b){this._windowResizeDelegate=Function.createDelegate(this,this._onMove);
$telerik.addExternalHandler(a,"resize",this._windowResizeDelegate);
this._windowScrollDelegate=Function.createDelegate(this,this._onMove);
$telerik.addExternalHandler(a,"scroll",this._windowScrollDelegate);
}else{if(this._windowResizeDelegate){$telerik.removeExternalHandler(a,"resize",this._windowResizeDelegate);
}this._windowResizeDelegate=null;
if(this._windowScrollDelegate){$telerik.removeExternalHandler(a,"scroll",this._windowScrollDelegate);
}this._windowScrollDelegate=null;
}}};
Telerik.Web.PopupBehavior.registerClass("Telerik.Web.PopupBehavior",Sys.UI.Behavior);
Type.registerNamespace("Telerik.Web");
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.ResizeExtender=function(d,b,c,f,e,a,g){this._document=e?e:document;
this._documentMouseMoveDelegate=null;
this._documentMouseUpDelegate=null;
this._element=null;
this._tableElement=null;
this._moveCursorType="move";
this._enabled=true;
this._jsOwner=null;
this._hideIframes=true;
this._autoScrollEnabled=true;
this._saveDelegates={};
this._iframeToSkip=null;
this.makeResizable(d,b,c,f,a,g);
};
Telerik.Web.UI.ResizeExtender.containsBounds=function(a,b){if(!a||!b){return false;
}var c=$telerik.containsPoint(a,b.x,b.y);
if(c){var d=b.x+b.width;
var e=b.y+b.height;
c=$telerik.containsPoint(a,d,e);
}return c;
};
Telerik.Web.UI.ResizeExtender.prototype={dispose:function(){this._attachDocumentHandlers(false);
this._configureHandleElements(false);
this._iframeToSkip=null;
this._jsOwner=null;
},enable:function(a){this._enabled=a;
},set_hideIframes:function(a){this._hideIframes=a;
},get_hideIframes:function(){return this._hideIframes;
},set_iframeToSkip:function(a){this._iframeToSkip=a;
},get_iframeToSkip:function(){return this._iframeToSkip;
},makeResizable:function(c,d,b,f,a,e){if(!d){return;
}if(this._element){alert("Element "+d.getAttribute("id")+" cannot be made resizable, as the resizeExtender already has the element "+this._element.getAttribute("id")+" associated with it. You must create a new extender resizer object");
return;
}this._jsOwner=c;
this._element=d;
this._tableElement=f;
this._resizeHandles=b;
if(a){this._moveCursorType=a;
}if(e!=null){this._autoScrollEnabled=e;
}this._startX=0;
this._startY=0;
this._cancelResize=true;
this._configureHandleElements(true);
},_raiseDragEvent:function(c,d,b){if(this._jsOwner&&this._jsOwner["on"+c]){var a=d;
if(!a){a={};
}a.element=this._element;
a.ownerEvent=b;
return this._jsOwner["on"+c](a);
}return true;
},_raiseEvent:function(b,a){if(this._jsOwner&&this._jsOwner["on"+b]){if(!a){a=new Sys.EventArgs();
}else{if(b=="Resize"){a=this._resizeDir;
}else{if(b=="Resizing"){a=this._getProposedBounds(a);
}}}return this._jsOwner["on"+b](a);
}return true;
},_getProposedBounds:function(a){var b=$telerik.getBounds(this._element);
return{x:a.x||b.x,y:a.y||b.y,width:a.width||b.width,height:a.height||b.height};
},_resize:function(i){if(!this._enabled||this._cancelResize){return false;
}var b=0;
var c=0;
var h=0;
var f=0;
var d=this._originalBounds;
var g=this._resizeDir.move;
if(g){h=d.x+(i.clientX-this._startX);
f=d.y+(i.clientY-this._startY);
}else{if(this._resizeDir.east){b=d.width+(i.clientX-this._startX);
}else{if(this._resizeDir.west){h=i.clientX-this._leftHandleMouseDelta;
b=d.width-(i.clientX-this._startX);
}}if(this._resizeDir.south){c=d.height+(i.clientY-this._startY);
}else{if(this._resizeDir.north){f=d.y+(i.clientY-this._startY);
c=d.height-(i.clientY-this._startY);
}}}if(this._offsetLocation){h-=this._offsetLocation.x;
f-=this._offsetLocation.y;
}var a=new Sys.UI.Bounds(h,f,b,c);
var j=g?this._raiseDragEvent("Drag",a,i):this._raiseEvent("Resizing",a);
if(false==j){return true;
}if(g||a.x>0){this._element.style.left=a.x+"px";
}if(g||a.y>0){this._element.style.top=a.y+"px";
}if(a.width>0){this._element.style.width=a.width+"px";
}if(a.height>0){this._element.style.height=a.height+"px";
}if(!g){this._updateInnerTableSize();
}return true;
},getPositionedParent:function(){var a=this._element.parentNode;
while(a&&a!=document){if("static"!=$telerik.getCurrentStyle(a,"position","static")){return a;
}a=a.parentNode;
}return null;
},_storeStartCoords:function(f){if(!this._enabled){return;
}this._cancelResize=false;
this._startX=f.clientX;
this._startY=f.clientY;
var g=$telerik.getBounds(this._element);
var h=false;
if(this._element.id!=null&&Telerik.Web.UI.RadDock&&Telerik.Web.UI.RadDock.isInstanceOfType($find(this._element.id))){h=true;
}if($telerik.isIE&&h!=true){var i=this.getPositionedParent();
if(i){g.x+=i.scrollLeft;
g.y+=i.scrollTop;
}}this._originalBounds=g;
var d=f.target?f.target:f.srcElement;
if(d&&d.type==3){d=d.parentNode;
}this._resizeType=$telerik.getCurrentStyle(d,"cursor");
if(!this._resizeType&&f.currentTarget){this._resizeType=$telerik.getCurrentStyle(f.currentTarget,"cursor");
}this._resizeDir={north:this._resizeType.match(/n.?-/)?1:0,east:this._resizeType.match(/e-/)?1:0,south:this._resizeType.match(/s.?-/)?1:0,west:this._resizeType.match(/w-/)?1:0,move:new RegExp(this._moveCursorType).test(this._resizeType)?1:0};
this._leftHandleMouseDelta=0;
if(this._resizeDir.west){this._leftHandleMouseDelta=Math.abs(g.x-this._startX);
}var b=this._resizeDir.move?this._raiseDragEvent("DragStart",null,f):this._raiseEvent("ResizeStart");
this._cancelResize=(b==false);
var a=$telerik.getCurrentStyle(this._element.parentNode,"position");
var c=("relative"==a)||("absolute"==a);
this._offsetLocation=c?$telerik.getLocation(this._element.parentNode):null;
if(!this._cancelResize){this._clearSelection();
this._setIframesVisible(false);
this._attachDocumentHandlers(false);
this._attachDocumentHandlers(true);
}},_updateInnerTableSize:function(){var a=this._resizeDir;
if(a.south||a.north){var b=this._element.style.height;
var c=this._tableElement;
if(c){c.style.height=b;
this._fixIeHeight(c,b);
}}},_setIframesVisible:function(c){if(!this._hideIframes){return;
}var f=this._document.getElementsByTagName("IFRAME");
var e=this.get_iframeToSkip();
for(var a=0;
a<f.length;
a++){var d=f[a];
if(e&&e===d){continue;
}d.style.visibility=c?"":"hidden";
if($telerik.isIE){try{d.contentWindow.document.body.style.visibility=c?"":"hidden";
}catch(b){}}}},_configureHandleElements:function(d){var e=["nw","n","ne","w","e","sw","s","se",this._moveCursorType];
for(var a=0;
a<e.length;
a++){var c=e[a];
var f=this._resizeHandles[c];
if(f){if(f instanceof Array){for(var b=0;
b<f.length;
b++){this._configureHandle("id"+a+"_"+b,d,f[b],c);
}}else{this._configureHandle("id"+a,d,f,c);
}}}if(!d){this._saveDelegates={};
}},_configureHandle:function(c,b,e,a){if(b){var f=Function.createDelegate(this,this._onHandleMouseDown);
$telerik.addExternalHandler(e,"mousedown",f);
this._saveDelegates[c]={delegate:f,element:e};
var d=(a==this._moveCursorType?this._moveCursorType:a+"-resize");
e.style.cursor=d;
}else{$telerik.removeExternalHandler(e,"mousedown",this._saveDelegates[c].delegate);
e.style.cursor="";
}},_attachDocumentHandlers:function(b){var a=this._document;
if(true==b){this._documentMouseMoveDelegate=Function.createDelegate(this,this._onDocumentMouseMove);
$telerik.addExternalHandler(a,"mousemove",this._documentMouseMoveDelegate);
this._documentMouseUpDelegate=Function.createDelegate(this,this._onDocumentMouseUp);
$telerik.addExternalHandler(a,"mouseup",this._documentMouseUpDelegate);
}else{if(this._documentMouseMoveDelegate){$telerik.removeExternalHandler(a,"mousemove",this._documentMouseMoveDelegate);
}this._documentMouseMoveDelegate=null;
if(this._documentMouseUpDelegate){$telerik.removeExternalHandler(a,"mouseup",this._documentMouseUpDelegate);
}this._documentMouseUpDelegate=null;
}},_onDocumentMouseMove:function(b){var a=this._resize(b);
if(this._autoScrollEnabled){this._autoScroll(b);
}if(a){return $telerik.cancelRawEvent(b);
}},_onDocumentMouseUp:function(b){var a=!this._cancelResize;
this._cancelResize=true;
if(a){this._clearSelection();
this._setIframesVisible(true);
if(this._resizeDir&&this._resizeDir.move){this._raiseDragEvent("DragEnd",null,b);
}else{this._raiseEvent("ResizeEnd");
}this._attachDocumentHandlers(false);
if(this._scroller){this._scroller.set_enabled(false);
}}},_onHandleMouseDown:function(a){this._storeStartCoords(a);
return $telerik.cancelRawEvent(a);
},_clearSelection:function(){if(this._document.selection&&this._document.selection.empty){try{this._document.selection.empty();
}catch(a){}}},_fixIeHeight:function(b,a){if("CSS1Compat"==document.compatMode){var c=(b.offsetHeight-parseInt(a));
if(c>0){var d=(parseInt(b.style.height)-c);
if(d>0){b.style.height=d+"px";
}}}},_initializeAutoScroll:function(){if(this._autoScrollInitialized){return;
}this._scrollEdgeConst=40;
this._scrollByConst=10;
this._scroller=null;
this._scrollDeltaX=0;
this._scrollDeltaY=0;
this._scrollerTickHandler=Function.createDelegate(this,this._onScrollerTick);
this._scroller=new Telerik.Web.Timer();
this._scroller.set_interval(10);
this._scroller.add_tick(this._scrollerTickHandler);
this._autoScrollInitialized=true;
},_autoScroll:function(b){this._initializeAutoScroll();
var c=$telerik.getClientBounds();
if(c.width>0){this._scrollDeltaX=this._scrollDeltaY=0;
if(b.clientX<c.x+this._scrollEdgeConst){this._scrollDeltaX=-this._scrollByConst;
}else{if(b.clientX>c.width-this._scrollEdgeConst){this._scrollDeltaX=this._scrollByConst;
}}if(b.clientY<c.y+this._scrollEdgeConst){this._scrollDeltaY=-this._scrollByConst;
}else{if(b.clientY>c.height-this._scrollEdgeConst){this._scrollDeltaY=this._scrollByConst;
}}var a=this._scroller;
if(this._scrollDeltaX!=0||this._scrollDeltaY!=0){this._originalStartX=this._startX;
this._originalStartY=this._startY;
a.set_enabled(true);
}else{if(a.get_enabled()){this._startX=this._originalStartX;
this._startY=this._originalStartY;
}a.set_enabled(false);
}}},_onScrollerTick:function(){var c=document.documentElement.scrollLeft||document.body.scrollLeft;
var g=document.documentElement.scrollTop||document.body.scrollTop;
window.scrollBy(this._scrollDeltaX,this._scrollDeltaY);
var i=document.documentElement.scrollLeft||document.body.scrollLeft;
var h=document.documentElement.scrollTop||document.body.scrollTop;
var f=i-c;
var b=h-g;
var a=this._element;
var d={x:parseInt(a.style.left)+f,y:parseInt(a.style.top)+b};
this._startX-=f;
this._startY-=b;
try{$telerik.setLocation(a,d);
}catch(e){}}};
Telerik.Web.UI.ResizeExtender.registerClass("Telerik.Web.UI.ResizeExtender",null);

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2010, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Sat Feb 13 22:33:48 2010 -0500
 */
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);

// Move jQuery to $telerik
$telerik.$ = jQuery.noConflict(true);

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
if(typeof $telerik.$==="undefined"){$telerik.$=jQuery;
/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright ? 2008 George McGinley Smith
 * All rights reserved.
*/
/*
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright ? 2001 Robert Penner
 * All rights reserved.
 */
}(function(a){a.easing.jswing=a.easing.swing;
a.extend(a.easing,{def:"easeOutQuad",swing:function(i,g,f,h,e){return a.easing[a.easing.def](i,g,f,h,e);
},easeLinear:function(i,g,f,h,e){return h*g/e+f;
},easeInQuad:function(i,g,f,h,e){return h*(g/=e)*g+f;
},easeOutQuad:function(i,g,f,h,e){return -h*(g/=e)*(g-2)+f;
},easeInOutQuad:function(i,g,f,h,e){if((g/=e/2)<1){return h/2*g*g+f;
}return -h/2*((--g)*(g-2)-1)+f;
},easeInCubic:function(i,g,f,h,e){return h*(g/=e)*g*g+f;
},easeOutCubic:function(i,g,f,h,e){return h*((g=g/e-1)*g*g+1)+f;
},easeInOutCubic:function(i,g,f,h,e){if((g/=e/2)<1){return h/2*g*g*g+f;
}return h/2*((g-=2)*g*g+2)+f;
},easeInQuart:function(i,g,f,h,e){return h*(g/=e)*g*g*g+f;
},easeOutQuart:function(i,g,f,h,e){return -h*((g=g/e-1)*g*g*g-1)+f;
},easeInOutQuart:function(i,g,f,h,e){if((g/=e/2)<1){return h/2*g*g*g*g+f;
}return -h/2*((g-=2)*g*g*g-2)+f;
},easeInQuint:function(i,g,f,h,e){return h*(g/=e)*g*g*g*g+f;
},easeOutQuint:function(i,g,f,h,e){return h*((g=g/e-1)*g*g*g*g+1)+f;
},easeInOutQuint:function(i,g,f,h,e){if((g/=e/2)<1){return h/2*g*g*g*g*g+f;
}return h/2*((g-=2)*g*g*g*g+2)+f;
},easeInSine:function(i,g,f,h,e){return -h*Math.cos(g/e*(Math.PI/2))+h+f;
},easeOutSine:function(i,g,f,h,e){return h*Math.sin(g/e*(Math.PI/2))+f;
},easeInOutSine:function(i,g,f,h,e){return -h/2*(Math.cos(Math.PI*g/e)-1)+f;
},easeInExpo:function(i,g,f,h,e){return(g==0)?f:h*Math.pow(2,10*(g/e-1))+f;
},easeOutExpo:function(i,g,f,h,e){return(g==e)?f+h:h*(-Math.pow(2,-10*g/e)+1)+f;
},easeInOutExpo:function(i,g,f,h,e){if(g==0){return f;
}if(g==e){return f+h;
}if((g/=e/2)<1){return h/2*Math.pow(2,10*(g-1))+f;
}return h/2*(-Math.pow(2,-10*--g)+2)+f;
},easeInCirc:function(i,g,f,h,e){return -h*(Math.sqrt(1-(g/=e)*g)-1)+f;
},easeOutCirc:function(i,g,f,h,e){return h*Math.sqrt(1-(g=g/e-1)*g)+f;
},easeInOutCirc:function(i,g,f,h,e){if((g/=e/2)<1){return -h/2*(Math.sqrt(1-g*g)-1)+f;
}return h/2*(Math.sqrt(1-(g-=2)*g)+1)+f;
},easeInElastic:function(e,j,g,h,i){var k=1.70158;
var f=0;
var l=h;
if(j==0){return g;
}if((j/=i)==1){return g+h;
}if(!f){f=i*0.3;
}if(l<Math.abs(h)){l=h;
var k=f/4;
}else{var k=f/(2*Math.PI)*Math.asin(h/l);
}return -(l*Math.pow(2,10*(j-=1))*Math.sin((j*i-k)*(2*Math.PI)/f))+g;
},easeOutElastic:function(e,j,g,h,i){var k=1.70158;
var f=0;
var l=h;
if(j==0){return g;
}if((j/=i)==1){return g+h;
}if(!f){f=i*0.3;
}if(l<Math.abs(h)){l=h;
var k=f/4;
}else{var k=f/(2*Math.PI)*Math.asin(h/l);
}return l*Math.pow(2,-10*j)*Math.sin((j*i-k)*(2*Math.PI)/f)+h+g;
},easeInOutElastic:function(e,j,g,h,i){var k=1.70158;
var f=0;
var l=h;
if(j==0){return g;
}if((j/=i/2)==2){return g+h;
}if(!f){f=i*(0.3*1.5);
}if(l<Math.abs(h)){l=h;
var k=f/4;
}else{var k=f/(2*Math.PI)*Math.asin(h/l);
}if(j<1){return -0.5*(l*Math.pow(2,10*(j-=1))*Math.sin((j*i-k)*(2*Math.PI)/f))+g;
}return l*Math.pow(2,-10*(j-=1))*Math.sin((j*i-k)*(2*Math.PI)/f)*0.5+h+g;
},easeInBack:function(e,i,f,g,h,j){if(j==undefined){j=1.70158;
}return g*(i/=h)*i*((j+1)*i-j)+f;
},easeOutBack:function(e,i,f,g,h,j){if(j==undefined){j=1.70158;
}return g*((i=i/h-1)*i*((j+1)*i+j)+1)+f;
},easeInOutBack:function(e,i,f,g,h,j){if(j==undefined){j=1.70158;
}if((i/=h/2)<1){return g/2*(i*i*(((j*=(1.525))+1)*i-j))+f;
}return g/2*((i-=2)*i*(((j*=(1.525))+1)*i+j)+2)+f;
},easeInBounce:function(i,g,f,h,e){return h-a.easing.easeOutBounce(i,e-g,0,h,e)+f;
},easeOutBounce:function(i,g,f,h,e){if((g/=e)<(1/2.75)){return h*(7.5625*g*g)+f;
}else{if(g<(2/2.75)){return h*(7.5625*(g-=(1.5/2.75))*g+0.75)+f;
}else{if(g<(2.5/2.75)){return h*(7.5625*(g-=(2.25/2.75))*g+0.9375)+f;
}else{return h*(7.5625*(g-=(2.625/2.75))*g+0.984375)+f;
}}}},easeInOutBounce:function(i,g,f,h,e){if(g<e/2){return a.easing.easeInBounce(i,g*2,0,h,e)*0.5+f;
}return a.easing.easeOutBounce(i,g*2-e,0,h,e)*0.5+h*0.5+f;
}});
})($telerik.$);
(function(c){c.fx.step.height=function(d){var f=$telerik.quirksMode?1:0;
var e=d.now>f?d.now:f;
d.elem.style[d.prop]=Math.round(e)+d.unit;
};
function a(e,d){return["live",e,d.replace(/\./g,"`").replace(/ /g,"|")].join(".");
}function b(d,e){c.each(e,function(f,g){if(f.indexOf("et_")>0){d[f]=g;
return;
}if(f=="domEvent"&&g){d["get_"+f]=function(){return new Sys.UI.DomEvent(g.originalEvent||g.rawEvent||g);
};
}else{d["get_"+f]=function(h){return function(){return h;
};
}(g);
}});
return d;
}c.extend({registerControlEvents:function(e,d){c.each(d,function(f,g){e.prototype["add_"+g]=function(h){this.get_events().addHandler(g,h);
};
e.prototype["remove_"+g]=function(h){this.get_events().removeHandler(g,h);
};
});
},registerControlProperties:function(e,d){c.each(d,function(f,g){e.prototype["get_"+f]=function(){var h=this["_"+f];
return typeof h=="undefined"?g:h;
};
e.prototype["set_"+f]=function(h){this["_"+f]=h;
};
});
},registerEnum:function(e,f,d){e[f]=function(){};
e[f].prototype=d;
e[f].registerEnum(e.getName()+"."+f);
},raiseControlEvent:function(e,f,g){var d=e.get_events().getHandler(f);
if(d){d(e,b(new Sys.EventArgs(),g));
}},raiseCancellableControlEvent:function(e,g,h){var d=e.get_events().getHandler(g);
if(d){var f=b(new Sys.CancelEventArgs(),h);
d(e,f);
return f.get_cancel();
}return false;
},isBogus:function(f){try{var e=f.parentNode;
return false;
}catch(d){return true;
}}});
c.eachCallback=function(g,e){var f=0;
function d(){if(g.length==0){return;
}var h=g[f];
e.apply(h);
f++;
if(f<g.length){setTimeout(d,1);
}}setTimeout(d,1);
};
c.fn.eachCallback=function(f){var g=0;
var d=this;
function e(){if(d.length==0){return;
}var h=d.get(g);
f.apply(h);
g++;
if(g<d.length){setTimeout(e,1);
}}setTimeout(e,1);
};
})($telerik.$);

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
Type.registerNamespace("Telerik.Web.UI.Animations");
Telerik.Web.UI.Animations.playJQueryAnimation=function(b,c,k,m,l,e,n,h){if(!b){return;
}if(!c){c=2;
}if(!k){k=new Sys.UI.Bounds(1,1,1,1);
}if(!m){m=new Sys.UI.Bounds(1,1,1,1);
}var g=h?h:500;
if(!l){l=32;
}l+="";
var f=parseInt(l.substr(0,1));
var i=parseInt(l.substr(1,1));
if(e){e();
}$telerik.$(b).stop(false,true);
if(c==2){$telerik.$(b).css({left:m.x,top:m.y}).fadeIn(g,n);
return;
}if(c==8){var d=$telerik.getClientBounds();
var j=$telerik.getClientBounds();
k.x=j.width/2;
k.y=j.height;
switch(i){case 2:k.x=m.x;
break;
case 3:k.x=d.width;
break;
case 1:k.x=d.x;
}switch(f){case 2:k.y=m.y;
break;
case 1:k.y=d.y-m.height;
break;
case 3:k.y=d.height;
}}else{if(c==4){k.x=m.x;
k.y=m.y;
k.width=m.width;
k.height=1;
switch(i){case 2:k.x=m.x;
break;
case 3:k.x=m.x;
break;
case 1:var a=m.x;
if(2==f){a+=m.width;
}k.x=a;
}switch(f){case 2:k.y=m.y;
k.height=m.height;
k.width=1;
break;
case 1:k.y=m.y+m.height;
break;
case 3:k.y=m.y;
}}else{if(c==1){}}}$telerik.$(b).css({width:k.width,height:k.height,left:k.x,top:k.y,opacity:0.1,filter:"alpha(opacity=10)"}).show().animate({width:m.width,height:m.height,left:m.x,top:m.y,opacity:1},g,null,n);
};
$telerik.$.fx.prototype.oldstep=$telerik.$.fx.prototype.step;
$telerik.$.fx.prototype.step=function(b){if(this.prop=="left"||this.prop=="top"){if(this.elem.getAttribute("paused")){if(!this.elem.getAttribute("elapsedTime")){var a=(+new Date)-this.startTime;
this.elem.setAttribute("elapsedTime",a);
}return true;
}if(this.elem.getAttribute("elapsedTime")){this.startTime=(+new Date)-this.elem.getAttribute("elapsedTime");
this.elem.removeAttribute("elapsedTime");
}}return this.oldstep(b);
};
Telerik.Web.UI.Animations.jMove=function(d,a,c,f,e,b){Telerik.Web.UI.Animations.jMove.initializeBase(this);
this._owner=d;
this._element=a;
this._duration=c;
this._horizontal=(typeof(f)=="undefined"||f==null)?0:f;
this._vertical=(typeof(e)=="undefined"||e==null)?0:e;
this._events=null;
this._animationEndedDelegate=null;
this._isPlaying=false;
this._isPaused=false;
this._isCyclic=false;
this._easing=b;
};
Telerik.Web.UI.Animations.jMove.prototype={initialize:function(){Telerik.Web.UI.Animations.jMove.callBaseMethod(this,"initialize");
this._animationEndedDelegate=Function.createDelegate(this,this._animationEnded);
},dispose:function(){this._getAnimationQuery().stop(true,false);
this._owner=null;
this._element=null;
this._animationEndedDelegate=null;
},get_vertical:function(){return this._vertical;
},set_vertical:function(a){this._vertical=a;
},get_horizontal:function(){return this._horizontal;
},set_horizontal:function(a){this._horizontal=a;
},get_isPlaying:function(){return this._isPlaying;
},get_isCyclic:function(){return this._isCyclic;
},set_isCyclic:function(a){this._isCyclic=a;
},get_easing:function(){return this._easing;
},set_easing:function(a){this._easing=a;
},get_isActive:function(){return true;
},play:function(a){var c=this._element;
var d=c.getAttribute("paused");
c.removeAttribute("paused");
if(!(d&&c.getAttribute("elapsedTime"))){var f=this._owner;
var g=f.get_frameDuration();
if(this._isPaused&&this._isCyclic&&(g>0&&!a)&&f._setAnimationTimeout){f._setAnimationTimeout(g);
}else{var e=this._animationStarted();
if(e!=false){var b=(isNaN(parseInt(this._vertical)))?this._horizontal:this._vertical;
this._playAnimation(b);
this._isPlaying=true;
this._isPaused=false;
}}}},stop:function(){this._getAnimationQuery().stop(false,true);
this._isPlaying=false;
},pause:function(){if(this._isPlaying){this._element.setAttribute("paused",true);
}this._isPlaying=false;
this._isPaused=true;
},add_started:function(a){this.get_events().addHandler("started",a);
},remove_started:function(a){this.get_events().removeHandler("started",a);
},add_ended:function(a){this.get_events().addHandler("ended",a);
},remove_ended:function(a){this.get_events().removeHandler("ended",a);
},_getAnimationQuery:function(){return $telerik.$(this._element);
},_playAnimation:function(a){var b=this._getAnimationQuery();
var c=this._getAnimatedStyleProperty();
var d={queue:true};
d[c]=a;
b.stop(true,!this._isCyclic).animate(d,this._duration,this._easing,this._animationEndedDelegate);
},_getAnimatedStyleProperty:function(){return(isNaN(parseInt(this._vertical)))?"left":"top";
},_getPosition:function(){var a=this._element;
var b=this._getAnimatedStyleProperty();
return a.style[b];
},_animationStarted:function(){var a=new Sys.CancelEventArgs();
this._raiseEvent("started",a);
return !a.get_cancel();
},_animationEnded:function(){this._isPlaying=false;
this._raiseEvent("ended",Sys.EventArgs.Empty);
},_raiseEvent:function(b,c){var a=this.get_events().getHandler(b);
if(a){if(!c){c=Sys.EventArgs.Empty;
}a(this,c);
}}};
Telerik.Web.UI.Animations.jMove.registerClass("Telerik.Web.UI.Animations.jMove",Sys.Component);

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
Type.registerNamespace("Telerik.Web.UI");
$telerik.toWindow=function(a){return a;
};
$telerik.findWindow=$find;
Telerik.Web.UI.RadWindowControllerClass=function(){this._activeWindow=null;
this._historyStack=[];
this._registerGlobalBodyEventHandlers();
};
Telerik.Web.UI.RadWindowControllerClass.prototype={getInstance:function(){return this;
},_registerGlobalBodyEventHandlers:function(){var a=Function.createDelegate(null,function(b){if(b.keyCode==27){Telerik.Web.UI.RadWindowController.hideCurrentWindowIfNonModal();
}});
$addHandler(document.documentElement,"keydown",a);
Sys.Application.add_unload(function(){$removeHandler(document.documentElement,"keydown",a);
});
},hideCurrentWindowIfNonModal:function(){if(this._activeWindow!=null&&this._activeWindow.isModal&&!this._activeWindow.isModal()){this._activeWindow.close();
}this._activeWindow=null;
},inactivateCurrentWindow:function(){if(this._activeWindow!=null){this._activeWindow.setActive(false);
}this._activeWindow=null;
},set_activeWindow:function(a){if(a==this._activeWindow){return;
}this.inactivateCurrentWindow();
this._activeWindow=a;
Array.remove(this._historyStack,a);
Array.add(this._historyStack,a);
},notifyWindowClosed:function(a){if(this._activeWindow==a){this._activeWindow=null;
}Array.remove(this._historyStack,a);
this._activatePreviousWindow();
},_activatePreviousWindow:function(){var a=this._historyStack;
var b=a.length-1;
for(;
b>=0;
b--){var c=a[b];
if(!c){return;
}if(c.isCreated()&&!c.isClosed()&&!c.isMinimized()){c.setActive(true);
break;
}else{Array.removeAt(a,b);
}}},get_activeWindow:function(){return this._activeWindow;
}};
Telerik.Web.UI.RadWindowControllerClass.registerClass("Telerik.Web.UI.RadWindowControllerClass",null);
if(!Telerik.Web.UI.RadWindowController){Telerik.Web.UI.RadWindowController=new Telerik.Web.UI.RadWindowControllerClass();
}Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.RadWindowUtils");
Telerik.Web.UI.RadWindowUtils.Localization={Close:"Close",Minimize:"Minimize",Maximize:"Maximize",Reload:"Reload",PinOn:"Pin on",PinOff:"Pin off",Restore:"Restore",OK:"OK",Cancel:"Cancel",Yes:"Yes",No:"No"};
Telerik.Web.UI.RadWindow=function(a){Telerik.Web.UI.RadWindow.initializeBase(this,[a]);
this._openerElement=null;
this._offsetElement=null;
this._popupElement=null;
this._tableElement=null;
this._contentElement=null;
this._contentCell=null;
this._titleElement=null;
this._titleCell=null;
this._titlebarElement=null;
this._statusCell=null;
this._statusMessageElement=null;
this._iframe=null;
this._dockMode=false;
this._buttonsElement=null;
this._buttonsArray=[];
this.isIE=($telerik.isIE);
this._openerElementID=null;
this._offsetElementID=null;
this._behaviors=Telerik.Web.UI.WindowBehaviors.Default;
this._initialBehaviors=Telerik.Web.UI.WindowBehaviors.None;
this._navigateUrl=null;
this._left=null;
this._top=null;
this._formID=null;
this._skin="Default";
this._title="";
this._width="300px";
this._minWidth=null;
this._minHeight=null;
this._handlesWidth=null;
this._resizeOverlayElement=null;
this._height="300px";
this._opacity=100;
this._minimizeZoneID=null;
this._restrictionZoneID="";
this._clientCallBackFunction=null;
this._reloadOnShow=false;
this._visibleOnPageLoad=false;
this._showOnTopWhenMaximized=true;
this._destroyOnClose=false;
this._visibleTitlebar=true;
this._visibleStatusbar=true;
this._showContentDuringLoad=true;
this._modal=false;
this._overlay=false;
this._keepInScreenBounds=false;
this._autoSize=false;
this._iconUrl=null;
this._minimizeIconUrl=null;
this._animation=Telerik.Web.UI.WindowAnimation.None;
this._animationDuration=500;
this._windowAnimation=null;
this._onMouseDownDelegate=null;
this._onClickDelegate=null;
this._onTitlebarDblclickDelegate=null;
this._onTitlebarClickDelegate=null;
this._onWindowResizeDelegate=null;
this._onIframeLoadDelegate=null;
this._onChildPageUnloadDelegate=null;
this._onChildPageClickDelegate=null;
this._onModalShowHandler=null;
this._onModalCloseHandler=null;
this._loaded=false;
this._isCloned=false;
this._restoreRect=null;
this._popupBehavior=null;
this._popupVisible=false;
this._windowManager;
this._browserWindow=window;
this._stylezindex=null;
this._cssClass="";
this.GetWindowManager=this.get_windowManager;
this.BrowserWindow=window;
this.GetContentFrame=this.get_contentFrame;
this.GetLeftPosition=function(){this.getWindowBounds().x;
};
this.GetTopPosition=function(){this.getWindowBounds().y;
};
this.GetTitlebar=function(){return this._titleCell;
};
this.GetStatusbar=function(){return this._statusCell;
};
this.SetOpenerElementId=this.set_openerElementID;
this.SetStatus=this.set_status;
this.GetStatus=this.get_status;
this.SetModal=this.set_modal;
this.SetWidth=this.set_width;
this.SetHeight=this.set_height;
this.GetWidth=this.get_width;
this.GetHeight=this.get_height;
this.SetOffsetElementId=this.set_offsetElementID;
this.SetTitle=this.set_title;
this.MoveTo=this.moveTo;
this.Center=this.center;
this.SetVisible=this.setVisible;
this.SetSize=this.setSize;
this.Show=this.show;
this.Hide=this.hide;
this.GetUrl=this.get_navigateUrl;
this.SetUrl=this.setUrl;
this.Reload=this.reload;
this.SetActive=this.setActive;
this.Minimize=this.minimize;
this.Restore=this.restore;
this.Maximize=this.maximize;
this.Close=this.close;
this.TogglePin=this.togglePin;
this.IsMaximized=this.isMaximized;
this.IsMinimized=this.isMinimized;
this.IsModal=this.isModal;
this.IsClosed=this.isClosed;
this.IsPinned=this.isPinned;
this.IsVisible=this.isVisible;
this.IsActive=this.isActive;
this.IsBehaviorEnabled=this.isBehaviorEnabled;
};
Telerik.Web.UI.RadWindow.prototype={_getLocalization:function(){return Telerik.Web.UI.RadWindowUtils.Localization;
},get_stylezindex:function(){return this._stylezindex;
},set_stylezindex:function(a){this._stylezindex=a;
},_registerIframeLoadHandler:function(a){if(!this._iframe){return;
}if(a){this._onIframeLoadDelegate=Function.createDelegate(this,this._onIframeLoad);
$addHandler(this._iframe,"load",this._onIframeLoadDelegate);
}else{if(this._onIframeLoadDelegate){$removeHandler(this._iframe,"load",this._onIframeLoadDelegate);
this._onIframeLoadDelegate=null;
$clearHandlers(this._iframe);
}}},_registerWindowResizeHandler:function(a){if(a){this._onWindowResizeDelegate=Function.createDelegate(this,this._maintainMaximizedSize);
$addHandler(window,"resize",this._onWindowResizeDelegate);
}else{if(this._onWindowResizeDelegate){$removeHandler(window,"resize",this._onWindowResizeDelegate);
this._onWindowResizeDelegate=null;
}}},_registerOpenerElementHandler:function(b,a){if(!b){return;
}if(true==a){this._onClickDelegate=Function.createDelegate(this,this._onClick);
$addHandler(b,"click",this._onClickDelegate);
}else{var c=$removeHandler(b,"click",this._onClickDelegate);
this._onClickDelegate=null;
}},_registerTitlebarHandlers:function(b){var a=this._titleCell;
if(b){this._onTitlebarDblclickDelegate=Function.createDelegate(this,function(){if(this.isMinimized()){this.restore();
}else{if(this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Maximize)){if(this.isMaximized()){this.restore();
}else{this.maximize();
}}}});
this._onTitlebarClickDelegate=Function.createDelegate(this,function(){this.setActive(true);
});
$addHandler(a,"dblclick",this._onTitlebarDblclickDelegate);
$addHandler(a,"click",this._onTitlebarClickDelegate);
}else{if(a){if(this._onTitlebarDblclickDelegate){$removeHandler(a,"dblclick",this._onTitlebarDblclickDelegate);
this._onTitlebarDblclickDelegate=null;
}if(this._onTitlebarClickDelegate){$removeHandler(a,"click",this._onTitlebarClickDelegate);
this._onTitlebarClickDelegate=null;
}$clearHandlers(a);
}}},_makeModal:function(a){if(this._onModalShowHandler){this.remove_show(this._onModalShowHandler);
this._onModalShowHandler=null;
}if(this._onModalCloseHandler){this.remove_close(this._onModalCloseHandler);
this._onModalCloseHandler=null;
}if(this._modalExtender){this._modalExtender.dispose();
this._modalExtender=null;
}if(!a){return;
}if(typeof(Telerik.Web.UI.RadWindowManager)!="undefined"&&Telerik.Web.UI.RadWindowManager.isInstanceOfType(this)){return;
}this._onModalShowHandler=function(c){if(!c._modalExtender){c._modalExtender=new Telerik.Web.UI.ModalExtender(c._popupElement);
}c._modalExtender.show();
var d=document.activeElement;
if(d&&d.tagName.toLowerCase()!="body"){var b=(!$telerik.isDescendant(this._contentElement,d)&&this._dockMode);
if(!(c._isPredefined)||b){c._focusedPageElement=d;
d.blur();
}}c.center();
};
this.add_show(this._onModalShowHandler);
this._onModalCloseHandler=function(b){window.setTimeout(function(){if(b._modalExtender){b._modalExtender.hide();
}var c=b._focusedPageElement;
if(c){try{c.focus();
}catch(d){}b._focusedPageElement=null;
}},10);
};
this.add_close(this._onModalCloseHandler);
},_enableMoveResize:function(b){if(this._resizeExtender){this._resizeExtender.dispose();
this._resizeExtender=null;
}if(!b){return;
}if(!this._popupElement){return;
}var e=this._tableElement.rows;
var d={};
var c=this._isWindowRightToLeft();
if(this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Resize)){if(c){d={nw:e[0].cells[2],n:this._topResizer,ne:e[0].cells[0],w:[e[1].cells[2],e[2].cells[2]],e:[e[1].cells[0],e[2].cells[0]],sw:e[3].cells[2],s:e[3].cells[1],se:[e[3].cells[0],this._bottomResizer]};
}else{d={nw:e[0].cells[0],n:this._topResizer,ne:e[0].cells[2],w:[e[1].cells[0],e[2].cells[0]],e:[e[1].cells[2],e[2].cells[2]],sw:e[3].cells[0],s:e[3].cells[1],se:[e[3].cells[2],this._bottomResizer]};
}}if(this.isBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Move)){d.move=this._titleCell;
}this._resizeExtender=new Telerik.Web.UI.ResizeExtender(this,this._popupElement,d,this._tableElement);
var a=this._dockMode?null:this._iframe;
this._resizeExtender.set_iframeToSkip(a);
},_setResizeOverlayVisible:function(d){if(this._dockMode){return;
}var b=this._resizeOverlayElement;
if(!b){var c=this._getHandlesWidth();
var a=this._visibleTitlebar?this._tableElement.rows[0].offsetHeight:c;
b=document.createElement("DIV");
b.style.position="absolute";
b.style.zIndex="1";
b.style.top=a+"px";
b.style.left=Math.round(c/2)+"px";
b.style.backgroundColor="White";
b.style.filter="alpha(opacity=0)";
b.style.opacity=0;
this._contentCell.appendChild(b);
this._resizeOverlayElement=b;
}this._setResizeOverlaySize();
b.style.display=d?"":"none";
},_setResizeOverlaySize:function(){var a=this._resizeOverlayElement;
if(a){var b=this._contentCell;
a.style.width=b.offsetWidth+"px";
a.style.height=b.offsetHeight+"px";
}},onResizeStart:function(){if(this.isMaximized()){return false;
}this.setActive(true);
this._setResizeOverlayVisible(true);
this._cachedDragZoneBounds=this._getRestrictionZoneBounds();
var a=new Sys.CancelEventArgs();
this.raiseEvent("resizeStart",a);
if(a.get_cancel()){return false;
}},onResizing:function(d){if(!this._cachedDragZoneBounds||this._checkRestrictionZoneBounds(this._cachedDragZoneBounds,d)){if(this._dockMode){this.setWidthDockMode(d.width-1);
this.setHeightDockMode(d.height-1);
}else{this._setResizeOverlaySize();
}var c=this.get_minWidth();
if(d.width<c){var b=this._getCurrentBounds();
d.width=c;
var a=this._resizeExtender._originalBounds;
if(this._resizeExtender._resizeDir.west){d.x=a.x+(a.width-c);
if(this._cachedDragZoneBounds){d.x-=this._cachedDragZoneBounds.x;
}}else{d.x=b.x;
}d.y=b.y;
d.height=b.height;
this.setSize(d.width,d.height);
this._setPopupVisible(d.x,d.y);
return false;
}this._updateTitleWidth();
return true;
}return false;
},onResizeEnd:function(){this._cachedDragWindowBounds=null;
var a=this._getCurrentBounds();
if(this._dockMode){this.setBounds(a);
}else{this._setResizeOverlayVisible(false);
this._setPopupVisible(a.x,a.y);
this._storeBounds();
}if(this._overlay&&$telerik.isFirefox){this._popupBehavior._onMove();
}this.raiseEvent("resizeEnd",new Sys.EventArgs());
},onDragStart:function(){this.setActive(true);
if(this.isPinned()||this.isMaximized()){return false;
}if(this.isMinimized()&&this.get_minimizeZoneID()){return false;
}var c=this.get_popupElement();
this._cachedDragZoneBounds=this._getRestrictionZoneBounds();
var a=$telerik.getSize(c);
var b=$telerik.getBorderBox(c);
a.width-=b.horizontal;
a.height-=b.vertical;
this._cachedDragWindowBounds=a;
this._setResizeOverlayVisible(true);
this.raiseEvent("dragStart",new Sys.EventArgs());
return true;
},onDragEnd:function(b){this._cachedDragZoneBounds=null;
this._cachedDragWindowBounds=null;
if(this._overlay&&$telerik.isFirefox){this._popupBehavior._onMove();
}this._setResizeOverlayVisible(false);
this.raiseEvent("dragEnd",new Sys.EventArgs());
var a=this._getCurrentBounds();
this.moveTo(a.x,a.y);
this.setActive(true);
if(this.isMinimized()){this._getTitleElement().style.width="";
}},onDrag:function(d){if(!this._cachedDragZoneBounds){return true;
}var b=this._cachedDragWindowBounds;
var c=this._cachedDragZoneBounds;
d.width=b.width;
d.height=b.height;
var a=this._checkRestrictionZoneBounds(c,d);
if(!a){if(d.x<=c.x){d.x=c.x;
}else{if(c.x+c.width<=d.x+b.width){d.x=c.x+c.width-b.width;
}}if(d.y<=c.y){d.y=c.y;
}else{if(c.y+c.height<=d.y+b.height){d.y=c.y+c.height-b.height;
}}a=true;
}return a;
},initialize:function(){Telerik.Web.UI.RadWindow.callBaseMethod(this,"initialize");
if(this._visibleOnPageLoad){setTimeout(Function.createDelegate(this,function(){this.show();
}),0);
}this._registerWindowResizeHandler(true);
var a=this.get_element().className;
if(a){this.set_cssClass(a.replace(/^ /,""));
}},dispose:function(){var c=this.get_windowManager();
if(c){if(c.get_preserveClientState()){c.saveWindowState(this);
}if(this._destroyOnClose){c.removeWindow(this);
}}if(this._windowAnimation){this._windowAnimation.dispose();
}this._enableMoveResize(false);
this._makeModal(false);
this._registerTitlebarHandlers(false);
this._registerWindowResizeHandler(false);
this._registerIframeLoadHandler(false);
if(this._openerElement){this._registerOpenerElementHandler(this._openerElement,false);
}this.set_behaviors(Telerik.Web.UI.WindowBehaviors.None);
var a=this._iframe;
if(a){a.radWindow=null;
a.src="javascript:'<html></html>';";
a.name="";
a.removeAttribute("name");
a.removeAttribute("NAME");
}if(this._contentElement&&this._isPredefined){this._contentElement.innerHTML="";
}var b=this._popupElement;
if(b&&b.parentNode){b.parentNode.removeChild(b);
}Telerik.Web.UI.RadWindow.callBaseMethod(this,"dispose");
},hide:function(){this._hide();
return true;
},clone:function(a){var b=document.createElement("SPAN");
if(a){b.setAttribute("id",a);
}return $telerik.cloneControl(this,Telerik.Web.UI.RadWindow,b);
},set_contentElement:function(a){if(!this._isPredefined){this._dockMode=true;
}var b=$get(this.get_id()+"_C");
if(b&&a!=b){$telerik.disposeElement(b);
b.innerHTML="";
b.appendChild(a);
a=b;
}this._createUI();
if(this._iframe){this._iframe.style.display="none";
}if(a.parentNode&&a.parentNode.removeChild){a.parentNode.removeChild(a);
}this._contentCell.appendChild(a);
a.style.display="";
this._contentElement=a;
},get_contentElement:function(){return this._contentElement;
},isCreated:function(){return this._popupElement!=null;
},show:function(){var a=this.isCreated();
this._createUI();
if(this._navigateUrl&&(!a||this._reloadOnShow)){this.setUrl(this._navigateUrl);
}if(!a&&(this._initialBehaviors!=Telerik.Web.UI.WindowBehaviors.None)){this._show();
this._afterShow();
if(this.isInitialBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Minimize)){this.minimize();
}if(this.isInitialBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Maximize)){this.maximize();
}if(this.isInitialBehaviorEnabled(Telerik.Web.UI.WindowBehaviors.Pin)){this.togglePin();
}return;
}if(this.isModal()){this.center();
}if(this._animation==Telerik.Web.UI.WindowAnimation.None){this._show();
this._afterShow();
}else{this._playAnimation();
}},_show:function(){this.raiseEvent("beforeShow",new Sys.EventArgs());
if(this.get_offsetElementID()&&!this._offsetElement){var b=$get(this.get_offsetElementID());
if(b){this._offsetElement=b;
}}var a=this._popupBehavior.get_parentElement();
if(this._offsetElement&&!this._offsetSet){this._popupBehavior.set_parentElement(this._offsetElement);
this._offsetSet=true;
}this.set_visibleTitlebar(this._visibleTitlebar);
this.set_visibleStatusbar(this._visibleStatusbar);
this._reSetWindowPosition();
if(a!=this._popupBehavior.get_parentElement()){this._popupBehavior.set_parentElement(a);
}this._popupVisible=true;
var c=this.get_contentElement();
if(!this._isPredefned&&c){$telerik.repaintChildren(c);
}},_hide:function(){if(!this._animation||this._animation==0){this._afterHide();
}else{var a=Function.createDelegate(this,this._afterHide);
var b=this.isMaximized();
$telerik.$(this._popupElement).stop().fadeOut(this._animationDuration,function(){a(b);
});
}},_afterHide:function(b){if(!this._popupBehavior){return;
}if(b==null){b=this.isMaximized();
}var a=this.isMinimized();
if(b||a){this.restore();
}this._popupBehavior.hide(true);
this._popupVisible=false;
this._getWindowController().notifyWindowClosed(this);
},_afterShow:function(){this.setActive(true);
this._storeBounds();
this.raiseEvent("show",new Sys.EventArgs());
var a=!this._animation==Telerik.Web.UI.WindowAnimation.None;
if(this._autoSize&&(this._dockMode||a)){this.autoSize(a);
}},_playAnimation:function(){var f=Function.createDelegate(this,function(){var k=this._getCalculatedPopupBounds();
this._setPopupVisible(k.x,k.y);
var j=$telerik.getBounds(this._popupElement);
var l=this.get_offsetElementID();
if(l){var m=$get(l);
if(m){var n=$telerik.getBounds(m);
j.x=n.x;
j.y=n.y;
}}$telerik.$(this._popupElement).hide();
return j;
});
var b=this._popupElement;
var g=this._animation;
var d=this._openerElement?$telerik.getBounds(this._openerElement):null;
var a=f();
var e=this._animationDuration;
var c=""+this._position;
var i=null;
var h=Function.createDelegate(this,function(){this._popupElement.style.filter="";
this.get_popupElement().style.opacity="";
this._show();
this._afterShow();
});
Telerik.Web.UI.Animations.playJQueryAnimation(b,g,d,a,c,i,h,e);
},_onClick:function(a){this.show();
return this._cancelEvent(a);
},_cancelEvent:function(a){if(a){a.returnValue=false;
a.cancelBubble=true;
a.preventDefault();
a.stopPropagation();
}return false;
},_getWindowController:function(){return Telerik.Web.UI.RadWindowController.getInstance();
},_getReloadOnShowUrl:function(b){var c="rwndrnd="+Math.random();
if(b.indexOf("?")>-1){c="&"+c;
}else{c="?"+c;
}var a=b.indexOf("#");
b=(a>-1)?b.substr(0,a)+c+b.substr(a):b+c;
return b;
},getWindowBounds:function(){return this._getCalculatedPopupBounds();
},toString:function(){return"[RadWindow id="+this.get_id()+"]";
},center:function(){var a=this._getCentralBounds();
this.moveTo(a.x,a.y);
},moveTo:function(b,c){var d=this._popupElement;
if(d){var a=$telerik.getBounds(d);
var f=this._getRestrictionZoneBounds();
if(f){var e=this._checkRestrictionZoneBounds(null,new Sys.UI.Bounds(b+f.x,c+f.y,a.width,a.height));
if(!e){return false;
}}}b=parseInt(b);
c=parseInt(c);
this._createUI();
this._setPopupVisible(b,c);
this._storeBounds();
return true;
},setSize:function(a,b){this._firstShow=false;
this.set_width(a);
this.set_height(b);
this._storeBounds();
},autoSize:function(z){if(this.isClosed()){return;
}var b=this.get_contentFrame();
var a=this.get_popupElement();
var c=$telerik.getBounds(a);
var i=$telerik.getBorderBox(a);
c.width-=i.horizontal;
c.height-=i.vertical;
var x=null;
var m;
var f;
var y=this.get_contentElement();
var g=this.get_minWidth();
var d=this._getTitleElement();
if(d){d.style.width="1px";
}if(this._dockMode&&y){y.style.height="1px";
y.style.width="1px";
Sys.UI.DomElement.addCssClass(this._contentCell,"rwLoading");
m=y.scrollHeight;
var w=y.scrollWidth;
f=w>g?w:g;
}else{try{x=b.contentWindow.document.documentElement;
if(!x){return;
}}catch(h){return false;
}var u=b.contentWindow.document.body;
var y=x;
if($telerik.isIE||$telerik.isFirefox){y=b;
}y.style.width="1px";
m=x.scrollHeight;
f=x.scrollWidth;
if(f<g){y.style.width=g+"px";
f=x.scrollWidth;
}y.style.height="1px";
m=x.scrollHeight;
}var t=this._getRestrictionZoneBounds();
var n=t?t:this._getViewportBounds();
var o=this._getHandlesWidth()+f;
var A=this.get_minHeight()+m;
var p=Math.min(o,n.width);
var l=Math.min(A,n.height);
var s=this.get_keepInScreenBounds();
if(!t){this.set_keepInScreenBounds(true);
}var r=16;
if(l<m){p=Math.min(p+r,n.width);
}if(p<f){l=Math.min(l+r,n.height);
}var q=this.calcPosition(c.x,c.width,p,n.width);
var v=this.calcPosition(c.y,c.height,l,n.height);
var j={x:q+n.scrollLeft,y:v+n.scrollTop,width:p,height:l};
var e;
var k;
if(x){e=x.style.overflow;
k=u.style.overflow;
}this.setOverflowVisible(false,x,u);
if(z){this._autoSizeWithAnimation(j,x,u,e,k);
}else{this._restoreRect=null;
this.setBounds(j);
this.setOverflowVisible(true,x,u,e,k);
Sys.UI.DomElement.removeCssClass(this._contentCell,"rwLoading");
}if($telerik.isIE&&b){b.style.overflow="hidden";
setTimeout(function(){b.style.overflow="";
},0);
}this.set_keepInScreenBounds(s);
if(b){y.style.width="100%";
y.style.height="100%";
}return true;
},_autoSizeWithAnimation:function(a,k,d,c,h){var d=null;
var k=null;
var b=this.get_contentElement();
var j=this.get_contentFrame();
if(j){d=j.contentWindow.document.body;
k=j.contentWindow.document.documentElement;
}var e=this.get_popupElement();
var g=Function.createDelegate(this,function(){this._popupElement.style.filter="";
this.get_popupElement().style.opacity="";
this._restoreRect=null;
this.setBounds(a);
this.setOverflowVisible(true,k,d,c,h);
Sys.UI.DomElement.removeCssClass(this._contentCell,"rwLoading");
});
this._tableElement.style.height="100%";
var f={width:a.width,height:a.height,x:a.x,y:a.y};
var i=this._getRestrictionZoneBounds();
if(i){f.x+=i.x;
f.y+=i.y;
}$telerik.$(e).animate({width:f.width,height:f.height,left:f.x,top:f.y,opacity:1},300,null,g);
},setBounds:function(a){if(!a){return;
}this._checkRestrictionZoneBounds=function(){return true;
};
this.moveTo(a.x,a.y);
this.setSize(a.width,a.height);
this._checkRestrictionZoneBounds=Telerik.Web.UI.RadWindow.prototype._checkRestrictionZoneBounds;
},setWidthDockMode:function(a){if(!this._dockMode||!this.get_contentElement()){return;
}widthToSet=a-this._getHandlesWidth();
if(widthToSet>0){this._contentElement.style.width=widthToSet+"px";
}},setHeightDockMode:function(b){if(!this._dockMode||!this.get_contentElement()){return;
}var a=b;
a-=parseInt($telerik.getCurrentStyle(this._tableElement.rows[3].cells[1],"height"));
if(this._visibleTitlebar){a-=parseInt($telerik.getCurrentStyle(this._titlebarElement,"height"));
a-=parseInt($telerik.getCurrentStyle(this._topResizer,"height"));
}else{a-=parseInt($telerik.getCurrentStyle(this._tableElement.rows[0].cells[1],"height"));
}if(this._visibleStatusbar){a-=parseInt($telerik.getCurrentStyle(this._tableElement.rows[2].cells[1],"height"));
}if(a>0){this._contentElement.style.height=a+"px";
}},calcPosition:function(a,b,c,e){var d=a+Math.round((b-c)/2);
if(d<0||d+b>e){d=Math.round(Math.abs((e-c)/2));
}return d;
},_maintainMaximizedSize:function(){if(!this.isMaximized()){return;
}var c=this._popupElement;
if(!c){return;
}var f=this._getViewportBounds();
c.style.top=(f.scrollTop+f.y)+"px";
c.style.left=(f.scrollLeft+f.x)+"px";
$telerik.setSize(c,{width:f.width,height:f.height});
var g=this._getRestrictionZoneBounds();
if(!g){this._enablePageScrolling(false);
}var a=this._tableElement;
f=$telerik.getContentSize(c);
var e=$telerik.getBorderBox(a);
var b=$telerik.getPaddingBox(a);
var d=f.height-e.vertical-b.vertical;
a.style.height=d+"px";
this._fixIeHeight(a,d);
if(this._dockMode){this.setWidthDockMode(f.width);
this.setHeightDockMode(f.height);
}},_enablePageScrolling:function(a){var b=document.body;
var c=document.documentElement;
if(a){if(null!=this._documentOverflow){c.style.overflow=this._documentOverflow;
}if(null!=this._bodyOverflow){b.style.overflow=this._bodyOverflow;
}this._documentOverflow=null;
this._bodyOverflow=null;
}else{if(null==this._documentOverflow){this._documentOverflow=c.style.overflow;
}if(null==this._bodyOverflow){this._bodyOverflow=b.style.overflow;
}b.style.overflow="hidden";
c.style.overflow="hidden";
}},_getRestrictionZoneBounds:function(){var b=null;
if(this.get_restrictionZoneID()){var a=$get(this.get_restrictionZoneID());
if(a){b=$telerik.getBounds(a);
b.scrollLeft=0;
b.scrollTop=0;
}}return b;
},_storeBounds:function(){if(!this.isCreated()){return;
}var a=this._getCurrentBounds();
if(this.isMaximized()){return false;
}if(this.isMinimized()){if(this._restoreRect){a.width=this._restoreRect.width;
a.height=this._restoreRect.height;
}else{a.width=this.get_width();
a.height=this.get_height();
}}this._restoreRect=a;
},_restoreBounds:function(){if(!this._restoreRect){return;
}var a=this._restoreRect;
this.setSize(a.width,a.height);
this.moveTo(a.x,a.y);
},_getStoredBounds:function(){if(this._restoreRect){return this._restoreRect;
}},_deleteStoredBounds:function(){this._restoreRect=null;
},_getCurrentBounds:function(){var a=(this._popupElement.style.display=="none")?true:false;
this._popupElement.style.display="";
if(this._firstShow!=true){this._updateWindowSize(this._height);
this._firstShow=true;
}var c=$telerik.getBounds(this._popupElement);
if(a){this._popupElement.style.display="none";
}var b=this._getRestrictionZoneBounds();
if(b){c.x-=b.x;
c.y-=b.y;
}return c;
},_getCentralBounds:function(){var d=this._getCurrentBounds();
var a=this._getViewportBounds();
var c=parseInt((a.width-d.width)/2);
var b=parseInt((a.height-d.height)/2);
d.x=c+a.scrollLeft;
d.y=b+a.scrollTop;
return d;
},_getViewportBounds:function(){var b=this._getRestrictionZoneBounds();
if(b){return b;
}var d=$telerik.getClientBounds();
var a=$telerik.getCorrectScrollLeft(document.documentElement)||$telerik.getCorrectScrollLeft(document.body);
var c=document.documentElement.scrollTop||document.body.scrollTop;
d.scrollLeft=a;
d.scrollTop=c;
if(this.isIE){if(d.width==0){d.width=document.body.clientWidth;
}if(d.height==0){d.height=document.body.clientHeight;
}}return d;
},_getCalculatedPopupBounds:function(){var e=this._getStoredBounds();
if(e){return e;
}var a=this._getCurrentBounds();
var b=this._offsetElement;
if(this._top==null&&this._left==null&&!b){a=this._getCentralBounds();
}else{if(b){a.y=0;
a.x=0;
}else{var f=this._getViewportBounds();
a.x=f.scrollLeft;
a.y=f.scrollTop;
}var c=this._left?this._left:0;
a.x+=c;
var d=this._top?this._top:0;
a.y+=d;
}return a;
},_checkRestrictionZoneBounds:function(a,c){var b=a;
if(!b){b=this._getRestrictionZoneBounds();
if(!b){return true;
}}return Telerik.Web.UI.ResizeExtender.containsBounds(b,c);
},_reSetWindowPosition:function(){var a=this._getCalculatedPopupBounds();
this._setPopupVisible(a.x,a.y);
},_fixIeHeight:function(b,a){if("CSS1Compat"==document.compatMode){var c=(b.offsetHeight-parseInt(a));
if(c>0){var d=(parseInt(b.style.height)-c);
if(d>0){b.style.height=d+"px";
}}}},_setPopupVisible:function(b,c){var a=this._getRestrictionZoneBounds();
if(a){b+=a.x;
c+=a.y;
}this._popupBehavior._setCoordinates(b,c);
this._popupBehavior.show();
if(!this.get_width()){this._popupElement.style.width="";
}this._updateTitleWidth();
},_createDefaultTable:function(){var a=document.createElement("TABLE");
a.align="left";
a.cellSpacing=0;
a.cellPadding=0;
a.insertRow(-1);
return a;
},_isWindowRightToLeft:function(){var a=this._isRightToLeft;
if(a==null){var b=this.get_element();
var c=b.parentNode?b:this._getDefaultParent();
a=this._isRightToLeft=$telerik.isRightToLeft(c);
}return a;
},_createStatusbarResizer:function(b){var a=b.rows[0].insertCell(-1);
a.style.width="15px";
var c=document.createElement("DIV");
a.appendChild(c);
this._bottomResizer=c;
},_createStatusbarMessageCell:function(a){var b=a.rows[0].insertCell(-1);
b.style.width="100%";
var c=this._getStatusMessageElement();
b.appendChild(c);
},_createUI:function(){if(!this._popupElement){var w=this.get_id();
var o="RadWindowWrapper_"+w;
var x=this._isWindowRightToLeft();
var n=document.createElement("DIV");
n.id=o;
n.className=this._getFullSkinName();
var e=this.get_cssClass();
if(e){Sys.UI.DomElement.addCssClass(n,e);
}if(x){Sys.UI.DomElement.addCssClass(n,"RadWindow_rtl");
}if(!this._visibleTitlebar){Sys.UI.DomElement.addCssClass(n,"rwNoTitleBar");
}n.style.width=this._width;
n.style.height=this._height;
n.setAttribute("unselectable","on");
this._popupElement=n;
var f=document.createElement("TABLE");
f.cellSpacing=0;
f.cellPadding=0;
this._tableElement=f;
var d=[];
if(x){d=["rwCorner rwTopRight","rwTitlebar","rwCorner rwTopLeft","rwCorner rwBodyRight","rwWindowContent","rwCorner rwBodyLeft","rwCorner rwBodyRight","rwStatusbar","rwCorner rwBodyLeft","rwCorner rwFooterRight","rwFooterCenter","rwCorner rwFooterLeft"];
}else{d=["rwCorner rwTopLeft","rwTitlebar","rwCorner rwTopRight","rwCorner rwBodyLeft","rwWindowContent","rwCorner rwBodyRight","rwCorner rwBodyLeft","rwStatusbar","rwCorner rwBodyRight","rwCorner rwFooterLeft","rwFooterCenter","rwCorner rwFooterRight"];
}var u=["rwTitleRow","rwContentRow","rwStatusbarRow","rwFooterRow"];
var t=0;
for(var r=0;
r<4;
r++){var l=f.insertRow(-1);
l.className=u[r];
for(var s=1;
s<=3;
s++){var A=l.insertCell(-1);
A.innerHTML="&nbsp;";
A.className=d[t];
t++;
}}var p=f.rows[0].cells[1];
p.innerHTML="";
this._titleCell=p;
var c=document.createElement("DIV");
c.className="rwTopResize";
c.innerHTML="<!-- / -->";
this._topResizer=c;
this._titleCell.appendChild(this._topResizer);
var q=this._createDefaultTable();
q.className="rwTitlebarControls";
this._titlebarElement=q;
this._titleCell.appendChild(this._titlebarElement);
var b=this._getTitleIcon();
var h=this._titlebarElement.rows[0].insertCell(-1);
h.appendChild(b);
var v=this._getTitleElement();
var p=this._titlebarElement.rows[0].insertCell(-1);
p.appendChild(v);
this.set_title(this._title);
var y=this._titlebarElement.rows[0].insertCell(-1);
y.noWrap=true;
y.style.whiteSpace="nowrap";
y.appendChild(this._getTitleCommandButtonsHolder());
var k=f.rows[1].cells[1];
k.vAlign="top";
k.innerHTML="";
this._contentCell=k;
var a=this.get_name();
var z=this._createDefaultTable();
z.style.width="100%";
this._statusCell=f.rows[2].cells[1];
this._statusCell.innerHTML="";
this._statusCell.appendChild(z);
if(x){this._createStatusbarResizer(z);
this._createStatusbarMessageCell(z);
}else{this._createStatusbarMessageCell(z);
this._createStatusbarResizer(z);
}this._popupElement.appendChild(this._tableElement);
this._popupElement.style.display="none";
this._popupElement.style.position="absolute";
this._addWindowToDocument();
this._registerTitlebarHandlers(true);
this.set_visibleTitlebar(this._visibleTitlebar);
this.set_visibleStatusbar(this._visibleStatusbar);
if(this._dockMode){var g=$get(this.get_id()+"_C");
if(g&&g.innerHTML){g.style.overflow="auto";
g.style.border="0px";
this.set_contentElement(g);
this.setWidthDockMode(this.get_width());
this.setHeightDockMode(this.get_height());
}}else{var m=($telerik.isIE)?document.createElement("<iframe name='"+a+"'>"):document.createElement("iframe");
m.name=a;
m.src="javascript:'<html></html>';";
m.style.width="100%";
m.style.height="100%";
m.style.border="0px";
m.frameBorder="0";
if($telerik.isIE8){m.style.display="block";
}this._iframe=m;
this._contentCell.appendChild(this._iframe);
}if(!this._dockMode){this._createBackReference();
}}this._updateOpacity();
if(!this._popupBehavior){this.set_behaviors(this._behaviors);
this._popupBehavior=$create(Telerik.Web.PopupBehavior,{id:(new Date()-100)+"PopupBehavior",parentElement:null,overlay:this._overlay,keepInScreenBounds:this._keepInScreenBounds},null,null,this._popupElement);
}},_getDefaultParent:function(){var a=this._formID?document.getElementById(this._formID):null;
if(!a){if(document.forms&&document.forms.length>0){a=document.forms[0];
}else{a=document.body;
}}return a;
},_getStatusMessageElement:function(){if(null==this._statusMessageElement){var a=document.createElement("INPUT");
a.readOnly="readonly";
a.setAttribute("unselectable","on");
this._statusMessageElement=a;
}return this._statusMessageElement;
},_getTitleCommandButtonsHolder:function(){if(null==this._buttonsElement){var a=document.createElement("UL");
a.className="rwControlButtons";
this._buttonsElement=a;
}return this._buttonsElement;
},_getTitleElement:function(){if(!this._titleElement){this._titleElement=document.createElement("EM");
this._titleElement.setAttribute("unselectable","on");
}return this._titleElement;
},_getTitleIcon:function(){if(null==this._titleIconElement){var a=document.createElement("A");
this._titleIconElement=a;
a.className="rwIcon";
if(this.get_iconUrl()){a.style.background="transparent url("+this.get_iconUrl()+") no-repeat scroll 0px 0px";
}}return this._titleIconElement;
},_getTitleCommandButton:function(b){if(!b||!this._buttonsArray){return null;
}var e=b.toLowerCase();
e=e.charAt(0).toUpperCase()+e.substring(1);
b="rw"+e+"Button";
var c=this._buttonsArray.length;
for(var d=0;
d<c;
d++){var a=this._buttonsArray[d];
if(a&&Sys.UI.DomElement.containsCssClass(a,b)){return a;
}}return null;
},_getHandlesWidth:function(){if(!this._handlesWidth){var a=this._tableElement;
if(!a){return 0;
}var b=parseInt($telerik.getCurrentStyle(a.rows[2].cells[0],"width"));
if(!b){return 0;
}this._handlesWidth=2*b;
}return this._handlesWidth;
},get_minWidth:function(){if(!this._minWidth){var d=this._getHandlesWidth();
this._minWidth=d;
if(this._visibleTitlebar){var e=this._tableElement;
var b=this._getTitleElement();
var c=b.style.width;
if(b){b.style.width="1px";
}if(this._dockMode){this._contentElement.style.width="1px";
}e.style.width="1px";
var a=this._titleCell.offsetWidth;
b.style.width=c;
e.style.width="";
if(this._dockMode){this._contentElement.style.width="";
}this._minWidth+=a;
}}return this._minWidth;
},get_minHeight:function(){if(!this._minHeight){var a=Math.ceil(this._getHandlesWidth()/2);
this._minHeight=a;
this._minHeight+=this._visibleTitlebar?this._titleCell.offsetHeight:a;
this._minHeight+=this._visibleStatusbar?this._statusCell.offsetHeight:0;
}return this._minHeight;
},setOverflowVisible:function(c,f,b,e,d){var a="auto";
if(!c){d="hidden";
e="hidden";
a="hidden";
}if(this._dockMode){this.get_contentElement().style.overflow=a;
}if(f&&b){f.style.overflow=e;
b.style.overflow=d;
}},_updateTitleWidth:function(){if(this._visibleTitlebar){var g=this._getTitleElement();
if(!g){return;
}g.style.width="1px";
var a=0;
var i=this._getTitleCommandButtonsHolder();
var f=i.offsetWidth;
if(f>0){var e=i.getElementsByTagName("LI");
if(e[0]&&e[0].offsetWidth>0){f=e.length*e[0].offsetWidth;
}i.style.width=f+"px";
a+=f;
}var d=this._getTitleIcon();
var b=d.offsetWidth;
if(b>0&&d.parentNode.tagName=="TD"){d.parentNode.style.width=b+"px";
a+=b;
}a+=this._getHandlesWidth();
var h=0;
var c=this._titlebarElement;
h=c?c.offsetWidth-a:a;
if(h>0){g.style.width=h+"px";
}}},_addWindowToDocument:function(){var a=this._getDefaultParent();
a.insertBefore(this._popupElement,a.firstChild);
},_createBackReference:function(){var c=this;
if(!c.Argument){c.Argument={};
}var a=this._iframe;
try{a.radWindow=c;
if(a.contentWindow!=null){a.contentWindow.radWindow=c;
}}catch(b){}},_getFullSkinName:function(){return"RadWindow RadWindow_"+this._skin+" rwNormalWindow rwTransparentWindow";
},_configureMinimizeButton:function(d){var a=this._getLocalization();
var c=(true==d)?a.Restore:a.Minimize;
var b=(true==d)?this.restore:this.minimize;
this._registerTitlebarHandlersButton("Minimize",c,b);
},_configureMaximizeButton:function(d){var a=this._getLocalization();
var c=(true==d)?a.Restore:a.Maximize;
var b=(true==d)?this.restore:this.maximize;
this._registerTitlebarHandlersButton("Maximize",c,b);
},_registerTitlebarHandlersButton:function(a,d,e){var c=this._getTitleCommandButton(a);
if(c){var b=this._getLocalization();
c.setAttribute("title",d);
c.innerHTML=d;
$clearHandlers(c);
$addHandlers(c,{click:e},this);
$addHandler(c,"dblclick",this._cancelEvent);
$addHandler(c,"mousedown",this._cancelEvent);
}},isCloned:function(){return this._isCloned;
},isBehaviorEnabled:function(a){return a&this._behaviors?true:false;
},isInitialBehaviorEnabled:function(a){return a&this._initialBehaviors?true:false;
},setVisible:function(a){if(this._popupBehavior){if(a){this._popupBehavior.show();
}else{this._popupBehavior.hide();
}}},isVisible:function(){return this._popupVisible;
},isModal:function(){return this._modal;
},isActive:function(){return(this._popupElement&&!Sys.UI.DomElement.containsCssClass(this._popupElement,"rwInactiveWindow"));
},isPinned:function(){var a=this._getTitleCommandButton("Pin");
return(a&&Sys.UI.DomElement.containsCssClass(a,"on"));
},isClosed:function(){return(!this.isVisible());
},isMinimized:function(){return(this._popupElement&&Sys.UI.DomElement.containsCssClass(this._popupElement,"rwMinimizedWindow"));
},isMaximized:function(){return(this._popupElement&&Sys.UI.DomElement.containsCssClass(this._popupElement,"rwMaximizedWindow"));
},_moveToMinimizeZone:function(){var b=$get(this.get_minimizeZoneID());
if(b){if(this.isPinned()){this._isPinned=true;
this.togglePin();
}var a=this._popupElement;
if(a.parentNode!=b){a.parentNode.removeChild(a);
b.appendChild(a);
this.setVisible(true);
a.style.position="static";
if(this.isIE){a.style.display="inline";
}else{a.style.cssFloat="left";
}}}},_moveToDocument:function(){var a=this._popupElement;
a.parentNode.removeChild(a);
a.style.position="absolute";
if(this.isIE){a.style.display="";
}else{a.style.cssFloat="";
}this._addWindowToDocument();
if(this._isPinned){this._isPinned=false;
this.togglePin();
}},minimize:function(){if(!this.isCreated()){return;
}var b=this.onCommand("Minimize");
if(!b){return;
}if(this.isMaximized()){this._normalizeWindowRootCss();
this._restoreBounds();
}var a=this._popupElement;
$telerik.removeCssClasses(a,["rwNormalWindow","rwMaximizedWindow"]);
Sys.UI.DomElement.addCssClass(a,"rwMinimizedWindow");
var c=a._hideWindowedElementsIFrame;
if(c){Sys.UI.DomElement.addCssClass(c,"rwMinimizedWindowOverlay_"+this._skin);
}this._configureMinimizeButton(true);
this._enablePageScrolling(true);
this._getTitleElement().style.width="";
if(this.get_minimizeZoneID()){this._moveToMinimizeZone();
}},restore:function(){if(!this.isCreated()||this.isClosed()){return;
}var a=this.onCommand("Restore");
if(!a){return;
}this._configureMinimizeButton();
this._configureMaximizeButton();
if(this.isMinimized()&&this.get_minimizeZoneID()){this._moveToDocument();
}this._normalizeWindowRootCss();
this._enablePageScrolling(true);
this._restoreBounds();
this.setVisible(true);
if(this.get_showOnTopWhenMaximized()&&this._restoreZindex){this._popupElement.style.zIndex=this._restoreZindex;
this._restoreZindex=null;
}this.setVisible(true);
this.setActive(true);
},maximize:function(){if(!this.isCreated()){return;
}var b=this.onCommand("Maximize");
if(!b){return;
}this._storeBounds();
if(this.isMinimized()&&this.get_minimizeZoneID()){this._moveToDocument();
}if(this.isMinimized()){this._normalizeWindowRootCss();
this._checkRestrictionZoneBounds=function(){return true;
};
this._restoreBounds();
this._checkRestrictionZoneBounds=Telerik.Web.UI.RadWindow.prototype._checkRestrictionZoneBounds;
}var a=this._popupElement;
$telerik.removeCssClasses(a,["rwNormalWindow","rwMinimizedWindow"]);
Sys.UI.DomElement.addCssClass(a,"rwMaximizedWindow");
this._configureMaximizeButton(true);
this._configureMinimizeButton();
this._maintainMaximizedSize();
this._maintainMaximizedSize();
var d=a._hideWindowedElementsIFrame;
if(d){Sys.UI.DomElement.removeCssClass(d,"rwMinimizedWindowOverlay_"+this._skin);
this._popupBehavior._handleElementResize();
}if(!this.isActive()){this.setActive(true);
}if(this.get_showOnTopWhenMaximized()){var c=a.style.zIndex;
if(c){this._restoreZindex=c;
}a.style.zIndex=100000;
}this._updateTitleWidth();
},setActive:function(a){var d=this._popupElement;
if(!a){Sys.UI.DomElement.addCssClass(d,"rwInactiveWindow");
}else{if(!this.isMaximized()){var b=parseInt(d.style.zIndex);
var c=(this._stylezindex)?this._stylezindex:Telerik.Web.UI.RadWindowUtils.get_newZindex(b);
d.style.zIndex=""+c;
}this._getWindowController().set_activeWindow(this);
this.raiseEvent("activate",new Sys.EventArgs());
if(this.isActive()){return;
}Sys.UI.DomElement.removeCssClass(d,"rwInactiveWindow");
}},togglePin:function(){if(!this.isCreated()){return;
}var c=this.onCommand("Pin");
if(!c){return;
}var a=this._getTitleCommandButton("Pin");
var d=this._getLocalization();
var e=this.isPinned();
var b=e?d.PinOn:d.PinOff;
if(a){Sys.UI.DomElement.toggleCssClass(a,"on");
}this._registerTitlebarHandlersButton("Pin",b,this.togglePin);
Telerik.Web.UI.RadWindowUtils.setPinned(!e,this);
},reload:function(){if(!this.isCreated()){return;
}var b=this.onCommand("Reload");
if(!b){return;
}if(!this._iframe){return;
}this._onWindowUrlChanging();
try{this._iframe.contentWindow.location.reload();
}catch(a){this._onWindowUrlChanged();
}},_normalizeWindowRootCss:function(){var a=this._popupElement;
if(a){$telerik.removeCssClasses(a,["rwMinimizedWindow","rwMaximizedWindow"]);
Sys.UI.DomElement.addCssClass(a,"rwNormalWindow");
var b=a._hideWindowedElementsIFrame;
if(b){Sys.UI.DomElement.removeCssClass(b,"rwMinimizedWindowOverlay_"+this._skin);
}}this._updateTitleWidth();
},close:function(a){if(this.isClosed()){return;
}var b=new Sys.CancelEventArgs();
this.raiseEvent("beforeClose",b);
if(b.get_cancel()){return;
}this.hide();
var c=new Sys.EventArgs();
c._argument=(typeof(a)!="undefined"&&!(a instanceof Sys.UI.DomEvent))?a:null;
c.get_argument=function(){return this._argument;
};
this.raiseEvent("close",c);
this._enablePageScrolling(true);
this._normalizeWindowRootCss();
if(a instanceof Sys.UI.DomEvent){a=null;
}this._invokeDialogCallBackFunction(a);
if(this._destroyOnClose&&!this._dockMode){this.dispose();
}},_invokeDialogCallBackFunction:function(b){var a=this.get_clientCallBackFunction();
if(a){if("string"==typeof(a)){a=eval(a);
}if("function"==typeof(a)){a(this,b);
}}},onCommand:function(b){var a=new Sys.CancelEventArgs();
a._commandName=b;
a.get_commandName=function(){return this._commandName;
};
this.raise_command(a);
if(a.get_cancel()){return false;
}return true;
},setUrl:function(b){if(this._dockMode){return;
}this._createUI();
this._navigateUrl=b;
var a=b;
if(this._reloadOnShow){a=this._getReloadOnShowUrl(a);
}this._iframe.src=a;
this._onWindowUrlChanging();
if(!this._loaded){this._registerIframeLoadHandler(true);
}this._loaded=true;
},_registerChildPageHandlers:function(a){var b=null;
try{b=this._iframe.contentWindow.document;
if(b.domain!=document.domain){return;
}}catch(c){return;
}if(null==b){return;
}if(a){this._onChildPageUnloadDelegate=Function.createDelegate(this,this._onChildPageUnload);
if(this.isIE){b.onunload=this._onChildPageUnloadDelegate;
}else{this._iframe.contentWindow.onunload=this._onChildPageUnloadDelegate;
}this._onChildPageClickDelegate=Function.createDelegate(this,this._onChildPageClick);
$telerik.addExternalHandler(b,"click",this._onChildPageClickDelegate);
}else{if(this._onChildPageClickDelegate){$telerik.removeExternalHandler(b,"click",this._onChildPageClickDelegate);
this._onChildPageClickDelegate=null;
}}},_onChildPageUnload:function(a){this._registerChildPageHandlers(false);
},_onChildPageClick:function(b){if(!this.isVisible()||this.isClosed()){return;
}var a=b.target?b.target:b.srcElement;
if(a){if(a.tagName=="INPUT"&&a.type=="button"){return;
}else{if(a.tagName=="BUTTON"||a.tagName=="A"){return;
}}}this.setActive(true);
},_onIframeLoad:function(){this._onWindowUrlChanged();
this._registerChildPageHandlers(true);
this.raiseEvent("pageLoad",new Sys.EventArgs());
if(this.get_autoSize()){var b=this.get_animation()!=Telerik.Web.UI.WindowAnimation.None;
this.autoSize(b);
}var a=null;
try{a=this._iframe.contentWindow;
var c=a.document;
}catch(d){return false;
}a.close=Function.createDelegate(this,function(){this.close();
});
},_onWindowUrlChanging:function(){var d=$telerik.isRightToLeft(this._iframe);
if(this._showContentDuringLoad||d){var b=this._getStatusMessageElement();
if(b){Sys.UI.DomElement.addCssClass(b,"rwLoading");
}}else{var a=this._iframe.style;
a.position="absolute";
a.top="-10000px";
a.left="-10000px";
var c=this._iframe.parentNode;
Sys.UI.DomElement.addCssClass(c,"rwLoading");
}},_onWindowUrlChanged:function(){var a=this._getStatusMessageElement();
var c=$telerik.isRightToLeft(this._iframe);
if(this._showContentDuringLoad||c){if(a){Sys.UI.DomElement.removeCssClass(a,"rwLoading");
}}else{this._iframe.style.position="";
var b=this._iframe.parentNode;
Sys.UI.DomElement.removeCssClass(b,"rwLoading");
}if(a){this.set_status(this._navigateUrl);
}try{if(this._iframe.contentWindow.document.title){this.set_title(this._iframe.contentWindow.document.title);
}}catch(d){}},_updatePopupZindex:function(){if(this._popupBehavior){if(this.isVisible()){this._popupBehavior.show();
}}},_updateOpacity:function(){var a=this._dockMode?this.get_contentElement():this.get_contentFrame();
if(a){if(this._opacity<100){this._contentCell.style.background="none transparent";
var b=a.style;
b.filter="alpha(opacity="+this._opacity+")";
b.opacity=(this._opacity/100);
}else{this._contentCell.style.background="";
if($telerik.isIE){this._contentCell.removeAttribute("style");
a.style.removeAttribute("filter");
a.style.removeAttribute("opacity");
}else{a.style.filter="";
a.style.opacity="";
}}}},get_zindex:function(){if(this._popupElement){return this._popupElement.style.zIndex;
}else{return -1;
}},get_browserWindow:function(){return this._browserWindow;
},get_contentFrame:function(){return this._iframe;
},get_minimizeZoneID:function(){return this._minimizeZoneID;
},set_minimizeZoneID:function(a){if(this._minimizeZoneID!=a){this._minimizeZoneID=a;
}},get_restrictionZoneID:function(){return this._restrictionZoneID;
},set_restrictionZoneID:function(a){if(this._restrictionZoneID!=a){this._restrictionZoneID=a;
}},get_minimizeIconUrl:function(){return this._minimizeIconUrl;
},set_minimizeIconUrl:function(a){if(this._minimizeIconUrl!=a){this._minimizeIconUrl=a;
}},get_iconUrl:function(){return this._iconUrl;
},set_iconUrl:function(a){if(this._iconUrl!=a){this._iconUrl=a;
}},get_clientCallBackFunction:function(){return this._clientCallBackFunction;
},set_clientCallBackFunction:function(a){if(this._clientCallBackFunction!=a){this._clientCallBackFunction=a;
}},get_navigateUrl:function(){return this._navigateUrl;
},set_navigateUrl:function(a){if(this._navigateUrl!=a){this._navigateUrl=a;
}},get_targetControl:function(){return this._openerElement;
},set_targetControl:function(a){if(this._openerElement!=a){this._openerElement=a;
}},get_name:function(){return this._name;
},set_name:function(a){if(this._name!=a){this._name=a;
}},get_formID:function(){return this._formID;
},set_formID:function(a){if(this._formID!=a){this._formID=a;
}},get_offsetElementID:function(){return this._offsetElementID;
},set_offsetElementID:function(a){if(this._offsetElementID!=a){this._offsetElementID=a;
this._offsetElement=$get(a);
this._deleteStoredBounds();
this._offsetSet=false;
}if(this.isVisible()){this._show();
}},get_openerElementID:function(){return this._openerElementID;
},set_openerElementID:function(a){if(this._openerElementID!=a){if(this._openerElement){this._registerOpenerElementHandler(this._openerElement,false);
this._openerElement=null;
}this._openerElementID=a;
if(this._openerElementID){this._openerElement=$get(this._openerElementID);
}if(this._openerElement){this._registerOpenerElementHandler(this._openerElement,true);
}}},get_left:function(){return this._left;
},set_left:function(a){if(this._left!=a){this._left=parseInt(a)||parseInt(a)==0?parseInt(a):null;
}},get_top:function(){return this._top;
},set_top:function(a){if(this._top!=a){this._top=parseInt(a)||parseInt(a)==0?parseInt(a):null;
}},get_title:function(){return this._title;
},set_title:function(a){if(this._title!=a){this._title=a;
}if(null==this._titleElement){return;
}this._titleElement.innerHTML=a==""?"&nbsp;":this._title;
this._updateTitleWidth();
},get_width:function(){return parseInt(this._width);
},_fixSizeValue:function(a){a=""+a;
if(-1==a.indexOf("px")){a=parseInt(a);
if(!isNaN(a)){a=a+"px";
}else{a="";
}}return a;
},set_width:function(a){if(null==a){return false;
}if(this.isMaximized()){return false;
}a=this._fixSizeValue(a);
var c=this._popupElement;
if(c){var d=$telerik.getBounds(c);
var b=parseInt(a);
if(isNaN(b)){b=d.width;
}var e=this._checkRestrictionZoneBounds(null,new Sys.UI.Bounds(d.x,d.y,b,d.height));
if(!e){return false;
}}if(this._width!=a){this._width=a;
}if(this._dockMode){this.setWidthDockMode(this.get_width());
}if(c){this._deleteStoredBounds();
c.style.width=this._width;
this._updatePopupZindex();
}this._updateTitleWidth();
return true;
},get_height:function(){return parseInt(this._height);
},set_height:function(a){if(null==a){return false;
}if(this.isMaximized()){return false;
}a=this._fixSizeValue(a);
var b=this._popupElement;
if(b){this._firstShow=false;
var c=$telerik.getBounds(b);
var d=this._checkRestrictionZoneBounds(null,new Sys.UI.Bounds(c.x,c.y,c.width,parseInt(a)));
if(!d){return false;
}}if(this._height!=a){this._height=a;
}if(this._dockMode){this.setHeightDockMode(this.get_height());
}if(b){this._deleteStoredBounds();
this._updateWindowSize(this._height);
this._updatePopupZindex();
}return true;
},_updateWindowSize:function(b,c){var d=this._tableElement;
var a=b?b:d.style.height;
if(true==c){a=d.offsetHeight+"px";
}if(parseInt(a)==0){return;
}d.style.height=a;
this._fixIeHeight(d,a);
d.parentNode.style.height=a;
},get_initialBehaviors:function(){return this._initialBehaviors;
},set_initialBehaviors:function(a){if(this._initialBehaviors!=a){this._initialBehaviors=a;
}},get_behaviors:function(){return this._behaviors;
},set_behaviors:function(a){if(this._behaviors!=a){this._behaviors=a;
}if(null==this._titlebarElement){return;
}this._enableMoveResize(false);
this._enableMoveResize(true);
if(this._buttonsArray&&this._buttonsArray.length>0){var f=this._buttonsArray.length;
for(var l=0;
l<f;
l++){var o=this._buttonsArray[l];
$clearHandlers(o);
}this._buttonsArray=[];
var e=this._getTitleCommandButtonsHolder();
e.innerHTML="";
}if(Telerik.Web.UI.WindowBehaviors.None==this._behaviors){return;
}else{var b=this._getLocalization();
var m=Telerik.Web.UI.WindowBehaviors;
var n=[[this.isBehaviorEnabled(m.Pin),"rwPinButton",b.PinOn,this.togglePin],[this.isBehaviorEnabled(m.Reload),"rwReloadButton",b.Reload,this.reload],[this.isBehaviorEnabled(m.Minimize),"rwMinimizeButton",b.Minimize,this.minimize],[this.isBehaviorEnabled(m.Maximize),"rwMaximizeButton",b.Maximize,this.maximize],[this.isBehaviorEnabled(m.Close),"rwCloseButton",b.Close,this.close]];
for(var c=0;
c<n.length;
c++){var h=n[c];
if(!h[0]){continue;
}var d=document.createElement("LI");
var k=document.createElement("A");
k.href="javascript:void(0);";
k.className=h[1];
k.setAttribute("title",h[2]);
var g=document.createElement("SPAN");
g.innerHTML=h[2];
k.appendChild(g);
$addHandlers(k,{click:h[3],dblclick:this._cancelEvent,mousedown:this._cancelEvent},this);
$addHandler(k,"click",this._cancelEvent);
d.appendChild(k);
this._buttonsElement.appendChild(d);
this._buttonsArray[this._buttonsArray.length]=k;
this._updateTitleWidth();
this._minWidth=null;
}}},get_modal:function(){return this._modal;
},set_modal:function(a){if(this._modal!=a){this._modal=a;
}this._makeModal(this._modal);
if(this.isVisible()){this._afterShow();
}},get_destroyOnClose:function(){return this._destroyOnClose;
},set_destroyOnClose:function(a){if(this._destroyOnClose!=a){this._destroyOnClose=a;
}},get_reloadOnShow:function(){return this._reloadOnShow;
},set_reloadOnShow:function(a){if(this._reloadOnShow!=a){this._reloadOnShow=a;
}},get_showContentDuringLoad:function(){return this._showContentDuringLoad;
},set_showContentDuringLoad:function(a){if(this._showContentDuringLoad!=a){this._showContentDuringLoad=a;
}},get_visibleOnPageLoad:function(){return this._visibleOnPageLoad;
},set_visibleOnPageLoad:function(a){if(this._visibleOnPageLoad!=a){this._visibleOnPageLoad=a;
}},get_showOnTopWhenMaximized:function(){return this._showOnTopWhenMaximized;
},set_showOnTopWhenMaximized:function(a){if(this._showOnTopWhenMaximized!=a){this._showOnTopWhenMaximized=a;
}},get_visibleTitlebar:function(){return this._visibleTitlebar;
},set_visibleTitlebar:function(b){if(this._visibleTitlebar!=b){this._visibleTitlebar=b;
}var a=this.get_popupElement();
if(a){b?Sys.UI.DomElement.removeCssClass(a,"rwNoTitleBar"):Sys.UI.DomElement.addCssClass(a,"rwNoTitleBar");
}if(this._titlebarElement){this._titlebarElement.style.display=b?"":"none";
}},get_visibleStatusbar:function(){return this._visibleStatusbar;
},set_visibleStatusbar:function(a){if(this._visibleStatusbar!=a){this._visibleStatusbar=a;
}if(this._statusCell){this._statusCell.parentNode.style.display=a?"":"none";
}},get_animation:function(){return this._animation;
},set_animation:function(a){if(this._animation!=a){this._animation=a;
}},get_animationDuration:function(){return this._animationDuration;
},set_animationDuration:function(a){if(this._animationDuration!=a){this._animationDuration=a;
}},get_overlay:function(){return this._overlay;
},set_overlay:function(a){this._overlay=a;
if(this._popupBehavior){this._popupBehavior.set_overlay(this._overlay);
}if(this.isVisible()){this._reSetWindowPosition();
}},get_opacity:function(){return this._opacity;
},set_opacity:function(a){if(this.get_opacity()!=a){this._opacity=a>100?100:a;
this._opacity=a<0?0:a;
if(this.isCreated()){this._updateOpacity();
}}},get_keepInScreenBounds:function(){return this._keepInScreenBounds;
},set_keepInScreenBounds:function(a){this._keepInScreenBounds=a;
if(this._popupBehavior){this._popupBehavior.set_keepInScreenBounds(this._keepInScreenBounds);
}if(this.isVisible()){this._reSetWindowPosition();
}},get_autoSize:function(){return this._autoSize;
},set_autoSize:function(a){if(this._autoSize!=a){this._autoSize=a;
}},get_skin:function(){return this._skin;
},set_skin:function(a){if(a&&this._skin!=a){this._skin=a;
}},get_popupElement:function(){return this._popupElement;
},get_windowManager:function(){return this._windowManager;
},set_windowManager:function(a){this._windowManager=a;
},set_status:function(b){var a=this._getStatusMessageElement();
if(a){window.setTimeout(function(){a.value=b;
},0);
}},get_status:function(){var a=this._getStatusMessageElement();
if(a){return a.value;
}},get_cssClass:function(){return this._cssClass;
},set_cssClass:function(a){this._cssClass=a;
},add_command:function(a){this.get_events().addHandler("command",a);
},remove_command:function(a){this.get_events().removeHandler("command",a);
},raise_command:function(a){this.raiseEvent("command",a);
},add_dragStart:function(a){this.get_events().addHandler("dragStart",a);
},remove_dragStart:function(a){this.get_events().removeHandler("dragStart",a);
},add_dragEnd:function(a){this.get_events().addHandler("dragEnd",a);
},remove_dragEnd:function(a){this.get_events().removeHandler("dragEnd",a);
},add_activate:function(a){this.get_events().addHandler("activate",a);
},remove_activate:function(a){this.get_events().removeHandler("activate",a);
},add_beforeShow:function(a){this.get_events().addHandler("beforeShow",a);
},remove_beforeShow:function(a){this.get_events().removeHandler("beforeShow",a);
},add_show:function(a){this.get_events().addHandler("show",a);
},remove_show:function(a){this.get_events().removeHandler("show",a);
},add_pageLoad:function(a){this.get_events().addHandler("pageLoad",a);
},remove_pageLoad:function(a){this.get_events().removeHandler("pageLoad",a);
},add_close:function(a){this.get_events().addHandler("close",a);
},remove_close:function(a){this.get_events().removeHandler("close",a);
},add_beforeClose:function(a){this.get_events().addHandler("beforeClose",a);
},remove_beforeClose:function(a){this.get_events().removeHandler("beforeClose",a);
},add_resizeStart:function(a){this.get_events().addHandler("resizeStart",a);
},remove_resizeStart:function(a){this.get_events().removeHandler("resizeStart",a);
},add_resizeEnd:function(a){this.get_events().addHandler("resizeEnd",a);
},remove_resizeEnd:function(a){this.get_events().removeHandler("resizeEnd",a);
},add_resize:function(a){this.get_events().addHandler("resizeEnd",a);
},remove_resize:function(a){this.get_events().removeHandler("resizeEnd",a);
},saveClientState:function(){var a=["position"];
var c={};
for(var b=0;
b<a.length;
b++){c[a[b]]=this["get_"+a[b]]();
}return Sys.Serialization.JavaScriptSerializer.serialize(c);
}};
Telerik.Web.UI.RadWindow.registerClass("Telerik.Web.UI.RadWindow",Telerik.Web.UI.RadWebControl);
Telerik.Web.UI.WindowAnimation=function(){throw Error.invalidOperation();
};
Telerik.Web.UI.WindowAnimation.prototype={None:0,Resize:1,Fade:2,Slide:4,FlyIn:8};
Telerik.Web.UI.WindowAnimation.registerEnum("Telerik.Web.UI.WindowAnimation",false);
Telerik.Web.UI.WindowMinimizeMode=function(){throw Error.invalidOperation();
};
Telerik.Web.UI.WindowMinimizeMode.prototype={SameLocation:1,MinimizeZone:2,Default:1};
Telerik.Web.UI.WindowMinimizeMode.registerEnum("Telerik.Web.UI.WindowMinimizeMode",false);
Telerik.Web.UI.WindowBehaviors=function(){throw Error.invalidOperation();
};
Telerik.Web.UI.WindowBehaviors.prototype={None:0,Resize:1,Minimize:2,Close:4,Pin:8,Maximize:16,Move:32,Reload:64,Default:(1+2+4+8+16+32+64)};
Telerik.Web.UI.WindowBehaviors.registerEnum("Telerik.Web.UI.WindowBehaviors",false);
Telerik.Web.UI.RadWindowUtils._zIndex=3000;
Telerik.Web.UI.RadWindowUtils.get_newZindex=function(a){a=parseInt(a);
if(null==a||isNaN(a)){a=0;
}if(Telerik.Web.UI.RadWindowUtils._zIndex<a){Telerik.Web.UI.RadWindowUtils._zIndex=a;
}Telerik.Web.UI.RadWindowUtils._zIndex++;
return Telerik.Web.UI.RadWindowUtils._zIndex;
};
Telerik.Web.UI.RadWindowUtils._pinnedList={};
Telerik.Web.UI.RadWindowUtils.setPinned=function(c,a){if(c){var h=a._getViewportBounds();
var g=a._getCurrentBounds();
a.LeftOffset=g.x-h.scrollLeft;
a.TopOffset=g.y-h.scrollTop;
var f=window.setInterval(function(){Telerik.Web.UI.RadWindowUtils._updatePinnedElementPosition(a);
},100);
Telerik.Web.UI.RadWindowUtils._pinnedList[f]=a;
}else{var e=null;
var b=Telerik.Web.UI.RadWindowUtils._pinnedList;
for(var d in b){if(b[d]==a){e=d;
break;
}}if(null!=e){window.clearInterval(e);
Telerik.Web.UI.RadWindowUtils._pinnedList[e]=null;
}a.TopOffset=null;
a.LeftOffset=null;
}};
Telerik.Web.UI.RadWindowUtils._updatePinnedElementPosition=function(d){if(d.isMaximized()||!d.isVisible()){return;
}var e=d._getViewportBounds();
var b=d._getCurrentBounds();
var c=(d.LeftOffset!=null)?d.LeftOffset+e.scrollLeft:b.x;
var a=(d.TopOffset!=null)?d.TopOffset+e.scrollTop:b.y;
d.moveTo(c,a);
};

if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
Type.registerNamespace('NeXTPortal.Modules.PSEParts.Resources.Services');
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog=function() {
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.initializeBase(this);
this._timeout = 0;
this._userContext = null;
this._succeeded = null;
this._failed = null;
}
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.prototype={
_get_path:function() {
 var p = this.get_path();
 if (p) return p;
 else return NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.get_path();},
GetStock:function(req,succeededCallback, failedCallback, userContext) {
return this._invoke(this._get_path(), 'GetStock',false,{req:req},succeededCallback,failedCallback,userContext); },
GetPna:function(req,succeededCallback, failedCallback, userContext) {
return this._invoke(this._get_path(), 'GetPna',false,{req:req},succeededCallback,failedCallback,userContext); },
GetProductDetails:function(gShopGuid,gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,eThumbnailImageSize,eProductImageSize,intLcid,succeededCallback, failedCallback, userContext) {
return this._invoke(this._get_path(), 'GetProductDetails',false,{gShopGuid:gShopGuid,gUserGuid:gUserGuid,gVirtualCatalogId:gVirtualCatalogId,gCatalogGuid:gCatalogGuid,strProductId:strProductId,eThumbnailImageSize:eThumbnailImageSize,eProductImageSize:eProductImageSize,intLcid:intLcid},succeededCallback,failedCallback,userContext); },
GetColorAndSizeAvailabilityMatrix:function(gShopGuid,gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductFamilyId,strSenderElementId,intLcid,succeededCallback, failedCallback, userContext) {
return this._invoke(this._get_path(), 'GetColorAndSizeAvailabilityMatrix',false,{gShopGuid:gShopGuid,gUserGuid:gUserGuid,gVirtualCatalogId:gVirtualCatalogId,gCatalogGuid:gCatalogGuid,strProductFamilyId:strProductFamilyId,strSenderElementId:strSenderElementId,intLcid:intLcid},succeededCallback,failedCallback,userContext); }}
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Catalog',Sys.Net.WebServiceProxy);
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance = new NeXTPortal.Modules.PSEParts.Resources.Services.Catalog();
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.set_path = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.set_path(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.get_path = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.get_path(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.set_timeout = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.set_timeout(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.get_timeout = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.get_timeout(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.set_defaultUserContext = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.set_defaultUserContext(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.get_defaultUserContext = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.get_defaultUserContext(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.set_defaultSucceededCallback = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.set_defaultSucceededCallback(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.get_defaultSucceededCallback = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.get_defaultSucceededCallback(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.set_defaultFailedCallback = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.set_defaultFailedCallback(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.get_defaultFailedCallback = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.get_defaultFailedCallback(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.set_path("/_wpresources/NeXTPortal.Modules.PSEParts/Services/Catalog.asmx");
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.GetStock= function(req,onSuccess,onFailed,userContext) {NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.GetStock(req,onSuccess,onFailed,userContext); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.GetPna= function(req,onSuccess,onFailed,userContext) {NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.GetPna(req,onSuccess,onFailed,userContext); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.GetProductDetails= function(gShopGuid,gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,eThumbnailImageSize,eProductImageSize,intLcid,onSuccess,onFailed,userContext) {NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.GetProductDetails(gShopGuid,gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,eThumbnailImageSize,eProductImageSize,intLcid,onSuccess,onFailed,userContext); }
NeXTPortal.Modules.PSEParts.Resources.Services.Catalog.GetColorAndSizeAvailabilityMatrix= function(gShopGuid,gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductFamilyId,strSenderElementId,intLcid,onSuccess,onFailed,userContext) {NeXTPortal.Modules.PSEParts.Resources.Services.Catalog._staticInstance.GetColorAndSizeAvailabilityMatrix(gShopGuid,gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductFamilyId,strSenderElementId,intLcid,onSuccess,onFailed,userContext); }
var gtc = Sys.Net.WebServiceProxy._generateTypedConstructor;
Type.registerNamespace('NeXTPortal.Modules.PSEParts.Resources.Services.Model');
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockRequest) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockRequest=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockRequest");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockRequest.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockRequest');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaResponse) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaResponse=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaResponse");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaResponse.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaResponse');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockRequestItem) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockRequestItem=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockRequestItem");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockRequestItem.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockRequestItem');
}
Type.registerNamespace('NeXTPortal.Modules.PSEParts.Model');
if (typeof(NeXTPortal.Modules.PSEParts.Model.ProductExpectedStockInfo) === 'undefined') {
NeXTPortal.Modules.PSEParts.Model.ProductExpectedStockInfo=gtc("NeXTPortal.Modules.PSEParts.Model.ProductExpectedStockInfo");
NeXTPortal.Modules.PSEParts.Model.ProductExpectedStockInfo.registerClass('NeXTPortal.Modules.PSEParts.Model.ProductExpectedStockInfo');
}
if (typeof(NeXTPortal.Modules.PSEParts.Model.ProductStockInfo) === 'undefined') {
NeXTPortal.Modules.PSEParts.Model.ProductStockInfo=gtc("NeXTPortal.Modules.PSEParts.Model.ProductStockInfo");
NeXTPortal.Modules.PSEParts.Model.ProductStockInfo.registerClass('NeXTPortal.Modules.PSEParts.Model.ProductStockInfo');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaRequestItem) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaRequestItem=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaRequestItem");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaRequestItem.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaRequestItem');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaRequest) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaRequest=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaRequest");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaRequest.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaRequest');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaResponseItem) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaResponseItem=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaResponseItem");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaResponseItem.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.PnaResponseItem');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsInfo) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsInfo=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsInfo");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsInfo.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsInfo');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsImageInfo) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsImageInfo=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsImageInfo");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsImageInfo.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsImageInfo');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockResponseItem) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockResponseItem=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockResponseItem");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockResponseItem.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockResponseItem');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockResponse) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockResponse=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockResponse");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockResponse.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.StockResponse');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsSizeInfo) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsSizeInfo=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsSizeInfo");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsSizeInfo.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.ProductDetailsSizeInfo');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.ColorAndSizeAvailabilityMatrix) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.ColorAndSizeAvailabilityMatrix=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.ColorAndSizeAvailabilityMatrix");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.ColorAndSizeAvailabilityMatrix.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.ColorAndSizeAvailabilityMatrix');
}
Type.registerNamespace('NeXTPortal.Modules.PSEParts.Enums');
if (typeof(NeXTPortal.Modules.PSEParts.Enums.ImageSize) === 'undefined') {
NeXTPortal.Modules.PSEParts.Enums.ImageSize = function() { throw Error.invalidOperation(); }
NeXTPortal.Modules.PSEParts.Enums.ImageSize.prototype = {NotSet: 0,Swatch: 1,Small: 2,Medium: 3,Large: 4,Campaign: 5,ProductFamily: 6,XSmall: 7,FoxXSmall: 8,FoxMedium: 9}
NeXTPortal.Modules.PSEParts.Enums.ImageSize.registerEnum('NeXTPortal.Modules.PSEParts.Enums.ImageSize', true);
}

Type.registerNamespace('NeXTPortal.Modules.PSEParts.Resources.Services');
NeXTPortal.Modules.PSEParts.Resources.Services.Order=function() {
NeXTPortal.Modules.PSEParts.Resources.Services.Order.initializeBase(this);
this._timeout = 0;
this._userContext = null;
this._succeeded = null;
this._failed = null;
}
NeXTPortal.Modules.PSEParts.Resources.Services.Order.prototype={
_get_path:function() {
 var p = this.get_path();
 if (p) return p;
 else return NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.get_path();},
AddToOrder:function(req,succeededCallback, failedCallback, userContext) {
return this._invoke(this._get_path(), 'AddToOrder',false,{req:req},succeededCallback,failedCallback,userContext); },
AddToUserBasket:function(gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,decQuantity,strComments,intLcid,succeededCallback, failedCallback, userContext) {
return this._invoke(this._get_path(), 'AddToUserBasket',false,{gUserGuid:gUserGuid,gVirtualCatalogId:gVirtualCatalogId,gCatalogGuid:gCatalogGuid,strProductId:strProductId,decQuantity:decQuantity,strComments:strComments,intLcid:intLcid},succeededCallback,failedCallback,userContext); }}
NeXTPortal.Modules.PSEParts.Resources.Services.Order.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Order',Sys.Net.WebServiceProxy);
NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance = new NeXTPortal.Modules.PSEParts.Resources.Services.Order();
NeXTPortal.Modules.PSEParts.Resources.Services.Order.set_path = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.set_path(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Order.get_path = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.get_path(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Order.set_timeout = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.set_timeout(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Order.get_timeout = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.get_timeout(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Order.set_defaultUserContext = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.set_defaultUserContext(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Order.get_defaultUserContext = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.get_defaultUserContext(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Order.set_defaultSucceededCallback = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.set_defaultSucceededCallback(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Order.get_defaultSucceededCallback = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.get_defaultSucceededCallback(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Order.set_defaultFailedCallback = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.set_defaultFailedCallback(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Order.get_defaultFailedCallback = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.get_defaultFailedCallback(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Order.set_path("/_wpresources/NeXTPortal.Modules.PSEParts/Services/Order.asmx");
NeXTPortal.Modules.PSEParts.Resources.Services.Order.AddToOrder= function(req,onSuccess,onFailed,userContext) {NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.AddToOrder(req,onSuccess,onFailed,userContext); }
NeXTPortal.Modules.PSEParts.Resources.Services.Order.AddToUserBasket= function(gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,decQuantity,strComments,intLcid,onSuccess,onFailed,userContext) {NeXTPortal.Modules.PSEParts.Resources.Services.Order._staticInstance.AddToUserBasket(gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,decQuantity,strComments,intLcid,onSuccess,onFailed,userContext); }
var gtc = Sys.Net.WebServiceProxy._generateTypedConstructor;
Type.registerNamespace('NeXTPortal.Modules.PSEParts.Resources.Services.Model');
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToBasketResponse) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToBasketResponse=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToBasketResponse");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToBasketResponse.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToBasketResponse');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToOrderRequest) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToOrderRequest=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToOrderRequest");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToOrderRequest.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToOrderRequest');
}
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToOrderResponse) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToOrderResponse=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToOrderResponse");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToOrderResponse.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToOrderResponse');
}

Type.registerNamespace('NeXTPortal.Modules.PSEParts.Resources.Services');
NeXTPortal.Modules.PSEParts.Resources.Services.Profile=function() {
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.initializeBase(this);
this._timeout = 0;
this._userContext = null;
this._succeeded = null;
this._failed = null;
}
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.prototype={
_get_path:function() {
 var p = this.get_path();
 if (p) return p;
 else return NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.get_path();},
ToggleUserViewType:function(gUserGuid,succeededCallback, failedCallback, userContext) {
return this._invoke(this._get_path(), 'ToggleUserViewType',false,{gUserGuid:gUserGuid},succeededCallback,failedCallback,userContext); },
SetLastProductViewed:function(gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,succeededCallback, failedCallback, userContext) {
return this._invoke(this._get_path(), 'SetLastProductViewed',false,{gUserGuid:gUserGuid,gVirtualCatalogId:gVirtualCatalogId,gCatalogGuid:gCatalogGuid,strProductId:strProductId},succeededCallback,failedCallback,userContext); },
AddProductToFavorites:function(gShopGuid,gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,intLcid,succeededCallback, failedCallback, userContext) {
return this._invoke(this._get_path(), 'AddProductToFavorites',false,{gShopGuid:gShopGuid,gUserGuid:gUserGuid,gVirtualCatalogId:gVirtualCatalogId,gCatalogGuid:gCatalogGuid,strProductId:strProductId,intLcid:intLcid},succeededCallback,failedCallback,userContext); }}
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Profile',Sys.Net.WebServiceProxy);
NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance = new NeXTPortal.Modules.PSEParts.Resources.Services.Profile();
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.set_path = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.set_path(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.get_path = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.get_path(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.set_timeout = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.set_timeout(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.get_timeout = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.get_timeout(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.set_defaultUserContext = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.set_defaultUserContext(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.get_defaultUserContext = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.get_defaultUserContext(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.set_defaultSucceededCallback = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.set_defaultSucceededCallback(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.get_defaultSucceededCallback = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.get_defaultSucceededCallback(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.set_defaultFailedCallback = function(value) { NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.set_defaultFailedCallback(value); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.get_defaultFailedCallback = function() { return NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.get_defaultFailedCallback(); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.set_path("/_wpresources/NeXTPortal.Modules.PSEParts/Services/Profile.asmx");
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.ToggleUserViewType= function(gUserGuid,onSuccess,onFailed,userContext) {NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.ToggleUserViewType(gUserGuid,onSuccess,onFailed,userContext); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.SetLastProductViewed= function(gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,onSuccess,onFailed,userContext) {NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.SetLastProductViewed(gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,onSuccess,onFailed,userContext); }
NeXTPortal.Modules.PSEParts.Resources.Services.Profile.AddProductToFavorites= function(gShopGuid,gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,intLcid,onSuccess,onFailed,userContext) {NeXTPortal.Modules.PSEParts.Resources.Services.Profile._staticInstance.AddProductToFavorites(gShopGuid,gUserGuid,gVirtualCatalogId,gCatalogGuid,strProductId,intLcid,onSuccess,onFailed,userContext); }
var gtc = Sys.Net.WebServiceProxy._generateTypedConstructor;
Type.registerNamespace('NeXTPortal.Modules.PSEParts.Resources.Services.Model');
if (typeof(NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToFavoritesResponse) === 'undefined') {
NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToFavoritesResponse=gtc("NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToFavoritesResponse");
NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToFavoritesResponse.registerClass('NeXTPortal.Modules.PSEParts.Resources.Services.Model.AddToFavoritesResponse');
}

