// main home page on off switcher
function onoffswitch(which_id)
{
// 	alert('helloworld');
	var whichTab = 'tab-' + which_id;
	var whichBox = 'tab-box-' + which_id;
	
	turnThemOff();
	document.getElementById( whichTab ).style.background="url(http://www.visualworkplaceinc.com/VLI/assets/templates/modxhost/images/home-tab-on.gif) no-repeat"; 
	document.getElementById( whichTab ).style.color="#444444"; 
	document.getElementById( whichBox ).style.display="block"; 
}

function turnThemOff()
{
	var whichTab = 'tab-';
	var whichBox = 'tab-box-';
	var tabId = '';
	var boxId = '';
	for ( i=1; i<7; i++ )
	{
		tabId = whichTab + i;
		boxId = whichBox + i;
		//alert(whichTab);
		if ( document.getElementById( tabId ) && document.getElementById( boxId ) )
		{
			
			//alert(whichTab);
			document.getElementById( tabId ).style.background="url(http://www.visualworkplaceinc.com/VLI/assets/templates/modxhost/images/home-tab-off.gif) no-repeat"; 
			document.getElementById( boxId ).style.display="none"; 
			document.getElementById( tabId ).style.color="#fff"; 
		}
	}
}


//main image pop up
function PopImagePage(url, sizex, sizey)
{
	var path, posx = 0, posy = 0;
	
	leftPos = ( screen.availWidth <= 800 ) ? 0 : 10;
	topPos = ( screen.availHeight <= 600 ) ? 0 : 8;
	features = 'scrollbars=no,toolbar=no,menubar=no,status=no,resizable=no,width=' + sizex + ',height=' + sizey;
	features += ',top=' + topPos + ',left= ' + leftPos;

	var popupWindow = window.open(url, 'imagewindow', features );
	popupWindow.focus();
}

// basic email writer
function no_sp(name, domain, css_class, subject, text) 
{
	if (text)// do this first to avoid putting query string into printname
	{
		printname = text;
	}
	else 
	{
		printname = name + '&#064;' + domain;
	}
	if (subject)
	{
		domain += '?subject=' + subject;
	}
	if (css_class)
	{
		css_class += ' class="' + css_class + '\"';
	}
	
	email = '<a href=\"mailto:' + name + '&#064;' + domain + '\"' + css_class + '\>' + printname + '<\/a>';
	document.write(email);
}



// basic email address protection:
