var WeWantAd =
{
formIDStr: "",
hiddenChoiceIDStr: "",
btnDescriptor: [],
BTN_ID_ELEM: 0,
BTN_NORMCLAS_ELEM: 1,
BTN_EMPHCLAS_ELEM: 2,
BTN_POST_NUM:  3
};
WeWantAd.Init = function()
{
var idx;
var input;
for (idx = 0; idx < WeWantAd.btnDescriptor.length; idx++)
{
input = document.getElementById(WeWantAd.btnDescriptor[idx][WeWantAd.BTN_ID_ELEM]);
if (input)
WeWantAd.CreateRadioBtnObj(idx);
}
};
WeWantAd.CreateRadioBtnObj = function
(
radBtnNum
)
{
var radBtnObj = function (radBtnNum,sltdRadBtnStr)
{
var that = this;
this.btnDescription = WeWantAd.btnDescriptor[radBtnNum];
this.node = document.getElementById(this.btnDescription[WeWantAd.BTN_ID_ELEM]);
this.ClickAction = function ()
{
var node = document.getElementById(WeWantAd.hiddenChoiceIDStr);
node.value = that.btnDescription[WeWantAd.BTN_POST_NUM];
var form = document.getElementById(WeWantAd.formIDStr);
form.submit();
};
this.node.onclick = this.ClickAction;
this.MouseoverAction = function ()
{
that.node.className = that.btnDescription[WeWantAd.BTN_EMPHCLAS_ELEM];
};
this.node.onmouseover = this.MouseoverAction;
this.MouseoutAction = function ()
{
that.node.className = that.btnDescription[WeWantAd.BTN_NORMCLAS_ELEM];
};
this.node.onmouseout = this.MouseoutAction;
};
return new radBtnObj(radBtnNum);
};
WeWantAd.Start = function ()
{
if (document.addEventListener)
{
window.addEventListener("load",WeWantAd.Init,false);
}
else
{
window.attachEvent("onload",WeWantAd.Init);
}
};
WeWantAd.formIDStr = 'items_for_sale_form';
WeWantAd.hiddenChoiceIDStr = 'userchoice';
WeWantAd.btnDescriptor =
[
["addbtn","norm_activity_btn","emph_activity_btn","b0"],
["modifybtn","norm_activity_btn","emph_activity_btn","b1"],
["removebtn","norm_activity_btn","emph_activity_btn","b2"],
["applybtn","norm_action1_btn","emph_action1_btn","b3"],
["cancelbtn","norm_action2_btn","emph_action2_btn","b4"]
];
WeWantAd.Start();
function CdCCViewIcon
(
imgID,
bMouseOver
)
{
var imageElem = document.getElementById(imgID);
imageElem.src = bMouseOver == true ? "../images/LightGreenEye16px.png" : "../images/DarkBlueEye16px.png";
};
