/***********************************************************************************
**** Select Box Design Script ******************************************************
**** Start *************************************************************************
************************************************************************************/
var nowOpenedSelectBox = "";
var mousePosition = "";
function selectThisValue(thisId,thisIndex,thisValue,thisString) {
var objId = thisId;
var nowIndex = thisIndex;
var valueString = thisString;
var sourceObj = document.getElementById(objId);
var nowSelectedValue = document.getElementById(objId+"SelectBoxOptionValue"+nowIndex).value;
hideOptionLayer(objId);
if (sourceObj) sourceObj.value = nowSelectedValue;
settingValue(objId,valueString);
selectBoxFocus(objId);
if (sourceObj.onchange) sourceObj.onchange();
}
function selectThisValueMyMenu(thisId,thisIndex,thisValue,thisString, className) {
var objId = thisId;
var nowIndex = thisIndex;
var valueString = thisString;
var sourceObj = document.getElementById(objId);
var nowSelectedValue = document.getElementById(objId+"SelectBoxOptionValue"+nowIndex).value;
hideOptionLayer(objId);
if (sourceObj) sourceObj.value = nowSelectedValue;
settingValue(objId,valueString);
selectBoxFocusMyMenu(objId, className);
if (sourceObj.onchange) sourceObj.onchange();
}
function settingValue(thisId,thisString) {
var objId = thisId;
var valueString = thisString;
var selectedArea = document.getElementById(objId+"selectBoxSelectedValue");
if (selectedArea) selectedArea.innerHTML = valueString.replace("&","&");
}
function viewOptionLayer(thisId) {
var objId = thisId;
var optionLayer = document.getElementById(objId+"selectBoxOptionLayer");
if (optionLayer) optionLayer.style.display = "";
nowOpenedSelectBox = objId;
setMousePosition("inBox");
}
function hideOptionLayer(thisId) {
var objId = thisId;
var optionLayer = document.getElementById(objId+"selectBoxOptionLayer");
if (optionLayer) optionLayer.style.display = "none";
}
function setMousePosition(thisValue) {
var positionValue = thisValue;
mousePosition = positionValue;
}
function clickMouse() {
if (mousePosition == "out") hideOptionLayer(nowOpenedSelectBox);
}
function selectBoxFocus(thisId) {
var objId = thisId;
var obj = document.getElementById(objId + "selectBoxSelectedValue");
obj.className = "selectBoxSelectedAreaFocus";
obj.focus();
}
function selectBoxFocusMyMenu(thisId, classNameFocus) { //MyMeny
var objId = thisId;
var obj = document.getElementById(objId + "selectBoxSelectedValue");
obj.className = classNameFocus;
obj.focus();
}
function selectBoxBlurMyMenu(thisId, classNameFocus) {
var objId = thisId;
var obj = document.getElementById(objId + "selectBoxSelectedValue");
obj.className = classNameFocus;
}
function selectBoxBlur(thisId) {
var objId = thisId;
var obj = document.getElementById(objId + "selectBoxSelectedValue");
obj.className = "selectBoxSelectedArea";
}
function makeSelectBoxGlobal(thisId, selectBoxSelectedArea, lineColor, downArrowSrcPath, selectBoxOption, selectBoxSelectedAreaFocus, selectBoxOptionOver) {
var downArrowSrc = downArrowSrcPath; //rightArrow
var downArrowSrcWidth = 17; //rightQrrow Image width
var optionHeight = 19; // option heigh
var optionMaxNum = 6; // option Maxnum
var layerLeft = -13; //·¹À̾î ÁÂÃø ¼öÄ¡
var tdTextpadding = 18; //·¹À̾î ÁÂÃø ¼öÄ¡°¡ ¹Ð·Á³ª¸é¼ ¹ß»ýÇÏ´Â ÅØ½ºÆ® Á¤·Ä¹®Á¦
var optionInnerLayerHeight = "";
var objId = thisId;
var obj = document.getElementById(objId);
var selectBoxWidth = parseInt(obj.style.width);
var selectBoxHeight = parseInt(obj.style.height);
if (obj.options.length > optionMaxNum) optionInnerLayerHeight = "height:"+ (optionHeight * optionMaxNum) + "px";
newSelect = "
";
newSelect += " ";
newSelect += " | ";
newSelect += "
";
newSelect += " ";
newSelect += " ";
newSelect += " ";
newSelect += " ";
newSelect += " | ";
newSelect += " ";
newSelect += " ";
newSelect += " ";
newSelect += " ";
newSelect += " ";
newSelect += " | ";
newSelect += " ";
for (var i=0 ; i < obj.options.length ; i++) {
var nowValue = obj.options[i].value;
var nowText = obj.options[i].text;
if (nowValue != null && nowValue != "") { // value.
newSelect += " ";
newSelect += " | " + nowText + " | ";
newSelect += " ";
newSelect += " ";
}
}
newSelect += " ";
newSelect += " | ";
newSelect += " ";
newSelect += " ";
newSelect += " ";
newSelect += " ";
newSelect += " ";
newSelect += " | ";
newSelect += " ";
newSelect += " ";
newSelect += " | ";
newSelect += "
";
newSelect += "
";
newSelect += "";
newSelect += " ";
newSelect += " ";
newSelect += " ";
newSelect += " ";
newSelect += " | ";
newSelect += "  | ";
newSelect += " ";
newSelect += " ";
newSelect += " | ";
newSelect += "
";
newSelect += "
";
document.write(newSelect);
var haveSelectedValue = false;
for (var i=0 ; i < obj.options.length ; i++) {
if (obj.options[i].selected == true) {
haveSelectedValue = true;
settingValue(objId,obj.options[i].text);
}
}
if (!haveSelectedValue) settingValue(objId,obj.options[0].text);
}
/***********************************************************************************
**** Select Box Design Script ******************************************************
**** End ***************************************************************************
************************************************************************************/
function goLeftSelectBoxMenu(thisURL,thisTarget) {
if (thisURL == "" || thisURL == null || thisURL == "separator") return;
var nowTarget = "_blank";
if (thisTarget != null && thisTarget != "" ) nowTarget = thisTarget;
window.open(thisURL, nowTarget, "");
}