
<!--// format the Search price field on the propsearch form

////load iamges and swap
	
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
////////



function CheckPrice (which_field,strValue) {

        if (strValue == "") {
                return ("");
        }
        
        // Take out dollar sign
        if (strValue.substr (0, 1) == "$") {
                strValue = strValue.substr (1);
        }

        // take out commas
        do 
        {
                iPos = strValue.indexOf (",");
                if (iPos > 0) {
                        strValue = strValue.substr (0, iPos) + strValue.substr (iPos + 1);
                }
        } 
        while (iPos > 0);
        
        iPodd = strValue.indexOf (".");
                if (iPodd >= 1) {
                        alert ("Please use only whole numbers");
                which_field.value="";
                which_field.focus();
                return (0);
                
                }
        
        if (isNaN(strValue)) {
                alert ("Please do not user dollar signs ($), decimals (.), or commas (,) in price fields");
                which_field.value="";
                which_field.focus();
                return (0);
                
        }
        

        // Check if price is below 1000
         
        if (parseInt (strValue) < 1000) {
                strValue = strValue + "000";
        }

        
        return (FormatCurrency (strValue,which_field));
}

function FormatCurrency (strValue,which_field) {
        iLen = strValue.length
        strRight3 = strValue.substr (iLen - 3);
        if (iLen > 6) {
                strMid3 = strValue.substr (iLen - 6, 3);
                strLeft3 = strValue.substr (0, iLen - 6);
                strValue = "$" + strLeft3 + "," + strMid3 + "," + strRight3;
        } 
        else {
			if (strValue == "0")
			{
				strValue = "$" + strValue;
			}
			else
			{
                strMid3 = strValue.substr (iLen - 6, iLen - 3);
                strLeft3 = "";
                strValue = "$" + strMid3 + "," + strRight3;
            }
        }

        
        which_field.value=strValue
        //alert(strformfield)
}

///////////////////////////////////////////////////

//hides and shows areas
			function showLevel( _levelId) {
				var thisLevel = document.getElementById( _levelId );
					if ( thisLevel.style.display == "none") {
						thisLevel.style.display = "block";
						thisLevel.style.visibility = "visible";
					 }
				else {
					thisLevel.style.display = "none";
					thisLevel.style.visibility = "hidden";
				}
			}

///////////////////////////////////////////////////

//hides and shows areas

			function ToggleRecent(divID,DisplayID) {
			
				var thisLevel = document.getElementById(divID);
				var thisDisplay = document.getElementById(DisplayID);
					if ( thisLevel.style.display == "none") {
					
						thisLevel.style.display = "block";
						thisLevel.style.visibility = "visible";
						thisDisplay.innerHTML = "[-]";
					 }
				else {
				
					thisLevel.style.display = "none";
					thisLevel.style.visibility = "hidden";
					thisDisplay.innerHTML = "[+]";
				}
			}
//********************************************************
//chekc login in form
function CheckLogin(){

			var tmpValid = "0"
			
			
			
			if (isWhitespace(document.FormLogin.UserID.value))
				{
				alert("Please enter your User ID")
				document.FormLogin.UserID.focus();
				tmpValid++
				}
				
				else if  (isWhitespace(document.FormLogin.Password.value))
					{
					alert("Please enter your Password")
					document.FormLogin.Password.focus();
					tmpValid++
					}
				
				
			
			if (tmpValid == "0") {
				return (true);
			}
			else {
				return (false)
				}
		}
		
	//////////////////////////////////////////////////////////////////
		// ***** only allow one search param to look up listing info showtime/home.asp
		function clearOne(str_value,fieldToClear) {
			/*
			if (str_value != '') {
			//	alert(str_value)
			
			if (fieldToClear ='ln') {
				document.form1.ln.value ==''
				document.form1.ln.disabled = true
				}
			
			if(fieldToClear ='street') {
				document.form1.street.vallue ==''
				document.form1.Subdivision.value ==''
				document.form1.City.value ==''
				document.form1.agent.value ==''
				document.form1.street.disabled = true
				document.form1.Subdivision.disabled = true
				document.form1.City.disabled = true
				document.form1.agent.disabled = true
				}
				
			}
			
			if (str_value ='') {
				if (fieldToClear ='ln') {
				document.form1.ln.disabled = false
				}
				
				 if(fieldToClear ='street') {
				document.form1.street.disabled = false
				document.form1.Subdivision.disabled = false
				document.form1.City.disabled = false
				document.form1.agent.disabled = false
				}
			
			
			}*/
		}
		
	//******* CHECKS FIELDS ON Prop search criteria page
