// to open a pop-up window
function openW(url, name, w, h, o) {
// options - menubar,location,resizable,scrollbars,status,toolbar (there are more)
// if you want them just list them seperated by commas
	var wlocation = "left=25,screenX=25,top=25,screenY=25";
	var windowprops = "width=" + w + ",height=" + h;
	if (o != '')
	    windowprops = windowprops + "," + o + "," + wlocation;
	popup = window.open(url, name, windowprops);
	popup.focus();
}

// open popup for importing email addresses
function openImport(url,provider) {
	openW(url + "/wp-content/themes/cats/import-contacts.php?provider=" + provider, "import", 600, 350, "menubar=0,toolbar=0,scrolling=0,status=0")
}

// select all checkboxes
function selectAllOptions(checker, list) {
	var list = document.getElementById(list).getElementsByTagName("input");
	// alert(list.length);
	for (i = 0; i < list.length; i++) {
		if (list[i].type == "checkbox") {
			if (checker.checked) {
				list[i].checked = true;
			} else {
				list[i].checked = false;
			}
		}
	}
}

// collect all values from selected checkboxes and turn into string
function getCheckedValues(list) {
	var list = document.getElementById(list).getElementsByTagName("input");
	var strTmp = "";
	for (i = 0; i < list.length; i++) {
		if (list[i].type == "checkbox") {
			if (list[i].checked) {
				strTmp += list[i].value + ", ";	
			}
		}
	}
	// alert(strTmp);
	return strTmp;
}