
function openSignUp () {
	popUp('signup.html','signup',300,276);
}

function submitNewsletter() {
	popUp("http://www.verticalresponse.com", "vr_optin_popup", 600, 450, 1, 1);
	return true;
}

function changeBg(pageElement, color) {
	var newColor = "#FFF";
	if (color == "color1") {
		newColor = "#9FE454";
	}
	if (color == "color2") {
		newColor = "#F96";
	}
	pageElement.parentNode.parentNode.parentNode.style.backgroundColor = newColor;
}

function changeBg2(pageElement, color) {
	var newColor = "#FFF";
	if (color == "color1") {
		newColor = "#9FE454";
	}
	if (color == "color2") {
		newColor = "#F96";
	}
	pageElement.style.backgroundColor = newColor;
}

function popUp(url, winName, width, height, scr, res) {
	var features;
	(scr) ? scr = 1 : scr = 0;
	(res) ? res = 1 : res = 0;
	features = "toolbar=no,location=no,status=no,menubar=no,scrollbars=" + scr + ",resizable=" + res + ",width=" + width + ",height=" + height;
	window.open(url, winName, features);
}

function getCaptcha (doc) {
	var hex_chars = Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f");
	var hash = "";
	var hash_length = 20;
	for (h = 0; h < hash_length; h++) {
		hash = hash + hex_chars[Math.floor(16 * Math.random())];
	}
	doc.getElementById("vrCaptchaHash").value = hash;
	var captcha_image_url = "https://captcha.vresp.com/produce/" + hash;
	doc.getElementById("vrCaptchaImage").src = captcha_image_url;
}

