﻿// JScript File
function doHover(msrc,pan){
    if(msrc != null){
        if(pan !=null && document.getElementById(pan) != null){
            var panObj = document.getElementById(pan);
            
            panObj.top = msrc.top + 50 + 'px';
            panObj.left = msrc.left + 100 + 'px';
            //panObj.style.display='block;z-index:200;';
            alert(msrc.offsetTop);
        }else{
            alert('Cannot find panel');
        }
    }else{
        alert('src is null');
    }

}

function doMouseOut(pan){
    if(pan !=null && document.getElementById(pan) != null)
    {
        var panObj = document.getElementById(pan);
        panObj.style.display='none';
    }
}

function redirectPage(t,s,th,url){
    var re ='';
    if(t != null){
        if(re != ''){
             re = re + '&t=' +  encoder(t);
        }
        else{
             re = re + '?t=' + encoder(t);
        }
    }
    
    if(s != null){
        if(re != ''){
             re = re + '&s=' +  encoder(s);
        }
        else{
             re = re + '?s=' + encoder(s);
        }
    }
    
    if(th != null){
        if(re != ''){
             re = re + '&th=' +  encoder(th);
        }
        else{
             re = re + '?th=' + encoder(th);
        }
    }
    
    if(url != null){
        if(re != ''){
             re = re + '&url=' +  encoder(url);
        }
        else{
             re = re + '?url=' + encoder(url);
        }
    }
    
    var pre= '/page.aspx' + re;
    
    window.location=pre;
}

function encoder(toencode){
  var encodedInputString=escape(toencode);
  encodedInputString=encodedInputString.replace("+", "%2B");
  encodedInputString=encodedInputString.replace("/", "%2F"); 
  return encodedInputString;
}

