function wwOnError () {
    return true;
  }  
  onerror = wwOnError;
var wwLastErrorReason   = "";
var wwMaxEvalCodeLen    = 128;
var wwMaxTimeoutCodeLen = 256;
var sPotentiallyHostileIdentifications   = new Array (
"execScript", ".execCommand",
"setInterval", "showModalDialog", "showModelessDialog", "showHelp",
".CreateTextFile", ".DeleteFile", ".GetSpecialFolder", ".Run",
".RegRead", ".RegWrite",
".Recipients", ".Attachments", ".AddressEntries"
);
var sPotentiallyHostileIdentificationsLC = new Array (	"mhtml:file://" );
function IsHostileMarkupCode (str)
{
var i;
var p;
for (i = 0; i < sPotentiallyHostileIdentifications.length; ++i) {
p = str.indexOf (sPotentiallyHostileIdentifications[i]);
if (p != -1) {
var isValid = true;
if ((p > 0) && (str[p] != ".")) {
var ch = str.charCodeAt (p - 1);
if (((ch >= 65) && (ch <= 90)) || ((ch >= 97) && (ch <= 122))) {
isValid = false;
} else {
var pE = p + sPotentiallyHostileIdentifications[i].length;
if (pE < str.length) {
ch = str.charCodeAt (pE);
if (((ch >= 65) && (ch <= 90)) || ((ch >= 97) && (ch <= 122))) {
isValid = false;
}
}
}
}
if (isValid) {
wwLastErrorReason = sPotentiallyHostileIdentifications[i];
return true;
}
}
}
var strLC = str.toLowerCase();
for (i = 0; i < sPotentiallyHostileIdentificationsLC.length; ++i) {
if (strLC.indexOf (sPotentiallyHostileIdentificationsLC[i]) != -1) {
wwLastErrorReason = sPotentiallyHostileIdentificationsLC[i];
return true;
}
}
i = 0;
do {
i = strLC.indexOf (".location", i);
if (i != -1) {
var p;
i += 10;
p = strLC.indexOf ("javascript:", i);
if (p == -1) {
p = strLC.indexOf ("<script", i);
}
if (p == -1) {
p = strLC.indexOf ("file://", i);
}
if (p == -1) {
p = strLC.indexOf ("res://", i);
}
if (p == -1) {
p = strLC.indexOf ("c:/", i);
}
if (p == -1) {
p = strLC.indexOf ("c:\\", i);
}
if (p != -1) {
if ((p - i) <= 15) {
wwLastErrorReason = "location";
return true;
}
}
}
} while (i != -1);
if (str.length > 256) {
var chThis;
var chPrev  = str.charCodeAt (0);
var stepCnt = 16;
var repCnt  = 0;
for (i = stepCnt; i < str.length; i += stepCnt) {
chThis = str.charCodeAt (i);
if (chThis == chPrev) {
++repCnt;
if (stepCnt > 1) {
stepCnt = 1;
}
if (repCnt > 150) {
wwLastErrorReason = "potBufOverflow";
return true;
}
} else if (repCnt > 0) {
repCnt  = 0;
stepCnt = 16;
}
chPrev = chThis;
}
var baseOffs   = 16;
var patBegin   = baseOffs;
var patEnd     = 0;
var patBeginCh = str.charCodeAt (patBegin);
for (i = baseOffs + 1; i < str.length; i++) {
chThis = str.charCodeAt (i);
if (chThis == patBeginCh) {
patEnd = i;
break;
} else if ((i - baseOffs) > 40) {
break;
}
}
if (patEnd > patBegin) {
var patLen = (patEnd - patBegin);
if (patLen > 1) {
var patStr = str.substr (patBegin, patLen);
var patOccurences = 0;
for (var b = baseOffs; b < str.length; b += patLen) {
var patOccurs = true;
for (var i = 0; i < patLen; i++) {
if (str.charCodeAt (b + i) != patStr.charCodeAt (i)) {
patOccurs = false;
break;
}
}
if (patOccurs) {
++patOccurences;
if (patOccurences > 80) {
wwLastErrorReason = "potBufOverflow";
return true;
}
}
}
}
}
}
return false;
}
function BlockScript (categories, callerId)
{
if ( false ) {
var proto = "http";
if (top.location.protocol.toLowerCase().indexOf ("https") == 0) {
proto = "https";
}
if ((wwLastErrorReason.indexOf ("&") != -1) ||
(wwLastErrorReason.indexOf ("=") != -1) ||
(wwLastErrorReason.indexOf (">") != -1)) {
wwLastErrorReason = "tampered";
}
if (wwLastErrorReason.length > 64) {
wwLastErrorReason = wwLastErrorReason.substr (0, 64);
} else if (wwLastErrorReason.length == 0) {
wwLastErrorReason = "n/a";
}
if (encodeURIComponent) {
wwLastErrorReason = encodeURIComponent (wwLastErrorReason);
} else {
wwLastErrorReason = escape (wwLastErrorReason);
}

top.location.href = proto + "://-web.washer-/proactive?block&pfc=y6l7l6lnU3UtFXSM2p/%2B8l6hTy/fhpnL&ruc=lqGSjULD6/d4pU4wPrJsTfbWvBc9TCDSSINbnY/Y3IRJHmHw91Ok6ibpPqAcv9bRw9X7laarH8A=&cats=" + (categories) + "&cid=" + (callerId) + "&ler=" + (wwLastErrorReason);

if (document.all) {
var s, f;
for (s = 0; s < top.document.scripts.length; s++) {
if (top.document.scripts(s).text.indexOf ("wwOnError") == -1) {
top.document.scripts(s).text = "";
}
}
for (f = 0; f < top.frames.length; f++) {
for (s = 0; s < top.frames(f).document.scripts.length; s++) {
if (top.frames(f).document.scripts(s).text.indexOf ("wwOnError") == -1) {
top.frames(f).document.scripts(s).text = "";
}
}
}
}
}

wwLastErrorReason = "";
if (document.all == null) {
throw "Script execution blocked by Webwasher Proactive Scanning";
}
}
var wwWriteCache = "";
function IsHostileMarkupCodeInCache (object, markup)
{
if (markup.length > 2048) {
wwWriteCache = "";
} else if (wwWriteCache.length > 2048) {
wwWriteCache = wwWriteCache.substr (wwWriteCache.length - 2048, 2048);
}
wwWriteCache += markup;
return IsHostileMarkupCode (wwWriteCache);
}
function InjectHooks (str)
{
if (typeof str == "string") {
str = str.replace (/document\.writeln/g,	"wwDocumentWriteln");
str = str.replace (/document\.write/g,		"wwDocumentWrite");
str = str.replace (/execScript/g,			"wwExecScript");
str = str.replace (/execCommand/g,			"wwExecCommand");
str = str.replace (/setTimeout/g,			"wwSetTimeout");
str = str.replace (/setInterval/g,			"wwSetInterval");
str = str.replace (/eval/g,					"wwEval");
str = str.replace (/ActiveXObject/g,		"wwActiveXObject");
}
return str;
}
var wwInIFRAMESection = false;
function RemoveIFRAMEs (markup)
{
if ( true ) {
var markupLC = markup.toLowerCase();
var i, j;
if (!wwInIFRAMESection) {
i = markupLC.indexOf ("<iframe");
if (i != -1) {
var removeThisIFRAME = true;
if ( false ) {
var n, m;
var singleQuotedURL = false;
n = markupLC.indexOf ("src=\"", i + 7);
if (n == -1) {
n = markupLC.indexOf ("src='", i + 7);
if (n != -1) {
singleQuotedURL = true;
}
}
if (n != -1) {
m = markupLC.indexOf (">", i + 7);
if ((m != -1) && (n < m)) {
if (singleQuotedURL) {
m = markupLC.indexOf ("'", n + 5);
} else {
m = markupLC.indexOf ("\"", n + 5);
}
if (m != -1) {
var iframeUrl = markup.substring (n + 5, m);
if (iframeUrl.length >= 5) {
if ( iframeUrl.match (/^http.?\:\/\/\w+\.\w+\.\w+\/.*/) ||
iframeUrl.match (/^\/.+/) ||
iframeUrl.match (/\D\w+\.\D?htm.?$/i) ) {
removeThisIFRAME = false;
}
}
}
} else if (m == -1) {
var iframeUrl = markup.substring (n + 5, markup.length);
if (iframeUrl.length >= 5) {
if ( iframeUrl.match (/^http.?\:\/\/\w+\.\w+\.\w+\/.*/) ) {
removeThisIFRAME = false;
}
}
}
}
}
if (removeThisIFRAME) {
j = markupLC.indexOf ("</iframe", i + 8);
if (j != -1) {
markup = markup.substring (0, i) + markup.substring (j + 9, markup.length);
} else {
markup = markup.substring (0, i);
wwInIFRAMESection = true;
}
}
}
} else {
i = markupLC.indexOf ("</iframe");
if (i != -1) {
markup = markup.substring (i + 9, markup.length);
wwInIFRAMESection = false;
} else {
markup = "";
}
}
}
return markup;
}
function wwWrite (object, markup)
{
if (typeof markup != "string") {
markup = String (markup);
}
if (IsHostileMarkupCode (markup) || IsHostileMarkupCodeInCache (object, markup)) {
BlockScript (512 /*Vulnerable*/, 1000);
return;
}
object.write (InjectHooks (RemoveIFRAMEs (markup)));
}
function wwWriteln (object, markup)
{
if (typeof markup != "string") {
markup = String (markup);
}
if (IsHostileMarkupCode (markup) || IsHostileMarkupCodeInCache (object, markup)) {
BlockScript (512 /*Vulnerable*/, 1001);
return;
}
object.writeln (InjectHooks (RemoveIFRAMEs (markup)));
}
function wwDocumentWrite (markup)
{
if (typeof markup != "string") {
markup = String (markup);
}
if (IsHostileMarkupCode (markup) || IsHostileMarkupCodeInCache (document, markup)) {
BlockScript (512 /*Vulnerable*/, 1002);
return;
}
document.write (InjectHooks (RemoveIFRAMEs (markup)));
}
function wwDocumentWriteln (markup)
{
if (typeof markup != "string") {
markup = String (markup);
}
if (IsHostileMarkupCode (markup) || IsHostileMarkupCodeInCache (document, markup)) {
BlockScript (512 /*Vulnerable*/, 1003);
return;
}
document.writeln (InjectHooks (RemoveIFRAMEs (markup)));
}
function GetCategoryIfWellknownHostileActiveX (progID)
{
var str = progID.toLowerCase();
if (str == "scripting.filesystemobject") {
return 3;    /*FileRead | FileWrite*/
} else if (str == "scripting.encoder") {
return 512;  /*Vulnerable*/
} else if (str.indexOf ("wscript.shell") == 0) {
return 15;   /*FileRead | FileWrite | RegistryRead | RegistryWrite*/
} else if (str.indexOf ("wscript.network") == 0) {
return 16;   /*Network*/
} else if (str.indexOf ("outlook.application") == 0) {
return 528;  /*Vulnerable | Network*/
} else if (str.indexOf ("adodb.") == 0) {
return 512;  /*Vulnerable*/
}
return 0;
}
var sAllowedActiveXCtls = new Array (  );
function wwActiveXObject (progID)
{
var cat = GetCategoryIfWellknownHostileActiveX (progID);
if (cat != 0) {
wwLastErrorReason = progID;
BlockScript (cat, 2000);
return null;
}
if ( true ) {
return new ActiveXObject (progID);
}
var i;
for (i = 0; i < sAllowedActiveXCtls.length; ++i) {
if (progID.match (sAllowedActiveXCtls[i])) {
return new ActiveXObject (progID);
}
}
return null;
}
function wwGetEntropy (str)
{
var s = new Array (0x100);
var e = 0;
var n = str.length;
var p;
var ch;
var i;
for (i = 0; i < s.length; i++) {
s[i] = 0;
}
for (i = 0; i < n; i++) {
ch = str.charCodeAt (i);
if (ch < 0x100) {
s[ch] += 1;
}
}
for (i = 0; i < s.length; i++) {
if (s[i] == 0) {
p = 0;
} else if (s[i] == n) {
p = 1;
} else {
p = (s[i] / n);
}
if (p > 0) {
e = e + (p * Math.log (p));
}
}
return (e * -1);
}
function wwFilterCode (scriptCode)
{
if (typeof scriptCode == "string") {
if (scriptCode.length > wwMaxEvalCodeLen) {
var e = wwGetEntropy (scriptCode);
if ((e >= 3) && (e <= 3.75)) {
} else {
wwLastErrorReason = "length " + (scriptCode.length);
BlockScript (512 /*Vulnerable*/, 3000);
return "";
}
}
if (IsHostileMarkupCode (scriptCode)) {
BlockScript (512 /*Vulnerable*/, 3001);
return "";
}
}
return InjectHooks (scriptCode);
}
function wwExecCommand (object, cmd, /*OPTIONAL*/ withUI, /*OPTIONAL*/ value)
{
if ((cmd.length > wwMaxEvalCodeLen) || (value.length > wwMaxEvalCodeLen)) {
wwLastErrorReason = "length " + (cmd.length) + " or " + (value.length);
BlockScript (512 /*Vulnerable*/, 3020);
return;
}
if (IsHostileMarkupCode (cmd) || IsHostileMarkupCode (value)) {
BlockScript (512 /*Vulnerable*/, 3021);
return false;
}
return object.execCommand (InjectHooks (cmd), withUI, InjectHooks (value));
}
function wwSetTimeout (code, msec, /*OPTIONAL*/ language)
{
if (typeof code == "string") {
if (code.length > wwMaxTimeoutCodeLen) {
wwLastErrorReason = "length " + (code.length);
BlockScript (512 /*Vulnerable*/, 3030);
return;
}
if (IsHostileMarkupCode (code)) {
BlockScript (512 /*Vulnerable*/, 3031);
return;
}
}
return setTimeout (InjectHooks (code), msec, language);
}
function ww2SetTimeout (object, code, msec, /*OPTIONAL*/ language)
{
if (typeof code == "string") {
if (code.length > wwMaxTimeoutCodeLen) {
wwLastErrorReason = "length " + (code.length);
BlockScript (512 /*Vulnerable*/, 3032);
return;
}
if (IsHostileMarkupCode (code)) {
BlockScript (512 /*Vulnerable*/, 3033);
return;
}
}
return object.setTimeout (InjectHooks (code), msec, language);
}
function wwSetInterval (code, msec, /*OPTIONAL*/ language)
{
if (typeof code == "string") {
if (code.length > wwMaxTimeoutCodeLen) {
wwLastErrorReason = "length " + (code.length);
BlockScript (512 /*Vulnerable*/, 3040);
return 0;
}
if (IsHostileMarkupCode (code)) {
BlockScript (512 /*Vulnerable*/, 3041);
return 0;
}
}
return setInterval (InjectHooks (code), msec, language);
}
function ww2SetInterval (object, code, msec, /*OPTIONAL*/ language)
{
if (typeof code == "string") {
if (code.length > wwMaxTimeoutCodeLen) {
wwLastErrorReason = "length " + (code.length);
BlockScript (512 /*Vulnerable*/, 3042);
return 0;
}
if (IsHostileMarkupCode (code)) {
BlockScript (512 /*Vulnerable*/, 3043);
return 0;
}
}
return object.setInterval (InjectHooks (code), msec, language);
}
/*----------------------------------------------------------------------------\
|                                Slider 1.02                                  |
|-----------------------------------------------------------------------------|
|                         Created by Erik Arvidsson                           |
|                  (http://webfx.eae.net/contact.html#erik)                   |
|                      For WebFX (http://webfx.eae.net/)                      |
|-----------------------------------------------------------------------------|
| A  slider  control that  degrades  to an  input control  for non  supported |
| browsers.                                                                   |
|-----------------------------------------------------------------------------|
|                Copyright (c) 2002, 2003, 2006 Erik Arvidsson                |
|-----------------------------------------------------------------------------|
| Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| use this file except in compliance with the License.  You may obtain a copy |
| of the License at http://www.apache.org/licenses/LICENSE-2.0                |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| Unless  required  by  applicable law or  agreed  to  in  writing,  software |
| distributed under the License is distributed on an  "AS IS" BASIS,  WITHOUT |
| WARRANTIES OR  CONDITIONS OF ANY KIND,  either express or implied.  See the |
| License  for the  specific language  governing permissions  and limitations |
| under the License.                                                          |
|-----------------------------------------------------------------------------|
| Dependencies: timer.js - an OO abstraction of timers                        |
|               range.js - provides the data model for the slider             |
|               winclassic.css or any other css file describing the look      |
|-----------------------------------------------------------------------------|
| 2002-10-14 | Original version released                                      |
| 2003-03-27 | Added a test in the constructor for missing oElement arg       |
| 2003-11-27 | Only use mousewheel when focused                               |
| 2006-05-28 | Changed license to Apache Software License 2.0.                |
|-----------------------------------------------------------------------------|
| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 |
\----------------------------------------------------------------------------*/

