var subng_variation_flag = new String("NEWDESIGN");// dynamically values changed;
var navigation_align = "hp_design_align"; // dynamically values changed;

var xUA=navigator.userAgent.toLowerCase();
   
   xIE4=xUA.indexOf('msie 4')!=-1;
   xIE5=xUA.indexOf('msie 5')!=-1;
   xIE6=xUA.indexOf('msie 6')!=-1;

var  cursorType= "";
 
 if(xIE4 || xIE5)
            cursorType = 'CURSOR:HAND; ' ;
         else
            cursorType = 'cursor: hand; cursor: pointer; ';

//   horizontal_location = sub_navi_type;

// General Data
   var browser_type = navigator.appName;  //browser type
   var main_cat_arr = main_cat.split("::");  //main navis array
   var main_cat_length = main_cat_arr.length;   //length
   var main_sub_cat_arr = sub_cat.split(",");   //sub navis array
   var main_sub_cat_length = main_sub_cat_arr.length;    //sub navis length
   var main_sub_cat_ext_arr = sub_cat_ext.split(",");          // sub navis array
   var main_sub_cat_ext_length = main_sub_cat_ext_arr.length;  // sub navis length
   var STR_IE = "Microsoft Internet Explorer"; //ie   
   var STR_NS = "Netscape"; //netscape
   var STR_GECKO = "Gecko"; //gecko
   var STR_YES = "yes"; //yew
   var STR_NO = "no"; //no

   var f_str_dyn_sub_list = new Array();

// NS Properties
   var ns_sub_def_width ;   //width
   var ns_sub_def_height ; //height
   
// IE Properties
   var ie_down_key_status; //key status
   var ie_current_hid_index;  //index

//sub layer position inIE
   var ie_poistion_details = new Array(); //position list

//BACKGROUND IMAGE 
   var img_over = "";   //image over
   var img_out = ""; //image out;

// Sub navigation enable
   var bln_navigation_state = true; //state

// dyn layers height height
   var ns_layers_height;   //height
   
// common top & left
   var dyn_top;   //top
   var dyn_left;  //left

//current page id & url status 
   var current_page_id = "";  //current page id
   var current_url_status = "";  //current url
   var current_url_name = "";    //current url name for external link
   var current_url_tgt = "";     //current url
   var loc_id = '';
   var loc_status = '';
   
//Identify cell No
   var current_cell = "";  // cell details

//pixel list for screen
   var l_scr_total_width = screen.width;
   var l_arr_general_width_list = new Array(640,720,800,1024,1152,1280,1600);
   var l_arr_general_diff_list = new Array(1.125,1.111,1.28,1.25,1.111,1.25);
   var l_arr_dyn_diff_list = new Array();

//proparties for multiple configuration subnavigation  - additional sub-navigation type
   var add_subnavig_type = '';

function getSubCount(name)
{
   var l_int_cnt=0;
   for(var i=0;i<main_sub_cat_arr.length;i++)
      {
         if(main_sub_cat_arr[i].indexOf(name) != -1)
            l_int_cnt ++;
      }
   return l_int_cnt;
}
   var _is_gecko_bowser = STR_NO;
   var _browser_agent_type = navigator.userAgent;

   if( _browser_agent_type != null && _browser_agent_type.indexOf(STR_GECKO) != -1 )
    {
       _is_gecko_bowser = STR_YES;
      //alert("in if 1");
   }

   if( _browser_agent_type != null && _browser_agent_type.indexOf(STR_GECKO) != -1 && _browser_agent_type.indexOf(STR_NS) != -1 && browser_type.indexOf(STR_NS) != -1)
      _is_gecko_bowser = STR_YES;

   if(browser_type == STR_IE)
   {     //starts if
      /***            starts sub navigation property              ***/   
      // temp layers
      setIEAllSubNavis();
      document.onmousedown = getKeyDown;
      /***         close sub navigation property                  ***/         
   }     // close if
   else if(_is_gecko_bowser == STR_YES)   // check gecko browser
   {     //starts if
      // temp layers
      setGeckoAllSubNavis();
      document.onmousedown = getKeyDown;
   }     // close if
   else if(browser_type == STR_NS)
   {    //starts else-if
            
      /****                 starts sub navigation property                ****/   
      document.write("<layer id='tlayer' width=0 height=0 top=0 onMouseover='clearNSSubNavi();' onMouseout='this.visibility=\"hide\";clearNSSubNavi();' left=0 visibility='hide'  border-width=0><table   width=" + ns_sub_def_width + " border=0 cellPadding=0 cellSpacing=0 height=" + ns_sub_def_height + " ><tr><td>&nbsp;</td></tr></table></layer>");
      document.write("<layer id='bglayer' width=0 height=0 top=0 onMouseover='' onMouseout='' left=0 visibility='hide'  border-width=0><table   width=" + ns_sub_def_width + " border=0 cellPadding=0 cellSpacing=0 height=" + ns_sub_def_height + " ><tr><td>&nbsp;</td></tr></table></layer>");
      
      for(var i=0;i<main_sub_cat_length;i++)
         {  // starts for loop
            var lay = main_sub_cat_arr[i].split(":"); //array
            var layer_active = 'act_' + lay[1]; //array active
            // default layer
            var l_str_data = '';   // strings collection 
            var l_str_arr_data = getNoStrings(lay[2]);  // string list 
            var lay_ext = main_sub_cat_ext_arr[i].split("::"); //array
            for(var k=0;k<l_str_arr_data.length;k++)
                  l_str_data += l_str_arr_data[k] +'&nbsp;';  
                  
            var l_img_width_value = parseInt(l_img_width_list[getImageIndex(lay[0])]);
            var l_img_height_value = l_img_height;

            var l_str_table_1 = "<table width='" + l_img_width_value + "' height='" + l_img_height_value + "' border='0' cellspacing='0' cellpadding='0'><tr><td valign='" + l_str_ver_align + "' align='" + title_align + "'><font color='" + scroll_title_color + "' face='" + title_style + "' size='" + (title_size) + "'>&nbsp;"; //starts table 1
            var l_str_table_0 = "<table width='" + l_img_width_value + "' height='" + l_img_height_value + "' border='0' cellspacing='0' cellpadding='0'><tr><td valign='" + l_str_ver_align + "' align='"+ title_align +"'><font color='" + default_title_color + "' face='" + title_style + "' size='" + (title_size) + "'>&nbsp;";   //starts table 2
            var l_str_table_00 = "&nbsp;</font></td></tr></table>";  //close the table
                  
            // default layer                 
            document.write("<layer id='" + lay[1] + "' width=0 height=0 top=0 left=0 visibility='hide' text-align='center' border-style='inset' border-width=0 onMouseOut='' onMouseOver='onSubNaviNSMouseOver(this,\"" + layer_active + "\"," + l_img_width_value + ","+l_img_height_value+");' >" + l_str_table_0 + l_str_data  + l_str_table_00 + "</layer>");
            // active layers
            document.write("<layer id='" + layer_active + "' width=0 height=0 top=0 left=0 visibility='hide'  border-style='inset' border-width=0 onMouseOut='onSubNaviNSMouseOver(this,\"" + lay[1] + "\"," + l_img_width_value + ","+l_img_height_value+");' onMouseOver='onCurrentNSSubNavis(\"" + layer_active + "\",\"" + lay[3] + "\",\"" + lay_ext[1] + "\",\"" + lay_ext[2] + "\")' >" + l_str_table_1 + l_str_data +  l_str_table_00 + "</layer>");
         }  //close the  for loop
      document.captureEvents(Event.MOUSEDOWN || Event.MOUSEUP);
      document.onmousedown = getAction;
     /****           close sub navigation property                      ****/               
   }        // close else if
   /* clear all sublayer in general */

