﻿var cssdropdown={
    disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
    inside: 0,
    //No need to edit beyond here////////////////////////
    dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all,
    dropmenuobjchild: null, ie: document.all, firefox: document.getElementById&&!document.all,
    getposOffset:function(what, offsettype)
    {
        var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
        var parentEl=what.offsetParent;
        while (parentEl!=null)
        {
            if (this.ie )
            {
                if (offsettype == "left" )
                {
                    if (parentEl.style.position.toLowerCase() != "relative" && parentEl.style.position.toLowerCase() != "absolute")
                    {
                        totaloffset=totaloffset+parentEl.offsetLeft - parentEl.style.posLeft;
                    }
                }
                else 
                {
                    if (parentEl.style.position.toLowerCase() != "relative" && parentEl.style.position.toLowerCase() != "absolute")
                    {
                        totaloffset=totaloffset+parentEl.offsetTop - parentEl.style.posTop;
                    }
                }
            }
            else
            {
                var posLeft = 0;
                var posTop = 0;
                if (parentEl.style.left != "" && parentEl.style.left.indexOf("px") != -1)
                {
                    posLeft = parseInt(parentEl.style.left.substring(0, parentEl.style.left.indexOf("px")));
                }
                if (parentEl.style.top != "" && parentEl.style.top.indexOf("px") != -1)
                {
                    posTop = parseInt(parentEl.style.top.substring(0, parentEl.style.top.indexOf("px")));
                }
                if (parentEl.style.position.toLowerCase() != "relative")
                {
                    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop ;
                }
                else
                {
                totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop ;
                }
            }
            parentEl=parentEl.offsetParent;
        }
        return totaloffset;
    },

    showhide:function(obj, e, visible, hidden)
    {
        if (this.ie || this.firefox)
        {
           obj.style.left=obj.style.top="-500px";
        }
        if (e.type=="click" && obj.style.visibility==hidden || e.type=="mouseover")
        {
            obj.style.visibility=visible;
            obj.style.display="block";
        }
        else if (e.type=="click")
        {
            obj.style.visibility=hidden;
            obj.style.display="none";
        }
    },

    iecompattest:function()
    {
        return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
    },

    clearbrowseredge:function(obj,dm, whichedge)
    {
        var edgeoffset=0
        if (whichedge=="rightedge")
        {
            var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15;
            dm.contentmeasure=dm.offsetWidth;
            if (windowedge-dm.x < dm.contentmeasure)  //move menu to the left?
            {
                edgeoffset=dm.contentmeasure-obj.offsetWidth;
            }
        }
        else
        {
            var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset;
            var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18;
            dm.contentmeasure=dm.offsetHeight;
            if (windowedge-dm.y < dm.contentmeasure)
            { //move up?
                edgeoffset=dm.contentmeasure+obj.offsetHeight;
                if ((dm.y-topedge)<dm.contentmeasure) //up no good either?
                {
                    edgeoffset=dm.y+obj.offsetHeight-topedge;
                }
            }
        }
        return edgeoffset
    },
    clearbrowseredgechild:function(obj,dm, whichedge)
    {
        var edgeoffset=0;
        var offset=0;
        var parentEl=dm.offsetParent;
        while (parentEl!=null)
        {
            
            offset= (whichedge == "rightedge")? offset+parentEl.offsetLeft :offset + parentEl.offsetTop
            
            parentEl=parentEl.offsetParent;
        }
        if (whichedge=="rightedge")
        {
            var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15;
            dm.contentmeasure=dm.offsetWidth;
            if (windowedge- offset - obj.offsetWidth - dm.contentmeasure < 0)  //move menu to the left?
            {
                edgeoffset= -dm.contentmeasure;
            }
            else
            {
                edgeoffset = obj.offsetWidth;
            }
        }
        else
        {
            var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset;
            var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18;
            dm.contentmeasure=dm.offsetHeight;
            if (windowedge- offset - obj.offsetHeight - dm.contentmeasure < 0)
            { //move up?
                edgeoffset= 0 - dm.contentmeasure + obj.offsetTop+ obj.offsetHeight;
                
            }
            else
            {
                edgeoffset = obj.offsetTop - 1;
            }
        }
        return edgeoffset
    },

    dropit:function(obj, e, dropmenuID, direction)
    {
        if (this.dropmenuobj!=null) //hide previous menu
        {
            if (this.ie&&this.dropmenuobj.contains(obj))
            {
                if (this.dropmenuobjchild != null)
                {
                    this.dropmenuobjchild.style.visibility="hidden";
                    this.dropmenuobjchild.style.display="none";
                }
                this.SetChild(obj,e,dropmenuID, direction);
            }
            else if (this.firefox && this.contains_firefox(this.dropmenuobj,obj))
            {
                if (this.dropmenuobjchild != null)
                {
                    this.dropmenuobjchild.style.visibility="hidden";
                    this.dropmenuobjchild.style.display="none";
                }
                this.SetChild(obj,e,dropmenuID, direction);
            }
            else
            {
                this.dropmenuobj.style.visibility="hidden";
                this.dropmenuobj.style.display="none";
                this.SetParent(obj,e,dropmenuID,direction);
            }    
        }
        else 
        {
            this.SetParent(obj,e,dropmenuID,direction);
        }
        
    },
    SetChild:function(obj,e,dropmenuID,direction)
    {
        this.clearhidemenuchild();
        if (this.ie||this.firefox)
        {
            obj.onmouseout=function(){cssdropdown.delayhidemenuchild()};
            var tempdropobject = document.getElementById(dropmenuID);
            tempdropobject.onmouseover=function(){cssdropdown.clearhidemenuchild()};
            tempdropobject.onmouseout=function(){cssdropdown.dynamichidechild(e)};
            //tempdropobject.onclick=function(){cssdropsown.delayhidemenuchild()};
            this.showhide(tempdropobject, e, "visible", "hidden");
            
            tempdropobject.x = 0;
            tempdropobject.y= 0;
            tempdropobject.style.left=this.clearbrowseredgechild(obj,tempdropobject, "rightedge")+"px";
            tempdropobject.style.top=this.clearbrowseredgechild(obj, tempdropobject, "bottomedge") +"px";
            this.dropmenuobjchild = tempdropobject;
            
        }
    },
    SetParent:function(obj,e,dropmenuID,direction)
    {
        this.clearhidemenu();
        if (this.ie||this.firefox)
        {
            obj.onmouseout=function(){cssdropdown.delayhidemenu()};
            var tempdropobject = document.getElementById(dropmenuID);
            tempdropobject.onmouseover=function(){cssdropdown.clearhidemenu()};
            tempdropobject.onmouseout=function(){cssdropdown.dynamichide(e)};
            //tempdropobject.onclick=function(){cssdropdown.delayhidemenu()};
            this.showhide(tempdropobject, e, "visible", "hidden");
            tempdropobject.x=this.getposOffset(obj, "left");
            tempdropobject.y=this.getposOffset(obj, "top");
            
            tempdropobject.style.left=tempdropobject.x-this.clearbrowseredge(obj,tempdropobject, "rightedge", direction)+"px";
            tempdropobject.style.top=tempdropobject.y-this.clearbrowseredge(obj, tempdropobject, "bottomedge" , direction)+obj.offsetHeight+1+"px";
            this.dropmenuobj = tempdropobject;
            
        }
    },
    contains_firefox:function(a, b) 
    {
        while (b.parentNode)
        {
            if ((b = b.parentNode) == a)
            return true;
        }
        return false;
    },

    dynamichide:function(e)
    {
        var evtobj=window.event? window.event : e;
        if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
        {            
            this.delayhidemenu();
            
        }
        else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
        {
            this.delayhidemenu();
        }
    },
    dynamichidechild:function(e)
    {
        var evtobj=window.event? window.event : e;
        if (this.ie&&!this.dropmenuobjchild.contains(evtobj.toElement))
        {            
            this.delayhidemenuchild();
            
        }
        else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
        {
            this.delayhidemenuchild();
        }
    },

    delayhidemenu:function()
    {
        this.delayhide=setTimeout("cssdropdown.dropmenuobj.style.visibility='hidden';cssdropdown.dropmenuobj.style.display='none';",this.disappeardelay);
    },
    delayhidemenuchild:function()
    {
        this.delayhidechild=setTimeout("cssdropdown.dropmenuobjchild.style.visibility='hidden';cssdropdown.dropmenuobjchild.style.display='none';",this.disappeardelay);
    },
    clearhidemenu:function()
    {
        if (this.delayhide!="undefined")
        {
            clearTimeout(this.delayhide);
            
        }
       
    },
    clearhidemenuchild:function()
    {
        if (this.delayhide!="undefined")
        {
            clearTimeout(this.delayhide);
            clearTimeout(this.delayhidechild);
            
        }
       
    }
    
}
var cssdropmenu={
    disappeardelay: 250, //set delay in miliseconds before menu disappears onmouseout
    inside: 0,
    //No need to edit beyond here////////////////////////
    dropmenuobj: null, ie: document.all, firefox: document.getElementById&&!document.all,
    dropmenuobjchild: null, ie: document.all, firefox: document.getElementById&&!document.all,
    getposOffset:function(what, offsettype)
    {
        var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
        var parentEl=what.offsetParent;
        while (parentEl!=null)
        {
            
            if (this.ie )
            {
                if (offsettype == "left" )
                {
                    if (parentEl.style.position.toLowerCase() != "relative")
                    {
                        totaloffset=totaloffset+parentEl.offsetLeft - parentEl.style.posLeft;
                    }
                }
                else 
                {
                    if (parentEl.style.position.toLowerCase() != "relative")
                    {
                        totaloffset=totaloffset+parentEl.offsetTop - parentEl.style.posTop;
                    }
                }
            }
            else
            {
                var posLeft = 0;
                var posTop = 0;
                if (parentEl.style.left != "" && parentEl.style.left.indexOf("px") != -1)
                {
                    posLeft = parseInt(parentEl.style.left.substring(0, parentEl.style.left.indexOf("px")));
                }
                if (parentEl.style.top != "" && parentEl.style.top.indexOf("px") != -1)
                {
                    posTop = parseInt(parentEl.style.top.substring(0, parentEl.style.top.indexOf("px")));
                }
                if (parentEl.style.position.toLowerCase() != "relative")
                {
                    totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop ;
                }
                else
                {
                totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop ;
                }
            }
            parentEl=parentEl.offsetParent;
        }
        return totaloffset;
    },

    showhide:function(obj, e, visible, hidden)
    {
        if (this.ie || this.firefox)
        {
           obj.style.left=obj.style.top="-500px";
        }
        if (e.type=="click" && obj.style.visibility==hidden || e.type=="mouseover")
        {
            obj.style.visibility=visible;
            obj.style.display="block";
        }
        else if (e.type=="click")
        {
            obj.style.visibility=hidden;
            obj.style.display="none";
        }
    },

    iecompattest:function()
    {
        return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
    },

    clearbrowseredge:function(obj,dm, whichedge)
    {
        var edgeoffset=0
        if (whichedge=="rightedge")
        {
            var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15;
            dm.contentmeasure=dm.offsetWidth;
            if (windowedge-dm.x < dm.contentmeasure)  //move menu to the left?
            {
                edgeoffset=dm.contentmeasure-obj.offsetWidth;
            }
        }
        else
        {
            var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset;
            var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18;
            dm.contentmeasure=dm.offsetHeight;
            if (windowedge-dm.y < dm.contentmeasure)
            { //move up?
                edgeoffset=dm.contentmeasure+obj.offsetHeight;
                if ((dm.y-topedge)<dm.contentmeasure) //up no good either?
                {
                    edgeoffset=dm.y+obj.offsetHeight-topedge;
                }
            }
        }
        return edgeoffset
    },
    clearbrowseredgechild:function(obj,dm, whichedge)
    {
        var edgeoffset=0;
        var offset=0;
        var parentEl=dm.offsetParent;
        while (parentEl!=null)
        {
            
            offset= (whichedge == "rightedge")? offset+parentEl.offsetLeft :offset + parentEl.offsetTop
            
            parentEl=parentEl.offsetParent;
        }
        if (whichedge=="rightedge")
        {
            var windowedge=this.ie && !window.opera? this.iecompattest().scrollLeft+this.iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15;
            dm.contentmeasure=dm.offsetWidth;
            if (windowedge- offset - obj.offsetWidth - dm.contentmeasure < 0)  //move menu to the left?
            {
                edgeoffset= -dm.contentmeasure;
            }
            else
            {
                edgeoffset = obj.offsetWidth;
            }
        }
        else
        {
            var topedge=this.ie && !window.opera? this.iecompattest().scrollTop : window.pageYOffset;
            var windowedge=this.ie && !window.opera? this.iecompattest().scrollTop+this.iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18;
            dm.contentmeasure=dm.offsetHeight;
            if (windowedge- offset - obj.offsetHeight - dm.contentmeasure < 0)
            { //move up?
                edgeoffset= 0 - dm.contentmeasure + obj.offsetTop+ obj.offsetHeight;
                
            }
            else
            {
                edgeoffset = obj.offsetTop - 1;
            }
        }
        return edgeoffset
    },

    dropit:function(obj, e, dropmenuID, direction)
    {
        if (this.dropmenuobj!=null) //hide previous menu
        {
            if (this.ie&&this.dropmenuobj.contains(obj))
            {
                if (this.dropmenuobjchild != null)
                {
                    this.dropmenuobjchild.style.visibility="hidden";
                }
                this.SetChild(obj,e,dropmenuID, direction);
            }
            else if (this.firefox && this.contains_firefox(this.dropmenuobj,obj))
            {
                if (this.dropmenuobjchild != null)
                {
                    this.dropmenuobjchild.style.visibility="hidden";
                }
                this.SetChild(obj,e,dropmenuID, direction);
            }
            else
            {
                this.dropmenuobj.style.visibility="hidden";
                this.SetParent(obj,e,dropmenuID,direction);
            }    
        }
        else 
        {
            this.SetParent(obj,e,dropmenuID,direction);
        }
        
    },
    SetChild:function(obj,e,dropmenuID,direction)
    {
        this.clearhidemenuchild();
        if (this.ie||this.firefox)
        {
            obj.onmouseout=function(){cssdropmenu.delayhidemenuchild()};
            var tempdropobject = document.getElementById(dropmenuID);
            tempdropobject.onmouseover=function(){cssdropmenu.clearhidemenuchild()};
            tempdropobject.onmouseout=function(){cssdropmenu.dynamichidechild(e)};
            //tempdropobject.onclick=function(){cssdropsown.delayhidemenuchild()};
            this.showhide(tempdropobject, e, "visible", "hidden");
            
            tempdropobject.x = 0;
            tempdropobject.y= 0;
            tempdropobject.style.left=this.clearbrowseredgechild(obj,tempdropobject, "rightedge")+"px";
            tempdropobject.style.top=this.clearbrowseredgechild(obj, tempdropobject, "bottomedge") +"px";
            this.dropmenuobjchild = tempdropobject;
            
        }
    },
    SetParent:function(obj,e,dropmenuID,direction)
    {
        this.clearhidemenu();
        if (this.ie||this.firefox)
        {
            obj.onmouseout=function(){cssdropmenu.delayhidemenu()};
            var tempdropobject = document.getElementById(dropmenuID);
            tempdropobject.onmouseover=function(){cssdropmenu.clearhidemenu()};
            tempdropobject.onmouseout=function(){cssdropmenu.dynamichide(e)};
            //tempdropobject.onclick=function(){cssdropmenu.delayhidemenu()};
            this.showhide(tempdropobject, e, "visible", "hidden");
            tempdropobject.x=this.getposOffset(obj, "left");
            tempdropobject.y=this.getposOffset(obj, "top");
            tempdropobject.style.left=tempdropobject.x-this.clearbrowseredge(obj,tempdropobject, "rightedge", direction)+"px";
            tempdropobject.style.top=tempdropobject.y-this.clearbrowseredge(obj, tempdropobject, "bottomedge" , direction)+obj.offsetHeight+1+"px";
            this.dropmenuobj = tempdropobject;
            
        }
    },
    contains_firefox:function(a, b) 
    {
        while (b.parentNode)
        {
            b = b.parentNode;
            if (b == a)
            {
                return true;
            }
        }
        return false;
    },

    dynamichide:function(e)
    {
        var evtobj=window.event? window.event : e;
        if (this.ie&&!this.dropmenuobj.contains(evtobj.toElement))
        {            
            this.delayhidemenu();
            
        }
        else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
        {
            this.delayhidemenu();
        }
    },
    dynamichidechild:function(e)
    {
        var evtobj=window.event? window.event : e;
        if (this.ie&&!this.dropmenuobjchild.contains(evtobj.toElement))
        {            
            this.delayhidemenuchild();
            
        }
        else if (this.firefox&&e.currentTarget!= evtobj.relatedTarget&& !this.contains_firefox(evtobj.currentTarget, evtobj.relatedTarget))
        {
            this.delayhidemenuchild();
        }
    },

    delayhidemenu:function()
    {
        this.delayhide=setTimeout("cssdropmenu.dropmenuobj.style.visibility='hidden'",this.disappeardelay);
    },
    delayhidemenuchild:function()
    {
        this.delayhidechild=setTimeout("cssdropmenu.dropmenuobjchild.style.visibility='hidden'",this.disappeardelay);
    },
    clearhidemenu:function()
    {
        if (this.delayhide!="undefined")
        {
            clearTimeout(this.delayhide);
            
        }
       
    },
    clearhidemenuchild:function()
    {
        if (this.delayhide!="undefined")
        {
            clearTimeout(this.delayhide);
            clearTimeout(this.delayhidechild);
            
        }
       
    }
    
}


