
/*
  Copyright (c) 2006 Matter Solutions
  
  http://www.mattersolutions.com
  
  Coded by Ben Maden
*/


NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
SAF = (document.getElementById) ? 1 : 0;
//ver4 = (NS4 || IE4) ? 1 : 0;

function Highlight(what, color) {
  what.style.cursor = 'hand';
  what.style.backgroundColor = '#'+color;
  //what.background = '/images/header/theatre.gif';
}

function UnHighlight(what) {
  what.style.backgroundColor = '';
}

function GoThere(where) {
  window.location = where;
}

function openImage(imgfile,folder) {
  var url = '/uploaded/images';
  if( folder ) url += '/'+folder;
  url += '/'+imgfile
  var params = 'resizable=yes,toolbar=no,location=no,menubar=no,status=no,links=no,scrollbars=yes';
  window.open( url,'imgwindow', params );
}

function openPortfolioImage(portfolioid,imageid) {
  var url = '/portfolio/show/'; //images';
  //if( folder ) url += '/'+folder;
  url += '?e='+portfolioid;
  url += '&i='+imageid;
  var params = 'resizable=yes,toolbar=no,location=no,menubar=no,status=no,links=no,scrollbars=yes';
  window.open( url,'portfolioimgwindow', params );
}

function openSearch() {
  popUp('searchKick',true);
  //alert('Sorry,the search is not ready, it\'s coming soon :)');
}

function popUp(menuName,on) {
	//alert('menuName='+menuName);
	if (on) {
		moveLayers();
		if (IE4) {
			document.all[menuName].style.visibility = "visible";
		} else if(SAF) {
			document.getElementById(menuName).style.visibility = "visible";
		} else {
			document.layers[menuName].visibility = "show";
		}
	} else {
		if (IE4) {
			document.all[menuName].style.visibility = "hidden";
		} else if(SAF) {
			document.getElementById(menuName).style.visibility = "hidden";
		} else {
			document.layers[menuName].visibility = "hide";
		}
	}
}


function moveLayers() {
	if (IE4) {
		screenWidth = document.body.clientWidth + 18;
		document.all['searchKick'].style.pixelLeft = screenWidth/2 +10;
		document.all['searchKick'].style.pixelTop = 30;
	} else if(SAF) {
		screenWidth = document.body.clientWidth + 18;
		document.getElementById('searchKick').style.pixelLeft = screenWidth/2 +10;
		document.getElementById('searchKick').style.pixelTop = 30;
		
	} else {
		screenWidth = window.innerWidth;
		document.layers['searchKick'].left = screenWidth/2 +10;
		document.layers['searchKick'].top = 18;
	}
	//alert(document.layers['searchKick'].top);
}

window.name = 'WLmain';

