//
// B14 Flash JS Tools V1.2
//

//
// Navigation from flash back or forward buttons
//
function b14CmsHistoryGo(offset) {
	history.go(-1);	
}

//
// Dynamic sizechange from flash
//
function changeDivSize(width, height) {
	var flashDiv = document.getElementById("flashcontent");
	var flashSite = document.getElementById("flashSite");

	var newFlashWidth = parseInt(width);
	var newFlashHeight = parseInt(height);
	
	// update site's "global minimum height"
	if (minHeight && minHeight < newFlashHeight)
		minHeight = newFlashHeight;
	
	if (newFlashWidth != 0)
		flashDiv.style.width = newFlashWidth + "px";
	
	if (newFlashHeight != 0) {
		flashDiv.style.height = newFlashHeight + "px";
		// Handle old MSIE buggy CSS engine
		if ( navigator.appName == "Microsoft Internet Explorer" && parseFloat(navigator.appVersion) < 7 )
			flashSite.style.height = newFlashHeight;
	}
}

function scrollToTop() {
	window.scrollTo(0, 0);  // move to top of browser window
}

function b14trace(msg) {
	var traceDiv = document.getElementById("b14TraceDivOutput");	
	var traceDivContent = document.getElementById("b14TraceDivOutputContent");	
	
	var p = document.createElement("p");
	var textNode = document.createTextNode(msg);
	p.appendChild(textNode);
	
	traceDivContent.appendChild(p);
	traceDiv.scrollTop = traceDivContent.offsetHeight;
}

function b14traceClear() {
	var traceDivContent = document.getElementById("b14TraceDivOutputContent");
	if ( traceDivContent.hasChildNodes() ) {
	    while ( traceDivContent.childNodes.length >= 1 ) {
	        traceDivContent.removeChild( traceDivContent.firstChild );
	    } 
	}

}

function scrollMacBrowser(deltaX, deltaY) {
	window.scrollBy( (deltaX*-4), (deltaY*-4) );
}

//
// This is the universal b14 event tracking proxy
//
function trackEvent(category,action,label,value) {
	if (isFinite(value))
		pageTracker._trackEvent(category,action,label,value);
	else 
		pageTracker._trackEvent(category,action,label);

}