/*
	Galileo scripts
	Developed by Saforian
*/


/* --- Popup window functions --- */

// Fixed popup window
function popup(URL, width, height) {
	popWin = window.open(URL, "popWin", "width=" + width + ",height=" + height + ",resizable=0,scrollbars=0,location=0,toolbar=0");
	popWin.focus();
	return false;
}

// Resizable and scrollable popup window
function popupResize(URL, width, height) {
	popWin = window.open(URL, "popWin", "width=" + width + ",height=" + height + ",resizable=1,scrollbars=1,location=0,toolbar=0");
	popWin.focus();
	return false;
}


// Recipe popup
function showRecipe(URL) {
	cardWin = window.open(URL, "cardWin", "width=664,height=450,scrollbars=yes,resizable=yes,menubar=no");
	cardWin.focus();
	return false;
}

// Photos
function showPhotos(URL) {
	photoWin = window.open(URL, "photoWin", "width=423,height=470,scrollbars=no,resizable=yes,menubar=no");
	photoWin.focus();
	return false;
}

// Menus
function showMenu(URL) {
	menuWin = window.open(URL, "menuWin", "width=540,height=450,scrollbars=yes,resizable=yes,menubar=no");
	menuWin.focus();
	return false;
}



// Generic addevent
function addEvent(obj, evType, fn) {
	if (obj.addEventListener){
		obj.addEventListener(evType, fn, true);
		return true;
	} else if (obj.attachEvent) {
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	} else {
		return false;
	}
}
