function showMore(obj)
	{
		obj.style.display = ""
	}
function showLess(obj)
	{
		obj.style.display = "none"
	}
function disappear(obj) {
	if (obj.style.display == "") {
		obj.style.display = "none";
	}
	else {
		obj.style.display = "";
	}
}				
function AreUSureForm(msg, theForm) {
	if (confirm("Are you sure you want to delete " + msg + "?")) {
		theForm.submit();}
	else {return false}
}
function AreUSure(msg, theUrl) {
	if (confirm("Are you sure you want to delete  + msg + ?")) {
		document.location.href=theUrl;
		
	}
}

function swap(b) { 
  var a = "pix0"; 
  var tmp = document.getElementById(a).src; 
  document.getElementById(a).src=document.getElementById(b).src;    
 } 
 
function getAd(ID){
	x=window.open('viewadimage.cfm?ID='+ID,'Ad','height=430,width=780,scrollbars=yes,resizable=yes,left=20,top=10,status=yes');
	x.focus();      
 } 

function getDirectory(ID){
	x=window.open('viewdirectory2.cfm?ID='+ID,'Ad','height=430,width=610,scrollbars=yes,resizable=yes,left=20,top=10,status=yes');
	x.focus();      
} 

function textCounter2(theField,theCharCounter,theLineCounter,theLinesComplete,maxChars,maxLines,maxPerLine)
{
	var strTemp = "";
	var strLineCounter = 0;	
	var strCharCounter = 0;		

	for (var i = 0; i < theField.value.length; i++)	
	{
		var strChar = theField.value.substring(i, i + 1);			

		if (strChar == '\n')	
		{	
			strTemp += strChar;	
			strCharCounter = 1;	
			strLineCounter += 1;	
		}	
		else if (strCharCounter == maxPerLine)	
		{	
			strTemp += '\n' + strChar;	
			strCharCounter = 1;	
			strLineCounter += 1;	
		}	
		else	
		{	
			strTemp += strChar;	
			strCharCounter ++;	
		}	
	}		
	

	if (strTemp.length > maxChars) // if too long...trim it!	  	
		 alert("Maximum length reached. You have reached the maximum length allowed.\nPlease revise your description.");
	else
		theCharCounter.value = maxChars - strTemp.length;
	

	if (strLineCounter >= maxLines) // if too long...trim it!
		 alert("Maximum length reached. You have reached the maximum length allowed.\nPlease revise your description.");
	else
		theLineCounter.value = maxLines - strLineCounter;		
		theLinesComplete.value = strLineCounter;

}

