// AuctionDate

aImgTop 		= new Array(); 
aAdidTop		= new Array();
aTypeTop		= new Array();

aImgLeft 		= new Array();
aAdidLeft		= new Array();
aTypeLeft		= new Array();

aImgRite 		= new Array(); 
aAdidRite		= new Array();
aTypeRite		= new Array();

aImgTemp 		= new Array(); 
aAdidTemp		= new Array();
aTypeTemp		= new Array();

reEmail=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/

//---------------------------------------------------------------------------------- writeGoogleAdverts
function writeGoogleAdverts(numToShow)
{

	randomCount	= 6;	
	randomImage	= '<div class="adimage"><img src="i/ad/random%RANDOM_ID%.jpg" width="160" alt="auction date" /></p>';
	googleLine	=  '<p class="adimage">';
	googleLine	+= '<script type="text/javascript">';
	googleLine	+= 'google_ad_client = "pub-3827603934811810";';
	googleLine	+= 'google_ad_width  = 160;';
	googleLine	+= 'google_ad_height = 600;';
	googleLine	+= 'google_ad_format = "160x600_as";';
	googleLine	+= 'google_ad_type   = "text_image";';
	googleLine	+= 'google_ad_channel = "8232940704+0957651958";';
	googleLine	+= 'google_color_border = "2F2F2F";';
	googleLine	+= 'google_color_bg   = "ffffff";';
	googleLine	+= 'google_color_link = "3D83BB";';
	googleLine	+= 'google_color_text = "303030";';
	googleLine	+= 'google_color_url  = "3D83BB";';
	googleLine	+= '</script>';
	googleLine	+= '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
	googleLine	+= '<img src="i/ad/random%RANDOM_ID%.jpg" width="160" alt="auction date" />';
	googleLine	+= '</div>';

	oHtml = 'help';

	randomId 	= 1 + Math.round((randomCount - 1) * Math.random()) // generate a random number between 1 and the randomCount

	for (var x=0; x < numToShow; x++)
   		{

		outLine 	= googleLine ;
		outLine	= outLine.replace(/%RANDOM_ID%/g,randomId);
		oHtml 	+= outLine;

		randomId++; 
		if (randomId > randomCount)
			randomId = 1;

		}
prompt(1,oHtml);
	document.write(oHtml);
}


