  var viewReportLink;
  
  // onok in when you click on the disclaimer accept buttom
  function onOk(href,target,cookieName)
    {
         if(href.indexOf("/") == 0 ){
            href = href.substring(1);
          }
         if (target != null && target == '_blank') {
           window.open(base_path + href);
         }
         else {
              window.location = base_path + href;
         }
         document.cookie = cookieName+"="+cookieName; // onok create cookies
    } 

  // onOkUK in when you click on the disclaimer accept buttom and it will redirect to the UK website
  function onOkUK(href,target,cookieName)
    {
    
         if(href.indexOf("/") == 0 ){
            href = href.substring(1);
          }
         
         if (target != null && target == '_blank') {
           window.open(href);
         }
         else {
              window.location = href;
         }
         document.cookie = cookieName+"="+cookieName; // onOkUK create cookies
    } 
    var issearchbysymbol ; //this is used to fix a problem with the searchbysymbol textbox in firefox when you press the enter key only
    function onRoyceOk(dropDownID,target,cookieName)
    {
         //alert("i am onRoyceOK::" + dropDownID + "  target::" + target);
        // alert ("issearchbysymbol:: " + issearchbysymbol);
                      
         if ( issearchbysymbol != 'true')
          {
             if (target != null && target == '_blank' ) 
             {
                    var dropDown = document.getElementById(dropDownID);
                    window.open(dropDown.options[dropDown.selectedIndex].value);
             }
             else
             {
                 alert(dropDown.options[dropDown.selectedIndex].value);
                 window.location = dropDown.options[dropDown.selectedIndex].value;
             }
              
             document.cookie = cookieName+"="+cookieName; // onok create cookies
         }
         else
         {
            // this AutoCompletePostBack javascript function is defined in searchbysymbol control
            AutoCompletePostBack('',''); //this is used to fix a problem with the searchbysymbol textbox in firefox when you press the enter key only
         }
    } 
    
     function CallRoyceDisplay(dropDownsID,behaviourID,target,cookieName,cookieValue)
    {
         var IndexVal = dropDownsID.selectedIndex;
         var SelectedVal = dropDownsID.options[IndexVal].value.split("|");

         
         if (dropDownsID.options[IndexVal].value.indexOf("True") > -1) 
         {
            location.href = SelectedVal[0];
         }
         
         else
         {

            if((cookieIndex = document.cookie.indexOf(cookieName)) == -1){
             
                // show the popup extender page disclaimer
                DisplayModalPopup(behaviourID);
            }else{
                // Cookie already  exist to just open the document 
                if (target != null && target == '_blank') 
                {
                      window.open(SelectedVal);
                }
                else {
                   window.location.href = this.options[this.selectedIndex].value;
                } 
            }
        }
    }
        
    //this is called when you click on the document link
    function CallDisplay(behaviourID,link,target,cookieName,cookieValue)
    {
   
        
        if((cookieIndex = document.cookie.indexOf(cookieName)) == -1){
         
            // show the popup extender page disclaimer
            DisplayModalPopup(behaviourID);
        }else{
            // Cookie already  exist to just open the document 
            if (target != null && target == '_blank') {
                window.open(link);
            }
            else {
               window.location.href = link;
            } 
        }
    }
    
      // onOkUK in when you click on the disclaimer accept buttom and it will redirect to the UK website
    function onOkCVR(href,target,cookieName)
    {
         if (href == "")
         href = viewReportLink;
    
         if(href.indexOf("/") == 0 ){
            href = href.substring(1);
          }
         
         if (target != null && target == '_blank') {
           window.open(href);
         }
         else {
              window.location = href;
         }
         document.cookie = cookieName+"="+cookieName; // onOkUK create cookies
    } 

      //this is called when you click on the document link on the ViewReport of ClosedEnd
    function CallDisplayCVR(behaviourID,link,target,cookieName,cookieValue)
    {
    
        viewReportLink =  link;
        
        if((cookieIndex = document.cookie.indexOf(cookieName)) == -1){
         
            // show the popup extender page disclaimer
            DisplayModalPopup(behaviourID);
        }else{
            // Cookie already  exist to just open the document 
            if (target != null && target == '_blank') {
                window.open(link);
            }
            else {
               window.location.href = link;
            } 
        }
    }
