﻿// JScript File




function CollapseExpandDownloadSection(DownloadType)
{

    var arr = new Array();        
    arr = document.getElementsByName('trDownloadType'+DownloadType)
    
    //set the image
    if(document.getElementById('imgTitle'+DownloadType).src.split("/")[5] == DownloadType+'_open.gif')
        document.getElementById('imgTitle'+DownloadType).src = '/images/DownloadSection/'+DownloadType+'.gif'
    else
        document.getElementById('imgTitle'+DownloadType).src = '/images/DownloadSection/'+DownloadType+'_open.gif'
      
         
    
    for(var i = 0; i < arr.length; i++)        
    {                 
        var bExpand = arr.item(i).style.display == ''; 
        arr.item(i).style.display = (bExpand ? 'none' : '');               
    }
}

function CollapseExpand(SubMarketId)
{
    var arr = new Array();        
    arr = document.getElementsByName('trProductType'+SubMarketId);

    for(var i = 0; i < arr.length; i++)        
    {                 
        var bExpand = arr.item(i).style.display == ''; 
        arr.item(i).style.display = (bExpand ? 'none' : '');               
    }

}

function disableEnterKey(e)
{
     var key;

     if(window.event)
          key = window.event.keyCode;     //IE
     else
          key = e.which;     //firefox

     if(key == 13)
          return false;
     else
          return true;
}

function handleKeyPress(e, Id){
  var sbutton = '';//document.getElementById(Id)​;
  sbutton = document.getElementById(Id);
  var key= 0;
  if(window.event){
    key= e.keyCode;
    }else if(e.which){
   key= e.which;
  }
    if(key==13){
    sbutton.click();
    }
}
//-->




