/* Set frame height to match frame contents */
jQuery.noConflict();
function iFrameHeightX(iFrameId) {
	/**
	var h = 0;
        try {
            if ( !document.all ) {				// Firefox & Safari
                    h = document.getElementById(iFrameId).contentDocument.height;
                    h = (h < 500) ? h+300 : h;
                    document.getElementById(iFrameId).style.height = h + 'px';
            } else if( document.all ) {			// IE6, IE7
                    h = document.frames(iFrameId).document.body.scrollHeight;
                    h = (h < 500) ? h+300 : h;
                    document.all[iFrameId].style.height = (h + 10) + 'px';
            }
        } catch(e) {
            if ( !document.all ) {
                document.getElementById(iFrameId).style.height = '600px';
            } else if ( document.all) {
                document.all[iFrameId].style.height = '600px';
            }
        }
	**/
	
	var h = jQuery('#' + iFrameId).contents().find("html").height()
	
	jQuery('#' + iFrameId).height(h);
}

/* update the page title */
function pageTitleUpdate(iFrameId) {
	var oldTitle = document.title;
	var frameInfo = document.getElementById(iFrameId);
	
	var doc2 = frameInfo.contentWindow ? frameInfo.contentWindow.document : frameInfo.contentDocument;
	
	if(!doc2 && window.frames[iFrameId]) {
		doc2 = window.frames[iFrameId].window.document;
	}
	
	var newTitle = doc2.title;
	
	document.title = newTitle;
}

/* This function calls any others that are needed */
function ZenCartLoaded(iFrameId) {
	iFrameHeightX(iFrameId);
	pageTitleUpdate(iFrameId);
}

window.setInterval("iFrameHeightX('zencart');", 100);