function getTop()
{
   setClearSubLayer(main_sub_cat_length);
}        //close the function

function getNoSubs(main_navi)
{
   var l_int_count = 0
   for(n=0;n<main_sub_cat_length;n++) 
      { //starts for -1 loop
         if(main_sub_cat_arr[n].indexOf(main_navi) != -1)
            ++l_int_count;
      }
   return l_int_count;
}

function getImageIndex(main_cat)
{
   var l_arr_temp_sub = new Array();
   var l_int_count = 0;
   var l_int_layer_noofchars = 0;
   var l_int_layer_img_index = 0;
   if(l_img_scroll_list.length ==3)
   {
      for(var i=0;i<main_sub_cat_length;i++)
      {  //starts for loop - 
         var l_arr_properties = main_sub_cat_arr[i].split(':');
         if(l_arr_properties[0] == main_cat)
            l_arr_temp_sub[l_int_count++] = l_arr_properties[2];
      }
      for(var j=0;j<l_arr_temp_sub.length;j++)
      {  //starts for loop - run navis
         var l_int_len = l_arr_temp_sub[j].length;
         if(l_int_layer_noofchars < l_int_len)
            l_int_layer_noofchars = l_int_len;
      }
      if(l_int_layer_noofchars<8)   //if 7chars sub navis
         l_int_layer_img_index = 0;
      else if(l_int_layer_noofchars<12)
         l_int_layer_img_index = 1;
      else if(l_int_layer_noofchars>11)
        l_int_layer_img_index = 2;   
   }        
   else if(l_img_scroll_list.length == 1)
   {
      l_int_layer_img_index = 0;
   }
    return l_int_layer_img_index;
}      
function getSubNavisOnly(main_navi)
{
   var l_str_arr_subnavis = new Array(); //array
   var l_str_arr_ipnos = new Array(); //array
   var l_str_arr_result = new Array(); //array
   var l_int_i = 0;  //index
   for(n=0;n<main_sub_cat_length;n++) 
      { //starts for -1 loop
         var l_str_arr_temp = main_sub_cat_arr[n].split(':');   //array
         if(l_str_arr_temp[0] == main_navi)
            {
               l_str_arr_subnavis[l_int_i] = l_str_arr_temp[1] + ':' + l_str_arr_temp[4];
               l_str_arr_ipnos[l_int_i] = l_str_arr_temp[4];
               l_int_i++;
            }
      } //close for-1 loop
   var l_int_cnt = 0 //count
   if(l_str_arr_ipnos.length>0)
      {  //starts if -non-empyt array
         l_str_arr_ipnos.sort();
         l_str_arr_ipnos.sort(compareNumbers);
         if(horizontal_location == 'b' || add_subnavig_type == 'bl' || add_subnavig_type == 'br')
            l_str_arr_ipnos.reverse();
         for(var j=0;j<l_str_arr_ipnos.length;j++)
         {  //starts for -outter;
            for(var k=0;k < l_str_arr_subnavis.length; k++)
               {  //starts for -inner
                  var l_str_loc_data = l_str_arr_subnavis[k].split(':');
                  if(l_str_loc_data[1] == l_str_arr_ipnos[j])
                     l_str_arr_result[l_int_cnt++] = l_str_loc_data[0];
               }// inner loop-close
         }//outter loop -close
      }  //close if
      
   return l_str_arr_result;
}  // close the function

function setClearSubLayer(slength)
{
   if(browser_type == STR_IE) //if (ie)
      clearIENavis();
   else if(_is_gecko_bowser == STR_YES)   // check gecko browser
      clearGeckoNavis();
   else       //starts else
   {
      if(browser_type == STR_NS) //if(ns)
         setClearNSSubLayer(slength);
   }        //close the else
}           //close the function

 /* This function returns list of individual strings about collection strings such as para or 
     line etc.        */
function getNoStrings(str)
{
   var l_str_arr_strarray = new Array()   //temp array
   if(str != '')     //non emty
      l_str_arr_strarray = str.split(" ");      
   return l_str_arr_strarray;
}  //close the function

function getSubLayers(curr_cat,index,start_top,start_left)
{
   if(arguments.length == 9)
      add_subnavig_type = arguments[8];
   else
      add_subnavig_type = '';   

   if(_is_gecko_bowser == STR_YES)
   {        //starts if
      dyn_top = start_top; 
      dyn_left = start_left;
      setGeckoSubNavisList(curr_cat,index,start_left,start_top);
   }      
   else if(browser_type == STR_IE)
   {        //starts if
      dyn_top = start_top; 
      dyn_left = start_left;
      setIESubNavisList(curr_cat,index,start_left,start_top);
   }        // close if
   else
   {     //starts outter else
      if(browser_type == STR_NS)    //starts inner if
      {
         dyn_top = start_top; 
         dyn_left = start_left;
         setNSSubLayers(curr_cat,index,start_top,start_left);
      }  //close the inner if  
   }  //close the outter else
}  // close the function     

