
function ahahSwapModelImage(imageName, productName, url) {
    var productImage = document.getElementById("girl_imgModel");
    var girlUrl = document.getElementById("girl_lnkModel");
    var caption = document.getElementById("girl_lnkImageCaption");
    var moreInfo = document.getElementById("girl_lnkMoreInfo");
         
    if (caption != null && url != "" && productName != "")
    {
        caption.href = url;
        caption.innerHTML = productName;
    }
    
    if (moreInfo != null && url != "")
    {
        moreInfo.href = url;
    }
    
    if (girlUrl != null && url != "")
    {
        girlUrl.href = url;
    }
      
    if (productImage != null)
    {
        var imageSource = 'http://' + location.hostname + '/i/models/300x450/' + imageName;
        
        if (productImage.src != imageSource)
        {
            // This lets us enlarge the currently selected product image, even if its an alternate          
            xmlhttp = null;
             
            if (window.XMLHttpRequest)
            {
         	   xmlhttp = new XMLHttpRequest();
            }
            else if (window.ActiveXObject)
            {
         	   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }

            if (xmlhttp != null)
            {
		        xmlhttp.open("GET", imageSource, false);
		        xmlhttp.send("");

	            if (xmlhttp.status == 200)
	            {
	                // This is a stupid hack for IE7 which is stupid and throws an exception
	                // when you try to access responseText on a binary response.  Stupid MS.
	                var notFound = false;
	                try
	                {
	                   notFound = xmlhttp.responseText.indexOf("<h2>Page Not Found</h2>") > 0;
	                }
	                catch (ex)
	                {
    	            
	                }
    	                       
	                if (!notFound)
	                {
	     	            showImage(productImage, imageSource);
	     	        }
	            }
	        }
       }
   }
}
function showImage(productImage, imageSource) {
	$(productImage).show();
	productImage.src = productImage.value = imageSource.substring(imageSource.indexOf("/i/"), imageSource.length);
}