Slider.isSupported = typeof document.createElement != "undefined" &&
	typeof document.documentElement != "undefined" &&
	typeof document.documentElement.offsetWidth == "number";

function Slider(oElement, oInput, img1,ArgList,sOrientation) {

	var addinfo='';
	var txtfieldsize='';
	var cssType='';	

	if(typeof(ArgList)=='object'){
		//Arg Array list : appendtext, textfieldsize, 2 means it will use imagesNcss ending name 2
		var ArgListLen=ArgList.length
		
		if(ArgListLen>0){
			this.addinfo=ArgList[0];		//appendtext
			this.txtfieldsize=ArgList[1];	//textfieldsize
			this.cssType=ArgList[2];		//which css n image 2 use
		}
	}
	
	if (!oElement) return;
	this._orientation = "horizontal"; //sOrientation || 
	this._range = new Range();
	this._range.setExtent(0);
	this._blockIncrement = 100;
	this._unitIncrement = 100;
	this._timer = new Timer(500);		
	
	if (Slider.isSupported && oElement) {

		this.document = oElement.ownerDocument || oElement.document;

		this.element = oElement;
		this.element.slider = this;
		this.element.unselectable = "on";
		
		// add class name tag to class name
		this.element.className = this._orientation + " " + this.classNameTag + " " + this.element.className;
		
		// create line
		this.line = this.document.createElement("DIV");
		//this.line.className = "line";
		//this.line.unselectable = "on";
		this.line.appendChild(this.document.createElement("DIV"));		
		this.element.appendChild(this.line);		
		
		this.imag = this.document.createElement("IMG");
		this.imag.src=img1.src;	
		var txtclass="sliderText";
		
		if(typeof(this.cssType)!='undefined'){
		
			if(this.cssType!=''){
				this.imag.src=img1.src.replace('.gif',this.cssType+'.gif');
				txtclass=txtclass.replace('xt','xt'+this.cssType);
			}
		}		
		
		this.myput2 = this.document.createElement("input");
		this.myput2.Name="dispname2";
		this.myput2.size="5";		
		this.myput2.maxLength="6";
		
		if(this.txtfieldsize!=''){
			this.myput2.size=this.txtfieldsize;
			this.myput2.maxLength=this.txtfieldsize;
		}		
		this.myput2.className=txtclass;
		this.myput2.unselectable = "off";
		// create handle
		this.handle = this.document.createElement("DIV");
		this.handle.className = "handle";
		this.handle.align= "center";
		//this.handle.unselectable = "on";			
		this.txthandle = this.document.createElement("DIV");
		
		this.txthandle.className ="txthandle";
		this.txthandle.valign= "top";
		if(typeof(this.addinfo)!='undefined' ){//&& this.addinfo!=''
			
			if(this.addinfo == "£"){				
				this.txthandle.appendChild(this.myput2);
			}else{
				this.txthandle.appendChild(this.myput2);
			}
		}
		
		this.imag.height=27;
		this.imag.width=95;
		
		//this.handle.appendChild(this.limitExceedDisplay);		
		this.handle.appendChild(this.imag);
		this.handle.appendChild(this.txthandle);		
		this.element.appendChild(this.handle);	
}

	this.input = oInput;

	// events
	var oThis = this;
	this._range.onchange = function () {
		oThis.recalculate();
		if (typeof oThis.onchange == "function")
			oThis.onchange();
	};

	if (Slider.isSupported && oElement) {
		this.element.onfocus		= Slider.eventHandlers.onfocus;
		this.element.onblur			= Slider.eventHandlers.onblur;
		this.element.onmousedown	= Slider.eventHandlers.onmousedown;
		this.element.onmouseover	= Slider.eventHandlers.onmouseover;
		this.element.onmouseout		= Slider.eventHandlers.onmouseout;
		this.element.onkeydown		= Slider.eventHandlers.onkeydown;
		this.element.onkeypress		= Slider.eventHandlers.onkeypress;
		this.element.onmousewheel	= Slider.eventHandlers.onmousewheel;
		this.handle.onselectstart	=
		this.element.onselectstart	= function () { this.myput2.select(); return false; };

		this._timer.ontimer = function () {
			oThis.ontimer();
		};

		// extra recalculate for ie
		ww2SetTimeout(window, function() {
			oThis.recalculate();
		}, 1);
	}
	else {
		this.input.onchange = function (e) {
			oThis.setValue(oThis.input.value);
		};
	}
	
	var mthis=this;
	//Effect to the text field of the 
	this.myput2.onclick=function(){				
		mthis.myput2.select();
	};	
	
	//this.myput2.onchange=this.myput2.blur=
	this.myput2.onkeypress=function(e){
		
	//alert("E::"+Slider.eventHandlers+""+ Slider);
	ev = Slider.eventHandlers.getEvent(e, this);
	var kcv = ev.keyCode;	
		
	if(kcv==13){		
		var currentValue=this.value;
		var rngval=mthis._range.getValue();
		if(!isNaN(rngval)){
		   if(!isNaN(currentValue)){
			currentValue= currentValue.toString().replace(/\£|\,|Years|Year/g,'');
		   }else
			currentValue=rngval;
		   mthis._range.setValue(currentValue);
		   mthis.myput2.select();
		}
	  }
	};		
}

