function showHideSpan(target){
	if (document.getElementById(target).style.display=="")
		document.getElementById(target).style.display="none";
	else
		document.getElementById(target).style.display="";
}


function trim(strText) 
{
   return ltrim(rtrim(strText));
}

function ltrim(strText) 
{ 
    
    while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);   
   
   return strText;
}

function rtrim(strText) 
{ 	
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);
        
   return strText;
}

function checkValidEmail(adr,dispWarning)
{
	
	var myAtSymbolAt = adr.indexOf('@');
	var myLastDotAt = adr.lastIndexOf('.');	
	var myLength = adr.length;
	
	
	if(myLength <1){
		if (dispWarning) alert("Email address is required!");
		return false;
	}

	if (myAtSymbolAt < 1 ){
		if (dispWarning) alert("Email address needs an '@' sign! Please correct this.");
		return false;
	}

	if (myLastDotAt < myAtSymbolAt){
		if (dispWarning) alert("Invalid email address! Please use format jane@doe.com.");
		return false;
	}

	if (myLength - myLastDotAt <= 2){
		if (dispWarning) alert("Invalid email address! Please use format jane@doe.com.");
		return false;
	}
	return true;
}



function addbookmark()
{
	bookmarkurl=""
	bookmarktitle="Imaging Technologies"
	if (document.all)
		window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function formatMoney(value) 
{
	result = "$"+Math.floor(value)+".";
	var cents = 100*(value-Math.floor(value))+0.5;
	result += Math.floor(cents/10);
	result += Math.floor(cents%10);
	return result;
}