function chg_thisclass(obj,clsName,event_type)
{
    var event_obj;
    event_obj=eval(obj);
    if (event_type==1) {
        if (clsName!=""){
            event_obj.className +=" "+clsName;
        }
    }
    else {
        if (clsName!=""){
            event_obj.className=event_obj.className.replace(clsName,"");
        }
    }
}
function chg_theclass(total_num,now_i,clsName,obj_type,other_var)
{
    var event_obj,obj_idstr;
    obj_idstr="";
    if(obj_type)
    {
        if(obj_type==1)
        {
            obj_idstr="top_menu";
        }
        else if(obj_type==2)
        {
            obj_idstr="submenu_" + other_var + "_";
        }
    }
    for(var i=0;i<=total_num;i++)
    {
        var the_itemstr=obj_idstr + i;
        if(document.getElementById(the_itemstr))
        {
            event_obj=document.getElementById(the_itemstr);
            if(now_i==i)
            {
                event_obj.className = clsName;
            }
            else
            {
                event_obj.className = event_obj.className.replace(clsName,"");
            }
        }
    }
}
function attach_objclass(obj,clsName,event_type){
    var event_obj=document.getElementById(obj);
    if (event_type==1) {
        if (clsName!=""){
            event_obj.className +=" "+clsName;
        }
    }
    else {
        if (clsName!=""){
            event_obj.className=event_obj.className.replace(clsName,"");
        }
    }
}
function open_newpic(obj)
{
    var op_obj;
    op_obj=eval(obj);
    window.open(obj.value,"review_pic");
}
function redirect_url(urlpage,selObj)
{
    if (urlpage!="")
    {
        eval("self.location='"+ urlpage + selObj.options[selObj.selectedIndex].value +"'");
    }
}
document.attachEvent("onmouseover",mover_inputevent);
function mover_inputevent()
{
    var event_obj=event.srcElement;
    if (event_obj.tagName=="INPUT") {
        if (event_obj.type.toLowerCase()=="text" || event_obj.type.toLowerCase()=="password") {
            chg_thisclass(event_obj,'msover_border',1);
        }
    }
}
document.attachEvent("onmouseout",mout_inputevent);
function mout_inputevent()
{
    var event_obj=event.srcElement;
    if (event_obj.tagName=="INPUT") {
        if (event_obj.type.toLowerCase()=="text" || event_obj.type.toLowerCase()=="password") {
            chg_thisclass(event_obj,'msover_border',0);
        }
    }
}
function copyObjValue(obj)
{
    var theObj=document.getElementById(obj);
    var clipBoardContent=theObj.value;
    window.clipboardData.setData("Text",clipBoardContent);
}
function showhide_objdiv(div_obj,event_obj){
    if(document.getElementById(div_obj))
    {
        var showhide_obj=document.getElementById(div_obj);
        if (event_obj==1)
        {
            showhide_obj.style.display="";
        }
        else
        {
            showhide_obj.style.display="none";
        }
    }
}
function chg_thedisplay(obj,newObj)
{
    var event_obj;
    event_obj=eval(obj);
    if (document.getElementById(newObj)) {
        var theNewObj=document.getElementById(newObj);
        if(event_obj.checked==true)
        {
            theNewObj.style.display="";
        }
        else
        {
            theNewObj.style.display="none";
        }
    }
}
function chg_thevisibility(obj,newObj)
{
    var event_obj;
    event_obj=eval(obj);
    if (document.getElementById(newObj)) {
        var theNewObj=document.getElementById(newObj);
        if(event_obj.checked==true)
        {
            theNewObj.style.visibility="visible";
        }
        else
        {
            theNewObj.style.visibility="hidden";
        }
    }
}
function chg_thehidden(obj,newObj)
{
    var event_obj;
    event_obj=eval(obj);
    if (document.getElementById(newObj)) {
        var theNewObj=document.getElementById(newObj);
        if(event_obj.checked==true)
        {
            theNewObj.style.display="none";
        }
        else
        {
            theNewObj.style.display="";
        }
    }
}
function chg_theobjval(obj,newObj)
{
    var event_obj;
    event_obj=eval(obj);
    if (document.getElementById(newObj)) {
        var theNewObj=document.getElementById(newObj);
        if(event_obj.selectedIndex>=0)
        {
            theNewObj.value=event_obj.options[event_obj.selectedIndex].value;
        }
    }
}
var open_winobj=null;
function open_newwindow(url_var,win_name,winwidth,winheight)
{
    var win_width=screen.width;
    if(winwidth)
    {
        win_width=winwidth;
    }
    var win_height=screen.height;
    if(winheight)
    {
        win_height=winheight;
    }
    if(open_winobj)
    {
        open_winobj.close();
        open_winobj=null;
    }
    open_winobj=window.open(url_var,win_name,"width=" + win_width + ",height=" + win_height + ",top=0,left=0,scrollbars=1, resizable=yes");
}
function open_fixwindow(url_var,winwidth,winheight)
{
    var left_x,top_y;
    var win_width=screen.width-300;
    if(winwidth)
    {
        win_width=winwidth;
    }
    var win_height=screen.height-250;
    if(winheight)
    {
        win_height=winheight;
    }
    left_x=parseInt((screen.width-win_width)/2);
    top_y=parseInt((screen.height-win_height)/2);
    window.showModalDialog(url_var,"Arguments","dialogHeight: " + win_height + "px; dialogWidth: " + win_width + "px; dialogTop: " + top_y + "px; dialogLeft: " + left_x + "px; edge: Raised; center: no; help: no; resizable: no; status: no; scroll: auto;");
}
function thewindow_close(iswin_obj)
{
    window.close();
}
function open_thewin(url_var,win_name,winwidth,winheight,win_type)
{
    var win_width=screen.width;
    if(winwidth)
    {
        win_width=winwidth;
    }
    var win_height=screen.height;
    if(winheight)
    {
        win_height=winheight;
    }
    if(win_type)
    {
        window.open(url_var,win_name,"width=" + win_width + ",height=" + win_height + ",top=0,left=0,toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no");
    }
    else
    {
        window.open(url_var,win_name,"width=" + win_width + ",height=" + win_height + ",top=0,left=0,scrollbars=1, resizable=yes");
    }
}
function open_newwin(url_var,win_name,winwidth,winheight)
{
    var win_width=screen.width;
    if(winwidth)
    {
        win_width=winwidth;
    }
    var win_height=screen.height;
    if(winheight)
    {
        win_height=winheight;
    }
    window.open(url_var,win_name,"width=" + win_width + ",height=" + win_height + ",top=0,left=0,toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no");
}
function set_parentobj(parentObj,newValue)
{
    var theDoc_Obj;
    if(window.opener)
    {
        theDoc_Obj=window.opener.document;
    }
    else
    {
        theDoc_Obj=window.parent.document;
    }
    if(theDoc_Obj.getElementById(parentObj))
    {
        var parent_obj=theDoc_Obj.getElementById(parentObj);
        if(newValue)
        {
            parent_obj.value=newValue;
        }
    }
    thewindow_close(1);
}
function changeASelf(obj,hrefFront,otherObj)
{
    var theObj=eval(obj);
    var idObj=null;
    if(document.getElementById(otherObj))
    {
        idObj=document.getElementById(otherObj);
    }
    if(idObj.value)
    {
        theObj.target="_blank";
        theObj.href=hrefFront + idObj.value;
    }
    else
    {
        theObj.target="_self";
        theObj.href="#";
    }
}
function viewThe_Obj(hrefFront,otherObj)
{
    var idObj=null;
    if(document.getElementById(otherObj))
    {
        idObj=document.getElementById(otherObj);
    }
    if(idObj.value)
    {
        open_newwindow(hrefFront + idObj.value,'viewfile_window');
    }
}
function chgoption_show(event_obj,chg_obj)
{
    var eventObj=eval(event_obj);
    var chgObj=document.getElementById(chg_obj);
    var theValue=eventObj.options[eventObj.selectedIndex].value;
    if(!theValue)
    {
        chgObj.style.display="";
    }
    else
    {
        chgObj.style.display="none";
    }
}
function chgoption_show2(event_obj,chg_obj,chg_obj2)
{
    var eventObj=eval(event_obj);
    var chgObj=document.getElementById(chg_obj);
    var chgObj2=document.getElementById(chg_obj2);
    var theText=eventObj.options[eventObj.selectedIndex].text;
    var theValue=eventObj.options[eventObj.selectedIndex].value;
    if(!theValue)
    {
        chgObj.value="";
        chgObj.style.display="";
        chgObj2.readOnly=false;
        chgObj2.className="";
    }
    else
    {
        chgObj.value=theText;
        chgObj.style.display="none";
        chgObj2.readOnly=true;
        chgObj2.className="bg_readonly";
    }
    chgObj2.value=theValue;
}
function openPopDiv(divId,divBgId,mWidth,mHeight){
    if(document.getElementById(divId))
    {
        var divState = document.getElementById(divId).style.display;
        if(divState!='block')
        {
            document.getElementById(divId).style.width = mWidth + "px";
            document.getElementById(divId).style.height = mHeight + "px";
            document.getElementById(divId).style.marginLeft = -mWidth/2 + "px";
            document.getElementById(divId).style.marginTop = -mHeight/2 + "px";
            document.getElementById(divId).style.display = 'block';
            var ch=document.body.clientHeight, sh=document.body.scrollHeight, st=document.body.scrollTop;
            document.getElementById(divBgId).style.height = (sh > ch ? sh : ch) + 'px';
            document.getElementById(divBgId).style.width = document.body.clientWidth + 'px';
            document.getElementById(divBgId).style.display = 'block';
        }else
        {
            document.getElementById(divId).style.display = 'none';
            document.getElementById(divBgId).style.display = 'none';
        }
    }
}
function showhide_defaultval(selObj,theObj1,theObj2)
{
    var eventObj=eval(selObj);
    var theValue=eventObj.options[eventObj.selectedIndex].value;
    if(theValue=='text')
    {
        if(document.getElementById(theObj1))
        {
            document.getElementById(theObj1).style.display="none";
        }
        if(document.getElementById(theObj2))
        {
            document.getElementById(theObj2).style.display="";
        }
    }
    else
    {
        if(document.getElementById(theObj1))
        {
            document.getElementById(theObj1).style.display="";
        }
        if(document.getElementById(theObj2))
        {
            document.getElementById(theObj2).style.display="none";
        }
    }
}
function setTheCookie(name, value)
{
    var cookie_name=getTheDomain(1);
    cookie_name=cookie_name + name;
    var argv = setTheCookie.arguments;
    var argc = setTheCookie.arguments.length;
    var expires = (argc > 2) ? argv[2] : null;
    if(expires!=null)
    {
        var LargeExpDate = new Date ();
        LargeExpDate.setTime(LargeExpDate.getTime() + (expires*1000*3600*24));
    }
    document.cookie = cookie_name + "=" + escape (value)+((expires == null) ? "" : ("; expires=" +LargeExpDate.toGMTString()));
}
function getTheCookie(Name)
{
    var cookie_name=getTheDomain(1);
    cookie_name=cookie_name + Name;
    var search = cookie_name + "=";
    if(document.cookie.length > 0)
    {
        offset = document.cookie.indexOf(search);
        if(offset != -1)
        {
            offset += search.length;
            end = document.cookie.indexOf(";", offset);
            if(end == -1) end = document.cookie.length;
            return unescape(document.cookie.substring(offset, end));
        }
        else return ""
    }
}
function getTheDomain(rep_var)
{
    var theHost,thePort,theDomain;
    theHost=location.hostname;
    thePort=location.port;
    theDomain=theHost;
    if(thePort!="80" && thePort!="")
    {
        theDomain=theHost + ":" + thePort;
    }
    if(rep_var==1)
    {
        theDomain=theDomain.replace(".","");
        theDomain=theDomain.replace(":","");
    }
    return theDomain;
}