// validate function for Canadian bankrutpcy city sites
function validate( form ){
  if ( form.contact.value.length < 1 ) {
    alert( "Please enter an email address or phone number so that we can get back to you with a response to your question." );
    return false;
  }

  if ( form.message.value.length < 1 ) {
    alert( "Please enter a message or question.  Our team is pleased to help." );
    return false;
  }

  return true;
}
function validateblogquestion(form)
{
	if ( form.subject.value.length < 1 ) 
	{
		alert( "Please enter a subject of your question." );
		form.subject.focus();
		return false;
	}
	if ( form.message.value.length < 1 ) 
	{
		alert( "Please enter a question.  Our team is pleased to help." );
		form.message.focus();
		return false;
	}
	return true;
}
//print page function that opens the print window.
function printWindow() {
	bV = parseInt(navigator.appVersion);
	if (bV >= 4) window.print();
}

//open a pop up window for email an article
function openPopUpWindow(url,winName,features) {
  window.open(url,winName,features);
}

//email an article function
function emailanarticle()
{
	var url=document.URL; 
	var title=document.title; 
	var city = "Sackville";
	var script = "cityscript.js";
	var logo = "logo.gif";
	var domain = "sackville.com";
	var popupwindowurl = "/emailanarticle.php?url="+url+"&city="+city+"&script="+script+"&logo="+logo+"&domain="+domain; 
	openPopUpWindow(popupwindowurl,'','scrollbars=no,resizable=yes,width=450,height=350');
}

function validateemailanarticle( form )
{	
	if ( form.sendername.value.length < 1 ) {
		alert( "Please enter your name." );
		form.sendername.focus();
		return false;
	}
	if ( form.receivername.value.length < 1 ) {
		alert( "Please enter receiver's name." );
		form.receivername.focus();
		return false;
	}
	if ( form.receiveremail.value.length < 1 ) {
		alert( "Please enter receiver's email." );
		form.receiveremail.focus();
		return false;
	}

	return true;
}

//bookmark page function
function bookmarkus() 
{
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) 
	{
		var url=document.URL;
		var title=document.title;
		
		window.external.AddFavorite(url,title);
	}
	else 
	{
		var msg = "Press CTRL+D to add a bookmark to this site";
		if(navigator.appName == "Netscape")
		{
			alert(msg);
		}
	}
}