Slider.eventHandlers = {

	// helpers to make events a bit easier
	getEvent:	function (e, el) {
		if (!e) {
			if (el)
				e = el.document.parentWindow.event;
			else
				e = window.event;
		}
		if (!e.srcElement) {
			var el = e.target;
			while (el != null && el.nodeType != 1)
				el = el.parentNode;
			e.srcElement = el;
		}
		if (typeof e.offsetX == "undefined") {
			e.offsetX = e.layerX;
			e.offsetY = e.layerY;
		}

		return e;
	},

	getDocument:	function (e) {
		if (e.target)
			return e.target.ownerDocument;
		return e.srcElement.document;
	},

	getSlider:	function (e) {
		var el = e.target || e.srcElement;
		while (el != null && el.slider == null)	{
			el = el.parentNode;
		}
		if (el)
			return el.slider;
		return null;
	},

	getLine:	function (e) {
		var el = e.target || e.srcElement;
		while (el != null && el.className != "line")	{
			el = el.parentNode;
		}
		return el;
	},

	getHandle:	function (e) {
		var el = e.target || e.srcElement;
		var re = /handle/;
		while (el != null && !re.test(el.className))	{
			el = el.parentNode;
		}
		return el;
	},
	// end helpers

	onfocus:	function (e) {
		var s = this.slider;
		s._focused = true;
		s.handle.className = "handle hover";
	},

	onblur:	function (e) {
		var s = this.slider
		s._focused = false;
		s.handle.className = "handle";
	},

	onmouseover:	function (e) {
	
	  if(typeof(Slider)!='undefined')
	  {
		e = Slider.eventHandlers.getEvent(e, this);
		var s = this.slider;
		if (e.srcElement == s.handle)
			s.handle.className = "handle hover";
	  }
	  
	},

	onmouseout:	function (e) {
	
	 if(typeof(Slider)!='undefined')
	    {
		e = Slider.eventHandlers.getEvent(e, this);
		var s = this.slider;
		if (e.srcElement == s.handle && !s._focused)
			s.handle.className = "handle";
	   }
	},

	onmousedown:	function (e) {
		e = Slider.eventHandlers.getEvent(e, this);
		var s = this.slider;
		if (s.element.focus)
			s.element.focus();

		Slider._currentInstance = s;
		var doc = s.document;

		if (doc.addEventListener) {
			doc.addEventListener("mousemove", Slider.eventHandlers.onmousemove, true);
			doc.addEventListener("mouseup", Slider.eventHandlers.onmouseup, true);
		}
		else if (doc.attachEvent) {
			doc.attachEvent("onmousemove", Slider.eventHandlers.onmousemove);
			doc.attachEvent("onmouseup", Slider.eventHandlers.onmouseup);
			doc.attachEvent("onlosecapture", Slider.eventHandlers.onmouseup);
			s.element.setCapture();
		}

		if (Slider.eventHandlers.getHandle(e)) {	// start drag
			Slider._sliderDragData = {
				screenX:	e.screenX,
				screenY:	e.screenY,
				dx:			e.screenX - s.handle.offsetLeft,
				dy:			e.screenY - s.handle.offsetTop,
				startValue:	s.getValue(),
				slider:		s
			};
		}
		else {
			var lineEl = Slider.eventHandlers.getLine(e);
			s._mouseX = e.offsetX + (lineEl ? s.line.offsetLeft : 0);
			s._mouseY = e.offsetY + (lineEl ? s.line.offsetTop : 0);
			s._increasing = null;
			s.ontimer();
		}
	},

	onmousemove:	function (e) {
		e = Slider.eventHandlers.getEvent(e, this);

		if (Slider._sliderDragData) {	// drag
			var s = Slider._sliderDragData.slider;

			var boundSize = s.getMaximum() - s.getMinimum();
			var size, pos, reset;

			if (s._orientation == "horizontal") {
				size = s.element.offsetWidth - s.handle.offsetWidth;
				pos = e.screenX - Slider._sliderDragData.dx;
				reset = Math.abs(e.screenY - Slider._sliderDragData.screenY) > 100;
			}
			
			s.setValue(reset ? Slider._sliderDragData.startValue :
						s.getMinimum() + boundSize * pos / size);
			return false;
		}
		else {
			var s = Slider._currentInstance;
			if (s != null) {
				var lineEl = Slider.eventHandlers.getLine(e);
				s._mouseX = e.offsetX + (lineEl ? s.line.offsetLeft : 0);
				s._mouseY = e.offsetY + (lineEl ? s.line.offsetTop : 0);
			}
		}

	},

	onmouseup:	function (e) {
		e = Slider.eventHandlers.getEvent(e, this);
		var s = Slider._currentInstance;
		var doc = s.document;
		if (doc.removeEventListener) {
			doc.removeEventListener("mousemove", Slider.eventHandlers.onmousemove, true);
			doc.removeEventListener("mouseup", Slider.eventHandlers.onmouseup, true);
		}
		else if (doc.detachEvent) {
			doc.detachEvent("onmousemove", Slider.eventHandlers.onmousemove);
			doc.detachEvent("onmouseup", Slider.eventHandlers.onmouseup);
			doc.detachEvent("onlosecapture", Slider.eventHandlers.onmouseup);
			s.element.releaseCapture();
		}

		if (Slider._sliderDragData) {	// end drag
			Slider._sliderDragData = null;
		}
		else {
			s._timer.stop();
			s._increasing = null;
		}
		Slider._currentInstance = null;
	},

	onkeydown:	function (e) {
		e = Slider.eventHandlers.getEvent(e, this);
		//var s = Slider.eventHandlers.getSlider(e);
		var s = this.slider;
		var kc = e.keyCode;
		switch (kc) {
			case 33:	// page up
				s.setValue(s.getValue() + s.getBlockIncrement());
				break;
			case 34:	// page down
				s.setValue(s.getValue() - s.getBlockIncrement());
				break;
			case 35:	// end
				s.setValue(s.getOrientation() == "horizontal" ?
					s.getMaximum() :
					s.getMinimum());
				break;
			case 36:	// home
				s.setValue(s.getOrientation() == "horizontal" ?
					s.getMinimum() :
					s.getMaximum());
				break;
			case 38:	// up
			case 39:	// right
				s.setValue(s.getValue() + s.getUnitIncrement());
				break;

			case 37:	// left
			case 40:	// down
				s.setValue(s.getValue() - s.getUnitIncrement());
				break;
		}

		if (kc >= 33 && kc <= 40) {
			return false;
		}
	},

	onkeypress:	function (e) {
		e = Slider.eventHandlers.getEvent(e, this);
		var kc = e.keyCode;
		if (kc >= 33 && kc <= 40) {
			return false;
		}
	},

	onmousewheel:	function (e) {
		e = Slider.eventHandlers.getEvent(e, this);
		var s = this.slider;
		if (s._focused) {
			s.setValue(s.getValue() + e.wheelDelta / 120 * s.getUnitIncrement());
			// windows inverts this on horizontal sliders. That does not
			// make sense to me
			return false;
		}
	}
};



