/*******************Function to show/hide the arrow for the expand/collapse bars**********************/
function sh_arrow(id)
{  
    var up = document.getElementById('arrow_up_'+id);
    var dn = document.getElementById('arrow_dn_'+id);
    if (up.className == "faq_hide_arrow")
    {
        up.className = "faq_show_arrow";
        dn.className = "faq_hide_arrow";
    }
    else
    {
        up.className = "faq_hide_arrow";
        dn.className = "faq_show_arrow";
    }
}
/*******************END Function to show/hide the arrow for the expand/collapse bars******************/


/*******************Function to show/hide the html form***********************************************/
function showhide()
{
    document.getElementById("myform").style.display = "none";
    document.getElementById("mymessage").style.display = "block";
}
/*******************END Function to show/hide the html form*******************************************/

/*******************Function to style the country dropdown on all pages ******************************/
$(function(){	
    $('select#ddCountry').selectmenu({style:'dropdown'});
});
/*******************END Function to style the country dropdown on all pages **************************/

/*******************Function to change the country dropdown on all pages *****************************/
function switch_to_country(country_id)
{
    // ddCountry
    if(country_id == 6)
        {
            window.location="http://www.mtnbusiness.ci";
        }
    if(country_id == 7)
        {
            window.location="http://www.mtnbusiness.com.gh/";
        }
    if(country_id == 8)
        {
            window.location="http://www.mtnbusiness.ci";
        }
    document.getElementById('ddCountry').value = country_id;
    document.country.submit();
}
/*******************END Function to change the country dropdown on all pages *************************/

/*******************Function to change tab images*****************************************************/
function changeCssClass(objDivID)
{
    //changes selected/deselected images for tabs
       var items = ['connectivity','infrastructure','security','convergence','software'];
        for (i=0;i<=items.length;i++)
        {
            if(items[i] == objDivID)
            {                       
                document.getElementById(objDivID).className = 'selected';
            }              
            else
            {
                if(items[i] != null)
                {
                    document.getElementById(items[i]).className = '';
                }
            }
        }    
}
/*******************END Function to change tab images*************************************************/

/*******************Function to create a popup window*************************************************/
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=584,left = 412,top = 284');");
}
// End -->
/*******************END Function to create a popup window*********************************************/

/*******************Function to set search css********************************************************/
function setSearchCss()
{
    if(navigator.appName == "Microsoft Internet Explorer")
    {
        document.getElementById('searchtxt').style.margin = "3px 0px 0px 0px";
    }
    else
    {
        document.getElementById('searchtxt').style.margin = "4px 0px 0px 0px";
    }
}
/*******************END Function to set search css****************************************************/

/*******************JS for the contact and PAN Africa page********************************************/
function show_details(clicked)
{  
    
    var bot = document.getElementById('content_bot');
    var rsa = document.getElementById('content_sa');
    var nam = document.getElementById('content_nam');
    var zam = document.getElementById('content_zam');
    var ken = document.getElementById('content_ken');
    var ic = document.getElementById('content_ic');
    var gh = document.getElementById('content_gh');
    var ug = document.getElementById('content_ug');
    var clicked = document.getElementById('content_'+clicked);
    
    ic.style.display = "none";
    bot.style.display = "none";
    rsa.style.display = "none";
    nam.style.display = "none";
    zam.style.display = "none";
    ken.style.display = "none";
    ug.style.display = "none";
    gh.style.display = "none";
    
    clicked.style.display = "block";
}
/*******************END JS for the contact and PAN Africa page*****************************************/

/*******************JS to browse to url****************************************************************/
function browse_to(url)
{
    //window.location = url;
    window.open(url);
}
/*******************END JS to browse to url************************************************************/

/*******************************JS for IMAGE SLIDER ***************************************************/
//image slider
	$(window).load(function() {
	    $('#slider').nivoSlider({
	        effect:'fade', //Specify sets like: 'sliceDown,sliceDownLeft,sliceUp,sliceUpLeft,sliceUpDown,sliceUpDownLeft,fold,fade,random'
	        slices:15,
	        animSpeed:500, //Slide transition speed
	        pauseTime:5000,
	        startSlide:0, //Set starting Slide (0 index)
	        directionNav:true, //Next & Prev
	        directionNavHide:false, //Only show on hover
	        controlNav:false, //1,2,3...
	        controlNavThumbs:false, //Use thumbnails for Control Nav
	        controlNavThumbsFromRel:false, //Use image rel for thumbs
	        controlNavThumbsSearch: '.jpg', //Replace this with...
	        controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
	        keyboardNav:true, //Use left & right arrows
	        pauseOnHover:true, //Stop animation while hovering
	        manualAdvance:false, //Force manual transitions
	        captionOpacity:0.8, //Universal caption opacity
	        beforeChange: function(){},
	        afterChange: function(){},
	        slideshowEnd: function(){}, //Triggers after all slides have been shown
	        lastSlide: function(){}, //Triggers when last slide is shown
	        afterLoad: function(){
	        	$("#slider img").css("display","block");
		        } //Triggers when slider has loaded
	    });
	});
/*******************************END JS for IMAGE SLIDER ***********************************************/