function TabPressed(index)
{
    if (currentIndex != index )
    {
        var pressedTab = document.getElementById("Tab" + index.toString());
        var pressedTable = document.getElementById("PTable" + index.toString());
        var currentTab = document.getElementById("Tab" + currentIndex.toString());
        var currentTable = document.getElementById("PTable" + currentIndex.toString());
        if (currentTab!=null)
        {
            currentTab.className="properties_inactive_tab";
        }
        if (pressedTab!=null)
        {
            pressedTab.className="properties_active_tab";
        }
        if (currentTable!=null)
        {
            currentTable.style.display= "none";
        }
        if (pressedTable!=null)
        {
            pressedTable.style.display= "block";
        }
        currentIndex = index;
        var manager = document.getElementById("manager0");
        var tools = document.getElementById("console_container");
        var tsize = tools.clientWidth;
        manager.style.width= tsize;
        manager.style.height = tools.clientHeight;
    }
}
//function mymodalDialogShow(url,width,height)//moz
//    {
//    var left = screen.availWidth/2 - width/2;
//    var top = screen.availHeight/2 - height/2;
//    activeModalWin = window.open(url, "", "width="+width+"px,height="+height+",left="+left+",top="+top);
//    window.onfocus = function(){if (activeModalWin.closed == false){activeModalWin.focus();};};
//    }
function TabLoad()
{
    
    currentIndex = 0;
    setTimeout("DelayTabLoad()",1);
    
}
function DelayTabLoad()
{
    TabPressed(1);
    TabPressed(0);
}
function DisplayFile(filename)
{
    var imgtag = document.getElementById("fileimg");
    if (imgtag != null)
    {
        imgtag.src = filename;
    }
}
function submitAdminForm(action)
{
    var adminForm = document.getElementById("AdminForm");
    if (adminForm != null)
    {
        adminForm.mgr.value = action;
        adminForm.submit();
    }
}

