function FlashObj(objName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
    	if (Object.prototype.toString.call(window[objName]) === "[object HTMLCollection]"){
    		return document[objName];
    	}
        return window[objName];
    }
    else {
    	//var obj = document[objName];
        return document[objName];
    }
}

function SelectColor(strFlash, objName, nColor) {
	FlashObj(strFlash).SetColor(nColor);
	var oElement = document.getElementById("PaletteButton").getElementsByTagName("div");
	var nCnt;
	for(nCnt = 0; nCnt < 16; nCnt++)
	{
		oElement.item(nCnt).style.borderColor = "#aaaaaa";
	}
	objName.style.borderColor = "#505050";
}

function SelectPen(strFlash, objName, nWidth) {
	FlashObj(strFlash).SetPen(nWidth);
	var oElement = document.getElementById("PaletteButton").getElementsByTagName("div");
	var nCnt;
	for(nCnt = 16; nCnt < 22; nCnt++)
	{
		oElement.item(nCnt).style.borderColor = "#aaaaaa";
	}
	objName.style.borderColor = "#505050";
}

