function expandCollapseDiv(id,imgSrc){
		if(document.getElementById('t_'+id).style.display == 'none'){
			document.getElementById('t_'+id).style.display = '';
			document.getElementById('img_'+id).src = imgSrc + 'collapse.gif';
		}else{
            document.getElementById('t_'+id).style.display = 'none';
			document.getElementById('img_'+id).src = imgSrc + 'expand.gif';
		}
	}
	
function loadUnloadGallery(iframe_id,id,WineryID,link){
		if(document.getElementById(id).style.display == 'none'){
			document.getElementById(id).style.display = '';
			link.innerHTML = '<strong>Close Image Gallery</strong>';
			return loadIframe(iframe_id, baseUrl + '/winery/showGallery?wineryID=' + WineryID);
		}else{
            document.getElementById(id).style.display = 'none';
            link.innerHTML = '<strong>View Image Gallery</strong>';
            return loadIframe(iframe_id, '');
		}
	}
	
function adjustContainerHeight(targetID,ExtraPadding) {
	var WineTypeBlockHeight = document.getElementById('t_WineType').offsetHeight;
	var VarietalBlockHeight = document.getElementById('t_Varietal').offsetHeight;
	//var PriceBlockHeight = document.getElementById('t_Price').offsetHeight;
	var CityBlockHeight = document.getElementById('t_City').offsetHeight;
	var KeywordBlockHeight = document.getElementById('t_Keyword').offsetHeight;
	var AttributeBlockHeight = document.getElementById('t_Attribute').offsetHeight;
	var blockheight = parseInt(ExtraPadding) + parseInt(WineTypeBlockHeight) + parseInt(VarietalBlockHeight) + parseInt(CityBlockHeight) + parseInt(KeywordBlockHeight) + parseInt(AttributeBlockHeight);

	document.getElementById(targetID).style.height = blockheight + 'px';
	
}


// Two choices for loading new pages into the iframe 
function loadIframe(iframeName, url) {
    if ( window.frames[iframeName] ) {
        window.frames[iframeName].location = url;   
        return false;
    }
    return true;
}

function changeIframeSrc(id, url) {
    if (!document.getElementById) return;
    var el = document.getElementById(id);
    if (el && el.src) {
        el.src = url;
        return false;
    }
    return true;
}