function check_criteria(){
	var display = "The following fields are required:\n"
	var failed=false
	
	
	
		
		if (document.searchform.area.value=='') {
	  	display = display + "Search Area\n"
	 	 failed= true	
		}
		
		if (document.searchform.TYP.value=='') {
	  	display = display + "Property Type\n"
	 	 failed= true	
		}
		
		if (document.searchform.LN.value!='') {
	  	//display = display + "Property Type"
	 	 failed= false	
		}
		
			
	if (failed==true){
		display = display + "Or MLS Number"
		alert(display)
		return(false)
	}
	else {
		
	return(true)
}



	}
	
	///////////////////////////////////////////////////////////////
	
	//****** moves area from list to text box??
function MoveAreas(AreaValue,ListValue) {
		var NewAreaValule
		
		if (AreaValue=='') {
			NewAreaValule=ListValue
			}
		else {
			NewAreaValule = AreaValue +","+ ListValue
			}
		document.searchform.area.value=NewAreaValule
		}
	
	/////////////////////////////////////////////////////////////////////////////	
			//***** checks to make sure only one email address is in the agent email field
		function checkemail(which_field,email_address)
			{
				//var email_address = formagent.emailaddress.value;
  				var AtSign = 0;
				for (i = 0;  i < email_address.length;  i++)	
					if (email_address.charAt(i) == '@')
					{
						
						AtSign++;
						}
						
					if(AtSign >= 2){
					
					alert('Only one email address is allowed in this field.\n ');
						which_field.value="";
							which_field.focus();
					}
					
				}
///////////////////////////////////////////////////////////////////////
//******* CHECKS FIELDS ON Agent Info page
function CheckAgentUpdate(){
	var tmpValid = "0"
			
			
			
			if (isWhitespace(document.formagent.First_Name.value))
				{
				alert("First Name is Required")
				document.formagent.First_Name.focus();
				tmpValid++
				}
			
			else if  (isWhitespace(document.formagent.last_Name.value))
					{
					alert("Last Name is Required")
					document.formagent.last_Name.focus();
					tmpValid++
					}
			
			else if  (isWhitespace(document.formagent.password.value))
					{
					alert("Password is Required")
					document.formagent.password.focus();
					tmpValid++
					}
				
			else if (document.formagent.emailaddress.value.toLowerCase()!='none' && !(isEmail(document.formagent.emailaddress.value)))
				{
				alert("Please Enter a valid email address")
				document.formagent.emailaddress.focus();
				tmpValid++
				}	
				
				//else if  (  (document.getElementById("sms").checked == true) &&  isWhitespace(document.getElementById("smsnumber").value)   )
				  //  {
					//alert("Cell Number and Carrier Required when activating SMS Messaging")
				
					//tmpValid++
					//}
			
			if (tmpValid == "0") {
				return (true);
			}
			else {
				return (false)
				}	
	
		



	}
	
	///////////////////////////////////////////////////////////////////////
//******* CHECKS FIELDS ON Agent Info page
function CheckAddAgent(){
	var tmpValid = "0"
			
			
			
			if (isWhitespace(document.form2.First_Name.value))
				{
				alert("First Name is Required")
				document.form2.First_Name.focus();
				tmpValid++
				}
			
			else if  (isWhitespace(document.form2.last_Name.value))
					{
					alert("Last Name is Required")
					document.form2.last_Name.focus();
					tmpValid++
					}
			
			else if  (isWhitespace(document.form2.password.value))
					{
					alert("Password is Required")
					document.form2.password.focus();
					tmpValid++
					}
			
			else if  (isWhitespace(document.form2.MLSid.value))
					{
					alert("MLS ID is Required")
					document.form2.MLSid.focus();
					tmpValid++
					}
				
			else if (document.form2.emailaddress.value.toLowerCase()!='none' && !(isEmail(document.form2.emailaddress.value)))
				{
				alert("Please Enter a valid email address")
				document.form2.emailaddress.focus();
				tmpValid++
				}	
			
			if (tmpValid == "0") {
				return (true);
			}
			else {
				return (false)
				}	
	
		



	}
	
	////////////////////////////////////////////////////
	
	//******* CHECKS Feed back FIELDS FeedBack/default.asp
