﻿// JScript File
        var oldBorder;
        var sobj;
        
        function hideDescription(obj)
        {
            sobj = obj;
            if (obj.timer)
            {
                clearTimeout(obj.timer);
                obj.timer = null;
            }
            obj.timer = setTimeout('hideDescription2()',500);
        }
        
        function hideDescription2()
        {
            if (sobj)
            {
                obj = sobj;
                /*var o = obj.getElementsByTagName('input')[0];
                if (!o.checked)
                {*/
                    var no = getNext(obj);
                    if (no.className=='prodInfo')
                        no.style.display = 'none';
                //}
                obj.style.border = 'solid 1px #f0f0f0';
            }
        }
        
        function showDescription(obj)
        {
            if (obj.timer)
            {
                clearTimeout(obj.timer);
                obj.timer = null;
            }
            
                hideDescription2();
            
                
                obj.style.border = 'solid 1px #ccc';
                var no = getNext(obj);
                if (no.className=='prodInfo')
                {
                    if (no.style.display!='block')
                    {
                        no.style.display = 'block';
                        pos = wdCore.findPos(obj);
                        //no.style.top = pos[1]+obj.offsetHeight-10+'px';
                        //no.style.left = pos[0]+10+'px';
                        no.style.top = pos[1]-no.offsetHeight+'px';
                        no.style.left = pos[0]+'px';
                    }
                }
            
        }
        
        function getNext(obj) { 
            var n = obj; 
            do n = n.nextSibling; 
            while (n && n.nodeType != 1); 
            return n; 
        } 
        
        function getPrev(obj) { 
            var n = obj; 
            do n = n.previousSibling; 
            while (n && n.nodeType != 1); 
            return n; 
        }
        
        function changeSrcValue (org, mtc,value)
    {
        var idx = org.indexOf(mtc+'=')+(mtc.length+1);
        if (idx!=-1)
        {
            var start = org.substring(0,idx);
            var idx_end = org.indexOf('&',idx);
            if (idx_end==-1)
            {
                return start+escape(value);
            }
            else
            {
                var end = org.substring(idx_end,org.length);
                return start+Url.encode(value)+end;
            }
        }
        else
            return org;
    }
        
        function switchImage(cid,url)
        {
            var img = f$(cid);
            if (img.src)
            {
                //img.src = changeSrcValue(img.src,'url',url);
				 img.src = '/gen.img?imgurl=' + url + '&mw=490&mh=250&x=jpg';
                img.parentNode.href = '/gen.img?imgurl=' + url + '&mw=640&mh=480&x=jpg&c=&r=0';
            }
        }
        
        function toggleFlipper(obj,cname)
        {
            o = obj.parentNode.parentNode.getElementsByTagName("div");
            for(i in o)
            {
                
                if (obj.checked)
                {
                    if (o[i].className=='prodInfo')
                    {
                        o[i].style.display = 'block';
                        o[i].className=cname;
                    }
                }
                else
                {
                    if (o[i].className==cname)
                    {
                        o[i].style.display = 'none';
                        o[i].className='prodInfo';
                    }
                }
            }
            o = obj.parentNode.getElementsByTagName("input");
            for(i in o)
            {
                if (o[i].style!=null && o[i]!=obj)
                {
                    o[i].style.display = (obj.checked)?'none':'block';
                    if (!obj.checked && o[i].checked) 
                        showDescription(o[i].parentNode);
                }
            }
        }
        
        function f$(i) { 
       if(document.all) { 
          return document.all[i]; 
       } else { 
          return document.getElementById(i); 
       }
} 

      
    
 function toggleLev(obj)
 {
    var show = obj.checked;
    c$('lev').style.display = (show?'block':'none');
 }