﻿
function GetValue(strKey)
{
   if(strKey.length==0)
      return "";
   
   var strURL=window.location.href;
   var nStart=strURL.indexOf('?');
   
   if(nStart<0)
      return "";
   
   var strParamters=strURL.slice(nStart+1,strURL.length);
   
   var oParamters=new Array();
   
   if(strParamters.indexOf('&')<0)
      oParamters.push(strParamters);
   else
      oParamters=strParamters.split('&');
   
   for(var i=0;i<oParamters.length;i++)
   {
      var oCommand=oParamters[i].split("=");
      
      if(oCommand[0]==strKey)
         return oCommand[1];
   }      
}

function LoadItem(strFirstItem)
{
   var strItem = GetValue("item");
   
   if(strItem==null || strItem.length == 0)
   {
      strItem = strFirstItem;
   }
   var oLine = document.all["_"+strItem];
   var oElement = document.all[strItem];
   
   if(oElement!=null)
   {
      oElement.style.display = '';
      oLine.style.fontWeight = "bold";
   }
   strLastSelected = strItem;
   //set the title
   SectionTitle.innerHTML = oLine.innerHTML;
}

function SwapPage(strId,strButtonId)
{
   try
   {
      if(strButtonId.length==0)
         strButtonId=GetValue("b");
         
      if(strId.length==0)
         strId=GetValue("i");   
      
      if(strId.length==0||strButtonId.length==0)
         {
            strId="default";
            strButtonId="Home";
         }
    
     // LoadPromo(strId);        
      var oPageList=new Array("default","d_packges","contactus");
      
      for(var n=0;n<oPageList.length;n++)
      {
         if(oPageList[n]==strId)
         {
            document.all[oPageList[n]].style.display='';
         }
         else
            document.all[oPageList[n]].style.display='none';
      }
      
      if(strButtonId.length>0)
      {
         var oButtonList=new Array("Home","Packages");
         
         for(var i=0;i<oButtonList.length;i++)
         {
            if(oButtonList[i]==strButtonId)
            {
               if(document.all[oButtonList[i]].src.indexOf('_click')<0)
               {
                  document.all[oButtonList[i]].src=document.all[oButtonList[i]].src.replace('.gif','')+'_click.gif';
               }
            }   
            else
            {
               document.all[oButtonList[i]].src = document.all[oButtonList[i]].src.replace('_click','');
            }
         }
          
      }
   }
   catch(e)
   {
   }
   return true;
}
function LoadPromo(strId)
{
   if(strId == "default")
   {
      if(PromoImage.className != "Promo_Default")
      {
         PromoImage.className = "Promo_Default";
      }
      lMainPageTitle.innerHTML = "Visioning the Future";
   }
   if(strId == "d_packges")
   {
      PromoImage.className = "Promo_Packges"
      lMainPageTitle.innerHTML = "Packages";
   }
   if(strId == "contactus" )
   {
      if(PromoImage.className!="Promo_About")
      {
         PromoImage.className = "Promo_About"
      }
      lMainPageTitle.innerHTML = "Contact Us";
   }
}
var strLastSelected = "";
function SwapProductPage(obj)
{
   obj.style.fontWeight = "bold";
   var strId=obj.id.replace("_","");
   var oElement = document.all[strLastSelected];
   if(oElement!=null)
   {
      oElement.style.display = 'none';
      document.all['_'+strLastSelected].style.fontWeight = "normal";
   }
   strLastSelected = strId;
   oElement = document.all[strLastSelected];
   if(oElement!=null)
   {
      oElement.style.display = '';
   }
   SectionTitle.innerHTML = obj.innerHTML;
}

function SwapAboutPage(obj)
{
   obj.style.fontWeight = "bold";
   var strId=obj.id.replace("_","");
   var oElement = document.all[strLastSelected];
   if(oElement!=null)
   {
      oElement.style.display = 'none';
      document.all['_'+strLastSelected].style.fontWeight = "normal";
   }
   strLastSelected = strId;
   oElement = document.all[strLastSelected];
   if(oElement!=null)
   {
      oElement.style.display = '';
   }
   SectionTitle.innerHTML = obj.innerHTML;
}

function SwapSupportPage(obj)
{
   obj.style.fontWeight = "bold";
   var strId=obj.id.replace("_","");
   var oElement = document.all[strLastSelected];
   if(oElement!=null)
   {
      oElement.style.display = 'none';
      document.all['_'+strLastSelected].style.fontWeight = "normal";
   }
   strLastSelected = strId;
   oElement = document.all[strLastSelected];
   if(oElement!=null)
   {
      oElement.style.display = '';
   }
   SectionTitle.innerHTML = obj.innerHTML;
}


function InsertFlashObject()
{
   var strSrc = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="259" height="275" id="2"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="Brand/flash/MobileDesktop.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><EMBED src="Brand/flash/MobileDesktop.swf" quality=high WIDTH=686 HEIGHT=55 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></object>';
   flashObj.insertAdjacentHTML("afterBegin" ,strSrc);
   return true;
}

function SelectOtherRadio(strID)
{
   if(strID == null || strID.length == 0)
   {
      return false;
   }
   var oRadio = document.all[strID];
   if(oRadio != null)
   {
      oRadio.checked = true;
   }
   return true;
}