function CheckFeedBack(){
	var display = "You have to specify a general client opinion,\n a specific comment, or both\n please try again"
	var failed=false	
	var Ocount = 1
		for (i=0;i<3;i++)
			{
				if (document.formfeedback.opinion[i].checked==true) {
					Ocount = Ocount+1
					 //failed=true
					//alert(Ocount)
	  	 		 }
	  	 	 
	  		}
	  		
	  		
	  		
	  		
	  		if (Ocount == 0 && document.formfeedback.comments.value=='') {
	  			//alert(Ocount)
	  			failed=true
	  		}
		
			
if (failed==true){
		alert(display)
		return(false)
		}
	else {
	document.getElementById('AddIt').disabled = true
	return(true)
	}

}

//////////////////////////////////////////////////////////
//***** checks email on send feedback  feedback/emailfeedback.default.asp

	//******* CHECKS FIELDS ON LN Search criteria page
function CheckFeedbackEmails(){
	var display = "Error!\n"
	var failed=false
	var ToAddress = document.sendEmail.ToAddress.value
	var ToAgentAddress = document.sendEmail.AgentAddress.value
	var ToAtSign = 0;
	var AgentAtSign = 0;
	
	
		
		for (i = 0;  i < ToAddress.length;  i++)	
		if (ToAddress.charAt(i) == '@')
		{
			
			ToAtSign++;
			
			}
			
		if(ToAtSign != 1){
		//alert(ToAddress)
			display = display + "Only One email address is allowed in this field\n"
	 	 failed=true	
	 	 }
	
	
	for (i = 0;  i < ToAgentAddress.length;  i++)	
		if (ToAgentAddress.charAt(i) == '@')
		{
			
			AgentAtSign++;
			}
			
		if(AgentAtSign != 1){
		//alert(ToAgentAddress)
			display = display + "Only One email address is allowed in this field\n"
	 	 failed= true	
	 	 }
		
		
	 if (!(isEmail(ToAddress))){
			display = display + "You must supply a valid email for your client\n"
	 	 failed= true	
	 	 }
	 	 
	 if (!(isEmail(ToAgentAddress))){
			display = display + "You must supply a valid email for yourself\n"
	 	 failed= true	
	 	 }
		
					
	if (failed==true){
		alert(display)
		return(false)
	}
	else {
		
	return(true)
}



	}
	
/////////////////////////////////////
//********* look up LN for auto fill listings/default.asp
function getln(listnum) {
	if (listnum != '') {
		location.href="default.asp?ln=" + listnum
		}
	}
	
	
	//********* look up LN for auto fill listings/assistant.asp
function assistgetln(listnum) {
	if (listnum != '') {
		location.href="assistant.asp?ln=" + listnum
		}
	}
	
		//********* look up LN for auto fill listings/assistant.asp
function teamgetln(listnum) {
	if (listnum != '') {
		location.href="team.asp?ln=" + listnum
		}
	}

////////////////////////////////////////////////

//****** adds quick instruction to listing listings/default.asp//
function QuickPick(quickp,maintext) {
	//if maintext != "" {
		document.form1.instructions.value= quickp + "\n" + maintext
	//}
		
		//else {
		//document.form1.instructions.value= quickp 
		//}
}


////////////////////////////////////////////////

//****** adds quick notes to showing/appointment.asp//
function QuickPick2(stamp,quickp,maintext,doit) {
	var d=new Date()
	var day=d.getDate()
	var month=d.getMonth() + 1
	var year=d.getFullYear()

		document.form1.notes.value= stamp + ": \n" + quickp + "\n \n" + maintext + "\n \n"
		
		if (doit == '1') 
			{
				document.form1.ShowAgent_confirm.checked = true
			}
	
}