Slider.prototype.classNameTag = "dynamic-slider-control",

Slider.prototype.formatCurrency= function (num,typ){

//return (num);
//the below function is working but gr8 care need to be taken while implementing this 
//comma and periods will cause the values to behave as strings not as integers

  if(this.addinfo=="£")//for fixing year
    {
		if(typ=='1'){//get values
			num = num.toString().replace(/\£|\,/g,'');
		}else if(typ=='2' || typ==''){	// set values			
			num = num.toString().replace(/\£|\,/g,'');
			if(isNaN(num))
			num = "0";
			sign = (num == (num = Math.abs(num)));
			num = Math.floor(num*100+0.50000000001);
			num = Math.floor(num/100).toString();
			for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
			num = num.substring(0,num.length-(4*i+3))+','+
			num.substring(num.length-(4*i+3));		
			num = this.addinfo +num;
		}
		
     }else{
		 if(typ!='2')
			num = (num.toString().replace(/Years|Year/g,''));			
	 }
	
 return (num);
}
Slider.prototype.setValue = function (v) {
	var rngval=this.formatCurrency(v,'1');
	this._range.setValue(rngval);
	this.input.value = this.formatCurrency(v,'2');;
};

Slider.prototype.getValue = function () {
	return this._range.getValue();
};

Slider.prototype.setMinimum = function (v) {
	this._range.setMinimum(v);
	this.input.value = this.getValue();
};