//---------------------------------------------------------------------------------- writeAdverts
function writeAdverts(placement,nextAdIndex, numToShow)
{
	oHtml='';

	switch(placement)
		{
		case 'top': 
			randomCount	= 0;	
			randomImage	= '';
			inLine 	= '<p><a href="../glob-php/commercial_advert_redirect.php?adid=%ADVERT_ID%" target="_blank"><img src="i/ad/%IMG_NAME%" width="550" alt="advert" /></a></p>'; 
			inLine2 	= '<p><a href="../glob-php/commercial_advert_redirect.php?adid=%ADVERT_ID%&auctiondate=1" target="_top"><img src="i/ad/%IMG_NAME%" width="550" alt="advert" /></a></p>';
			aImgTemp 	= aImgTop;
			aAdidTemp	= aAdidTop;
			aTypeTemp	= aTypeTop;
			break;
		case 'left': 
			randomCount	= 0;	
			randomImage	= '';
			inLine 	= '<p class="adimage" align="center"><a href="../glob-php/commercial_advert_redirect.php?adid=%ADVERT_ID%" target="_blank"><img src="i/ad/%IMG_NAME%" width="160" alt="advert" /></a></p>'; 
			inLine2 	= '<p class="adimage" align="center"><a href="../glob-php/commercial_advert_redirect.php?adid=%ADVERT_ID%&auctiondate=1" target="_top"><img src="i/ad/%IMG_NAME%" width="160" alt="advert" /></a></p>';
			aImgTemp 	= aImgLeft;
			aAdidTemp	= aAdidLeft;
			aTypeTemp	= aTypeLeft;
			break;
		case 'right': 
			randomCount	= 6;	
			randomImage	= '<p class="adimage"><img src="i/ad/random%RANDOM_ID%.jpg" width="160" alt="auction date" /></p>';	
			//inLine 	= '<p class="adimage"><a href="../glob-php/commercial_advert_redirect.php?adid=%ADVERT_ID%" target="_blank"><img src="i/ad/%IMG_NAME%" width="160" alt="advert" /></a></p>'; 
			//inLine2	= '<p class="adimage"><a href="../glob-php/commercial_advert_redirect.php?adid=%ADVERT_ID%&auctiondate=1" target="_top"><img src="i/ad/%IMG_NAME%" width="160" alt="advert" /></a></p>';

			inLine3	=  '<p class="xadimage">';
			inLine3	+= '<script type="text/javascript">';
			inLine3	+= 'google_ad_client = "pub-3827603934811810";';
			inLine3	+= 'google_ad_width  = 160;';
			inLine3	+= 'google_ad_height = 600;';
			inLine3	+= 'google_ad_format = "160x600_as";';
			inLine3	+= 'google_ad_type   = "text_image";';
			inLine3	+= 'google_ad_channel = "8232940704+0957651958";';
			inLine3	+= 'google_color_border = "2F2F2F";';
			inLine3	+= 'google_color_bg   = "ffffff";';
			inLine3	+= 'google_color_link = "3D83BB";';
			inLine3	+= 'google_color_text = "303030";';
			inLine3	+= 'google_color_url  = "3D83BB";';
			inLine3	+= '</script>';
			inLine3	+= '<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>';
			inLine3	+= '</p>';

			inLine = inLine3;
			aImgTemp 	= aImgRite;
			aAdidTemp	= aAdidRite;
			aTypeTemp	= aTypeRite;
			break;
		}

	j 		= nextAdIndex;
	lastEntry 	= aImgTemp.length - 1;

	if (j > lastEntry)
		j = 1 + Math.round((lastEntry - 1) * Math.random()) // generate a random number between 1 and the max entry 

	randomId = 1 + Math.round((randomCount - 1) * Math.random()) // generate a random number between 1 and the randomCount 

	for (var x=0; x < numToShow; x++)
   		{
		if (aImgTemp[j])
      		{
	
			if (aTypeTemp[j].indexOf('auctiondate') == -1)
				outLine = inLine + randomImage; 
			else
				outLine = inLine2 + randomImage; //local link
			outLine= outLine.replace(/%ADVERT_ID%/g,aAdidTemp[j]);
			outLine= outLine.replace(/%IMG_NAME%/g,aImgTemp[j]);
			outLine= outLine.replace(/%RANDOM_ID%/g,randomId);
			oHtml += outLine;
			j++; 
			if (j > lastEntry)
				j = 1;

			randomId++; 
			if (randomId > randomCount)
				randomId = 1;


			}
		}
if (placement == "right") prompt(1,oHtml);

	document.write(oHtml);
}


//---------------------------------------------------------------------------------- getSelectedRadio
function getSelectedRadio(formID,fieldID)
{
	chosen 	= "";
	radioButt	= eval("formID."+fieldID);
	len 		= radioButt.length;

	for (i = 0; i < len; i++)
	{
	if (radioButt[i].checked)
		{
		chosen = radioButt[i].value
		}
	}
	return chosen;
}

//---------------------------------------------------------------------------------- getSelectedRadioPos
function getSelectedRadioPos(formID,fieldID)
{
	chosen 	= "";
	radioButt	= eval("formID."+fieldID);
	len 		= radioButt.length;

	for (i = 0; i < len; i++)
	{
	if (radioButt[i].checked)
		{
		chosen = i;
		}
	}
	return chosen;
}


//---------------------------------------------------------------------------------- setSelectedRadio
function setSelectedRadio(formID,fieldID,setVal)
{
	radioButt	= eval("formID."+fieldID);
	len 		= radioButt.length;

	for (i = 0; i < len; i++)
	{
	if (radioButt[i].value == setVal)
		{
		radioButt[i].checked = "checked";
		}
	}
}

//---------------------------------------------------------------------------------- setSelectedDropdown
function setSelectedDropdown(formID,fieldID,newVal)
{
	chosen 	= "";
	dropdownID	= eval("formID."+fieldID);
	len 		= dropdownID.length;

	for (i = 0; i < len; i++)
		{
		temp=dropdownID[i].value;alert(temp);
		if (temp == newVal)
			{
			dropdownID[i].selected = "selected";
			//dropdownID.selectedIndex = i;
			}
		}

}


