﻿// JScript File

function ToggleVisibility(blockId)
{ 
    quickLinkBlock = document.getElementById(blockId);

    if(quickLinkBlock.style.display == 'none' || quickLinkBlock.style.display =='')    
        document.getElementById(blockId).style.display = 'block';
    else
        document.getElementById(blockId).style.display = 'none';
}

function ShowAllPrograms()
{
    
    var img = document.getElementById('Arrow');
    var src = img.src;
    var quickLinkBlock = document.getElementById('programlist');
   
     
    if(quickLinkBlock.style.display == 'none' || quickLinkBlock.style.display =='')  
    {  
        document.getElementById('programlist').style.display = 'block';
        ShowUparrow(src);
    }
    else
    {
        document.getElementById('programlist').style.display = 'none';
        ShowDownarrow(src);
    }
}

function OpenQuickLink(blockId)
{
  
    document.getElementById(blockId).style.display = 'block';
    var src = document.getElementById('Arrow').src;
    ShowUparrow(src);
    
}

function CloseQuickLink(blockId)
{

    document.getElementById(blockId).style.display = 'none';
    var src = document.getElementById('Arrow').src;
    ShowDownarrow(src);
    
}

function ShowUparrow(src)
{
   src = src.replace("all_P_arrow.gif", "up-arrow.jpg");
   document.getElementById('Arrow').src = src;
}

function ShowDownarrow(src)
{
  src = src.replace("up-arrow.jpg", "all_P_arrow.gif");
  document.getElementById('Arrow').src = src;
}

function popUp(URL, width, height) {
    var popday = new Date();
    var popupid = popday.getTime();
    eval("page" + popupid + " = window.open(URL, '" + popupid + "', 'toolbar=0,width="+width+",height="+height+",scrollbars= 1,left = 0,top = 0');");
}

 function RedirectTo()
        {                 
            var course = document.getElementById('ProgramCtl').value;          
               
            switch(course)
            {
                case "1":
                  window.opener.window.location.href="mba-program/download-brochure";
                        break;
                case "2":
                  window.opener.window.location.href="mba-program/part-time/download-brochure";
                        break;
                case "3":
                  window.opener.window.location.href="masters-program/download-brochure";
                       break;
               case "4":
                  window.opener.window.location.href="undergraduate/download-brochure";
                        break;        
            }  
            window.close();
        }
        
        
 function ApplicationRedirectTo()
        {                 
            var course = document.getElementById('ProgramCtl').value;          
               
            switch(course)
            {
                case "1":
                  window.location.href="http://hult.topapply.com";
                        break;
                case "2":
                  window.location.href="http://hult.topapply.com";
                       break;
               case "3":
                  window.location.href="http://www.huron.ac.uk/application/";
                        break;        
            }  
            
        }        
        
            
function ShowInfoSession() 
{ 
     document.getElementById("info").className="tab"
     document.getElementById("news").className="inactive_tab"
      document.getElementById("news_box").style.display="none"
     document.getElementById("info_box").style.display="block"
  
} 
function ShowNews()
{ 
     document.getElementById("news").className="tab"
     document.getElementById("info").className="inactive_tab" 
     document.getElementById("info_box").style.display="none"
     document.getElementById("news_box").style.display="block" 
}   
function ShowInfoSessionSmall() 
{ 
     document.getElementById("info").className="tabsmall"
     document.getElementById("news").className="inactive_tabsmall"
      document.getElementById("news_boxsmall").style.display="none"
     document.getElementById("info_boxsmall").style.display="block"
  
} 
function ShowNewsSmall()
{ 
     document.getElementById("news").className="tabsmall"
     document.getElementById("info").className="inactive_tabsmall" 
     document.getElementById("info_boxsmall").style.display="none"
     document.getElementById("news_boxsmall").style.display="block" 
}   
function LinkTo(dropdown)
        {                 
            var course = document.getElementById(dropdown).value;          
               
            switch(course)
            {
                case "1":
                  window.location = "../mba-program/download-brochure";
                        break;
                case "2":
                  window.location = "../mba-program/part-time/download-brochure";
                        break;
                case "3":
                  window.location = "../masters-program/download-brochure";
                       break;
               case "4":
                  window.location ="../undergraduate/download-brochure";
                        break; 
               case "5":
                  window.location ="../executive-program/download-brochure";
                        break;        
            }  
            
        }

function PartLinkTo(dropdown)
        {                 
            var course = document.getElementById(dropdown).value;          
               
            switch(course)
            {
                case "1":
                  window.location = "../../mba-program/download-brochure";
                        break;
                case "2":
                  window.location = "../../mba-program/part-time/download-brochure";
                        break;
                case "3":
                  window.location = "../../masters-program/download-brochure";
                       break;
               case "4":
                  window.location ="../../undergraduate/download-brochure";
                        break;  
               case "5":
                  window.location ="../../executive-program/download-brochure";
                        break;        
            }  
            
        }

        
function showPanel(panelLabel,panel,hiddenpanelLabel,hiddenpanel)
{

  var labelObj = document.getElementById(panelLabel);
  var panelObj = document.getElementById(panel);
  var hiddenlabelObj = document.getElementById(hiddenpanelLabel);
  var hiddenpanelObj = document.getElementById(hiddenpanel);
  
  if(labelObj && panelObj && hiddenlabelObj && hiddenpanelObj)
  {
     labelObj.className="tab";
     hiddenlabelObj.className="inactive_tab";
     hiddenpanelObj.style.display="none";
     panelObj.style.display="block";
  }
}

function trim(str)
{
    return str.replace(/^\s*/, "").replace(/\s*$/, "");
}


function homebannerRotation()
{
  setTimeout("bannerTextChange()",8000);
}


function bannerTextChange()
{
var bannerPanel = document.getElementById('highlighbanner');
if(bannerPanel)
{
  if(bannerPanel.innerHTML == 'Next admission deadline January 31')
   {

     bannerPanel.innerHTML = '<a href="/flying-professor">&#8220;Winning the Next Global Growth Story&#8221;, Asia City Tour, January 14th to 17th - Register now!</a>';

   }
   else
   {

      bannerPanel.innerHTML = 'Next admission deadline January 31';
    }
  setTimeout("bannerTextChange()",8000);
}

}


function videoShow(e) 
{
//alert(e);
	//e.preventDefault(); 
	$('#basic-modal-content').modal();
}