function clearContent(field, initContent)
{
	if (field.value==initContent)
	{
		field.value="";
	}
}
function restoreContent(field, initContent)
{
	if (field.value=="")
	{
		field.value = initContent;
	}
}

function getBrowserType()
{
	var tmpImages = document.getElementsByTagName('img');
	var fImage = tmpImages[0];
	brType = 'none';
	
	if(typeof fImage.style.opacity != 'undefined')
	{
		brType = 'w3c';
	}
	else if(typeof fImage.style.MozOpacity != 'undefined')
	{
		brType = 'moz';
	}
	else if(typeof fImage.style.KhtmlOpacity != 'undefined')
	{
		brType = 'khtml';
	}
	else if(typeof fImage.filters == 'object')
	{
		brType = (fImage.filters.length > 0 && typeof fImage.filters.alpha == 'object' && typeof fImage.filters.alpha.opacity == 'number') ? 'ie' : 'none';
	}
	else
	{
		brType = 'none';
	}
}

function turnOffAllPersonPhotos()
{
	var tmpImages = document.getElementsByTagName('img');
	for (var i=0; i<tmpImages.length; i++)
	{
		var tmpImage = tmpImages[i];
		
		var relAttribute = String(tmpImage.getAttribute('rel'));

		// use the string.match() method to catch 'rImage' references in the rel attribute
		if ((relAttribute.toLowerCase().match('person_image')))
		{
			turnOffPersonPhoto(tmpImage);
		}
	}
}		


function turnOnPersonPhoto(imgItem)
{
	switch(brType)
	{
		case 'ie' :
			imgItem.filters.alpha.opacity = 100;
			break;			
		case 'khtml' :
			imgItem.style.KhtmlOpacity = 1;
			break;
			
		case 'moz' : 
			imgItem.style.MozOpacity = 1;
			break;				
		default : 
			imgItem.style.opacity = 1;
	}	
}

function turnOffPersonPhoto(imgItem)
{
	switch(brType)
	{
		case 'ie' :
			imgItem.filters.alpha.opacity = 50;
			break;
			
		case 'khtml' :
			imgItem.style.KhtmlOpacity = 0.5;
			break;
			
		case 'moz' : 
			imgItem.style.MozOpacity = 0.5;
			break;				
		default : 
			imgItem.style.opacity = 0.5;
	}	

}
