		////////////////////////////Estimated Proceeds page function////////////////////////////////////////
		
		//call on each page
		//if(document.domain != "localhost")
		//{
		//	if(window.history.forward(1) != null)
        //         window.history.forward(1);
		//}
		
		/********************************************************
		* This opens a dependant window with no scroll bars etc.
		*********************************************************/
		
		function openDep(where, w, h) {
			windowprops = "left="+((screen.width/2)-(w/2))+",top="+((screen.height/2)-(h/2))+",height="+h+",width="+w+","
			+ "scrollbars=yes,menubars=no,toolbars=no,resizable=yes";
			var win = window.open(where, "dep", windowprops);
		}
		
		/****************************************
		* This lets me specify which field I
		* want to have the focus when it loads.
		* Used with error checking, etc.
		* (code by Josh, comment by RHR)
		* 
		* Accepts 2 parameters
		*	form - string (the name of the form 
		*		containing the control that will
		*		receive the focus)
		*	cfocus - string (the name of the 
		*		control that will be receiving
		*		the focus by default)
		* 
		* NOTE: This uses an html hidden 'server control' text box as
		*		as a psuedo form property (called Hsetfocus)
		*****************************************/
		function setthefocus(form, cfocus)
		{
			if(document.forms(form).item("Hsetfocus").value=="")
			{
				document.forms(form).item(cfocus).focus();
			}
			else
			{
				document.forms(form).item(document.forms(form).item("Hsetfocus").value).focus();
			}
		}
		
		/************************************************
		*	
		*	Repalce Function 
		*
		*
		*
		*
		*///////////////////////////////////////////////////
		
		function replaceSubstring(inputString, fromString, toString) {
			// Goes through the inputString and replaces every occurrence of fromString with toString
			var temp = inputString;
			if (fromString == "") {
				return inputString;
			}
			if (toString.indexOf(fromString) == -1) { // If the string being replaced is not a part of the replacement string (normal situation)
				while (temp.indexOf(fromString) != -1) {
					var toTheLeft = temp.substring(0, temp.indexOf(fromString));
					var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
					temp = toTheLeft + toString + toTheRight;
				}
			} else { // String being replaced is part of replacement string (like "+" being replaced with "++") - prevent an infinite loop
				var midStrings = new Array("~", "`", "_", "^", "#");
				var midStringLen = 1;
				var midString = "";
				// Find a string that doesn't exist in the inputString to be used
				// as an "inbetween" string
				while (midString == "") {
					for (var i=0; i < midStrings.length; i++) {
						var tempMidString = "";
						for (var j=0; j < midStringLen; j++) { tempMidString += midStrings[i]; }
						if (fromString.indexOf(tempMidString) == -1) {
						midString = tempMidString;
						i = midStrings.length + 1;
						}
					}
				} // Keep on going until we build an "inbetween" string that doesn't exist
				// Now go through and do two replaces - first, replace the "fromString" with the "inbetween" string
				while (temp.indexOf(fromString) != -1) {
					var toTheLeft = temp.substring(0, temp.indexOf(fromString));
					var toTheRight = temp.substring(temp.indexOf(fromString)+fromString.length, temp.length);
					temp = toTheLeft + midString + toTheRight;
				}
				// Next, replace the "inbetween" string with the "toString"
				while (temp.indexOf(midString) != -1) {
					var toTheLeft = temp.substring(0, temp.indexOf(midString));
					var toTheRight = temp.substring(temp.indexOf(midString)+midString.length, temp.length);
					temp = toTheLeft + toString + toTheRight;
				}
			} // Ends the check to see if the string being replaced is part of the replacement string or not
			return temp; // Send the updated string back to the user
} // Ends the "replaceSubstring" function

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

		/*********************************************************************************************
		* This function pulls up the page Find_Login.aspx.  Find_Login allows a search for logins 
		* by username and when the user selects one of the logins it fills in the txtLogin and txtPass 
		* textboxes on the calling page
		**********************************************************************************************/
		function PopLoginFinder()
		{ 
			var m_url;
			var m_parameters;
		
			var txtBoxF = document.getElementById("txtFirst");
			var txtBoxL = document.getElementById("txtLast"); 
			
			if (txtBoxF.value == "" || txtBoxL.value == "")
			{
				alert("You must enter the contacts first and last name before continuing");
			}
			else
			{

				m_url='Find_Login.aspx';
				m_parameters='?id1='+txtBoxF.value+'&id2='+txtBoxL.value;
				
				mywindow=open(m_url+m_parameters,'myname','resizable=no,width=600,height=600,scrollbars=yes'); 
				if (mywindow.opener == null)
				{
					mywindow.opener= self;
				}
			}
			
		} 
		
		/******************************************************************
		* This function accepts a string variable and verifies if it is a
		* proper date or not. It validates format matching either
		* mm-dd-yyyy or mm/dd/yyyy. Then it checks to make sure the month
		* has the proper number of days, based on which month it is.
		*
		* The function returns true if a valid date, false if not.
		* It also returns false if an empty string is passed.
		*
		* Taken from http://www.bitbucketheaven.com/code/isdate.shtml
		*******************************************************************/
		function isDate(oObj, dateStr, allowempty) {
			// oObj = (Object) the calling object
			// dateStr = (String) oObj.value
			// allowempty = (boolean) whether we allow the date to be empty.

			// Empty and we allow empty.
			if (dateStr == "" && allowempty) {
				return true;
				}
			

			var predatePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{1,2})$/;
			var prematchArray = dateStr.match(predatePat);
			
			// Check if they only entered a 2 year date.
			if (prematchArray != null) {
				month = prematchArray[1]; 
				day = prematchArray[3];
				year = prematchArray[5];
				
				if(year > 45){
					dateStr = month.toString() + '/' + day.toString() + '/' + '19' + year.toString();
				}
				else{
					dateStr = month.toString() + '/' + day.toString() + '/' + '20' + year.toString();
				}
				
				oObj.value = dateStr;
			}

			// Check for the rest.
			var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
			var matchArray = dateStr.match(datePat); // is the format ok?

			if (matchArray == null) {
				alert("Please enter date as either mm/dd/yyyy or mm-dd-yyyy.");
				oObj.focus();
				return false;
			}

			month = matchArray[1]; // parse date into variables
			day = matchArray[3];
			year = matchArray[5];

			if (month < 1 || month > 12) { // check month range
				alert("Month must be between 1 and 12.");
				oObj.focus();
				return false;
			}

			if (day < 1 || day > 31) {
				alert("Day must be between 1 and 31.");
				oObj.focus();
				return false;
			}

			if ((month==4 || month==6 || month==9 || month==11) && day==31) {
				alert("Month "+month+" doesn't have 31 days!")
				oObj.focus();
				return false;
			}

			if (month == 2) { // check for february 29th
				var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
				if (day > 29 || (day==29 && !isleap)) {
					alert("February " + year + " doesn't have " + day + " days!");
					oObj.focus();
					return false;
				}
			}
			return true; // date is valid
		}

		/******************************************************************
		* IsNumeric
		* Verifies if the string is numeric or empty
		* sText - string ("012345")
		* bnotempty - boolean (true) If passed as true, the string cannot be empty
		*
		* Taken from http://www.codetoad.com/javascript/isnumeric.asp
		* Then altered by Josh - JJT
		*******************************************************************/
		function IsNumeric(oObj, sText, bAllowempty)
		{
		
			var ValidChars = "0123456789,";
			var IsNumber=true;
			var Char;
		
			if(sText=='' && !bAllowempty) // I don't want empty text either.
			{
				IsNumber = false;
				alert("This field must contain a numeric value.");
				oObj.focus();
				return IsNumber;
			}
			for (i = 0; i < sText.length && IsNumber == true; i++) 
			{ 
				Char = sText.charAt(i); 
				if (ValidChars.indexOf(Char) == -1) 
					{
						IsNumber = false;
					}
			}
			if (IsNumber==false)
			{
				alert("This field must contain a numeric value.");
				oObj.focus();
				return IsNumber;
			}
			else
			{
				return IsNumber;
			}
			
			return IsNumber;  //add for no error
		}
		/******************************************************************
		* IsDecimal
		* Verifies if the string is numeric or empty
		* sText - string ("012345")
		* bnotempty - boolean (true) If passed as true, the string cannot be empty
		*
		* Taken from http://www.codetoad.com/javascript/isnumeric.asp
		* Then altered by Josh - JJT
		*******************************************************************/
		function IsDecimal(oObj, sText, bAllowempty)
		{
		
			var ValidChars = "0123456789.,";
			var IsNumber=true;
			var Char;
		
			if(sText=='' && !bAllowempty) // I don't want empty text either.
			{
				IsNumber = false;
			}
			else
			{
				for (i = 0; i < sText.length && IsNumber == true; i++) 
				{ 
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
					{
						IsNumber = false;
					}
				}
			}
			if (IsNumber==false)
			{
				alert("This field must contain a numeric value.");
				oObj.value = 0;
			}
			
			oObj.focus();
			oObj.select();
		}
		
		function IsRealNumeric(id, num, bAllowempty)
		{			
			var Exp = "\D";
			var objRegExp = /(\)|\(|,|\s)/g;
			//RegExp("^[0-9]{1,8}$|^[0-9]{1,8}|^[.]\[0-9]{1,2}$","ig");
			num = num.replace(objRegExp,'');
			if(num != '')
			{
				var testText = new RegExp(/^-?\d*$/);
		
				var validate = testText.exec(num);
				if(!validate)
				{
					id.value = "0";
					id.focus();
					alert("This field must contain a numeric value.");
				}
				else
				{
					id.value = num;	
				}
			}
			else
			{
				if(bAllowempty)
				{
					id.value = "0";
				}
				else
				{
					alert("This field cannot be blank.");
				}
			}
			
		}
		
		function IsRealNumericBlank(id, num, bAllowempty)
		{			
			var Exp = "\D";
			var objRegExp = /(\)|\(|,|\s)/g;
			//RegExp("^[0-9]{1,8}$|^[0-9]{1,8}|^[.]\[0-9]{1,2}$","ig");
			num = num.replace(objRegExp,'');
			if(num != '')
			{
				var testText = new RegExp(/^-?\d*$/);
		
				var validate = testText.exec(num);
				if(!validate)
				{
					id.value = "0";
					alert("This field must contain a numeric value.");
				}
				else
				{
					id.value = num;	
				}
			}
			else
			{
				if(!bAllowempty)
				{
					alert("This field cannot be blank.");
				}
			}
			
		}
		
		function openWinterProcs(checker,assetID)
		{
			if(checker)
			{
				window.open('PrintWinterProcs.aspx?AssetID=' + assetID,null,'toolbar=no,location=no,status=no,resizable=yes,scrollbars=yes');
			}
		}
		/******************************************************************
		* Added 11/01/2004 - Roger Proctor taken from http://javascript.internet.com/forms/currency-format.html
		* inserts commas in proper place (orignal funtion added a "$" at the
		* beginning of string, but we don't want that
		*******************************************************************/
		function formatCurrency(num) {
		
			var objRegExp = /(\$|\,|\s)/g
			num = num.toString().replace(objRegExp,'');
			if(isNaN(num))
			{
				num = "0";
			}
			sign = (num == (num = Math.abs(num)));
			num = Math.floor(num*100+0.50000000001);
			cents = num%100;
			num = Math.floor(num/100).toString();
			if(cents<10)
			{
				cents = "0" + cents;
			}
			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));
			}
			return (((sign)?'':'-') + num + '.' + cents);
		}

		/******************************************************************
		* Added 07/29/2004 - Roger Proctor
		* Takes a previously validated number and formats it with .00
		* If the number has decimals, then we leave it alone
		* If the number doesn't have decimals, we add them
		* If the field is blank, we add 0.00
		*******************************************************************/
		function formatNum(id, num, readonly)
		{
			if(!readonly)
			{
				var objRegExp = /(\)|\(|,|\s)/g;
				//add cuz it might not be a string 
				num = num.toString().replace(objRegExp,'');
				//RegExp("^[0-9]{1,8}$|^[0-9]{1,8}|^[.]\[0-9]{1,2}$","ig");				
				if(num != '')
				{
					//A regualar expression that will allow +- numbers with up to 2 decimal places
					var testText = new RegExp(/^-?\d*$|^-?\d*\.\d{2}$|^-?\.\d{1}$|^-?\d*\.\d{1}$|^-?\.\d{1}$/);
					var validate = testText.exec(num);
					if(!validate)
					{
						//id.value = "0.00";
						alert("This field must contain a numeric value.");
						id.focus();
						id.select();
					}
					else
					{
						num = formatCurrency(num);
						id.value = num;
					}
				}
				else
				{
					id.value = "0.00";
				}
				num = 0;
			}				
		}
		
		function formatDec(id, num, readonly)
		{
			if(!readonly)
			{
				var objRegExp = /(\)|\(|,|\s)/g;
				//add cuz it might not be a string 
				num = num.toString().replace(objRegExp,'');
				//RegExp("^[0-9]{1,8}$|^[0-9]{1,8}|^[.]\[0-9]{1,2}$","ig");				
				if(num != '')
				{
					//A regualar expression that will allow +- numbers with up to 2 decimal places
					var testText = new RegExp(/^\d*$|^\d*\.\d*$|^\.\d*$/);
					var validate = testText.exec(num);
					if(!validate)
					{
						//id.value = "0.00";
						alert("This field must contain a numeric value.");
						id.focus();
						id.select();
					}
					else
					{
						//num = formatCurrency(num);
						id.value = num;
					}
				}
				else
				{
					id.value = "0.00";
				}
				num = 0;
			}				
		}
		
		function formatNum2(id, num)
		{

			var noDec = new RegExp("^[0-9]{1,8}$","ig");
			var validate = noDec.exec(num);
			if(validate != null)
			{
				id.value = num + ".00";
				
			}
			else
			{
				var Dec = new RegExp("^[0-9]{1,8}\.[0-9]{1,2}$","ig");
				validate = Dec.exec(num);
				if(validate != null) //num has a decimal with one or two numbers after
				{
					id.value = num;
				}
				else
				{
					id.value = "0.00";
					alert("This field must contain a numeric value.");
				}
				
				
			}
				
		}
		//****************************************************************
		//Added 10/22/2004 - Roger Proctor
		//Takes a date and adds the number of months  to the date
		//If the month is Oct, Nov, or Dec, the year will change to the next year.
		//
		//
		function SetDefaultExpireDate(id, listdate, months)
		{
			var i = listdate.length;
			var tempstr = listdate.substr(i-3,i);			
			var testText = new RegExp(/^\D\d{2}$/);
			
			var validate = testText.exec(tempstr);
			if(validate)
			{
				var firstSub = listdate.substr(0,i-2);
				var secondSub = "20" + listdate.substr(i-2,i);
				listdate = firstSub + secondSub;
			}	
			var expdate = new Date(listdate);
			var days = expdate.getDate();//javascript's getDate() method returns the Day of the month -- not the date!!!
			expdate.setMonth(expdate.getMonth() + months);
			var display = (expdate.getMonth() + 1) + "/" + expdate.getDate() + "/" + expdate.getFullYear();
			//Months and days of the week are indexed on 0. To display properly, you'll need to add 1.
			
			id.value = display;			
		}
		
		/******************************************************************
		* Added 07/19/2004 - Roger Proctor
		* Validates a phone number to be in the following patterns:
		*  xxx-xxx-xxxx
		*  (xxx)-xxx-xxxx
		*  xxxxxxxxxx
		* If the phone number field is empty or if the text doesn't match
		* the predefined patterns, then focus will be sent back to the text 
		* field to be re-entered.
		*******************************************************************/
		function isPhone(oObj, sText, bAllowempty,readonly)
		{
			if(!readonly)
			{
				var iText = sText;
				// validText variable checks for the xxx-xxx-xxxx pattern.
				var validText = /^\d{3}\-\d{3}\-\d{4}$/;
				var testText = new RegExp(validText);
				var testexec = testText.exec(sText);
	
				// validText2 variable checks for the (xxx) xxx-xxxx pattern.
				var validText2 = /^\(\d{3}\)(\s)?\d{3}\-\d{4}$/;
				var testText2 = new RegExp(validText2);
				var testexec2 = testText2.exec(sText);
	
				// validText3 variable checks for the xxxxxxxxxx pattern.
				var validText3 = /^\d{10}$/;
				var testText3 = new RegExp(validText3);
				var testexec3 = testText3.exec(sText);
			
				// validText2 variable checks for the (xxx)xxx-xxxx pattern.
				var validText4 = /^\(\d{3}\)\d{3}\-\d{4}$/;
				var testText4 = new RegExp(validText2);
				var testexec4 = testText4.exec(sText);
	
				var isPhone = true;
			
				if(iText == '' && !bAllowempty)
				{
					isPhone = false;
					alert("This field must be entered");
					oObj.focus();
					
				} 
				else if(testexec||testexec2||testexec3||testexec4)
				{
					isPhone = true;
				}
				else if (iText == '' && bAllowempty)
				{
					isPhone = true;
				}
				else
				{
					alert("Please re-enter the phone number.\n\nPossible formats are:\nxxx-xxx-xxxx\n(xxx) xxx-xxxx\nxxxxxxxxxx");
					isPhone = false;		
					oObj.focus();
				}	
				return isPhone;
			}
	
		}
		/******************************************************************
		* handleEnter
		* Taken from http://www.faqts.com/knowledge_base/view.phtml/aid/6793/fid/145
		* Captures the enter key and handles it as a tab
		* Roger Proctor
		*******************************************************************/
		function handleEnter(field, event)
		{
			var keyCode = event.keyCode ? event.keyCode : 
                event.which ? event.which : event.charCode;
			if (keyCode == 13)
			{
				var i;
				for(i=0; i<field.form.elements.length; i++)
				{
					if (field == field.form.elements[i])
					{
						break;
					}
				}
				i = (i + 1) % field.form.elements.length;
				field.form.elements[i].focus();
				return false;
			}
			else
			{
				return true;
			
			}
		}
		function Today(obj,readOnly)
		{
			if(!readOnly)
			{
				obj.value=curdate();
			}
		}
		/******************************************************************
		* accept
		* UI control to verify whether the listing agent
		* accepts or rejects the listing
		*******************************************************************/
		function accept(val)
		{
			switch(val)
			{
				case "true":
				window.alert("Accept");
				break
				
				case "false":
				window.alert("Are you sure you want to decline?");
				break
			}				
		}		
		/******************************************************************
		* curdate
		* Returns the current date as a string
		*******************************************************************/
		function curdate()
		{
		
			var RightNow = new Date(); 
			var d = RightNow.getDate();
			var m = RightNow.getMonth() + 1;
			var y = RightNow.getFullYear();
			
			var curdate = String(m) + '/' + String(d) + '/' + String(y);
			return curdate;
		
		}
		/******************************************************************
		* APVfunc
		* Validates the Aproval process for Bids
		*******************************************************************/
		function APVfunc(inum)
		{
			if (confirm("Do you want to create a Bid Detail for this?")==true)

				return true;

			else
				return false;
	
		}
		/******************************************************************
		* CompleteConfirm
		* Validates the Complete button for BPO's
		*******************************************************************/
		function CompleteConfirm()
		{
			if (confirm("This will make this BPO un-editable. Do you wish to still complete this BPO?")==true)

				return true;

			else
				return false;
	
		}
		function OfferSubmit()
		{
				if (confirm("I am aware that the following actions are FINAL. I have verified that ALL data is correct. I am aware that my actions are IRREVERSIBLE.")==true)

				return true;

			else
				return false;
		}
		function ConfirmBox(msg)
		{
			if (confirm(msg)==true)
				return true;

			
			else
				return false;
		
		}
		
		/******************************************************************
		* OkBox
		* Validates the Complete button for BPO's
		*******************************************************************/
		function OkBox(Message)
		{
			alert(Message);
		}
		function OkBoxFalse(Msg)
		{
			alert(Msg);
			return false;
		}
		
		
		/********************************************************************
		*	mask
		*	str - the value of the current textbox control, 
		*	textbox - the actual textbox object, (so that the value can be set) 
		*	loc - a string of multiple locations to place the specified character, 
		*	delim - the character (delimiter) that you want to use a separator. 
		*	The maxlength value is set to a length of 11 since I would like 9 characters and 2 "-" characters.
		*
		*	The mask function is called in 2 places (1: onKeyUp, so that as the user types, the field will be edited, 
		*	2: onBlur, this is not needed, but it's just in case)
		*
		********************************************************************/
		function mask(str,obj,loc,delim)
		{
				var locs = loc.split(','); 
				//Creates an array out of multiple numbers (to add each separator on its own).

				for (var i = 0; i <= locs.length; i++){
				//Begins a loop through the array of locations.

					for (var k = 0; k <= str.length; k++)
					{
					//Begins a nested loop through each character to check if the delimiter is already there.

						if (k == locs[i])
						{
						//Begins a conditional statement that checks to see what character number we are holding.

							if (str.substring(k, k+1) != delim)
							{
							//Begins a nested conditional statement if the character we're holding is the correct character location, and checks to see if it is the same character as the delimiter.

							str = str.substring(0,k) + delim + str.substring(k,str.length);
							//if the character is not the same as the delimiter, it will cut the value in half and insert the delimiter
							}
						}
					}
				}
				//obj.value = str;
				return str;
				//This sets the value of the textbox control being edite		
		}
		
 
		// How To:
		// <cc1:txtDate id="TxtDate1" runat="server" onKeypress="return DateMask(this.value,this,'2,5','/');"></cc1:txtDate>
 		function DateMask(str,textbox,loc,delim)
		{
				if (event.keyCode<48||event.keyCode>57)
				{
					//textbox.value=event.keyCode;
					return false;
				}

			
				var locs = loc.split(','); 
				//Creates an array out of multiple numbers (to add each separator on its own).

				for (var i = 0; i <= locs.length; i++){
				//Begins a loop through the array of locations.

					for (var k = 0; k <= str.length; k++)
					{
					//Begins a nested loop through each character to check if the delimiter is already there.

						if (k == locs[i])
						{
						//Begins a conditional statement that checks to see what character number we are holding.

							if (str.substring(k, k+1) != delim)
							{
							//Begins a nested conditional statement if the character we're holding is the correct character location, and checks to see if it is the same character as the delimiter.

							str = str.substring(0,k) + delim + str.substring(k,str.length);
							//if the character is not the same as the delimiter, it will cut the value in half and insert the delimiter
							}
						}
					}
				}
				str = str.substring(0,9);
				//return str;
				textbox.value=str;
				//This sets the value of the textbox control being edite		
		}
		


			//*************************************** XXXXXXXXXXXXXXXXX ***************************************
			//mask functions
			// see:  http://archive.devx.com/dhtml/articles/nz012402/nz012402-6.asp
			// How To:
			// <input type="text" size="18" onkeypress="return maskKeyPress(event)">
			//
			// On the web form (for now), in the <head> tag:
			/*
				<script language="javascript">
				//browser detection
				var strUserAgent = navigator.userAgent.toLowerCase(); 
				var isIE = strUserAgent.indexOf("msie") > -1; 
				var isNS6 = strUserAgent.indexOf("netscape6") > -1; 
				var isNS4 = !isIE && !isNS6  && parseFloat(navigator.appVersion) < 5; 
				
				
				// see: http://www.webreference.com/js/column5/
				// OR
				// http://javascriptkit.com/javatutors/re2.shtml
				//
				// for regular expression definition
				//regular expressions
				var reValidChars = /\d/;
				var reValidString = /^\d*$/;
				var reKeyboardChars = /[\x00\x03\x08\x0D\x16\x18\x1A]/;
				var reClipboardChars = /[cvxz]/i;
				</script>
			*/

			function maskKeyPress(objEvent) 
			{




				var iKeyCode, strKey, objInput;  
				
				if (isIE) {
				    iKeyCode = objEvent.keyCode;
					objInput = objEvent.srcElement;
				} else {
				    iKeyCode = objEvent.which;
					objInput = objEvent.target;
				}
				
				strKey = String.fromCharCode(iKeyCode);
				
				if (isValid(objInput.value)) 
				{
					objInput.validValue = objInput.value;
					if (!reValidChars.test(strKey) && !reKeyboardChars.test(strKey) && !checkClipboardCode(objEvent, strKey)) {
						alert("Invalid Character Detected!\nKeyCode = " + iKeyCode + "\nCharacter =" + strKey);
						return false;
					}
				} else {
					alert("Invalid Data");
					return false;
				}
			}
			
			function checkClipboardCode(objEvent, strKey) 
			{
			  	if (isNS6)
			    	return objEvent.ctrlKey && reClipboardChars.test(strKey);
			  	else
			    	return false;
			}
			
			function isValid(strValue) 
			{
				return reValidString.test(strValue) || strValue.length == 0;			
			}

			function maskChange(objEvent) 
			{
			  	var objInput;
			
			  	if (isIE) {
			    	objInput = objEvent.srcElement; 
			  	} else {
			    	objInput = objEvent.target;
			  	}
			 
			  	if (!isValid(objInput.value)) {
			    	alert("Invalid data");
					objInput.value = objInput.validValue || "";
					objInput.focus();
			    	objInput.select(); 
			  	} else {
					objInput.validValue = objInput.value;
				}
			}
			



		//Number.prototype.toDecimals=function(n)
		function DecimalFormat(n)
		{
		    n=(isNaN(n))?2:n;
		    var nT=Math.pow(10,n);

			return (isNaN(this))?this:(new String(Math.round(this*nT)/nT)).replace(/(\.\d*)?$/,pad);
		}

		function pad(s)
		{
	        s=s||'.';
	        return (s.length>n)?s:pad(s+'0');
		}
		//////////////////////////////////////////////////////////////////Calandar Control Functions////////////////////////////////////////
		
		
		<!-- Original:  Kedar R. Bhave (softricks@hotmail.com) -->
		<!-- Web Site:  http://www.softricks.com -->

		<!-- This script and many more are available free online at -->
		<!-- The JavaScript Source!! http://javascript.internet.com -->

		var weekend = [0,6];
		var weekendColor = "#e0e0e0";
		var fontface = "Verdana";
		var fontsize = 2;

		var gNow = new Date();
		var ggWinCal;
		isNav = (navigator.appName.indexOf("Netscape") != -1) ? true : false;
		isIE = (navigator.appName.indexOf("Microsoft") != -1) ? true : false;

		Calendar.Months = ["January", "February", "March", "April", "May", "June",
		"July", "August", "September", "October", "November", "December"];

		// Non-Leap year Month days..
		Calendar.DOMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
		// Leap year Month days..
		Calendar.lDOMonth = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];

		function Calendar(p_item, p_WinCal, p_month, p_year, p_format) {
			if ((p_month == null) && (p_year == null))	return;

			if (p_WinCal == null)
				this.gWinCal = ggWinCal;
			else
				this.gWinCal = p_WinCal;
			
			if (p_month == null) {
				this.gMonthName = null;
				this.gMonth = null;
				this.gYearly = true;
			} else {
				this.gMonthName = Calendar.get_month(p_month);
				this.gMonth = new Number(p_month);
				this.gYearly = false;
			}

			this.gYear = p_year;
			this.gFormat = p_format;
			this.gBGColor = "white";
			this.gFGColor = "black";
			this.gTextColor = "black";
			this.gHeaderColor = "black";
			this.gReturnItem = p_item;
		}

		Calendar.get_month = Calendar_get_month;
		Calendar.get_daysofmonth = Calendar_get_daysofmonth;
		Calendar.calc_month_year = Calendar_calc_month_year;
		Calendar.print = Calendar_print;

		function Calendar_get_month(monthNo) {
			return Calendar.Months[monthNo];
		}

		function Calendar_get_daysofmonth(monthNo, p_year) {
			/* 
			Check for leap year ..
			1.Years evenly divisible by four are normally leap years, except for... 
			2.Years also evenly divisible by 100 are not leap years, except for... 
			3.Years also evenly divisible by 400 are leap years. 
			*/
			if ((p_year % 4) == 0) {
				if ((p_year % 100) == 0 && (p_year % 400) != 0)
					return Calendar.DOMonth[monthNo];
			
				return Calendar.lDOMonth[monthNo];
			} else
				return Calendar.DOMonth[monthNo];
		}

		function Calendar_calc_month_year(p_Month, p_Year, incr) {
			/* 
			Will return an 1-D array with 1st element being the calculated month 
			and second being the calculated year 
			after applying the month increment/decrement as specified by 'incr' parameter.
			'incr' will normally have 1/-1 to navigate thru the months.
			*/
			var ret_arr = new Array();
			
			if (incr == -1) {
				// B A C K W A R D
				if (p_Month == 0) {
					ret_arr[0] = 11;
					ret_arr[1] = parseInt(p_Year) - 1;
				}
				else {
					ret_arr[0] = parseInt(p_Month) - 1;
					ret_arr[1] = parseInt(p_Year);
				}
			} else if (incr == 1) {
				// F O R W A R D
				if (p_Month == 11) {
					ret_arr[0] = 0;
					ret_arr[1] = parseInt(p_Year) + 1;
				}
				else {
					ret_arr[0] = parseInt(p_Month) + 1;
					ret_arr[1] = parseInt(p_Year);
				}
			}
			
			return ret_arr;
		}

		function Calendar_print() {
			ggWinCal.print();
		}

		function Calendar_calc_month_year(p_Month, p_Year, incr) {
			/* 
			Will return an 1-D array with 1st element being the calculated month 
			and second being the calculated year 
			after applying the month increment/decrement as specified by 'incr' parameter.
			'incr' will normally have 1/-1 to navigate thru the months.
			*/
			var ret_arr = new Array();
			
			if (incr == -1) {
				// B A C K W A R D
				if (p_Month == 0) {
					ret_arr[0] = 11;
					ret_arr[1] = parseInt(p_Year) - 1;
				}
				else {
					ret_arr[0] = parseInt(p_Month) - 1;
					ret_arr[1] = parseInt(p_Year);
				}
			} else if (incr == 1) {
				// F O R W A R D
				if (p_Month == 11) {
					ret_arr[0] = 0;
					ret_arr[1] = parseInt(p_Year) + 1;
				}
				else {
					ret_arr[0] = parseInt(p_Month) + 1;
					ret_arr[1] = parseInt(p_Year);
				}
			}
			
			return ret_arr;
		}

		// This is for compatibility with Navigator 3, we have to create and discard one object before the prototype object exists.
		new Calendar();

		Calendar.prototype.getMonthlyCalendarCode = function() {
			var vCode = "";
			var vHeader_Code = "";
			var vData_Code = "";
			
			// Begin Table Drawing code here..
			vCode = vCode + "<TABLE BORDER=1 BGCOLOR=\"" + this.gBGColor + "\">";
			
			vHeader_Code = this.cal_header();
			vData_Code = this.cal_data();
			vCode = vCode + vHeader_Code + vData_Code;
			
			vCode = vCode + "</TABLE>";
			
			return vCode;
		}

		Calendar.prototype.show = function() {
			var vCode = "";
			
			this.gWinCal.document.open();

			// Setup the page...
			this.wwrite("<html>");
			this.wwrite("<head><title>Calendar</title>");
			this.wwrite("</head>");

			this.wwrite("<body " + 
				"link=\"" + this.gLinkColor + "\" " + 
				"vlink=\"" + this.gLinkColor + "\" " +
				"alink=\"" + this.gLinkColor + "\" " +
				"text=\"" + this.gTextColor + "\">");
			this.wwriteA("<FONT FACE='" + fontface + "' SIZE=2><B>");
			this.wwriteA(this.gMonthName + " " + this.gYear);
			this.wwriteA("</B><BR>");

			// Show navigation buttons
			var prevMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, -1);
			var prevMM = prevMMYYYY[0];
			var prevYYYY = prevMMYYYY[1];

			var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1);
			var nextMM = nextMMYYYY[0];
			var nextYYYY = nextMMYYYY[1];
			
			this.wwrite("<TABLE WIDTH='100%' BORDER=1 CELLSPACING=0 CELLPADDING=0 BGCOLOR='#e0e0e0'><TR><TD ALIGN=center>");
			this.wwrite("[<A HREF=\"" +
				"javascript:window.opener.Build(" + 
				"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)-1) + "', '" + this.gFormat + "'" +
				");" +
				"\"><<<\/A>]</TD><TD ALIGN=center>");
			this.wwrite("[<A HREF=\"" +
				"javascript:window.opener.Build(" + 
				"'" + this.gReturnItem + "', '" + prevMM + "', '" + prevYYYY + "', '" + this.gFormat + "'" +
				");" +
				"\"><<\/A>]</TD><TD ALIGN=center>");
			this.wwrite("[<A HREF=\"javascript:window.print();\">Print</A>]</TD><TD ALIGN=center>");
			this.wwrite("[<A HREF=\"" +
				"javascript:window.opener.Build(" + 
				"'" + this.gReturnItem + "', '" + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "'" +
				");" +
				"\">><\/A>]</TD><TD ALIGN=center>");
			this.wwrite("[<A HREF=\"" +
				"javascript:window.opener.Build(" + 
				"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)+1) + "', '" + this.gFormat + "'" +
				");" +
				"\">>><\/A>]</TD></TR></TABLE><BR>");

			// Get the complete calendar code for the month..
			vCode = this.getMonthlyCalendarCode();
			this.wwrite(vCode);

			this.wwrite("</font></body></html>");
			this.gWinCal.document.close();
		}

		Calendar.prototype.showY = function() {
			var vCode = "";
			var i;
			var vr, vc, vx, vy;		// Row, Column, X-coord, Y-coord
			var vxf = 285;			// X-Factor
			var vyf = 200;			// Y-Factor
			var vxm = 10;			// X-margin
			var vym;				// Y-margin
			if (isIE)	vym = 75;
			else if (isNav)	vym = 25;
			
			this.gWinCal.document.open();

			this.wwrite("<html>");
			this.wwrite("<head><title>Calendar</title>");
			this.wwrite("<style type='text/css'>\n<!--");
			for (i=0; i<12; i++) {
				vc = i % 3;
				if (i>=0 && i<= 2)	vr = 0;
				if (i>=3 && i<= 5)	vr = 1;
				if (i>=6 && i<= 8)	vr = 2;
				if (i>=9 && i<= 11)	vr = 3;
				
				vx = parseInt(vxf * vc) + vxm;
				vy = parseInt(vyf * vr) + vym;

				this.wwrite(".lclass" + i + " {position:absolute;top:" + vy + ";left:" + vx + ";}");
			}
			this.wwrite("-->\n</style>");
			this.wwrite("</head>");

			this.wwrite("<body " + 
				"link=\"" + this.gLinkColor + "\" " + 
				"vlink=\"" + this.gLinkColor + "\" " +
				"alink=\"" + this.gLinkColor + "\" " +
				"text=\"" + this.gTextColor + "\">");
			this.wwrite("<FONT FACE='" + fontface + "' SIZE=2><B>");
			this.wwrite("Year : " + this.gYear);
			this.wwrite("</B><BR>");

			// Show navigation buttons
			var prevYYYY = parseInt(this.gYear) - 1;
			var nextYYYY = parseInt(this.gYear) + 1;
			
			this.wwrite("<TABLE WIDTH='100%' BORDER=1 CELLSPACING=0 CELLPADDING=0 BGCOLOR='#e0e0e0'><TR><TD ALIGN=center>");
			this.wwrite("[<A HREF=\"" +
				"javascript:window.opener.Build(" + 
				"'" + this.gReturnItem + "', null, '" + prevYYYY + "', '" + this.gFormat + "'" +
				");" +
				"\" alt='Prev Year'><<<\/A>]</TD><TD ALIGN=center>");
			this.wwrite("[<A HREF=\"javascript:window.print();\">Print</A>]</TD><TD ALIGN=center>");
			this.wwrite("[<A HREF=\"" +
				"javascript:window.opener.Build(" + 
				"'" + this.gReturnItem + "', null, '" + nextYYYY + "', '" + this.gFormat + "'" +
				");" +
				"\">>><\/A>]</TD></TR></TABLE><BR>");

			// Get the complete calendar code for each month..
			var j;
			for (i=11; i>=0; i--) {
				if (isIE)
					this.wwrite("<DIV ID=\"layer" + i + "\" CLASS=\"lclass" + i + "\">");
				else if (isNav)
					this.wwrite("<LAYER ID=\"layer" + i + "\" CLASS=\"lclass" + i + "\">");

				this.gMonth = i;
				this.gMonthName = Calendar.get_month(this.gMonth);
				vCode = this.getMonthlyCalendarCode();
				this.wwrite(this.gMonthName + "/" + this.gYear + "<BR>");
				this.wwrite(vCode);

				if (isIE)
					this.wwrite("</DIV>");
				else if (isNav)
					this.wwrite("</LAYER>");
			}

			this.wwrite("</font><BR></body></html>");
			this.gWinCal.document.close();
		}

		Calendar.prototype.wwrite = function(wtext) {
			this.gWinCal.document.writeln(wtext);
		}

		Calendar.prototype.wwriteA = function(wtext) {
			this.gWinCal.document.write(wtext);
		}

		Calendar.prototype.cal_header = function() {
			var vCode = "";
			
			vCode = vCode + "<TR>";
			vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Sun</B></FONT></TD>";
			vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Mon</B></FONT></TD>";
			vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Tue</B></FONT></TD>";
			vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Wed</B></FONT></TD>";
			vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Thu</B></FONT></TD>";
			vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Fri</B></FONT></TD>";
			vCode = vCode + "<TD WIDTH='16%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Sat</B></FONT></TD>";
			vCode = vCode + "</TR>";
			
			return vCode;
		}

		Calendar.prototype.cal_data = function() {
			var vDate = new Date();
			vDate.setDate(1);
			vDate.setMonth(this.gMonth);
			vDate.setFullYear(this.gYear);

			var vFirstDay=vDate.getDay();
			var vDay=1;
			var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear);
			var vOnLastDay=0;
			var vCode = "";

			/*
			Get day for the 1st of the requested month/year..
			Place as many blank cells before the 1st day of the month as necessary. 
			*/

			vCode = vCode + "<TR>";
			for (i=0; i<vFirstDay; i++) {
				vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(i) + "><FONT SIZE='2' FACE='" + fontface + "'> </FONT></TD>";
			}

			// Write rest of the 1st week
			for (j=vFirstDay; j<7; j++) {
				vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j) + "><FONT SIZE='2' FACE='" + fontface + "'>" + 
					"<A HREF='#' " + 
						"onClick=\"self.opener.document.getElementById('" + this.gReturnItem + "').value='" + 
						this.format_data(vDay) + 
						"';window.close();\">" + 
						this.format_day(vDay) + 
					"</A>" + 
					"</FONT></TD>";
				vDay=vDay + 1;
			}
			vCode = vCode + "</TR>";

			// Write the rest of the weeks
			for (k=2; k<7; k++) {
				vCode = vCode + "<TR>";

				for (j=0; j<7; j++) {
					vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j) + "><FONT SIZE='2' FACE='" + fontface + "'>" + 
						"<A HREF='#' " + 
							"onClick=\"self.opener.document.getElementById('" + this.gReturnItem + "').value='" + 
							this.format_data(vDay) + 
							"';window.close();\">" + 
						this.format_day(vDay) + 
						"</A>" + 
						"</FONT></TD>";
					vDay=vDay + 1;

					if (vDay > vLastDay) {
						vOnLastDay = 1;
						break;
					}
				}

				if (j == 6)
					vCode = vCode + "</TR>";
				if (vOnLastDay == 1)
					break;
			}
			
			// Fill up the rest of last week with proper blanks, so that we get proper square blocks
			for (m=1; m<(7-j); m++) {
				if (this.gYearly)
					vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j+m) + 
					"><FONT SIZE='2' FACE='" + fontface + "' COLOR='gray'> </FONT></TD>";
				else
					vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j+m) + 
					"><FONT SIZE='2' FACE='" + fontface + "' COLOR='gray'>" + m + "</FONT></TD>";
			}
			
			return vCode;
		}

		Calendar.prototype.format_day = function(vday) {
			var vNowDay = gNow.getDate();
			var vNowMonth = gNow.getMonth();
			var vNowYear = gNow.getFullYear();

			if (vday == vNowDay && this.gMonth == vNowMonth && this.gYear == vNowYear)
				return ("<FONT COLOR=\"RED\"><B>" + vday + "</B></FONT>");
			else
				return (vday);
		}

		Calendar.prototype.write_weekend_string = function(vday) {
			var i;

			// Return special formatting for the weekend day.
			for (i=0; i<weekend.length; i++) {
				if (vday == weekend[i])
					return (" BGCOLOR=\"" + weekendColor + "\"");
			}
			
			return "";
		}

		Calendar.prototype.format_data = function(p_day) {
			var vData;
			var vMonth = 1 + this.gMonth;
			vMonth = (vMonth.toString().length < 2) ? "0" + vMonth : vMonth;
			var vMon = Calendar.get_month(this.gMonth).substr(0,3).toUpperCase();
			var vFMon = Calendar.get_month(this.gMonth).toUpperCase();
			var vY4 = new String(this.gYear);
			var vY2 = new String(this.gYear.substr(2,2));
			var vDD = (p_day.toString().length < 2) ? "0" + p_day : p_day;

			switch (this.gFormat) {
				case "MM\/DD\/YYYY" :
					vData = vMonth + "\/" + vDD + "\/" + vY4;
					break;
				case "MM\/DD\/YY" :
					vData = vMonth + "\/" + vDD + "\/" + vY2;
					break;
				case "MM-DD-YYYY" :
					vData = vMonth + "-" + vDD + "-" + vY4;
					break;
				case "MM-DD-YY" :
					vData = vMonth + "-" + vDD + "-" + vY2;
					break;

				case "DD\/MON\/YYYY" :
					vData = vDD + "\/" + vMon + "\/" + vY4;
					break;
				case "DD\/MON\/YY" :
					vData = vDD + "\/" + vMon + "\/" + vY2;
					break;
				case "DD-MON-YYYY" :
					vData = vDD + "-" + vMon + "-" + vY4;
					break;
				case "DD-MON-YY" :
					vData = vDD + "-" + vMon + "-" + vY2;
					break;

				case "DD\/MONTH\/YYYY" :
					vData = vDD + "\/" + vFMon + "\/" + vY4;
					break;
				case "DD\/MONTH\/YY" :
					vData = vDD + "\/" + vFMon + "\/" + vY2;
					break;
				case "DD-MONTH-YYYY" :
					vData = vDD + "-" + vFMon + "-" + vY4;
					break;
				case "DD-MONTH-YY" :
					vData = vDD + "-" + vFMon + "-" + vY2;
					break;

				case "DD\/MM\/YYYY" :
					vData = vDD + "\/" + vMonth + "\/" + vY4;
					break;
				case "DD\/MM\/YY" :
					vData = vDD + "\/" + vMonth + "\/" + vY2;
					break;
				case "DD-MM-YYYY" :
					vData = vDD + "-" + vMonth + "-" + vY4;
					break;
				case "DD-MM-YY" :
					vData = vDD + "-" + vMonth + "-" + vY2;
					break;

				default :
					vData = vMonth + "\/" + vDD + "\/" + vY4;
			}

			return vData;
		}

		function Build(p_item, p_month, p_year, p_format) {
			var p_WinCal = ggWinCal;
			gCal = new Calendar(p_item, p_WinCal, p_month, p_year, p_format);

			// Customize your Calendar here..
			gCal.gBGColor="white";
			gCal.gLinkColor="black";
			gCal.gTextColor="black";
			gCal.gHeaderColor="darkgreen";

			// Choose appropriate show function
			if (gCal.gYearly)	gCal.showY();
			else	gCal.show();
		}

		function show_calendar() {
			/* 
				p_month : 0-11 for Jan-Dec; 12 for All Months.
				p_year	: 4-digit year
				p_format: Date format (mm/dd/yyyy, dd/mm/yy, ...)
				p_item	: Return Item.
			*/

			p_item = arguments[0];
			if (arguments[1] == null)
				p_month = new String(gNow.getMonth());
			else
				p_month = arguments[1];
			if (arguments[2] == "" || arguments[2] == null)
				p_year = new String(gNow.getFullYear().toString());
			else
				p_year = arguments[2];
			if (arguments[3] == null)
				p_format = "MM/DD/YYYY";
			else
				p_format = arguments[3];

			vWinCal = window.open("", "Calendar", 
				"width=250,height=250,status=no,resizable=no,top=200,left=200");
			vWinCal.opener = self;
			ggWinCal = vWinCal;

			Build(p_item, p_month, p_year, p_format);
		}
		/*
		Yearly Calendar Code Starts here
		*/
		function show_yearly_calendar(p_item, p_year, p_format) {
			// Load the defaults..
			if (p_year == null || p_year == "")
				p_year = new String(gNow.getFullYear().toString());
			if (p_format == null || p_format == "")
				p_format = "MM/DD/YYYY";

			var vWinCal = window.open("", "Calendar", "scrollbars=yes");
			vWinCal.opener = self;
			ggWinCal = vWinCal;

			Build(p_item, null, p_year, p_format);
		}
		
		/*
		Open Calender
		*/
		
		
		function openCalander(controlName,date) {
		y=window.event.screenY;
		x=window.event.screenX;
		var obj = document.getElementById(controlName);
		//alert(obj.value);
		if(y > 400)
			{x = x + 30 ; y = y - 150;}
		else
			{x = x + 30; y = y - 10;}
		var date = "";
		var now = new Date();
		
		//alert(document.getElementById(' + controlName + ').value);
		//alert(now + "   -    " + now.getMonth() + "/" + now.getDate() + "/" + now.getFullYear());
		var url = "Calendar.aspx?date=" + obj.value + "&control=" + controlName;
		popWin=window.open(url,"calendar","height=220,width=260,scrollbars=no,status=0,titlebar=no,screenX="+x+",left="+x+",screenY="+y+",top="+y);
		popWin.focus();
	}

