/* 
Simple JQuery menu.
HTML structure to use:

Notes: 

1: each menu MUST have an ID set. It doesn't matter what this ID is as long as it's there.
2: each menu MUST have a class 'menu' set. If the menu doesn't have this, the JS won't make it dynamic

Optional extra classnames:

noaccordion : no accordion functionality
collapsible : menu works like an accordion but can be fully collapsed
expandfirst : first menu item expanded at page load

<ul id="menu1" class="menu [optional class] [optional class]">
<li><a href="#">Sub menu heading</a>
<ul>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
...
...
</ul>
<li><a href="#">Sub menu heading</a>
<ul>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
...
...
</ul>
...
...
</ul>

Copyright 2008 by Marco van Hylckama Vlieg

web: http://www.i-marco.nl/weblog/
email: marco@i-marco.nl

Free for non-commercial use
*/

function initMenus() {
	$('ul.orange-arrow ul').hide();
	$.each($('ul.orange-arrow'), function(){
		$('#menu1' + this.id + '.expandfirst ul:first').show();
		
	});

	$('ul.orange-arrow li a').hover(function () {
		    var checkElement = $(this).next();
		    var parent = this.parentNode.parentNode.id;

		    if ($('#menu1' + parent).hasClass('noaccordion')) {
		        $(this).next().slideToggle('normal');
		        return false;
		    }
		    if ((checkElement.is('ul')) && (checkElement.is(':visible'))) {
		        if ($('#menu1' + parent).hasClass('collapsible')) {
		            $('#menu1' + parent + ' ul:visible').slideUp('normal');
		            
		        }
		        return false;
		    }
		    if ((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
		        $('#' + parent + ' ul:visible').slideUp('normal');
		        checkElement.slideDown('normal');
		        return false;
		    }
		}
	);
	
}
$(document).ready(function() { initMenus();
var path = location.pathname.substring(1); 
//var sk=path.split("/");
var sp=path.toString().split("/");

if(sp[2]=='document-translation' || sp[2]=='certified-translation-services' || sp[2]=='spanish-translation' || sp[2]=='spanish-to-english-translation' || 
sp[2]=='english-to-spanish-translation'|| sp[2]=='chinese-translation'|| sp[2]=='korean-translation'|| 
sp[2]=='french-translation'|| sp[2]=='vietnamese-translation'|| sp[2]=='vietnamese-translation'|| 
sp[2]=='portuguese-translation'|| sp[2]=='japanese-translation'|| sp[2]=='tagalog-translation'|| sp[2]=='language-services' || 
sp[2]=='document-translation-type')
{
	document.getElementById("doc1").style.display='block';
}else if(sp[2]=='software-internationalization-services' || sp[2]=='multilingual-application-development' || sp[2]=='automation')
{
	document.getElementById("doc2").style.display='block';
}else if(sp[2]=='consecutive-interpretation-services' || sp[2]=='simultaneous-interpretation-services' || sp[2]=='american-sign-language' || sp[2]=='interpretation')
{
	document.getElementById("doc3").style.display='block';
}else if(sp[2]=='interpreter-selection-process' || sp[2]=='telephonic-interpreter-selection-process' || sp[2]=='spanish-translator' || sp[2]=='spanish-to-english-translator' || sp[2]=='english-to-spanish-translator' || sp[2]=='chinese-translator' || sp[2]=='korean-translator' || sp[2]=='french-translator' || sp[2]=='vietnamese-translator' || sp[2]=='portugese-translator' || sp[2]=='japanese-translator' || sp[2]=='tagalog-translator' || sp[2]=='list-of-languages' || sp[2]=='multilingualstaffing')
{
	document.getElementById("doc4").style.display='block';
}

});
/* 
Simple JQuery menu.
HTML structure to use:

Notes: 

1: each menu MUST have an ID set. It doesn't matter what this ID is as long as it's there.
2: each menu MUST have a class 'menu' set. If the menu doesn't have this, the JS won't make it dynamic

Optional extra classnames:

noaccordion : no accordion functionality
collapsible : menu works like an accordion but can be fully collapsed
expandfirst : first menu item expanded at page load

<ul id="menu1" class="menu [optional class] [optional class]">
<li><a href="#">Sub menu heading</a>
<ul>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
...
...
</ul>
<li><a href="#">Sub menu heading</a>
<ul>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
<li><a href="http://site.com/">Link</a></li>
...
...
</ul>
...
...
</ul>

Copyright 2008 by Marco van Hylckama Vlieg

web: http://www.i-marco.nl/weblog/
email: marco@i-marco.nl

Free for non-commercial use*/


/*function initMenus() {
	$('ul.orange-arrow ul').hide();
	$.each($('ul.orange-arrow'), function(){
		$('#' + this.id + '.expandfirst ul:first').show();
	});
	
	$('ul.orange-arrow li a').hover(
		function() {
			var path = location.pathname.substring(1); 

			var checkElement = $(this).next();
			var parent = this.parentNode.parentNode.id;

			if($('#' + parent).hasClass('noaccordion')) {
				$(this).next().slideToggle('normal');
				return false;
			}
			if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
				if($('#' + parent).hasClass('collapsible')) {
					$('#' + parent + ' ul:visible').slideUp('normal');
				}
				return false;
			}
			if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
				$('#' + parent + ' ul:visible').slideUp('normal');
				checkElement.slideDown('normal');
				return false;
			}
		}
	);
	
}
$(document).ready(function() {initMenus();});*/