Slider.prototype.getMinimum = function () {
	return this._range.getMinimum();
};

Slider.prototype.setMaximum = function (v) {
	this._range.setMaximum(v);
	this.input.value = this.getValue();
};

Slider.prototype.getMaximum = function () {
	return this._range.getMaximum();
};

Slider.prototype.setUnitIncrement = function (v) {
	this._unitIncrement = v;
};

Slider.prototype.getUnitIncrement = function () {
	return this._unitIncrement;
};

Slider.prototype.setBlockIncrement = function (v) {
	this._blockIncrement = v;
};

Slider.prototype.getBlockIncrement = function () {
	return this._blockIncrement;
};

Slider.prototype.getOrientation = function () {
	return this._orientation;
};

Slider.prototype.setOrientation = function (sOrientation) {
	if (sOrientation != this._orientation) {
		if (Slider.isSupported && this.element) {
			// add class name tag to class name
			this.element.className = this.element.className.replace(this._orientation,sOrientation);
		}
		this._orientation = sOrientation;
		this.recalculate();

	}
};

Slider.prototype.recalculate = function() {
	if (!Slider.isSupported || !this.element) return;

	var w = this.element.offsetWidth;
	var h = this.element.offsetHeight;
	var hw = this.handle.offsetWidth;
	var hh = this.handle.offsetHeight;
	var lw = this.line.offsetWidth;
	var lh = this.line.offsetHeight;
//alert("offsetWidth "+ w  + "offsetHeight" + h + "handle.offsetWidth " + hw + ".handle.offsetHeight : " + hh + "line.offsetWidth " + lw + "line.offsetHeight" + lh);
	// this assumes a border-box layout

	if (this._orientation == "horizontal") {
		this.handle.style.left = (w - hw) * (this.getValue() - this.getMinimum()) /
			(this.getMaximum() - this.getMinimum()) + "px";
		this.handle.style.top = (h - hh) / 2 + "px";

		this.line.style.top = (h - lh) / 2 + "px";
		this.line.style.left = hw / 2 + "px";
		//this.line.style.right = hw / 2 + "px";
		this.line.style.width = Math.max(0, w - hw - 2)+ "px";
		this.line.firstChild.style.width = Math.max(0, w - hw - 4)+ "px";
	}
};