////////////////////////////////////////////////
//******* CHECKS FIELDS ON Angent Info page
function CheckEditListing(){
	var tmpValid = "0"

	
	 if (document.form1.Sellersemail.value!='' && !(isEmail(document.form1.Sellersemail.value)))
				{
				alert("Please Enter a valid email address for your seller or leave blank")
				document.form1.Sellersemail.focus();
				tmpValid++
				}	
	
if (tmpValid == "0") {
				//document.getElementById('Submit1').disabled = true
				return (true);
			}
			
			else {
				return (false)
				}



	}
	




////////////////////////////////////////////////
//******* CHECKS FIELDS ON Angent Info page
function CheckNewListing(){
	var tmpValid = "0"
			
	if (isWhitespace(document.form1.ln.value))
		{
		alert("Listing Number is Required")
		document.form1.ln.focus();
		tmpValid++
		}
	
	else if (isWhitespace(document.form1.listprice.value))
		{
		alert("Listing Price is Required")
		document.form1.listprice.focus();
		tmpValid++
		}
	
	else if (isWhitespace(document.form1.listAgentName.value))
		{
		alert("Listing Agent\'s Name is Required")
		document.form1.listAgentName.focus();
		tmpValid++
		}
	
	else if (document.form1.Sellersemail.value!='' && !(isEmail(document.form1.Sellersemail.value)))
				{
				alert("Please Enter a valid email address for your seller or leave blank")
				document.form1.Sellersemail.focus();
				tmpValid++
				}	
	
if (tmpValid == "0") {
				document.getElementById('Submit1').disabled = true
				return (true);
			}
			else {
				return (false)
				}



	}
	
	////////////////////////////////////////////////////////////
	//confimr beofre deleting a listing
		function confirm_delete(id,ln){
		 var whereto = "/listings/DeleteListing.asp?Delete=1&ID=" + id + "&ln=" + ln
	
    if (confirm("Deleting this Listing will completely remove it and all associated information (feedback, appointment history, etc.) from the system.\n Are you sure you want to continue? Click OK to Delete this Listing. Click Cancel to do nothing")) {
        window.open(whereto,'deletelistings','width=450,height=140,') 
        
    }
    else {
        //do nothing
    }       
}
///////////////////////////////////////
//print showing instruc
	//function printinst(listid) {
	//print_window = window.open('PrintInstructions.asp?id='+listid,'print_window','width=620,height=590');
	//print_window.focus()

	function printinst(theURL, Name, popW, popH, scroll, resize) { // V 1.0

	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+'';
	Win = window.open(theURL, Name, winProp);
	Win.window.focus();

	
}	



//******* CHECKS FIELDS ON Agent assistant.asp
function CheckAssistantListing(){
		var tmpValid = "0"
			
	if (isWhitespace(document.form1.ln.value))
		{
		alert("Listing Number is Required")
		document.form1.ln.focus();
		tmpValid++
		}
		
	else if (isWhitespace(document.form1.listprice.value))
		{
		alert("Listing Price is Required")
		document.form1.listprice.focus();
		tmpValid++
		}
	
	else if (document.form1.listAgentpick.value=='')
		{
		alert("Listing Agent\'s Name is Required")
		tmpValid++
		}
	
	else if (document.form1.Sellersemail.value!='' && !(isEmail(document.form1.Sellersemail.value)))
				{
				alert("Please Enter a valid email address for your seller or leave blank")
				document.form1.Sellersemail.focus();
				tmpValid++
				}		
	
if (tmpValid == "0") {
				document.getElementById('Submit1').disabled = true
				return (true);
			}
			else {
				return (false)
				}



	}
	
/////////////////////////////////////////////////
	function CheckListingUpdateForm() {
		var display = "The following fields are required:\n"
		var failed=false
		
		
			if (document.form1.emailSubject.value=='') {
				display = display + "Email Subject\n"
	 			 failed= true	
			}


//			if (document.form1.emailHeader.value=='') {
//				display = display + "Email Header\n"
//	 			 failed= true	
//			}
			
			//if (document.form1.EmailBody.value=='') {
			//	display = display + "Email Body\n"
	 		//	 failed= true	
			//}
			
					

		if (failed==true){
		alert(display)
		return(false)
	}
	else {
	    document.getElementById("inpContent").value = oEdit1.getHTMLBody();
		document.getElementById('SendIt').disabled = true
	return(true)
}



	}
	////////////////////////////////////////////////////////////////
	//**** checks form on appointment page appointment.asp
