function openManagementSystem() {
	var w = window.open ("/Shared/Login.aspx", 'winManagementSystem', "menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes");
}

function openControlsSelector() {
	var w = window.open ("/Controls.aspx", 'winControlsSelector', "menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes");

	if(screen.height == 1024) {
		w.resizeTo(1024, 768);
	}
	else if(screen.height > 800) {
		w.resizeTo(780, 600);
	}
	w.moveTo(0,0);
	w.focus();
}

function openLightingSelector() {
	var w = window.open ("/Lighting.aspx", 'winLightingSelector', "menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes");

	if(screen.height == 1024) {
		w.resizeTo(1024, 768);
	}
	else if(screen.height > 800) {
		w.resizeTo(780, 600);
	}
	w.moveTo(0,0);
	w.focus();
}

function openCableGlandsSelector() {
	var w = window.open ("/CableGlands.aspx", 'winCableGlandsSelector', "menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes,width=600,height=450");

	if(screen.height == 1024) {
		w.resizeTo(400, 400);
	}
	else if(screen.height > 800) {
		w.resizeTo(400, 400);
	}
	w.moveTo(0,0);
	w.focus();
}

function SubmitForm() {
	OpenResults();
}

function GetQuotePage(form, Sort, Code) {
	var selCurPage = form.CurPage[form.CurPage.selectedIndex].value;
	if(selCurPage.length > 0 && selCurPage.length > 0) {
		var qs = "Sort=" + Sort + "&CurPage=" + escape(selCurPage) + "&Code=" + escape(Code);

		this.location.href="QuotesList.asp?" + qs;
	}
}

function GetQuotePage_Sort(form, CurPage, Code) {
	var selSort = form.Sort[form.Sort.selectedIndex].value;
	if(selSort.length > 0 && selSort.length > 0) {
		var qs = "Sort=" + escape(selSort) + '&CurPage=' + CurPage + "&Code=" + escape(Code);
		this.location.href="QuotesList.asp?" + qs;
	}
}

function GetUser(form, PostPage) {
	var selCode = form.Code[form.Code.selectedIndex].value;
	if(selCode.length > 0 && selCode.length > 0) {
		var qs = "Code=" + escape(selCode);
		this.location.href=PostPage + "?" + qs;
	}
}

function GetQuotesReport(form) {
	var selWholesaler = form.Wholesaler[form.Wholesaler.selectedIndex].value;
	if(selWholesaler.length > 0 && selWholesaler.length > 0) {
		var qs = "Wholesaler=" + escape(selWholesaler);
		window.open('QuotesReport.asp?' + qs);
	}
}


function MoveIt()
{
	if(screen.height > 800) {
		parent.window.resizeTo(545,680);
	}
	if (parseInt(navigator.appVersion) >= 4 && screen.height > 800) {
		var screenHeight = screen.height;
		var screenWidth = screen.width;
		var topPos = (screenHeight)/2-400;
		var leftPos = (screenWidth)/2-300;
	}
	parent.self.moveTo(leftPos,topPos);
}

function UtcDifference() {
	var intPlusGMT = 10;
	return intPlusGMT;
}