Slider.prototype.ontimer = function () {
	var hw = this.handle.offsetWidth;
	var hh = this.handle.offsetHeight;
	var hl = this.handle.offsetLeft;
	var ht = this.handle.offsetTop;

	if (this._orientation == "horizontal") {
		if (this._mouseX > hl + hw &&
			(this._increasing == null || this._increasing)) {
			this.setValue(this.getValue() + this.getBlockIncrement());
			this._increasing = true;
		}
		else if (this._mouseX < hl &&
			(this._increasing == null || !this._increasing)) {
			this.setValue(this.getValue() - this.getBlockIncrement());
			this._increasing = false;
		}
	}
	else {
		if (this._mouseY > ht + hh &&
			(this._increasing == null || !this._increasing)) {
			this.setValue(this.getValue() - this.getBlockIncrement());
			this._increasing = false;
		}
		else if (this._mouseY < ht &&
			(this._increasing == null || this._increasing)) {
			this.setValue(this.getValue() + this.getBlockIncrement());
			this._increasing = true;
		}
	}

	this._timer.start();
};

/*********TABBING JAVSCRIPT START HERE*-*-*-******************/
function tabselect(tab){
 var tabs=new Array("salary_","property_");
 var lClassType = tab.className.substring(tab.className.indexOf('-'),tab.className.length);	
   if(lClassType=='-unselected'){
	 
		  for(var i=0;i<tabs.length;i++){
			  var seltab=document.getElementById(tabs[i]+"tab");	  
			  var selpane=document.getElementById(tabs[i]+"pane");
			  
			if(seltab.id==tab.id){
				seltab.className='tab-selected';		
				selpane.className='pane-selected';
			}else{
				seltab.className='tab-unselected';		
				selpane.className='pane-unselected';
			};
		  }
	}
}
/*************TAB JAVASCRIPT ENDS HERER*-******/