function catcalc(cal) 
{
    var date = cal.date;
    var time = date.getTime();
    var field = document.getElementById("f_calcdate");
    if (field == cal.params.inputField) 
    {
        field = document.getElementById("f_date_a");
        var begin_date = Date.parseDate(field.value,"%d.%m.%Y");
        if (date <=  begin_date)
        {
            begin_date.setDate(date.getDate()-1);
            field.value = begin_date.print("%d.%m.%Y");
        }
    } 
    else 
    {
        var end_date = Date.parseDate(field.value,"%d.%m.%Y");
        if (date >= end_date)
        {
            end_date.setDate(date.getDate()+ 1);
            field.value = end_date.print("%d.%m.%Y");
        }
    }
//    var date2 = new Date(time);
//    field.value = date2.print("%d.%m-%Y");
}
function setCalendarPair()
{
    Calendar.setup({
        inputField     :    "f_date_a",
        ifFormat       :    "%d.%m.%Y %H:%M",
        showsTime      :    true,
        timeFormat     :    "24",
        onUpdate       :    catcalc
    });
    Calendar.setup({
        inputField     :    "f_calcdate",
        ifFormat       :    "%d.%m.%Y %H:%M",
        showsTime      :    true,
        timeFormat     :    "24",
        onUpdate       :    catcalc
    });
}
function setCalendar(field)
{
    Calendar.setup({
        inputField     :    field,
        ifFormat       :    "%d.%m.%Y",
        showsTime      :    true,
        timeFormat     :    "24",
        onUpdate       :    catcalc
    });
}
function centerConsole()
{
    var console = document.getElementById("manager0");
    if (manager0 != null)
    {
        
        var winl = (document.body.offsetWidth-console.offsetWidth)/2;
        var wint = (screen.height-console.offsetHeight)/2-100;
        console.style.top = wint + "px";
        console.style.left = winl + "px";    

    }
}
function calcHeight(frameid)
{
    var iframe = document.getElementById(frameid);
    if (iframe != null)
    {
        var body = iframe.contentWindow.document.body;
        if (body != null)
        {
            
	        var the_height= body.scrollHeight;
	        document.getElementById(frameid).height = the_height;
	    }
	}
}
function writeHtml(html)
{
    document.write(html);
}
function writeFlash(src,url,width,height,id)
{
    var flashobj = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\" width=\"" + 
         width + "\" height=\"" + height + "\" id=\"link" + id + "\">" + 
         "<param name=\"movie\"  value=\""  + src + "\" />" +
         "<param name=\"quality\" value=\"high\" />" +
	     "<param name=\"wmode\"   value=\"Opaque\" />"  +
         "<param name=\"bgcolor\" value=\"transparent\">" +
         "<param name=\"flashvars\" value=\"ClickUrl=" + url + "\">" +
         "<embed src=\"" + src + "\" quality=\"high\" bgcolor=\"transparent\" wmode=\"Opaque\" width=\"" + 
         width + "\" height=\"" + height + "\" name=\"link" + id + "\"  align=\"\" type=\"application/x-shockwave-flash\"" +
         " pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object>";
    document.write(flashobj);
}

function showWindow(url,name,params)
{
    window.open(url,name,params);
}
function print_content(id)
{ 
    var disp_setting = "toolbar=yes,location=no,directories=yes,menubar=yes,"; 
        disp_setting += "scrollbars=yes,width=650, height=600, left=100, top=25"; 
    var content = document.getElementById(id).innerHTML; 
    if (content != null)
    {
        var docprint=window.open("","",disp_setting); 
        docprint.document.open(); 
        docprint.document.write('<html>'); 
        docprint.document.write('<body onLoad="self.print()">');
        docprint.document.write('<div style="width:600px;margin:10px;text-align:left;">');	
        docprint.document.write(content);
        docprint.document.write('</div></body></html>'); 
        docprint.document.close();
        docprint.focus(); 
    }
}