/******************************    Starts list of NS functions   ****************************/
/* set dummy layers with respect to main/sun */
/* dynmic navigation from the main navigation*/
function setNSSubLayers(c_cat,index, start_top, start_left)
{
   var l_img_scroll_value = l_img_scroll_list[getImageIndex(c_cat)];
   var l_img_static_value = l_img_static_list[getImageIndex(c_cat)];
   var l_img_width_value = parseInt(l_img_width_list[getImageIndex(c_cat)]);
   var l_img_height_value = l_img_height;
   var l_int_chgs_left = start_top;
   ns_sub_def_height = l_img_height_value;
   ns_sub_def_width = l_img_width_value;
   
   setClearSubLayer(main_sub_cat_length);
   document.layers["tlayer"].visibility = "hide";
   var temp_sub_arr = getSubNavisOnly(c_cat);                      // array of sub navis
   var l_int_chg_left = start_left;
   if(l_scr_total_width > 1024)
      l_int_chg_left=getSuitXposi(l_int_chg_left);

   if(main_sub_cat_length > 0)
      {  //starts if-1 atlease on subnavis
      if(temp_sub_arr.length > 0)
         {  //starts if-3
            f_str_dyn_sub_list = temp_sub_arr;
            ns_layers_height = 0;
            ns_sub_start_top = start_top;
            var position = index;   //index
            for(var i=0;i<temp_sub_arr.length;i++)
               {  //starts for loop
                  //var lay="sub_layer_"+i;
                  var layer_id = temp_sub_arr[i];  //array -temp
                  var act_layer = 'act_' + layer_id;  // active layer
                  document.layers[layer_id].visibility = "show";
                  document.layers[layer_id].top = ns_sub_start_top;
                  document.layers[act_layer].top = ns_sub_start_top;
// dyn layer shows outside the screen -starts
                  var l_int_max_ixposi = eval(l_int_chg_left + l_img_width_value);                     
                  if(l_int_max_ixposi > l_scr_total_width)
                     {
                         document.layers[layer_id].left = l_int_chg_left;
                         document.layers[act_layer].left = l_int_chg_left;
                        l_int_chgs_left = start_top;
                     }
                  else
                     {
                        document.layers[layer_id].left = l_int_chg_left;
                        document.layers[act_layer].left = l_int_chg_left;
                         l_int_chgs_left = start_top;
                     }
// dyn layer shows outside the screen - close
                  
                  document.layers[layer_id].background.src = l_img_static_value;
                  document.layers[act_layer].background.src = l_img_scroll_value;
//                  document.layers[layer_id].bgcolor="#12acacac";
                  document.layers[layer_id].resizeTo((l_img_width_value),(l_img_height_value));
                  document.layers[act_layer].resizeTo((l_img_width_value),(l_img_height_value));
                  ns_sub_start_top += l_img_height_value + 2;
                  ns_layers_height += l_img_height_value + 2;
                  position++;
               }  //close for loop
            /*netscape desktop layer properties*/   
            document.layers["tlayer"].visibility = "show";
            var l_int_dyn_width = 0;
            if(horizontal_location == 'b' || add_subnavig_type == 'bl' || add_subnavig_type == 'br')      
               document.layers["tlayer"].top = start_top - (ns_sub_def_height+(ns_sub_def_height/2));
            else if(horizontal_location == 't')
                     document.layers["tlayer"].top = start_top;
            if(horizontal_location =='b' || add_subnavig_type == 'bl' || add_subnavig_type == 'br')         
               {
                     document.layers["tlayer"].resizeTo((ns_sub_def_width + (ns_sub_def_width/2)),(ns_layers_height + (ns_sub_def_height*2) - (ns_sub_def_height/2) ));   
                     l_int_dyn_width = (ns_sub_def_width + (ns_sub_def_width/2));                     
               }
            else if(horizontal_location =='t')
               {
                  document.layers["tlayer"].resizeTo((ns_sub_def_width + (ns_sub_def_width/2)),(ns_layers_height + (ns_sub_def_height*2)));   
                  l_int_dyn_width = (ns_sub_def_width + (ns_sub_def_width/2));
               } 
            var l_int_max_xposi = eval(l_int_chg_left - Math.round(ns_sub_def_width/4)) + eval(l_int_dyn_width);                     
            if(l_int_max_xposi > l_scr_total_width)
               {
                  document.layers["tlayer"].left = l_int_chg_left - Math.round(ns_sub_def_width/4);
               }
            else
               {
                  document.layers["tlayer"].left = l_int_chg_left - Math.round(ns_sub_def_width/4);
               }
//            document.layers["tlayer"].bgColor ='#00aaff';            
            
            /*netscape total layers - count layer propareties*/
            document.layers["bglayer"].visibility = "show";
            document.layers["bglayer"].resizeTo((l_img_width_value) + 4, (ns_layers_height) + 2);
            document.layers["bglayer"].top = start_top - 2;
            var l_int_max_jxposi = eval(l_int_chg_left + l_img_width_value);                     
            if(l_int_max_jxposi > l_scr_total_width)
               {
                  document.layers["bglayer"].left = l_int_chg_left - 2;
               }
            else
               {
                  document.layers["bglayer"].left = l_int_chg_left - 2;
               }                        
            document.layers["bglayer"].bgColor ='#cccccc';                        
         }  //close if -3
      } // over the if -1
} // over the function

function onSubNaviNSMouseOver(ilayer,slayer,status,iwidth,iheight)
{
   current_page_id = '';      //current page id
   current_url_status = '';   //current url
   current_url_name = '';     //current url for external link
   current_url_tgt = '';      //current url target
   ilayer.visibility ='hide';
   var l_int_w = iwidth;
   var l_int_h = iheight;

   document.layers[slayer].visibility = 'show';
   document.layers[slayer].top = ilayer.top;
   document.layers[slayer].left = ilayer.left;
   document.layers[slayer].resizeTo(l_int_w,l_int_h);
}
/* Click to new link for NS */
function getAction(e)
{
   if(current_page_id != '' && current_url_status == 'y' && e.which == 1) //cursor points to page id
   {
      location.href = current_page_id + '.html';
   }
   else if (current_url_status == 'e' && current_url_name != '') //cursor points to page name
   {
      if (current_url_tgt == 'y')   // open in new window
      {
         window.open(current_url_name);
      }
      else
      {
         location.href = current_url_name;
      }
   }
   else if(current_page_id == '') //cursor has no page id 
      getTop();
}  // close the function


function getNSPage()
{
   if(current_page_id != '' && current_url_status == 'y') //cursor points to page id
   {
      location.href = current_page_id + '.html';
   }
   else if (current_url_status == 'e' && current_url_name != '') //cursor points to page name
   {
      if (current_url_tgt == 'y')   // open in new window
      {
         window.open(current_url_name);
      }
      else
      {
         location.href = current_url_name;
      }
   }
}