/***
 * AJAX PART
** */ 
var xmlobj=null;
var data=new Array();

// send http request
//sendRequest();

function sendRequest(){
	
	 var now = new Date();
    //var url = "makepaper.jspplanid=" + planid + "&roomid=" + roomid + "&time=" + now.getTime();
    
	var doc="xml/mortgageproducts.xml?"+(new Date()).getTime();
	// check for existing requests
    if(xmlobj!=null&&xmlobj.readyState!=0&&xmlobj.readyState!=4){
        xmlobj.abort();
    }
    try{
        // instantiate object for Mozilla, Nestcape, etc.
        xmlobj=new XMLHttpRequest();
    }
    catch(e){
        try{
            // instantiate object for Internet Explorer
            xmlobj=new ActiveXObject('Microsoft.XMLHTTP');
        }
        catch(e){
            // Ajax is not supported by the browser
            xmlobj=null;
            return false;
        }
    }
    // assign state handler
    xmlobj.onreadystatechange=stateChecker;
    
    var start = new Date();
    var doc = doc + "?time=" + start.getTime();
    
    // open socket connection
	xmlobj.open('GET',doc,true);
    // send GET request
    xmlobj.send(null);
	return true;
}
// check request status
function stateChecker(){
	if(xmlobj.readyState==4){
        /*xmlobj.responseXML.Clear();
		xmlobj.responseXML.CacheControl = "no-cache";
		xmlobj.responseXML.AddHeader("Pragma", "no-cache");
		xmlobj.responseXML.Expires = -1;
		xmlobj.responseXML.ContentType = "text/plain";*/
		data=xmlobj.responseXML.getElementsByTagName('PRODUCT');
		if(data.length==0){
			alert("No value in the XML FILE/ File not Exists");
		}
     }
}