//---------------------------------------------------------------------------------- getSelectedDropdownText
function getSelectedDropdownText(formID,fieldID)
{

	idx = document.forms[formID].elements[fieldID].selectedIndex;

	if (idx > -1)
		var foundText = document.forms[formID].elements[fieldID].options[idx].text;
	else
		var foundText = '';

	return foundText;
}


//---------------------------------------------------------------------------------- makePOSTRequest (AJAX)
function makePOSTRequest(url, parameters, checkRoutine)
{
	http_request = false;
	
	if (window.XMLHttpRequest) 
   		{ // Mozilla, Safari etc
		http_request = new XMLHttpRequest();
		
		if (http_request.overrideMimeType)
      		{
         		// set type accordingly to anticipated content type
			// http_request.overrideMimeType('text/xml');
          		http_request.overrideMimeType('text/html');
         		}
		}
	else if (window.ActiveXObject) 
			{ // IE
       		try {http_request = new ActiveXObject("Msxml2.XMLHTTP");} 
       		catch (e) {try {http_request = new ActiveXObject("Microsoft.XMLHTTP");} 
       		catch (e) {}
			}
		}
   
	if (!http_request)
		{
       	alert('Cannot create XMLHTTP instance');
		return false;
		}
      
	eval("http_request.onreadystatechange = " + checkRoutine + ";");
	http_request.open('POST', url, true);
	http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http_request.setRequestHeader("Content-length", parameters.length);
	http_request.setRequestHeader("Connection", "close");
	http_request.send(parameters);
}

//---------------------------------------------------------------------------------- createRequestString (AJAX)
function createRequestString(theForm)
{
	var reqStr = "";

	for(i=0; i < theForm.elements.length; i++)
		{
		isFormObject = false;

		switch (theForm.elements[i].tagName)
			{
			case "INPUT":

			switch (theForm.elements[i].type)
				{
				case "text":

				case "hidden":
					reqStr += theForm.elements[i].name + "=" + encodeURIComponent(theForm.elements[i].value);
					isFormObject = true;
					break;

				case "checkbox":
					if (theForm.elements[i].checked)
						{
						reqStr += theForm.elements[i].name + "=" + theForm.elements[i].value;
						}
					else
						{
						reqStr += theForm.elements[i].name + "=";
						}
					isFormObject = true;
					break;

				case "radio":
					if (theForm.elements[i].checked)
						{
						reqStr += theForm.elements[i].name + "=" + theForm.elements[i].value;
						isFormObject = true;
						}
				}
				break;

			case "TEXTAREA":
				reqStr += theForm.elements[i].name + "=" + encodeURIComponent(theForm.elements[i].value);
				isFormObject = true;
				break;

			case "SELECT":
				var sel = theForm.elements[i];
				reqStr += sel.name + "=" + sel.options[sel.selectedIndex].value;
				isFormObject = true;
				break;
			}

		if ((isFormObject) && ((i+1)!= theForm.elements.length))
			{
			reqStr += "&";
			}

		}

	return reqStr;
} 


function filterLineBreaks (ta) 
{
  ta = ta.replace(/\r\n|\r|\n/g, '<br />');
  return ta;
}

function limitLineBreaks (ta,maxLimit) 
{
	break_count =0;
	out_ta = '';

	for (var x=0; x < 500; x++)
   		{
		if (ta.substring(x, x+6) == '<br />')
			{
			break_count = break_count + 1;
			if (break_count > maxLimit)
				{out_ta = out_ta + ' ';x=x+5;}
			else
				{out_ta = out_ta + ta.substring(x, x+1);}
			}
		else if (ta.substring(x, x+4) == '<br>')
			{
			break_count = break_count + 1;
			if (break_count > maxLimit)
				{out_ta = out_ta + ' ';x=x+3;}
			else
				{out_ta = out_ta + ta.substring(x, x+1);}
			}
		else
			{
			out_ta = out_ta + ta.substring(x, x+1);
			}
		}

	//alert(break_count);
	//alert(out_ta);
  	return out_ta;
}

