function trySubmit(src) {
	if (src.selectedIndex != 0) {
		src.form.submit();
	}
}

function showPopup(url) {
	var width = 546;
	var height = 600;
	if(url){
	}else{url="wizard.form";}
	window.open(url, "mainPopup", "width=" + width + ",height=" + height + ",scrollbars=yes").focus();
}

function showDevicesPopup(url) {
	var width = 588;
	var height = 600;
	var features = "width=" + width + ",height=" + height + ",scrollbars=yes";
	window.open(url, "phoneModelsPopup", features).focus();
}

function showHotlinePopup(url) {
	var width = 588;
	var height = 652;
	var features = "width=" + width + ",height=" + height + ",scrollbars=yes";
	window.open(url, "hotlinePopup", features).focus();
}

function showWhatisPopup(url) {
	var width = 588;
	var height = 554;
	var features = "width=" + width + ",height=" + height + ",scrollbars=yes";
	window.open(url, "whatIsPopup", features).focus();
}

function selectDevice(vendor, model) {
	var form = window.opener.document.forms[0];
	form.model.value = model;
	form.submit();
	window.close();
}

var bookmarkCategories = new Array();

function Bookmark(name, url) {
	this.name = name;
	this.url = url;
}

function categoryChanged(src) {
	if (src.selectedIndex == 0) {
		document.getElementById("bookmark").selectedIndex = 0;
		document.getElementById("bookmark").disabled = true;
	} else {
		var bookmarks = bookmarkCategories[src.value];
		var select = document.getElementById("bookmark");
		while (select.length > 1) {
			select.remove(1);
		}
		for (var bookmark in bookmarks) {
			var option = document.createElement("option");
			option.value = bookmark;
			option.appendChild(document.createTextNode(bookmark));
			select.appendChild(option);
		}
		select.disabled = false;
	}
}

function bookmarkChanged(src) {
	var category = document.getElementById("bookmarkCategory").value;
	var bookmark = bookmarkCategories[category][src.value];
	document.getElementById("bookmarkName").value = bookmark.name;
	document.getElementById("bookmarkUrl").value = bookmark.url;
}

var mailProviders = new Array();

function MailProvider(name, address, username, password, ingoing, outgoing, protocol) {
	this.name = name;
	this.address = address;
	this.username = username;
	this.password = password;
	this.ingoing = ingoing;
	this.outgoing = outgoing;
	this.protocol = protocol == "" ? "POP3" : protocol;
}

function chooseProvider(src) {
	var provider = mailProviders[src.value];
	with (src.form) {
		mailName.value = provider.name;
		mailAddress.value = provider.address;
		mailUsername.value = provider.username;
		mailPassword.value = provider.password;
		mailIngoingServer.value = provider.ingoing;
		mailOutgoingServer.value = provider.outgoing;
		mailProtocol.value = provider.protocol;
	}
}