<!--
// Standard Javascript used throughout applications

//I use thig to open my new Cdonts email window...small and clean this leads
//to the window that loads into the dump
function am_win(url) {

theWindow = window.open(url,"newWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=430,height=430,left=30,top=30");

}

function newcalander_win(url) {

theWindow = window.open(url,"newWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=185,height=210,left=0,top=0");

}


function directions_win(url) {

theWindow = window.open(url,"newWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=350,height=275,left=20,top=20");

}

function newsletter_win(url) {

theWindow = window.open(url,"newWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=580,height=500,left=20,top=20");

}

function boarding_win(url) {

theWindow = window.open(url,"newWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=694,height=430,left=20,top=20");

}

function card_win(url) {

theWindow = window.open(url,"newWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=780,height=430,left=20,top=20");

}

/* Open window function for the Slide Show */
var isOpen = false
function slideshow(){

var aw = (screen.width - 600) /2;
var ah = (screen.height - 400) /2;

window.open("newslideshowLakeforest.htm","omars","toolbar=0, location=0, directories=0, status=0,menubar=0,scrollbars=0,resizable=0, width=520, height=430, top=" + ah +",left=" + aw +"");
}

function newcalendar_win(url) {

theWindow = window.open(url,"newWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=190,height=210,left=20,top=20");

}
function new_win(url) {

link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=275,height=220,left=50,top=20");

}
/*-------------------------------------start show openers------------------*/


/* Open window function for the Lakeforest SLIDESHOWS */


function slideshowLakeforest(){


var aw = (screen.width - 600) /2;
var ah = (screen.height - 400) /2;

window.open("show/lakeforestslideshow.html","omars","toolbar=0, location=0, directories=0, status=0,menubar=0,scrollbars=0,resizable=0, width=520, height=430, top=" + ah +",left=" + aw +"");
}

/* Open window function for the Placentia SLIDESHOWS */


function slideshowPlacentia(){


var aw = (screen.width - 600) /2;
var ah = (screen.height - 400) /2;

window.open("show/placentiaslideshow.html","omars","toolbar=0, location=0, directories=0, status=0,menubar=0,scrollbars=0,resizable=0, width=520, height=430, top=" + ah +",left=" + aw +"");
}

/* Open window function for the Placentia SLIDESHOWS */


function slideshowLaverne(){


var aw = (screen.width - 600) /2;
var ah = (screen.height - 400) /2;

window.open("show/laverneslideshow.html","omars","toolbar=0, location=0, directories=0, status=0,menubar=0,scrollbars=0,resizable=0, width=520, height=430, top=" + ah +",left=" + aw +"");
}

/* Open window function for the Westhollywood SLIDESHOWS */


function slideshowWesthollywood(){


var aw = (screen.width - 600) /2;
var ah = (screen.height - 400) /2;

window.open("show/Westhollywoodslideshow.html","omars","toolbar=0, location=0, directories=0, status=0,menubar=0,scrollbars=0,resizable=0, width=520, height=430, top=" + ah +",left=" + aw +"");
}

function newcalculator_win(url) {

link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=300,height=240,left=2,top=2");

}
/*-------------------------------------end show openers------------------*/


/* Open window function for the Slide Show */
var isOpen = false
function newWindow_slideshow(){

var aw = (screen.width - 600) /2;
var ah = (screen.height - 400) /2;

window.open("show/show.htm","omars","toolbar=0, location=0, directories=0, status=0,menubar=0,scrollbars=0,resizable=0, width=340, height=260, top=" + ah +",left=" + aw +"");
}


function redirect(theForm)
   	  {
      	var myindex=theForm.redirectionValue.selectedIndex
      	if (theForm.redirectionValue.options[myindex].value != 0)
	  		{
         		location=theForm.redirectionValue.options[myindex].value;
		 	}
   	  }



function invalidEmail(text){
var badFlag = 0
if ((text.indexOf("@") == -1) || (text.indexOf(".")== -1) || (text.indexOf(" ") != -1) || text.substring(text.length-1, text.length) == "@" || text.substring(0,1) == "@" || text.substring(text.length-1, text.length) == "." || text.substring(0,1) == "." ) {
	badFlag = 1
	}
	return badFlag
}



