﻿function ChangePic(ElementID, SourceUrl)
{
    if (document.getElementById(ElementID)!=null)
    {
        document.getElementById(ElementID).src = SourceUrl;
    }
}

function ChangePic_obj(ElementObj, SourceUrl)
{
    ElementObj.src = SourceUrl;
}

function ChangeVisible_obj(ElementObj, visibleValue)
{
    if(visibleValue){
        ElementObj.style.visibility = "visible";
    }
    else{
        ElementObj.style.visibility = "hidden";
    }
}

function pswf(tobj){
   if(tobj.text!=undefined) document.write(tobj.text);
   tobj.id='';
}

function DecodeHtml(text)
{   
    if((text==undefined)||(text==null)) return text;
    text = text.replace(/&quot;/g, "\"") ;
    text = text.replace(/&lt;/g, "<") ;
    text = text.replace(/&gt;/g, ">") ;
    text = text.replace(/&#146;/g, "'") ;
    text = text.replace(/&nbsp;/g, " ") ;
    text = text.replace(/&amp;/g, "&") ;
    return text ;
}

function SetMiddle(ID)
{
//    var obj = document.getElementById(ID);
//    if(obj==null) return;
//    var parent = obj.parentElement;
//    while(true)
//    {
//        if (parent==null) return;
//        if(parent.length!=undefined)
//        {
//           parent = parent[0];
//        }
//        if(parent.style.width!="") break;
//        parent = parent.parentElement;
//    }
//    obj.style.marginLeft = Math.round((parseInt(parent.style.width)-parseInt(obj.style.width)-4)/2)+"px";
//    obj.style.marginLeft = obj.style.marginLeft;
}