// JavaScript Document

//Context path of application
var ContextPath = '/Prosperity4';

//Function to open pop up windows
function GlobalPopUp(theURL,winName,features)
	{
	return window.open(theURL,winName,features);
	}

//MultiMailer's HTML preview
function PreviewHTML()
	{
	var strHTMLContent = document.DefaultForm.txtCode.value;
	var generator = window.open('','','toolbar=0,scrollbars=yes,location=0,width=620,height=820,resizable=yes');
	generator.document.write(strHTMLContent)
	}

//Function to open Velaro Chat windows only
function ValeroPopUp(theURL,winName,features)
	{
	NewWindow = GlobalPopUp('https://srv0.velaro.com/visitor/requestchat.aspx?siteid=2946&showwhen=inqueue&deptid=1176&secure=yes','VelaroChat','toolbar=no,location=no,directories=no,menubar=no,status=no,scrollbars=no,resizable=yes,replace=no');
	window.NewWindow.focus();
	return NewWindow;
	}

//Function to open pop up window and focus on it - Extends above function
//for this to work you must use window.name to name your new window
function GlobalFocusPopUp(theURL,winName,features)
	{
	NewWindow = GlobalPopUp(theURL,winName,features);
	window.NewWindow.focus();
	return NewWindow;
	}

//Function to email a page's link to a friend
function EmailFriend()
	{
		var e_add = prompt('Enter your friend\'s email address:',' ');
		//var subj = prompt('Enter the subject of your message:',' ');
		//if ((subj==" ") || (subj==null))
		var subj = "Hi, I found this page for you on Prosperity4's website - by the way, Prosperity4 are tax experts for contractors!";
		var bod = "Please copy this link into your browser to view the page: " + window.location + ". " + " \nProsperity4 - tax expertise for contractors.";
		window.location="mailto:"+e_add+"?subject="+subj+"&body="+bod;
	}

// Online contract print function
function PrintIframe()
	{
	frames["contract"].focus();
	frames["contract"].print();
	}