function addLineBreaks (ta) 
{
  ta = ta.replace(/<br \/>|<br>/g, '\n');
  return ta;
}

function formatDisplayBreaks (ta) 
{
	if (IsUsingIE())	
		ta = ta.replace(/<br \/>/g, '<br \/><br \/>');
  	return ta;
}

function displayOn(objectID)
  {
	domStyle = findDOM(objectID,1);
	domStyle.display='block';
  }

function displayOff(objectID)
  {
  	domStyle = findDOM(objectID,1);
	domStyle.display='none';
  }

function visibleOn(objectID)
  {
	domStyle = findDOM(objectID,1);
	domStyle.visibility='visible';
  }

function visibleOff(objectID)
  {
  	domStyle = findDOM(objectID,1);
	domStyle.visibility='hidden';
  }

function trimAll(sString)
	{
	while (sString.substring(0,1) == ' ')
		{
		sString = sString.substring(1, sString.length);
		}

	while (sString.substring(sString.length-1, sString.length) == ' ')
		{
		sString = sString.substring(0,sString.length-1);
		}
	return sString;
	}
 

extArray = new Array(".gif", ".jpg", ".png");

function isValidFileExt(form, file)
{

	allowSubmit = false;
	if (!file)
		return false;
	
	while (file.indexOf("\\") != -1)
		file = file.slice(file.indexOf("\\") + 1);
	
	ext = file.slice(file.indexOf(".")).toLowerCase();

	for (var i = 0; i < extArray.length; i++) 
		{
		if (extArray[i] == ext) 
			{allowSubmit = true;break;}
		}
	if (allowSubmit) 
		return true;
	else
		return false;
}

function isValidUrl(s)
{
	//reURL=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/

	var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
	return regexp.test(s);
}

//FUNCs
function IsUsingIE() { var result = false; var strBrowser = navigator.appName.toLowerCase(); if (strBrowser.indexOf("microsoft") != -1) result = true; return result; }

function IsUsingNS() { var result = false; var strBrowser = navigator.appName.toLowerCase(); if (strBrowser.indexOf("netscape") != -1) result = true; return result;}

function IsUsingOP() { var result = false; var strBrowser = navigator.appName.toLowerCase(); if (strBrowser.indexOf("opera") != -1) result = true; return result;}

function IsUsingSAF() { var result = false; var strBrowser = navigator.userAgent.toLowerCase(); if (strBrowser.indexOf("safari") != -1) result = true; return result;}

function IsUsingPC() { var result = false; var strBrowser = navigator.userAgent.toLowerCase(); if (strBrowser.indexOf("win") != -1) result = true; else if (strBrowser.indexOf("inux") != -1) result = true; return result; }

function IsUsingMAC() { var result = false; var strBrowser = navigator.userAgent.toLowerCase(); if (strBrowser.indexOf("mac") != -1) result = true; else if (strBrowser.indexOf("68k") != -1) result = true; return result; }


function limitText(limitField, limitCount, limitNum) 
{
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}

//FUNC---------------------------------------------------------------------------------------roundNumber
function roundNumber(Num, Places, ZeroPad) 
{
	if (!isNumeric(Num)) {Num=0;}

	var Num = parseFloat(Num);

	if (ZeroPad > 0)
		{
		switch (Places)
			{
			case 0:		addon = '';break;
			case 1:		addon = '.0';break;
			case 2:		addon = '.00';break;
			case 3:		addon = '.000';break;
			case 4:		addon = '.0000';break;
			default:	addon = '';
			}
		}
	else
		{
		addon='';
		}

   if (Places > 0) 
	{
       	var Rounder = Math.pow(10, Places);
	ret_val = (Math.round(Num * Rounder) / Rounder);
	if (ret_val.toString().lastIndexOf('.') > 0)
       		{return ret_val;}
	else
		{return ret_val+addon;}
					
   	}	
   else return Math.round(Num);
}

// end func

//FUNC---------------------------------------------------------------------------------------isNumeric
function isNumeric(sText)
{
   var ValidChars = "0123456789.-";
   var IsNumber=true;
   var Char;

   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
}