function CheckAppointment(){
	var tmpValid = "0"
			
	if (isWhitespace(document.form1.AgentID.value))
		{
		alert("Showing AgentID is Required")
		document.form1.AgentID.focus();
		tmpValid++
		}
	
	else if (isWhitespace(document.form1.FirstName.value))
		{
		alert("Agents Fist Name is Required")
		document.form1.FirstName.focus();
		tmpValid++
		}
		
	else if (isWhitespace(document.form1.LastName.value))
		{
		alert("Agents Last Name is Required")
		document.form1.LastName.focus();
		tmpValid++
		}
		
	else if (isWhitespace(document.form1.aptDate.value))
		{
		alert("Appointment date is Required")
		document.form1.LastName.focus();
		tmpValid++
		}
				
			
	else if (document.form1.aptStartTime.value=='') {
	  	alert("Appointment time  Required")
	 	 tmpValid++	
		}

else if (document.form1.agentEmail.value!='' && !(isEmail(document.form1.agentEmail.value)))
				{
				alert("Please Enter a valid showing agent email address or leave blank")
				document.form1.agentEmail.focus();
				tmpValid++
				}	

if (tmpValid == "0") {
				document.getElementById('AddIt').disabled = true
				return (true);
			}
			else {
				return (false)
				}


}
/////////////////////////////////////////////////////////
//********* look up agent ID for showing appointment showing/appointment.asp
function GetShowAgent(AID,listID) {
	if (AID != '') {
		location.href="overview.asp?ID=" + listID + "&ShowAID=" + AID
		}
	}
	
//////////////////////////////////////////////////////
function goGo(){
				document.form1.FirstName.focus();
				window.scrollTo(0,500);
				//alert("hello")
				}

/////////////////////////////////////////////////
//********* Open Calendar.aspx page
function OpenCal() {
	document.form1.aptDate.blur()
	calendar_window = window.open('cal.aspx','calendar_window','width=265,height=190');
	calendar_window.focus()
	
}
/////////////////////////////////////////////////
//********* Open Calendar.aspx page
function OpenCal3() {
	document.form1.PostDate.blur()
	calendar_window = window.open('cal.aspx','calendar_window','width=265,height=190');
	calendar_window.focus()
	
}

/////////////////////////////////////////////////
//********* Open Calendar2.aspx page
function OpenCal2() {
	document.form1.ArchiveDate.blur()
	calendar_window = window.open('cal2.aspx','calendar2_window','width=265,height=190');
	calendar_window.focus()
	
}

///////////////////////////////////////
function CheckAppointmentUpdate(){
	var tmpValid = "0"
	
	if (isWhitespace(document.form1.aptDate.value))
		{
		alert("Appointment date is Required")
		document.form1.LastName.focus();
		tmpValid++
		}
				
			
	else if (document.form1.aptStartTime.value=='') {
	  	alert("Appointment time  Required")
	 	 tmpValid++	
		}
	
	if (tmpValid == "0") {
				document.getElementById('mod1').disabled = true
				return (true);
			}
			else {
				return (false)
				}


}

////////////////////////////////////////////////////////////
	//confirm beofre deleting a post
		function confirm_delete_post(id){
		 var whereto = "/MessageBoard/DeletePost.asp?Delete=1&ID=" + id 
	
    if (confirm("Deleting this Message will completely remove it and all associated information from the system.\n Are you sure you want to continue? Click OK to Delete this Message. Click Cancel to do nothing")) {
        window.open(whereto,'deletePost','width=450,height=140,') 
        
    }
    else {
        //do nothing
    }       
}	

/////////////////////////////////

function CheckPost() {
	
	var tmpValid = "0"
	
	if (isWhitespace(document.form1.PostDate.value))
		{
		alert("Post Date is Required")
		document.form1.PostDate.focus();
		tmpValid++
		}
		
	else if (isWhitespace(document.form1.ArchiveDate.value))
		{
		alert("Archive Date is Required")
		document.form1.ArchiveDate.focus();
		tmpValid++
		}
	
	else if (isWhitespace(document.form1.subject.value))
		{
		alert("Subject is Required")
		document.form1.subject.focus();
		tmpValid++
		}
		
	if (tmpValid == "0") {
				document.getElementById('addPost').disabled = true
				document.getElementById("inpContent").value = oEdit1.getHTMLBody();
				return (true);
			}
			else {
				return (false)
				}


}