/* clear all sub navigation */
function setClearNSSubLayer(slength)
{
   if(slength > 0)
   { //starts if - more than one navis 
      for(var i=0;i<main_sub_cat_length;i++)
      { //starts for loop - run navis
         // var lay="sub_layer_"+i;
         var lay = main_sub_cat_arr[i].split(":"); // array layers
         var layi = lay[1];   //at position 2
         var layiact = 'act_' + lay[1];   //active layer
         document.layers[layi].visibility = "hide";
         document.layers[layiact].visibility = "hide";
      }  //close the loop 
      document.layers["bglayer"].visibility = "hide";
   } //close if
} // close the function

/* clear navigation with function overloading */
function clearNSSubNavi()
{
   setClearNSSubLayer(main_sub_cat_length);  
} // close the function

function onCurrentNSSubNavis(tar_navis, status, url_name, url_tgt)
{
   current_page_id = tar_navis.substr(8);  //current page id
   current_url_status = status;  //current url
   current_url_name = url_name;  //current url name
   current_url_tgt = url_tgt;    //current url target ( '' / 'n' )

   for(var i=0;i<f_str_dyn_sub_list.length;i++)
   { //starts for -1 loop
      var lay = f_str_dyn_sub_list[i]; //array
      var layer_active = 'act_' + lay; //array active
      if(layer_active == tar_navis)
         {
            document.layers[lay].visibility = 'hide';
            document.layers[layer_active].visibility = 'show';
         }
      else
         {
            document.layers[lay].visibility = 'show';
            document.layers[layer_active].visibility = 'hide';
         }
   }  //close for-1 loop
}   
/******************************    Close list of NS functions    ****************************/