function textCounter(theField,theCharCounter,theLineCounter,maxChars,maxLines,maxPerLine)
{
	var strTemp = "";
	var strLineCounter = 0;
	var strCharCounter = 0;

	st = theField.value;
	//st = theField.value.split('\n')
	//st = st.join(' ')
	//st = st.split('\r')
	//st = st.join(' ')
	//st = st.split(' ')
	//st = st.join(' ')
	//alert(st);
	
	for (var i = 0; i < st.length; i++)
		{
		var strChar = st.substring(i, i + 1);
		var strNextChar = st.substring(i+1, i + 2);
		//alert(strChar);
		if ((strChar == '\n') || (strChar == '\r\n'))
			{//alert('break found at postion' + i); 
			strTemp += strChar;
			strCharCounter = 0;
			strLineCounter += 1;
			}
		else if ((strCharCounter == (maxPerLine + 0)) && (strNextChar != '\n'))
			{//alert(strCharCounter); 
			strTemp += '\n' + strChar;
			strCharCounter = 0;
			strLineCounter += 1;
			}
		else
			{
			strTemp += strChar;
			strCharCounter ++;
//alert(strCharCounter); 
			}
		}

	theCharCounter.value = maxChars - strTemp.length;
	theLineCounter.value = maxLines - strLineCounter;

	theField.value = strTemp;

	//if (theCharCounter.value < (maxLines - theLineCounter.value)) 
	//	{
	//	theField.value = theField.value.substring(0, maxChars);
	//	theCharCounter.value = 0;
	//	}

	//if (theLineCounter.value < 1) 
	//	{		
	//	theField.value = theField.value.substring(0, maxChars);
	//	theLineCounter.value = 0;
	//	}

}




function testje(fieldName)
{

	st = fieldName.value.split('\n')
	st = st.join(' ')
	st = st.split('\r')
	st = st.join(' ')
	st = st.split(' ')
	st = st.join(' ')

	col		= fieldName.cols
	lineLength 	= col-1


	vorige 	= 0
 	regels 	= new Array()
	r 		= 0

	while(lineLength < st.length && r < fieldName.rows)
		{
		lineLength = st.lastIndexOf(' ',lineLength)
		regels[r] = st.substring(vorige,lineLength)
		r++
		vorige = lineLength+1
		lineLength += col
		}

	if (r < fieldName.rows)
		regels[r]=st.substring(vorige,st.length)
	else 
		fieldName.blur()

	st=regels.join('\n')
}

function ververs(fieldName) 
{
	st = fieldName.value.split('\n')
	st = st.join(' ')
	st = st.split('\r')
	st = st.join(' ')
	st = st.split(' ')
	st = st.join(' ')

	col		= fieldName.cols
	lineLength 	= col-1


	vorige 	= 0
 	rowSpace 	= new Array()
	r 		= 0

	while(lineLength < st.length && r < fieldName.rows)
		{
		lineLength = st.lastIndexOf(' ',lineLength)
		rowSpace[r] = st.substring(vorige,lineLength)
		r++
		vorige = lineLength+1
		lineLength += col
		}

	if (r < fieldName.rows)
		rowSpace[r]=st.substring(vorige,st.length)
	else 
		fieldName.blur()

	st=rowSpace.join('\n')

	if (r >= fieldName.rows)
		alert('knipperdeknip')

	fieldName.value =st
} 


function textAreaSplit(theField,maxLines,maxPerLine)
{
	var strTemp = "";
	var strLineCounter = 0;
	var strCharCounter = 0;

	//st = theField.value;
	userLine = theField.value.split('\n');
	//st = st.join(' ')
	//st = st.split('\r')
	//st = st.join(' ')
	//st = st.split(' ')
	//st = st.join(' ')
	//alert(st);
outLine = new Array();
x=0;
	for (var i = 0; i < userLine.length; i++)
		{
		//alert(userLine[i]);
		//}
		if (userLine[i].length >= maxPerLine)
			{
			outLine[x++]=userLine[i].substring(0,31)+' ';
			outLine[x++]=userLine[i].substring(0+32,31+32)+' ';
			outLine[x++]=userLine[i].substring(0+64,31+64)+' ';
			outLine[x++]=userLine[i].substring(0+96,31+96)+' ';
			outLine[x++]=userLine[i].substring(0+128,31+128)+' ';
			outLine[x++]=userLine[i].substring(0+160,31+160)+' ';
			outLine[x++]=userLine[i].substring(0+192,31+192)+' ';
			outLine[x++]=userLine[i].substring(0+224,31+224)+' ';
			outLine[x++]=userLine[i].substring(0+256,31+256)+' ';
			outLine[x++]=userLine[i].substring(0+288,31+288)+' ';
			outLine[x++]=userLine[i].substring(0+320,31+320)+' ';
			outLine[x++]=userLine[i].substring(0+352,31+352)+' ';
			outLine[x++]=userLine[i].substring(0+384,31+384)+' ';
			}
		else
			{
			outLine[x++]=userLine[i]+'\n';	 
			}
		}
	outField ='';
	for (var f = 0; f < outLine.length; f++)
		{
		if (outLine[f] != ' ')
			//alert(outLine[f]);
			outField=outField+outLine[f];
		}

	theField.value = outField;

}