///////////////////////////////////////////////////////////////////////////////////////end of Calandar Controls////////////////////////////////////////

        function decodeHtml(inputControl)
        {
            if(inputControl.value)
            {
                var div = document.createElement('div');
                div.innerHTML = encodeURI(inputControl.value);
                if(div.innerText) // IE
                {
                    inputControl.value = decodeURI(div.innerText);
                }
                else if(div.textContent) // FireFox
                {
                    inputControl.value = decodeURI(div.textContent);
                }
                
                encodeHtml(inputControl);
            }
        }
        
        function encodeHtml(inputControl)
        {
            var regex = /\b\r\n\b/g;
            inputControl.value = inputControl.value.replace(regex, "%0D%0A");
            
            var div = document.createElement('div');
            var text = document.createTextNode(inputControl.value);
            div.appendChild(text);
            inputControl.value = decodeURI(div.innerHTML);
        }
        
        /******************************************************************
		* OpenWindowFullScreen(Url)
		* Opens the new window with screen's height and width
		*******************************************************************/
		function OpenWindowFullScreen(Url) {
		   var w = screen.width - 10;
		   var h = screen.height - 20;
		   
		   var params  = 'width='+ w
             params += ', height='+ h
             params += ', top=0, left=0'
             params += ', resizable=1'
             params += ', scrollbars =1'
             params += ', status =1'
             
           var win = window.open(Url, '_blank', params);
        }