///////////////////////////////Highlight rows on message board////////////////////
function HighlightRow(Level_id1,Level_id2,Level_id3) {
		
			var thisLevel1 = document.getElementById(Level_id1);
			var thisLevel2 = document.getElementById(Level_id2);
			var thisLevel3 = document.getElementById(Level_id3);
				thisLevel1.className = 'tdHighlight'
				thisLevel2.className = 'tdHighlight'
				thisLevel3.className = 'tdHighlight'				
				
			}
			
function ResetRow(Level_id1,Level_id2,Level_id3) {
			var thisLevel1 = document.getElementById(Level_id1);
			var thisLevel2 = document.getElementById(Level_id2);
			var thisLevel3 = document.getElementById(Level_id3);
				thisLevel1.className = 'tdNormal'
				thisLevel2.className = 'tdNormal'
				thisLevel3.className = 'tdNormal'
			}


/////////////////////////////////

//////////////////////////////////////////////////////////
//2 cell table
function HighlightRow2(Level_id1,Level_id2,Level_id3) {
		
			var thisLevel1 = document.getElementById(Level_id1);
			var thisLevel2 = document.getElementById(Level_id2);
			//var thisLevel3 = document.getElementById(Level_id3);
				thisLevel1.className = 'tdHighlight'
				thisLevel2.className = 'tdHighlight'	
			//	thisLevel3.className = 'tdHighlight'		
				
			}
			
function ResetRow2(Level_id1,Level_id2,Level_id3) {
			var thisLevel1 = document.getElementById(Level_id1);
			var thisLevel2 = document.getElementById(Level_id2);
			//var thisLevel3 = document.getElementById(Level_id3);
				thisLevel1.className = 'tdNormal'
				thisLevel2.className = 'tdNormal'
			//	thisLevel3.className = 'tdNormal'
			}


///////////////////////////////////////////////////////////////////

function CheckReplyTo() {
	
	var tmpValid = "0"
	
	if (isWhitespace(document.form1.subject.value))
		{
		alert("Subject is Required")
		document.form1.subject.focus();
		tmpValid++
		}
	
	else if (isWhitespace(document.form1.replytext.value))
		{
		alert("Your Response is Required")
		document.form1.replytext.focus();
		tmpValid++
		}
		
	
	
	else if (!(isEmail(document.form1.ReplyTo.value)))
			{
				alert("Please enter a valid Email Address")
				document.form1.ReplyTo.focus();
				tmpValid++
				}
	

		
	if (tmpValid == "0") {
				document.getElementById('SendReply').disabled = true
				//document.getElementById("inpContent").value = oEdit1.getHTMLBody();
				return (true);
			}
			else {
				return (false)
				}


}

///////////////////////////////////////////////////

function CheckOfficeUpdate() {
	
	var tmpValid = "0"

 if (!(isEmail(document.form1.OfficeEmail.value)))
			{
				alert("Please enter a valid office email address before proceeding")
				document.form1.OfficeEmail.focus();
				tmpValid++
				}

if (tmpValid == "0") {
				document.getElementById('submitbutton').disabled = true
				//document.getElementById("inpContent").value = oEdit1.getHTMLBody();
				return (true);
			}
			else {
				return (false)
				}


}

////////////////////////////////////

function OpenGenWindow(theURL, Name, popW, popH, scroll, resize) { // V 1.0
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+'';
	Win = window.open(theURL, Name, winProp);
	Win.window.focus();
}

///////////////////////////////////


