	function openSub(id){
		element = document.getElementById(id);
		element.style.display = "block";
	}
	function closeSub(id){
		element = document.getElementById(id);
		element.style.display = "none";
	}
	function changeBck(id, color) {
		element = document.getElementById(id);
		element.style.background = color;
	}

	function changeCategory($catId){
		f = document.forms["subCategoryForm"];
		f.changeCatId.value = $catId;
		f.submit();
	}

	function selectProduct($prodId, $action){
		f = document.forms["subProductForm"];
		f.productId.value = $prodId;
		f.productAction.value = $action;
		f.submit();
	}
	var popUpWin=0;
	function startVirtualTour(URLStr, left, top, width, height){
	URLStr='virtualtour.php';
	left='200';
	top='200';
	width='350';
	height='400';

  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
 // popUpWin = open('virtualtour.php','Cardinal Newman-Virtual Tour','height=400,width=350,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

	}

	function changeMenu($menuId){
		f = document.forms["sideMenuForm"];
		f.menuItem.value = $menuId;
		f.submit();
	}

    function selectLang(code){

        lang = document.getElementById('lang');
        lang.value=code;
        f = document.getElementById('langSelectForm');
        f.submit();
    }