function textAreaSplit2(theField,maxLines,maxPerLine)
{
	var strTemp = "";
	var strLineCounter = 0;
	var strCharCounter = 0;

	userLine = theField.value;
	userLine = userLine.split('\n');
	userLine = userLine.join(' ')
	userLine = userLine.split('\r')
	userLine = userLine.join(' ')
	userLine = userLine.split(' ')

outLine = new Array();
x=0;
	for (var i = 0; i < userLine.length; i++)
		{
		//alert(userLine[i]);
		//}
		if (userLine[i].length >= maxPerLine)
			{
			outLine[x++]=userLine[i].substring(0,31)+' ';
			outLine[x++]=userLine[i].substring(0+32,31+32)+' ';
			outLine[x++]=userLine[i].substring(0+64,31+64)+' ';
			outLine[x++]=userLine[i].substring(0+96,31+96)+'';
			outLine[x++]=userLine[i].substring(0+128,31+128)+'\n';
			outLine[x++]=userLine[i].substring(0+160,31+160)+'\n';
			outLine[x++]=userLine[i].substring(0+192,31+192)+'\n';
			outLine[x++]=userLine[i].substring(0+224,31+224)+'\n';
			outLine[x++]=userLine[i].substring(0+256,31+256)+'\n';
			outLine[x++]=userLine[i].substring(0+288,31+288)+'\n';
			outLine[x++]=userLine[i].substring(0+320,31+320)+'\n';
			outLine[x++]=userLine[i].substring(0+352,31+352)+'\n';
			outLine[x++]=userLine[i].substring(0+384,31+384)+'\n';
			}
		else
			{
			outLine[x++]=userLine[i];	 
			}
		}
	outField ='';
	for (var f = 0; f < outLine.length; f++)
		{
		if (outLine[f] != '\n')
			//alert(outLine[f]);
			outField=outField+outLine[f];
		}
	//for (var i = 0; i < st.length; i++)
	//	{
	//	var strChar = st.substring(i, i + 1);
	//	var strNextChar = st.substring(i+1, i + 2);
	//	//alert(strChar);
	//	if ((strChar == '\n') || (strChar == '\r\n'))
	//		{//alert('break found at postion' + i); 
	//		strTemp += strChar;
	//		strCharCounter = 0;
	//		strLineCounter += 1;
	//		}
	//	else if ((strCharCounter == (maxPerLine + 0)) && (strNextChar != '\n'))
	//		{//alert(strCharCounter); 
	//		strTemp += '\n' + strChar;
	//		strCharCounter = 0;
	//		strLineCounter += 1;
	//		}
	//	else
	///		{
	//		strTemp += strChar;
	//		strCharCounter ++;
//alert(strCharCounter); 
	//		}
	//	}

	//theCharCounter.value = maxChars - strTemp.length;
	//theLineCounter.value = maxLines - strLineCounter;

	theField.value = outField;

	//if (theCharCounter.value < (maxLines - theLineCounter.value)) 
	//	{
	//	theField.value = theField.value.substring(0, maxChars);
	//	theCharCounter.value = 0;
	//	}

	//if (theLineCounter.value < 1) 
	//	{		
	//	theField.value = theField.value.substring(0, maxChars);
	//	theLineCounter.value = 0;
	//	}

}

