function addboat()
    {
    parent.frames[1].location = 'leftframeaddboat.htm'
    parent.frames[2].location = '../basic_entry.asp?CallPage=Add'
    adding = 1
    }
function saveprompt(page) {
    if (adding = 1) {
        if (parent.frames[2].location != 'broker_menu.asp')
            {
            alert("Please click save")
            }
        }
    else
        {
        parent.frames[2].location = page
        }
    }
        
        
function pop_up(pppurl,nm,wdth,hgt,lps,tps) {
    var features = ' " ' + ' toolbar=no scrollbars=yes resizable=yes width = '+ wdth + ' height=' +  hgt + 'screenX = ' + lps+ 'screenY=' +tps+' " ' ;
    popupWin = window.open(pppurl,nm,features);
    popupWin.focus();
}
	
allchecked = "false"
function checkAll(field) 
	{ 
	if (allchecked == "true")
		{
		field.reset();
		allchecked = "false"
		}
	else
		{
		l = field.elements.length; 
		for (i = 0; i < l; i++) 
			{ 
			if (field.elements[i].type == "checkbox")
				{   
				field.elements[i].checked = true;
				}
			} 
		allchecked = "true"
		}
	} 
function FindStaff(firstName,lastName,source)
	{
	var URLPrefix = ""
	if (source == "")
		{
		source = 2
		}
	if (source > 0)
		{
		for (a = 1 ; a <= source ; a++)
			{
			URLPrefix = URLPrefix + "../"
			}
		}
	if (firstName == '' && lastName == '')
		{
		newURL = URLPrefix + "FindStaff.asp"
		}
	else
		{
		newURL = URLPrefix + "FindStaffSubmitter.asp?firstname=" + firstName + "&lastname=" + lastName
		}
	pop_up(newURL,"FindStaff",500,300,50,50)
	}

var selectText
selectText = "";

var selectedItem
selectedItem = -1
function selectSelector()
	{
	i = 0
	//compared.innerText = ""
	selectText = selectText + String.fromCharCode(event.keyCode);
	if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 33 || event.keyCode == 34 || event.keyCode == 35 || event.keyCode == 36) //up and down arrows and Page Up and Page Down should be ignored
		{
		clearSelectString();
		resetSelector();
		return;
		}
		//alert(event.keyCode)
	selectBoxName = event.srcElement.name;
	var selectName = document.getElementById(selectBoxName);
	selectString = new String(selectText);
	selectStringLength = selectString.length;
	if (selectName.length>0) 
		{
	//alert(selectName.length)
		for (i=0; i< selectName.length; i++)
			{
			//alert(i);
			optionName = new String(selectName.options(i).text);
			//alert(optionName)
			//alert(selectStringLength)
			//alert("/" + optionName.substr(0,selectStringLength))
			if (selectString == optionName.substr(0,selectStringLength))
				{
				selectedItem = i;
				selectName.selectedIndex = i;
				return;
				}
			}
		}
	}

function clearSelectString()
	{
	//alert("cleared");
	selectText = "";
	}
	
function reselect()
	{
	if (selectedItem >= 0)
		{
		selectBoxName = event.srcElement.name;
		var selectName = document.getElementById(selectBoxName);
		selectName.selectedIndex = selectedItem;
		//selectedItem = -1
		}
	}
	
function resetSelector()
	{
	selectedItem = -1;
	}
	
function popup_specoptions() {
	pop_up("SpecPrintingOptionsSSKR.asp","SpecOptions",300,200,50,50)
	return false;
}


function popup_specoptionscustom(brokercode) {
	pop_up("SpecPrintingOptions" + brokercode + ".asp","SpecOptions",300,150,50,50)
	return false;
}

function addReminderToOutlook(remid)
	{
	pop_up('ReminderToOutlook.asp?remid=' + remid,'AddReminder',400,150,10,10)
	}