/******************************    Starts list of IE functions   *****************************/
/*set sub navigations for dummy operation*/
function setIEAllSubNavis()
{
   var l_str_data;   //data
   var properties;   //properties
   var active_layer; //active layer
   var l_str_arr_single_string;  //single string
   document.write("<div id='subdesktop' style='visibility:hidden; background:transparent; position:absolute; clip:auto; top:0; left:0; height:0; width:0;' onMouseover='onIEClearSubs()' onMouseout='whenIEParamClear();this.style.visibility=\"hidden\";onIEClearSubs();'>&nbsp;</div>");       
   document.write("<div id='bglayer' style='visibility:hidden; background:transparent; position:absolute; clip:auto; top:0; left:0; height:0; width:0;' onMouseover='whenIEParamClear()' onMouseout=''>&nbsp;</div>");        
   for(var i=0;i<main_sub_cat_length;i++)
   {  //starts for loop - run navis
      properties = main_sub_cat_arr[i].split(':');
      active_layer = 'act_'+ properties[1];
      l_str_data = '';
      l_str_arr_single_string = getNoStrings(properties[2]);
      var lay_ext = main_sub_cat_ext_arr[i].split("::"); //array
     for(var k=0;k<l_str_arr_single_string.length;k++)  //inner loop - for split indiviual strings from string
          l_str_data += l_str_arr_single_string[k] + '&nbsp;'; 
      
      var l_img_scroll_value = l_img_scroll_list[getImageIndex(properties[0])];
      var l_img_static_value = l_img_static_list[getImageIndex(properties[0])];
      var l_img_width_value = l_img_width_list[getImageIndex(properties[0])];
      var l_img_height_value = l_img_height;
      
      var l_str_table_1 = "<table width='" + l_img_width_value + "' height='" + l_img_height_value + "' border='0' cellspacing='0' cellpadding='0'><tr><td valign='" + l_str_ver_align + "' align='" + title_align + "'><font color='" + scroll_title_color + "' face='" + title_style + "' size='" + (title_size) + "'>&nbsp;"; //starts table 1
      var l_str_table_0 = "<table width='" + l_img_width_value + "' height='" + l_img_height_value + "' border='0' cellspacing='0' cellpadding='0'><tr><td valign='" + l_str_ver_align + "' align='"+ title_align +"'><font color='" + default_title_color + "' face='" + title_style + "' size='" + (title_size) + "'>&nbsp;";   //starts table 2
      var l_str_table_00 = "&nbsp;</font></td></tr></table>";  //close the table
      
      document.write("<div id='img_" + properties[1] + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:1;' onMouseover='' onMouseout=''><img src='"+ l_img_static_value +"' height="+l_img_height_value+" width=" + l_img_width_value + " alt='sample'></div>");
      document.write("<div id='" + properties[1] + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:2;overflow:hidden;' onMouseover='' onMouseout=''>" + l_str_table_0 + l_str_data + l_str_table_00 + "</div>");
      document.write("<div id='b_" + properties[1] + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:3;' onMouseover='getIEActiveNavi(\""+properties[1]+"\",\""+ active_layer +"\",this)' onMouseout=''>" + l_str_table_1 +"" + l_str_table_00 + "</div>");

      document.write("<div id='img_" + active_layer + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:1;' onMouseover='' onMouseout=''><img src='"+ l_img_scroll_value +"' height="+l_img_height_value+" width=" + l_img_width_value +" alt='sample'></div>");
      document.write("<div id='" + active_layer + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:2;overflow:hidden;' onMouseover='' onMouseout=''>"+ l_str_table_1 +l_str_data + l_str_table_00 +"</a></div>");
      document.write("<div id='b_" + active_layer + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:3;' onMouseover='onCurrentIEsubNavis(\"" + active_layer + "\",\"" + properties[3] + "\",\"" + lay_ext[1] + "\",\"" + lay_ext[2] + "\");' onMouseout='getIEActiveNavi(\""+active_layer+"\",\""+ properties[1] +"\",this);'>"+ l_str_table_1 +"" + l_str_table_00 +"</div>");
   }  //close the for loop
   clearIENavis();
}  //close the function

/*set sub navigations for gecko's dummy operation*/
function setGeckoAllSubNavis()
{
   var l_str_data;   //data
   var properties;   //properties
   var active_layer; //active layer
   var l_str_arr_single_string;  //single string
   document.write("<div id='subdesktop' style='visibility:hidden; background:transparent; position:absolute; clip:auto; top:0; left:0; height:0; width:0;' onMouseover='onGeckoClearSubs()' onMouseout='whenIEParamClear();this.style.visibility=\"hidden\";onGeckoClearSubs();'>&nbsp;</div>");       
   document.write("<div id='bglayer' style='visibility:hidden; background:transparent; position:absolute; clip:auto; top:0; left:0; height:0; width:0;' onMouseover='whenIEParamClear()' onMouseout=''>&nbsp;</div>");        
   for(var i=0;i<main_sub_cat_length;i++)
   {  //starts for loop - run navis
      properties = main_sub_cat_arr[i].split(':');
      active_layer = 'act_'+ properties[1];
      l_str_data = '';
      l_str_arr_single_string = getNoStrings(properties[2]);
      var lay_ext = main_sub_cat_ext_arr[i].split("::"); //array
     for(var k=0;k<l_str_arr_single_string.length;k++)  //inner loop - for split indiviual strings from string
          l_str_data += l_str_arr_single_string[k] + '&nbsp;'; 
      
      var l_img_scroll_value = l_img_scroll_list[getImageIndex(properties[0])];
      var l_img_static_value = l_img_static_list[getImageIndex(properties[0])];
      var l_img_width_value = l_img_width_list[getImageIndex(properties[0])];
      var l_img_height_value = l_img_height;
      
      var l_str_table_1 = "<table width='" + l_img_width_value + "' height='" + l_img_height_value + "' border='0' cellspacing='0' cellpadding='0'><tr><td valign='" + l_str_ver_align + "' align='" + title_align + "'><font color='" + scroll_title_color + "' face='" + title_style + "' size='" + (title_size) + "'>&nbsp;"; //starts table 1
      var l_str_table_0 = "<table width='" + l_img_width_value + "' height='" + l_img_height_value + "' border='0' cellspacing='0' cellpadding='0'><tr><td valign='" + l_str_ver_align + "' align='"+ title_align +"'><font color='" + default_title_color + "' face='" + title_style + "' size='" + (title_size) + "'>&nbsp;";   //starts table 2
      var l_str_table_00 = "&nbsp;</font></td></tr></table>";  //close the table
      
      document.write("<div id='img_" + properties[1] + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:1;' onMouseover='' onMouseout=''><img src='"+ l_img_static_value +"' height="+l_img_height_value+" width=" + l_img_width_value + " alt='sample'></div>");
      document.write("<div id='" + properties[1] + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:2;overflow:hidden;' onMouseover='' onMouseout=''>" + l_str_table_0 + l_str_data + l_str_table_00 + "</div>");
      document.write("<div id='b_" + properties[1] + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:3;' onMouseover='getGeckoActiveNavi(\""+properties[1]+"\",\""+ active_layer +"\",this)' onMouseout=''>" + l_str_table_1 +"" + l_str_table_00 + "</div>");

      document.write("<div id='img_" + active_layer + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:1;' onMouseover='' onMouseout=''><img src='"+ l_img_scroll_value +"' height="+l_img_height_value+" width=" + l_img_width_value +" alt='sample'></div>");
      document.write("<div id='" + active_layer + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:2;overflow:hidden;' onMouseover='' onMouseout=''>"+ l_str_table_1 +l_str_data + l_str_table_00 +"</a></div>");
      document.write("<div id='b_" + active_layer + "' style=' " +cursorType+" visibility:hidden; background:transparent; position:absolute; clip:auto; top:535; left:0; height:0; width:0;z-index:3;' onMousedown='getKeyDown()' onMouseover='onCurrentGeckosubNavis(\"" + active_layer + "\",\"" + properties[3] + "\",\"" + lay_ext[1] + "\",\"" + lay_ext[2] + "\");' onMouseout='getGeckoActiveNavi(\""+active_layer+"\",\""+ properties[1] +"\",this);'>"+ l_str_table_1 +"" + l_str_table_00 +"</div>");
   }  //close the for loop
//   clearGeckoNavis();
}  //close the function

function clearIENavis()
{
   for(var i=0;i<main_sub_cat_length;i++)
   {  //starts for loop - run navis
      properties = main_sub_cat_arr[i].split(':');
      active_layer = 'act_' + properties[1];
      var l_str_inamer_scr = 'img_' + active_layer;
      var l_str_bname_scr = 'b_' + active_layer;
      var l_str_inamer_stc = 'img_' + properties[1];
      var l_str_bname_stc = 'b_' + properties[1];
      
      document.all.item(active_layer).style.visibility = 'hidden';
      document.all.item(properties[1]).style.visibility = 'hidden';
      document.all.item(l_str_inamer_scr).style.visibility = 'hidden';
      document.all.item(l_str_inamer_stc).style.visibility = 'hidden';
      document.all.item(l_str_bname_scr).style.visibility = 'hidden';
      document.all.item(l_str_bname_stc).style.visibility = 'hidden';
      
   }  //close the for loop
   bglayer.style.visibility = 'hidden';
}  //close the function

function clearGeckoNavis()
{
   for(var i=0;i<main_sub_cat_length;i++)
   {  //starts for loop - run navis
      properties = main_sub_cat_arr[i].split(':');
      active_layer = 'act_' + properties[1];
      var l_str_inamer_scr = 'img_' + active_layer;
      var l_str_bname_scr = 'b_' + active_layer;
      var l_str_inamer_stc = 'img_' + properties[1];
      var l_str_bname_stc = 'b_' + properties[1];
      
      document.getElementById(active_layer).style.visibility = 'hidden';
      document.getElementById(properties[1]).style.visibility = 'hidden';
      document.getElementById(l_str_inamer_scr).style.visibility = 'hidden';
      document.getElementById(l_str_inamer_stc).style.visibility = 'hidden';
      document.getElementById(l_str_bname_scr).style.visibility = 'hidden';
      document.getElementById(l_str_bname_stc).style.visibility = 'hidden';
      
   }  //close the for loop
   document.getElementById('bglayer').style.visibility = 'hidden';
}  //close the function

function setIESubNavisList(c_cat,index,left,top)
{
   var l_int_left = left; //left
   var l_int_top = top; //top
   onIEClearSubs();
   var l_str_arr_temp = getSubNavisOnly(c_cat);  //get acti navis
   f_str_dyn_sub_list = l_str_arr_temp;
   var l_int_inc_top = l_int_top;   //top
   var l_int_mheight_inc = 0;
   var width = l_img_width_list[getImageIndex(c_cat)];
   var height = l_img_height;   
   var l_int_bg_height = (l_str_arr_temp.length)*(height+1) + (l_str_arr_temp.length)*(1.5);   //get length
   if(l_scr_total_width > 1024)
      l_int_left=getSuitXposi(left);
   for(var n=0;n<l_str_arr_temp.length;n++)
   { //starts for -1 loop
      var l_int_snavi_width = width;
      var l_int_snavi_left = l_int_left;
      var l_int_snavi_total =  eval(l_int_left) + eval(width);
      document.all.item(l_str_arr_temp[n]).style.top = l_int_inc_top;
      document.all.item(l_str_arr_temp[n]).style.left = l_int_left;
      document.all.item(l_str_arr_temp[n]).style.width = width;
      document.all.item(l_str_arr_temp[n]).style.height = height;      
      document.all.item(l_str_arr_temp[n]).style.visibility = 'visible';   

      document.all.item('b_'+l_str_arr_temp[n]).style.top = l_int_inc_top;
      document.all.item('b_'+l_str_arr_temp[n]).style.left = l_int_left;
      document.all.item('b_'+l_str_arr_temp[n]).style.width = width;
      document.all.item('b_'+l_str_arr_temp[n]).style.height = height;      
      document.all.item('b_'+l_str_arr_temp[n]).style.visibility = 'visible';   

      document.all.item('img_'+l_str_arr_temp[n]).style.top = l_int_inc_top;
      document.all.item('img_'+l_str_arr_temp[n]).style.left = l_int_left;
      document.all.item('img_'+l_str_arr_temp[n]).style.width = width;
      document.all.item('img_'+l_str_arr_temp[n]).style.height = height;      
      document.all.item('img_'+l_str_arr_temp[n]).style.visibility = 'visible';   

      l_int_inc_top += height + 2; 
      l_int_mheight_inc  += height;
   } //close for-1 loop
   if(l_str_arr_temp.length > 0) //true-more than zero navis
      setIEOutsideLayer(l_int_left,l_int_inc_top,width,height,l_int_top,l_int_bg_height);
}  //close the function

function setGeckoSubNavisList(c_cat,index,left,top)
{
   var l_int_left = left; //left
   var l_int_top = top; //top
   onGeckoClearSubs();
   var l_str_arr_temp = getSubNavisOnly(c_cat);  //get acti navis
   f_str_dyn_sub_list = l_str_arr_temp;
   var l_int_inc_top = l_int_top;   //top
   var l_int_mheight_inc = 0;
   var width = l_img_width_list[getImageIndex(c_cat)];
   var height = l_img_height;   
   var l_int_bg_height = (l_str_arr_temp.length)*(height+1) + (l_str_arr_temp.length)*(1.5);   //get length
   if(l_scr_total_width > 1024)
      l_int_left=getSuitXposi(left);
   for(var n=0;n<l_str_arr_temp.length;n++)
   { //starts for -1 loop
      var l_int_snavi_width = width;
      var l_int_snavi_left = l_int_left;
      var l_int_snavi_total =  eval(l_int_left) + eval(width);
      document.getElementById(l_str_arr_temp[n]).style.top = l_int_inc_top;
      document.getElementById(l_str_arr_temp[n]).style.left = l_int_left;
      document.getElementById(l_str_arr_temp[n]).style.width = width;
      document.getElementById(l_str_arr_temp[n]).style.height = height;      
      document.getElementById(l_str_arr_temp[n]).style.visibility = 'visible';   

      document.getElementById('b_'+l_str_arr_temp[n]).style.top = l_int_inc_top;
      document.getElementById('b_'+l_str_arr_temp[n]).style.left = l_int_left;
      document.getElementById('b_'+l_str_arr_temp[n]).style.width = width;
      document.getElementById('b_'+l_str_arr_temp[n]).style.height = height;      
      document.getElementById('b_'+l_str_arr_temp[n]).style.visibility = 'visible';   

      document.getElementById('img_'+l_str_arr_temp[n]).style.top = l_int_inc_top;
      document.getElementById('img_'+l_str_arr_temp[n]).style.left = l_int_left;
      document.getElementById('img_'+l_str_arr_temp[n]).style.width = width;
      document.getElementById('img_'+l_str_arr_temp[n]).style.height = height;      
      document.getElementById('img_'+l_str_arr_temp[n]).style.visibility = 'visible';   

      l_int_inc_top += height + 2; 
      l_int_mheight_inc  += height;
   } //close for-1 loop
   if(l_str_arr_temp.length > 0) //true-more than zero navis
      setGeckoOutsideLayer(l_int_left,l_int_inc_top,width,height,l_int_top,l_int_bg_height);
}  //close the function

function getIEActiveNavi(curr_navi_name,des_navi_name,curr_navi_object)
{
   var des_navi_blk_name = 'b_' + des_navi_name;
   var des_navi_img_name = 'img_' + des_navi_name;   
   var cur_navi_img_name = 'img_' + curr_navi_name;      
   
   document.all.item(des_navi_name).style.top = parseInt(curr_navi_object.style.top);
   document.all.item(des_navi_name).style.left = parseInt(curr_navi_object.style.left);
   document.all.item(des_navi_name).style.width = parseInt(curr_navi_object.style.width);
   document.all.item(des_navi_name).style.height = parseInt(curr_navi_object.style.height);
   document.all.item(des_navi_name).style.visibility = 'visible';   
   
   document.all.item(des_navi_blk_name).style.top = parseInt(curr_navi_object.style.top);
   document.all.item(des_navi_blk_name).style.left = parseInt(curr_navi_object.style.left);
   document.all.item(des_navi_blk_name).style.width = parseInt(curr_navi_object.style.width);
   document.all.item(des_navi_blk_name).style.height = parseInt(curr_navi_object.style.height);
   document.all.item(des_navi_blk_name).style.visibility = 'visible';      
   
   document.all.item(des_navi_img_name).style.top = parseInt(curr_navi_object.style.top);
   document.all.item(des_navi_img_name).style.left = parseInt(curr_navi_object.style.left);
   document.all.item(des_navi_img_name).style.width = parseInt(curr_navi_object.style.width);
   document.all.item(des_navi_img_name).style.height = parseInt(curr_navi_object.style.height);
   document.all.item(des_navi_img_name).style.visibility = 'visible';         
   
   curr_navi_object.style.visibility = 'hidden'
   document.all.item(curr_navi_name).style.visibility = 'hidden';      
   document.all.item(cur_navi_img_name).style.visibility = 'hidden';         
}  // close the function

function getGeckoActiveNavi(curr_navi_name,des_navi_name,curr_navi_object)
{
   var des_navi_blk_name = 'b_' + des_navi_name;
   var des_navi_img_name = 'img_' + des_navi_name;   
   var cur_navi_img_name = 'img_' + curr_navi_name;      
   
   document.getElementById(des_navi_name).style.top = parseInt(curr_navi_object.style.top);
   document.getElementById(des_navi_name).style.left = parseInt(curr_navi_object.style.left);
   document.getElementById(des_navi_name).style.width = parseInt(curr_navi_object.style.width);
   document.getElementById(des_navi_name).style.height = parseInt(curr_navi_object.style.height);
   document.getElementById(des_navi_name).style.visibility = 'visible';   
   
   document.getElementById(des_navi_blk_name).style.top = parseInt(curr_navi_object.style.top);
   document.getElementById(des_navi_blk_name).style.left = parseInt(curr_navi_object.style.left);
   document.getElementById(des_navi_blk_name).style.width = parseInt(curr_navi_object.style.width);
   document.getElementById(des_navi_blk_name).style.height = parseInt(curr_navi_object.style.height);
   document.getElementById(des_navi_blk_name).style.visibility = 'visible';      
   
   document.getElementById(des_navi_img_name).style.top = parseInt(curr_navi_object.style.top);
   document.getElementById(des_navi_img_name).style.left = parseInt(curr_navi_object.style.left);
   document.getElementById(des_navi_img_name).style.width = parseInt(curr_navi_object.style.width);
   document.getElementById(des_navi_img_name).style.height = parseInt(curr_navi_object.style.height);
   document.getElementById(des_navi_img_name).style.visibility = 'visible';         
   
   curr_navi_object.style.visibility = 'hidden'
   document.getElementById(curr_navi_name).style.visibility = 'hidden';      
   document.getElementById(cur_navi_img_name).style.visibility = 'hidden';         
}  // close the function

function whenIEParamClear()
{
   current_page_id = '';
   current_url_status = '';
   current_url_name = '';  //current url for external link
   current_url_tgt = '';   //current url target
}  //close the function

/*set whenmouseover layer onIE formatted layers */
function setIEOutsideLayer(left,top,width,height,default_top,total_height)
{
   bglayer.style.top = default_top - 2;
   bglayer.style.left = left - 2;
   bglayer.style.width = eval(width) + 4;
   bglayer.style.height = total_height + 2;
   document.all.item('bglayer').style.background = '#cccccc';                  
   bglayer.style.visibility = 'visible';
   if(horizontal_location =='b' || add_subnavig_type == 'bl' || add_subnavig_type == 'br')      
      subdesktop.style.top = default_top - (height+Math.round(height/2));
   else if(horizontal_location =='t')
            subdesktop.style.top = default_top;
   
   var l_int_sdesk_left = left - Math.round(width/4);
   subdesktop.style.left = l_int_sdesk_left;
   var l_int_sdesk_width = eval(width) + eval(Math.round(width/2));
   subdesktop.style.width = l_int_sdesk_width;
   if(horizontal_location =='b' || add_subnavig_type == 'bl' || add_subnavig_type == 'br')         
      subdesktop.style.height = total_height + (height*2) - Math.round(height/2);   
   else if(horizontal_location =='t')
      subdesktop.style.height = total_height + (height*2);   
      
   var l_max_pixel_left = l_int_sdesk_left + l_int_sdesk_width;
   subdesktop.style.visibility = 'visible';   
//   document.all.item('subdesktop').style.background = '#cccccc';                  
}  //close the function

/*set whenmouseover layer onIE formatted layers */
function setGeckoOutsideLayer(left,top,width,height,default_top,total_height)
{
   document.getElementById('bglayer').style.top = default_top - 2;
   document.getElementById('bglayer').style.left = left - 2;
   document.getElementById('bglayer').style.width = eval(width) + 4;
   document.getElementById('bglayer').style.height = total_height + 2;
   document.getElementById('bglayer').style.background = '#cccccc';                  
   document.getElementById('bglayer').style.visibility = 'visible';
   if(horizontal_location =='b' || add_subnavig_type == 'bl' || add_subnavig_type == 'br')      
      document.getElementById('subdesktop').style.top = default_top - (height+Math.round(height/2));
   else if(horizontal_location =='t')
            document.getElementById('subdesktop').style.top = default_top;
   
   var l_int_sdesk_left = left - Math.round(width/4);
   document.getElementById('subdesktop').style.left = l_int_sdesk_left;
   var l_int_sdesk_width = eval(width) + eval(Math.round(width/2));
   document.getElementById('subdesktop').style.width = l_int_sdesk_width;
   if(horizontal_location =='b' || add_subnavig_type == 'bl' || add_subnavig_type == 'br')         
      document.getElementById('subdesktop').style.height = total_height + (height*2) - Math.round(height/2);   
   else if(horizontal_location =='t')
      document.getElementById('subdesktop').style.height = total_height + (height*2);   
      
   var l_max_pixel_left = l_int_sdesk_left + l_int_sdesk_width;
   document.getElementById('subdesktop').style.visibility = 'visible';   
//   document.getElementById('subdesktop').style.background = '#cccccc';                  
}  //close the function

function getKeyDown()
{
   var tmp_current_url_name = current_url_name;
   current_page_id = current_page_id.substr(8);

   if (current_page_id != '' && current_url_status == 'y')  // true -non empty
   {
      location.href = current_page_id + '.html';
   }
   else if (current_url_status == 'e' && current_url_name != '') //cursor points to page name
   {
      if (current_url_tgt == 'y')   // open in new window
      {
         whenIEParamClear();
         window.open(tmp_current_url_name);
      }
      else
      {
         location.href = current_url_name;
      }
   }
   else if(current_page_id == '' )  // false - empty
   {
      if(_is_gecko_bowser == STR_YES)
         clearGeckoNavis();
      else
         clearIENavis();
   }  
}   //close the function

function onCurrentIEsubNavis(tar_navis, status, url_name, url_tgt)
{
   current_page_id = tar_navis;  //current page id
   current_url_status = status;  //current url
   current_url_name = url_name;  //current url name
   current_url_tgt = url_tgt;    //current url target ( '' / 'n' )

   for(var n=0;n < f_str_dyn_sub_list.length;n++)
   { //starts for -1 loop
      var l_str_scroll_layer = 'act_'+ f_str_dyn_sub_list[n];
      var l_str_static_layer = f_str_dyn_sub_list[n];      
      //blk layer names      
      var l_blk_stc_name = 'b_'+l_str_static_layer;      
      var l_blk_scl_name = 'b_'+l_str_scroll_layer;            
      //imgage layer name
      var l_img_stc_name = 'img_'+l_str_static_layer;      
      var l_img_scl_name = 'img_'+l_str_scroll_layer;            
      
      if(tar_navis == l_str_scroll_layer)
         {
            document.all.item(l_str_scroll_layer).style.visibility = 'visible';
            document.all.item(l_blk_scl_name).style.visibility = 'visible';            
            document.all.item(l_img_scl_name).style.visibility = 'visible';            
                        
            document.all.item(l_str_static_layer).style.visibility = 'hidden';
            document.all.item(l_blk_stc_name).style.visibility = 'hidden';
            document.all.item(l_img_stc_name).style.visibility = 'hidden';                        
         }
      else
         {
            document.all.item(l_str_scroll_layer).style.visibility = 'hidden';
            document.all.item(l_img_scl_name).style.visibility = 'hidden';
            document.all.item(l_blk_scl_name).style.visibility = 'hidden';                        
            
            document.all.item(l_str_static_layer).style.visibility = 'visible';
            document.all.item(l_img_stc_name).style.visibility = 'visible';
            document.all.item(l_blk_stc_name).style.visibility = 'visible';                        
         }
   }  //close for-1 loop
}

function onCurrentGeckosubNavis(tar_navis, status, url_name, url_tgt)
{
   current_page_id = tar_navis;  //current page id
   current_url_status = status;  //current url
   current_url_name = url_name;  //current url name
   current_url_tgt = url_tgt;    //current url target ( '' / 'n' )

   for(var n=0;n < f_str_dyn_sub_list.length;n++)
   { //starts for -1 loop
      var l_str_scroll_layer = 'act_'+ f_str_dyn_sub_list[n];
      var l_str_static_layer = f_str_dyn_sub_list[n];      
      //blk layer names      
      var l_blk_stc_name = 'b_'+l_str_static_layer;      
      var l_blk_scl_name = 'b_'+l_str_scroll_layer;            
      //imgage layer name
      var l_img_stc_name = 'img_'+l_str_static_layer;      
      var l_img_scl_name = 'img_'+l_str_scroll_layer;            
      
      if(tar_navis == l_str_scroll_layer)
         {
            document.getElementById(l_str_scroll_layer).style.visibility = 'visible';
            document.getElementById(l_blk_scl_name).style.visibility = 'visible';            
            document.getElementById(l_img_scl_name).style.visibility = 'visible';            
                        
            document.getElementById(l_str_static_layer).style.visibility = 'hidden';
            document.getElementById(l_blk_stc_name).style.visibility = 'hidden';
            document.getElementById(l_img_stc_name).style.visibility = 'hidden';                        
         }
      else
         {
            document.getElementById(l_str_scroll_layer).style.visibility = 'hidden';
            document.getElementById(l_img_scl_name).style.visibility = 'hidden';
            document.getElementById(l_blk_scl_name).style.visibility = 'hidden';                        
            
            document.getElementById(l_str_static_layer).style.visibility = 'visible';
            document.getElementById(l_img_stc_name).style.visibility = 'visible';
            document.getElementById(l_blk_stc_name).style.visibility = 'visible';                        
         }
   }  //close for-1 loop
}

function onIEClearSubs()
{
   for(var n=0;n <f_str_dyn_sub_list.length;n++)
   { //starts for -1 loop
      var l_str_scroll_layer = 'act_'+ f_str_dyn_sub_list[n];
      var l_str_static_layer = f_str_dyn_sub_list[n];      
      var l_str_inamer_scr = 'img_' + l_str_scroll_layer;
      var l_str_bname_scr = 'b_' + l_str_scroll_layer;
      var l_str_inamer_stc = 'img_' + l_str_static_layer;
      var l_str_bname_stc = 'b_' + l_str_static_layer;
      
      
      document.all.item(l_str_scroll_layer).style.visibility = 'hidden';
      document.all.item(l_str_static_layer).style.visibility = 'hidden';
      document.all.item(l_str_inamer_scr).style.visibility = 'hidden';
      document.all.item(l_str_inamer_stc).style.visibility = 'hidden';
      document.all.item(l_str_bname_scr).style.visibility = 'hidden';
      document.all.item(l_str_bname_stc).style.visibility = 'hidden';
      
   }  //close for-1 loop
   bglayer.style.visibility = 'hidden';
   f_str_dyn_sub_list = new Array();
}

function onGeckoClearSubs()
{
   for(var n=0;n <f_str_dyn_sub_list.length;n++)
   { //starts for -1 loop
      var l_str_scroll_layer = 'act_'+ f_str_dyn_sub_list[n];
      var l_str_static_layer = f_str_dyn_sub_list[n];      
      var l_str_inamer_scr = 'img_' + l_str_scroll_layer;
      var l_str_bname_scr = 'b_' + l_str_scroll_layer;
      var l_str_inamer_stc = 'img_' + l_str_static_layer;
      var l_str_bname_stc = 'b_' + l_str_static_layer;
      
      document.getElementById(l_str_scroll_layer).style.visibility = 'hidden';
      document.getElementById(l_str_static_layer).style.visibility = 'hidden';
      document.getElementById(l_str_inamer_scr).style.visibility = 'hidden';
      document.getElementById(l_str_inamer_stc).style.visibility = 'hidden';
      document.getElementById(l_str_bname_scr).style.visibility = 'hidden';
      document.getElementById(l_str_bname_stc).style.visibility = 'hidden';
   }  //close for-1 loop
   document.getElementById('bglayer').style.visibility = 'hidden';
   f_str_dyn_sub_list = new Array();
}

function compareNumbers(a, b) 
{ 
  return a - b;
}

/* this method generates the screen suitable X position pixel with based on  1024 pixel data */
function getSuitXposi(val1024)
{
	var l_int_result_pixel = val1024;
//alert("left"+val1024);
	if( subng_variation_flag == "OLDDESIGN")
	{	
		if(screen.width == 1280)
		{

			if(dyn_top > 310 && navigation_align == "hp_left_align")
				l_int_result_pixel = val1024 +280;
				
			else if ( dyn_top < 310 && navigation_align == "hp_right_align" && val1024 > 350)
				l_int_result_pixel = val1024 +280;
			
			else		
				l_int_result_pixel = val1024;
		}
		else if(screen.width == 1152)
		{	
			if(dyn_top > 310 && navigation_align == "hp_left_align")
				l_int_result_pixel = val1024 +150;
			else if ( dyn_top < 310 && navigation_align == "hp_right_align" && val1024 > 350)
				l_int_result_pixel = val1024 +150;	
			else 	
			        l_int_result_pixel = val1024;
		}
		else		
		{
			l_int_result_pixel = val1024+125;   //default
		}	
	}    
	else if( subng_variation_flag == "NEWDESIGN")	
		l_int_result_pixel = val1024;      // 
	else if(navigation_align == "hp_left_align" )
	{
				
		if( screen.width == 1152)
			l_int_result_pixel = val1024+125;   //
		else if( screen.width == 1280)	
			l_int_result_pixel = val1024+265;  	
		else		
			l_int_result_pixel = val1024+125;   //default

	}		
return l_int_result_pixel;

}