function validateForm(form) {
	if (form.business_name.value == "") {
		alert("Please enter the Producer's Business Name !")
		form.business_name.focus()
		return false
	}
	
	if (form.business_address.value == "") {
		alert("Please enter the Producer's Business Address !")
		form.business_address.focus()
		return false
	}
	
	if (form.city.value == "") {
		alert("Please enter the City !")
		form.city.focus()
		return false
	}
	
	if (form.state.selectedIndex == 0) {
		alert("Please select the State !")
		form.state.focus()
		return false
	}
	
	if (form.zip_code.value == "") {
		alert("Please enter the Zip Code !")
		form.zip_code.focus()
		return false
	}
	
	var theZip = form.zip_code.value;
	var theLength = theZip.length;
	var goodZip = true;
	if (theLength != 5 && theLength != 0) {
		goodZip = false;
	}
	if (theLength == 5) {
		for (var i = 0; i < 5; i++) {
			var theChar = theZip.substring(i, i+1);
			if (theChar < "0" || theChar > "9") {
				goodZip = false;
			}
		}
	}
	if (goodZip == false) {
		alert("The zip code must be a 5 digit number !")
		form.zip_code.focus()
		form.zip_code.select()
		return false
	}
	
	if (form.signed_by_officer.value == "") {
		alert("Please enter the Officer's Name !")
		form.signed_by_officer.focus()
		return false
	}
	
	if (form.tax_id_or_ss_number.value == "") {
		alert("Please enter the Tax ID or Social Security Number !")
		form.tax_id_or_ss_number.focus()
		return false
	}	
	
	if (form.phone_area_code.value == "") {
		alert("Please enter the area code for the phone number !")
		form.phone_area_code.focus()
		return false
	}
	
	if (form.phone1.value == "") {
		alert("Please enter the first three digits of the phone number !")
		form.phone1.focus()
		return false
	}
	
	if (form.phone2.value == "") {
		alert("Please enter the last four digits of the phone number !")
		form.phone2.focus()
		return false
	}
	
	var theAreaCode = form.phone_area_code.value;
	var theLength = theAreaCode.length;
	var goodAreaCode = true;
	if (theLength != 3 && theLength !=0) {
		goodAreaCode = false;
	}
	if (theLength == 3) {
		for (var i = 0; i < 3; i++) {
			var theChar = theAreaCode.substring(i, i+1);
			if (theChar < "0" || theChar > "9") {
				goodAreaCode = false;
			}
		}
	}
	
	if (goodAreaCode == false) {
		alert("This does not appear to be a valid phone number !")
		form.phone_area_code.focus()
		form.phone_area_code.select()
		return false
	}
	
	var theFirstThree = form.phone1.value;
	var theLength = theFirstThree.length;
	var goodFirstThree = true;
	if (theLength != 3 && theLength !=0) {
		goodFirstThree = false;
	}
	if (theLength == 3) {
		for (var i = 0; i < 3; i++) {
			var theChar = theFirstThree.substring(i, i+1);
			if (theChar < "0" || theChar > "9") {
				goodFirstThree = false;
			}
		}
	}
	
	if (goodFirstThree == false) {
		alert("This does not appear to be a valid phone number !")
		form.phone1.focus()
		form.phone1.select()
		return false
	}
	
	var theLastFour = form.phone2.value;
	var theLength = theLastFour.length;
	var goodLastFour = true;
	if (theLength != 4 && theLength !=0) {
		goodLastFour = false;
	}
	if (theLength == 4) {
		for (var i = 0; i < 4; i++) {
			var theChar = theLastFour.substring(i, i+1);
			if (theChar < "0" || theChar > "9") {
				goodLastFour = false;
			}
		}
	}
	
	if (goodLastFour == false) {
		alert("This does not appear to be a valid phone number !")
		form.phone2.focus()
		form.phone2.select()
		return false
	}
	
	if (form.fax_area_code.value == "") {
		alert("Please enter the area code for the fax number !")
		form.fax_area_code.focus()
		return false
	}
	
	if (form.fax1.value == "") {
		alert("Please enter the first three digits of the fax number !")
		form.fax1.focus()
		return false
	}
	
	if (form.fax2.value == "") {
		alert("Please enter the last four digits of the fax number !")
		form.fax2.focus()
		return false
	}
	
	var theAreaCode = form.fax_area_code.value;
	var theLength = theAreaCode.length;
	var goodAreaCode = true;
	if (theLength != 3 && theLength !=0) {
		goodAreaCode = false;
	}
	if (theLength == 3) {
		for (var i = 0; i < 3; i++) {
			var theChar = theAreaCode.substring(i, i+1);
			if (theChar < "0" || theChar > "9") {
				goodAreaCode = false;
			}
		}
	}
	
	if (goodAreaCode == false) {
		alert("This does not appear to be a valid fax number !")
		form.fax_area_code.focus()
		form.fax_area_code.select()
		return false
	}
	
	var theFirstThree = form.fax1.value;
	var theLength = theFirstThree.length;
	var goodFirstThree = true;
	if (theLength != 3 && theLength !=0) {
		goodFirstThree = false;
	}
	if (theLength == 3) {
		for (var i = 0; i < 3; i++) {
			var theChar = theFirstThree.substring(i, i+1);
			if (theChar < "0" || theChar > "9") {
				goodFirstThree = false;
			}
		}
	}
	
	if (goodFirstThree == false) {
		alert("This does not appear to be a valid fax number !")
		form.fax1.focus()
		form.fax1.select()
		return false
	}
	
	var theLastFour = form.fax2.value;
	var theLength = theLastFour.length;
	var goodLastFour = true;
	if (theLength != 4 && theLength !=0) {
		goodLastFour = false;
	}
	if (theLength == 4) {
		for (var i = 0; i < 4; i++) {
			var theChar = theLastFour.substring(i, i+1);
			if (theChar < "0" || theChar > "9") {
				goodLastFour = false;
			}
		}
	}
	
	if (goodLastFour == false) {
		alert("This does not appear to be a valid fax number !")
		form.fax2.focus()
		form.fax2.select()
		return false
	}
	
	if (form.email.value == "") {
		alert("Please enter a valid email address !")
		form.email.focus()
		form.email.select()
		return false
	}
		
	if (invalidEmail(form.email.value)) {
		alert("The email address you have entered appears to be invalid. Please use a properly formatted email address containing the @ symbol, a period, and no spaces !")
		form.email.focus()
		form.email.select()
		return false
	}
	
	if (form.email2.value == "") {
		alert("Please enter a valid email address !")
		form.email2.focus()
		form.email2.select()
		return false
	}		
	if (form.email2.value != form.email.value) {
		alert("The email address you have entered does not match please re-enter !")
		form.email2.focus()
		form.email2.select()
		return false
	}	
	if (invalidEmail(form.email2.value)) {
		alert("The email address you have entered appears to be invalid. Please use a properly formatted email address containing the @ symbol, a period, and no spaces !")
		form.email.focus()
		form.email.select()
		return false
	}
	if (form.license_number.value == "") {
		alert("Please enter the License Number !")
		form.license_number.focus()
		return false
	}
	
	if (form.e_and_o_carrier.value == "") {
		alert("Please enter the E & O Carrier !")
		form.e_and_o_carrier.focus()
		return false
	}
	
	if (form.total_volume.value == "") {
		alert("Please enter the Total Annual Premium Volume !")
		form.total_volume.focus()
		return false
	}
	
	if (form.agency_established.value == "") {
		alert("Please enter the Date your Agency was Established !")
		form.agency_established.focus()
		return false
	}
	
	var test=new String(form.agency_established.value);
	var bool = null;

	if (test!=""){	
		bool = test.match(/[0-9]+[-\\\/][0-9]+[-\\\/][0-9]{2,}/);
		if (! bool){
			alert("The date format you have entered is incorrect.  Please enter in the format: mm/dd/yyyy.");
			form.agency_established.focus();
			form.agency_established.select();
			return false
		}
	}

	else
	return true
}



