function popup(url, win, w, h, scroll)
{
	if(!scroll)
		scroll = 'yes';
 	var winl = (screen.width - w) / 2;
	/* var wint = (screen.height - h) / 2; */
	prop = 'height='+h+',width='+w+',top=100,left='+winl+',scrollbars='+scroll+',resizable=no,toolbar=no,location=no,status'
 	Window = window.open(url,win,prop);
	Window.focus()	// making sure that the window will be focused in case someone minimalized it and then clicked on a link that popped it open again
}
function validate_number(submit_type)
{
	var frm = document.getElementById('cartForm');
	frm.onsubmit = null;
	frm.submit();	
}
function toggleVisibility(id)
{
	var tbody = document.getElementById('fas'+id);
	var pm = document.getElementById('pm'+id);

	if (tbody.style.display=='none')
	{
		try {
			tbody.style.display = null;
		}
		catch (exc)
		{
			// IE will generate an error, in that case we assign this:
			// (which gives, rightfully, displaying problems in mozilla)
			tbody.style.display = 'block';
		}
		pm.innerHTML = '[-]';
	}
	else
	{
		tbody.style.display = 'none';
		pm.innerHTML = '[+]';
	}
}

function bla()
{
	var menu = document.getElementById('');
	var as = menu.getElementsByTagName('A');
	for (var i=0; i<as.length; i++)
	{
		var url = as[i].href;
		var li = as[i].parent;
		li.onclick = function() {
			location.href = url
		}
	}
}

if (typeof(EnhancedMenu) != 'undefined')
{
	var propsArr = [{menuId: 'mainMenu', hoverClass: 'hover'}];
	if (window.addEventListener)
	{
		window.addEventListener('load', function() { EnhancedMenu.prototype.init(propsArr);}, false);
	}
	else
	{
		window.attachEvent('onload', function() { EnhancedMenu.prototype.init(propsArr);});
	}
}

// if we ever switch to jquery this should be rewritten to version that selects by classname
// and adds/removes classes instead of changing styles directly
function enhanceImages() {
	var divs = document.getElementsByTagName("DIV");
	for (var i=0; i<divs.length; i++) {
		var div = divs[i];
		if (div.className == 'imagesLikeGoogle') {
			div.onmouseover = function() {
				this.style.color = '#000';
			}
			div.onmouseout = function() {
				this.style.color = '#565656';
			}
		}
	}
}

if (window.addEventListener)
{
	window.addEventListener('load', function() { enhanceImages();}, false);
}
else
{
	window.attachEvent('onload', function() { enhanceImages();});
}
