// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

var menu_timer = 0;
var drop_down;

function show_menu() {
	clearTimeout(menu_timer);
	drop_down = document.getElementById("menu_drop_down");

	drop_down.style.left = getX("products");
	drop_down.style.top = getY("products");
	drop_down.style.visibility = 'visible';
	document.getElementById("product_link").style.color = '#FFC318';
}

function hide_menu() {
	drop_down = document.getElementById("menu_drop_down");
	
	menu_timer = setTimeout("drop_down.style.visibility = 'hidden'; document.getElementById(\"product_link\").style.color = '#FFFFFF';", 100);
}

function getX(element_id){
	var xPos = document.getElementById(element_id).offsetLeft;
	var tempEl = document.getElementById(element_id).offsetParent;

	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
	
	return xPos + 134;
}

function getY(element_id) {
	var yPos = document.getElementById(element_id).offsetTop;
	var tempEl = document.getElementById(element_id).offsetParent;

	while (tempEl != null) {
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
	
	return yPos;
}

function register(register_id)
{
	var newwindow;
	newwindow=window.open("https://www.gotomeeting.com/register/" + register_id,'register','height=615,width=760,toolbar=yes,menubar=yes,location=yes,scrollbars=yes');
	if (window.focus) {newwindow.focus()}
}



