// Javascript functions	
// On Page load
//var j = jQuery.noConflict();

$(document).ready(function() {
    // Main Slideshow transitions
    $('.slideshow').cycle( {
        fx : 'scrollLeft', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        timeout : 8000
    });

     $('.slideshow-clients').cycle( {
        fx : 'scrollLeft', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        cleartypeNoBg: true,
        timeout : 4000
    });
		
    // Side Menu
    //---------------------------------+
    //  Developed by Roshan Bhattarai
    //  Visit http://roshanbh.com.np for this script and more.
    //  This notice MUST stay intact for legal use
    // --------------------------------->
		
    //slides the element with class "menu_body" when paragraph with class "menu_head" is clicked
    $("#side-menu p.menu_head").click(function()
    {
        //$(this).css({background:"url(images/down.png) no-repeat"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
        $(this).toggleClass('down').next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
    //$(this).css({background:"url(images/up.png) no-repeat"});
    // above line messes up transparency
    });
    
});
	

	

//Collapse/Expand boxes
function toggle(id) {

    for (i=1;i<=20;i++) {
        var j = "toggle"+i;
        var h = "heading"+i;
        if (j==id){
            var el = document.getElementById(j);
            var heading = document.getElementById(h);
            if(el.style.display == 'none') {
                el.style.display = 'block';
                heading.style.backgroundImage = "url('images/grey-bar.gif')";
            }
            else {
                el.style.display = 'none';
                heading.style.backgroundImage = "url('images/grey-bar-shut.gif')";
            }

        }
        else {
            document.getElementById(j).style.display="none";
            document.getElementById(h).style.backgroundImage = "url('images/grey-bar-shut.gif')";
        }

    }

}

function toggleclients(id) {
    var el = document.getElementById(id);
   
  

  el.style.display = (el.style.display == 'none') ? 'block' : 'none';
    if(el.style.display=="block" )  {
        document.getElementById('cbottom').style.backgroundImage= "url('images/some-of-our-clients-bottom.gif')";
        document.getElementById('ctop').style.backgroundImage= "url('images/some-of-our-clients-top-ope.gif')";
    } else {
        document.getElementById('cbottom').style.backgroundImage= "url('images/some-of-our-clients-bottom1.gif')";
        document.getElementById('ctop').style.backgroundImage= "url('images/some-of-our-clients-top.gif')";
     }

  //secondly, hide side menu/clients as appropriate
   if(id!="side-menu") { document.getElementById('side-menu').style.display = "none"; document.getElementById('menu_list_top').style.backgroundImage= "url('images/in-partnership-top.jpg')"

 }
   else { 
     document.getElementById('cmiddle').style.display = "none"; 
     document.getElementById('cbottom').style.backgroundImage= "url('images/some-of-our-clients-bottom1.gif')";
     document.getElementById('ctop').style.backgroundImage= "url('images/some-of-our-clients-top.gif')";
     if(el.style.display=="block") {
       document.getElementById('menu_list_top').style.backgroundImage= "url('images/in-partnership-top-ope.gif')";
     } else {
       document.getElementById('menu_list_top').style.backgroundImage= "url('images/in-partnership-top.jpg')"
    } 
   }
}

function toggle2(id,h2) {



    var b1 = document.getElementById('bio1');
    var b2 = document.getElementById('bio2');
    var b3 = document.getElementById('bio3');
    var b4 = document.getElementById('bio4');
    var b5 = document.getElementById('bio5');
    if(b1) {
        b1.style.display = 'none';
    }
    if(b2) {
        b2.style.display = 'none';
    }
    if(b3) {
        b3.style.display = 'none';
    }
    if(b4) {
        b4.style.display = 'none';
    }
    if(b5) {
        b5.style.display = 'none';
    }




    var el = document.getElementById(id);
    el.style.display = (el.style.display == 'none') ? 'block' : 'none';


}



