function popup(page) {
	var w = window.open(page + '.html', page, 'width=500,height=500,top=10,left=10,menubar=yes,scrollbars=yes,resizable=yes');
	if (window.focus) {
		w.focus()
	}	
}

function pop_privacy() {
	var windowname = window.open('/lp/privacy/', 'privacy',"width=525,height=500,top=10,left=10,menubar=yes,scrollbars=yes,resizable=yes");
	if (window.focus) {
		windowname.focus();
	}
}

function hide(element) {
	document.getElementById(element).style.display = 'none';	
}
function show(element) {
	document.getElementById(element).style.display = 'block';
}

function show_home_module(module) {
	var modules = new Array('why', 'how', 'who', 'see');
	
	// Make sure it's valid first
	var found = 0;
	for (var i = 0; i < modules.length; i++) {
		if (modules[i] == module) {
			document.getElementById('about_modules_content').innerHTML = document.getElementById('about_module_' + module).innerHTML;
			document.getElementById('about_module_tab_' + module).className = 'ir active';
			document.getElementById('about_modules_content').className = 'about_modules_wrapper_' + module;
			// Hide others
			for (var j = 0; j < modules.length; j++) {
				if (modules[j] != module) {
					document.getElementById('about_module_tab_' + modules[j]).className = 'ir';
				}
			}
			//initialize(); // Needed to setup the lightbox links		
			break;
		}
	}
}

//preload wait button
btnWait = new Image();
btnWait.src = '/images/btn_wait.gif';
var btn_active = true;
function submitForm() {
	if(btn_active == true) {
		btn_active = false;
		document.getElementById('btn_submit').src = btnWait.src;
		setTimeout('document.getElementById(\'form_feedback\').submit();', 500);
	}
}

var _IE  = /MSIE/.test(navigator.userAgent) && !window.opera;
var videos = ['video', 'testimonials', 'mainlander', 'craigslist', 'emOwners', 'ach', 'search', 'transfer', 'paperless', 'receipt', 'bill', 'migration'];
function displayVideo(video) {
	for(i = 0; i < videos.length; i++) {
		if(document.getElementById('video_' + videos[i]) && _IE == false) {
			document.getElementById('video_' + videos[i]).style.display = 'none';
		}
		if(document.getElementById('video_' + videos[i] + '_link') && _IE == false) {
			document.getElementById('video_' + videos[i] + '_link').style.display = 'block'; //turn off link
		}
	}
	if(document.getElementById('video_' + video)) {
		document.getElementById('video_' + video).style.display = 'block';
	}
	if(document.getElementById('video_' + video + '_link')) {
		document.getElementById('video_' + video + '_link').style.display = 'none'; //turn on link
	}
}
