function initFlashExpandable (flashID) {
    var flashObject = document.getElementById(flashID);
    var flashContainer = flashObject.parentNode;

    if ( flashContainer.nodeType != -1 && flashContainer.nodeName.toLowerCase() != "body" ) {
        flashContainer.style.position = "absolute";
		flashContainer.style.top = 0;
		flashContainer.style.left = -16 + "px";
		flashContainer.style.zIndex = 10000;
    }
    else {
        flashContainer = document.createElement("div");
        flashContainer.style.width = flashObject.clientWidth + "px";
        flashContainer.style.height = flashObject.clientHeight + "px";
        flashObject.parentNode.insertBefore(flashContainer, flashObject);
        flashContainer.appendChild(flashObject);
    }
}
function expandeAdvisorTool () {
    var flashObject = document.getElementById("player");
	var flashContainer = flashObject.parentNode;

    flashObject.style.width = 1025 + "px"; // may con so nay de cau hinh sao cho de sua nha, keo sau nay client keu doi, sua met
    flashObject.style.height = 514 + "px";
//	flashObject.scaleControlBar();
	flashContainer.style.left = -750 + "px";
	flashContainer.style.top = -16 + "px";
}
function createOverlay () {
	var boxOverlay=document.getElementById("overlayBox");
	boxOverlay.style.zIndex = 10;
	boxOverlay.style.display = "block";
	if (document.getElementById("breadcum")==null)
		boxOverlay.style.top = 513 + "px";
	else
		boxOverlay.style.top = 528 + "px";
    var flashObject = document.getElementById("player");
    flashObject.parentNode.className += " ContainerOverlays";
}
function removeOverlay () {
	var boxOverlay=document.getElementById("overlayBox");
	boxOverlay.style.zIndex = -1;
	boxOverlay.style.display = "none";

    var flashObject = document.getElementById("player");
    flashObject.parentNode.className = flashObject.parentNode.className.replace(/ContainerOverlays/, "");
}
function closeAdvisorTool () {
    var flashObject = document.getElementById("player");
	var flashContainer = flashObject.parentNode;
        flashObject.style.width = 257 + "px";
    flashObject.style.height = 371 + "px";
	//alert(flashObject.style.width);
	flashContainer.style.left = -16 + "px";
	flashContainer.style.top = 0 + "px";
}
//example to call expand flash from javascript
//<button id="buttonGuideMe" onclick = "showAdvisorTool('player','GuideMe');">GuideMe</button>
//<button id="buttonInspireMe" onclick = "showAdvisorTool('player','InspireMe');">InspireMe</button>
	
function showAdvisorTool(flashID, type) {
    var flashObject = document.getElementById(flashID);
	flashObject.showAdvisorTool(type);
}
function windowPop(url, name, width, height, scrollboolean) {

    var LeftPosition = (screen.width) ? (screen.width - width) / 2 : 0;
    var TopPosition = (screen.height) ? (screen.height - height) / 2 : 0;

    var params;
    if (scrollboolean != "") {
        params = "scrollbars=" + scrollboolean;
    } else {
        params = "scrollbars=0";
    }
    params = params + ",location=0,menubar=0,status=0,toolbar=0,resizable=1,top=" + TopPosition + ",left=" + LeftPosition + ",";
    params = params + "width=" + width + ",height=" + height;
    window.open(url, name, params).focus();
}