function CheckSellerPage()
{
tmpValid = "0"
document.getElementById("SellerLogin_Label").innerHTML = ""
document.getElementById("Password_Label").innerHTML = ""
document.getElementById("listigid_Label").innerHTML = ""
document.getElementById("SellerEmail_Label").innerHTML = ""


//if (isWhitespace(document.getElementById("SellerLogin").value))
if (!(isEmail(document.getElementById("SellerEmail").value)))
				{
					document.getElementById("SellerEmail_Label").innerHTML = " *"
					
				tmpValid++
			
				} 
	if (isWhitespace(document.getElementById("SellerLogin").value))
				{
					document.getElementById("SellerLogin_Label").innerHTML = " *"
					
				tmpValid++
			
				}
				
if (isWhitespace(document.getElementById("Password").value))
				{
					document.getElementById("Password_Label").innerHTML = " *"
					
				tmpValid++
			
				} 
				

if (document.getElementById("listingid").selectedindex <=0)
				{
					document.getElementById("listigid_Label").innerHTML = " *"
					
				tmpValid++
			
				} 


 if (tmpValid == "0") {
			document.getElementById("Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=12px; color=CC0000'><b>Please be patient, this may take a minute...</b></span>"
			document.getElementById("submitbutton").disabled = true
			//document.getElementById("inpContent").value = oEdit1.getHTMLBody();
			return (true);
		}
			
		else {
			document.getElementById("Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=12px; color=CC0000'><b>Required fields are missing, please correct the marked fields before continuing</b></span><BR><BR>"
			return (false)
			}


}

//////////////////////////////////////////////////////////////
// fieldname, warningname, remainingname, maxchars
function CheckFieldLength(fn,wn,rn,mc) {
  var len = fn.value.length;
  if (len > mc) {
    fn.value = fn.value.substring(0,mc);
    len = mc;
  }
  document.getElementById(wn).innerHTML = len;
  document.getElementById(rn).innerHTML = mc - len;
}

///////////////////////////////////////// 

function CheckActivity()
{
tmpValid = "0"
document.getElementById("activityType_Label").innerHTML = ""


	
	 if  (document.getElementById("activityType").selectedIndex <=0)
				{
					document.getElementById("activityType_Label").innerHTML = " *"
					
				tmpValid++
			
				}
    
 
				
	
	if (tmpValid == "0") {
			document.getElementById("Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=12px; color=CC0000'><b>Please be patient, this may take a minute...</b></span>"
			document.getElementById("submitbutton").disabled = true
			//document.getElementById("inpContent").value = oEdit1.getHTMLBody();
			return (true);
		}
			
		else {
			document.getElementById("Main_Label").innerHTML = "<span style='font-family:Verdana; font-size=12px; color=CC0000'><b>Required fields are missing, please correct the marked fields before continuing</b></span><BR><BR>"
			return (false)
			}
}


///////////////////////////////////////////////////

//hides and shows areas
			function SwapActivityViews(_ViewPaneID, _HidePaneID) {
				var ViewPanel = document.getElementById( _ViewPaneID );
				var HidePanel = document.getElementById( _HidePaneID );
				
				ViewPanel.style.display = "block";
				ViewPanel.style.visibility = "visible";
					
				HidePanel.style.display = "none";
				HidePanel.style.visibility = "hidden";
					
			}


//********************************************************	
	
	
	function OpenPic(WhatField,whatfolder){
				var nW = window.open("", "PicFileUpload", "resizable=no,scrollbars=yes,width=650,height=350");
				nW.location.href = "/renformPic.asp?whatfield=" + WhatField + "&whatfolder=" + whatfolder
				nW = null;
			}
	
	//////////////////////////////////////////////////////////////////
	function ChangeLinkTab() {
				if (document.getElementById("sms").checked == true)
					 {					
						
						document.getElementById("smsinfo").style.display = "block";
						document.getElementById("smsinfo").style.visibility = "visible";
						
						
						
											
					}
			    
			    if (document.getElementById("sms").checked == false)
					 {					
						
						
						document.getElementById("smsinfo").style.display = "none";
						document.getElementById("smsinfo").style.visibility = "hidden";
						
						document.getElementById("smsnumber").value =''
											
					}
		}
//////////////////////////////////////////////////////

function formatCurrencyNW(num) {
num = num.toString().replace(/\$|\,/g,'');
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 );
}
/////////////////////////////////////////////////////

function winBRopen(theURL, Name, popW, popH, scroll, resize) { // V 1.0
	var winleft = (screen.width - popW) / 2;
	var winUp = (screen.height - popH) / 2;
	winProp = 'width='+popW+',height='+popH+',left='+winleft+',top='+winUp+',scrollbars='+scroll+',resizable='+resize+'';
	Win = window.open(theURL, Name, winProp);
	Win.window.focus();
}
//-->



	