/* Array function for selection box urls */
function urlsArray() {
	var args=urlsArray.arguments;
	for (var i=0; i<args.length; i++) {
	this[i]=args[i];
	}
this.length=args.length;
}

/* This array holds the urls's of the pages */
var urls=new urlsArray("", "http://www.altavista.com", "http://www.excite.com", "http://www.google.com", "http://www.hotbot.com", "http://www.lycos.com", "http://www.northernlight.com", "http://www.snap.com", "http://www.webcrawler.com", "http://www.yahoo.com");

/* This function determines which page is selected, opens a window and goes to it */
var isOpen = false
function goPage(form) {
i=form.goSearchEngine.selectedIndex;
	if (i!=0) {
		if (i>0){
			if (navigator.appVersion.indexOf("AOL") != -1) {
				document.location = "/sais_frameset/sais_frameset.asp?URL=" +urls[i]
			}
			else if (navigator.appName == "Microsoft Internet Explorer") {
				if (isOpen==true) {
				theWindow.close()
				}
			theWindow = window.open(urls[i],'newWin','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=640,height=450,top=0,left=0')
		isOpen = true
			}
			else if (navigator.appName == "Netscape") {
			theWindow = window.open(urls[i],'newWin','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=640,height=450,top=0,left=0')
	theWindow.focus()
			}
		}
	}
}
function new_win(url) {

link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=217,height=190,left=1,top=1");

}

function calander_win(url) {

theWindow = window.open(url,"newWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=295,height=300,left=1,top=1");

}

function calc_win(url) {

link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=290,height=240,left=50,top=20");

}

/* Open window function */
var isOpen = false
function newWindow(i) {
	if (navigator.appVersion.indexOf("AOL") != -1) {
		document.location = "/sais_frameset/sais_frameset.asp?URL=" + i
	}
	else if (navigator.appName == "Microsoft Internet Explorer") {
		if (isOpen==true) {
		theWindow.close()
		}
		theWindow = window.open(i,'newWin','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=640,height=450,top=0,left=0')
		isOpen = true
	}
	else if (navigator.appName == "Netscape") {
	theWindow = window.open(i,'newWin','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=640,height=450,top=0,left=0')
	theWindow.focus()
	}
}
/* This function determines which page is selected, opens a window and goes to it */
var isOpen = false
function goPage(form) {
i=form.goState.selectedIndex;
	if (i!=0) {
		if (i>0){
			if (navigator.appVersion.indexOf("AOL") != -1) {
				document.location = "/sais_frameset/sais_frameset.asp?URL=" +urls[i]
			}
			else if (navigator.appName == "Microsoft Internet Explorer") {
				if (isOpen==true) {
				theWindow.close()
				}
			theWindow = window.open(urls[i],'newWin','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=640,height=450,top=0,left=0')
		isOpen = true
			}
			else if (navigator.appName == "Netscape") {
			theWindow = window.open(urls[i],'newWin','toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=640,height=450,top=0,left=0')
	theWindow.focus()
			}
		}
	}
}


//<a href="javascript:am_win('xmail/slug_email.asp')">Test link </a> 

//-->