function setPic(img, url) 
{
	if (document.images) 
	{
		img.src = url;
	}
}

function swapPhoto(url)
{
	var pic;
	
	pic = document.getElementById("unitPhotos_largePhoto");
	
	//if(pic == null)
	//	pic = document.all["largePhoto"];
	
		
	if(pic != null)
	{
		if(pic.src != url)
		{	
			try
			{
				pic.filters[0].enabled = true;
				pic.filters[0].apply();
			}
			catch(ex)
			{
			
			}
			finally
			{
			
			}
			pic.src = url;
		
			try
			{
				pic.filters[0].play();
			}
			catch(ex)
			{
			
			}
			finally
			{
			
			}
		}
	}
}

function emailFriend(subject, returnUrl)
{
	openNewWindow('EmailFriend', 'emailfriend.aspx?subject=' + subject + '&url=' + returnUrl, '450', '415', false, false, true, true, true, true);
}

function openNewWindow(name, url, w, h, nav, loc, sts, menu, scroll, resize) 
{
	var windowProperties=''; 
	if(nav==false) 
		windowProperties+='toolbar=no,'; 
	else
  		windowProperties+='toolbar=yes,'; 
  	
  	if(loc==false)
  		windowProperties+='location=no,'; 
	else 
	 	windowProperties+='location=yes,'; 
	 
	if(sts==false) 
		windowProperties+='status=no,';
	else 
		windowProperties+='status=yes,'; 
	
	if(menu==false)
		windowProperties+='menubar=no,';
	else 
		windowProperties+='menubar=yes,'; 
	
	if(scroll==false) 
		windowProperties+='scrollbars=no,';
	else 
		windowProperties+='scrollbars=yes,'; 
	
	if(resize==false) 
		windowProperties+='resizable=no,';
	else
		windowProperties+='resizable=yes,'; 
	
	if(w != "") 
		windowProperties+='width=' + w + ',';
	 	
	if(h!="")
		windowProperties+='height='+h; 
	
	if(windowProperties!="") 
	{ 
  		if( windowProperties.charAt(windowProperties.length-1)==',') 
		   windowProperties=windowProperties.substring(0,windowProperties.length-1); 
	} 
	
	window.open(url,name,windowProperties);
}


