/*
*	inc_navigation.js
*	author Ok!nteractif
*/
var sousSections =new Array();
	sousSections['smenu_products'] = new Array('product_1clickkit.php', 'product_darkroom.php','product_trigger.php','prices.php');
	sousSections['smenu_about'] = new Array('faq.php','contact.php');

function selectNavigationLink(divId){
	var location = String(window.location);
	var allLinks = $(divId).getElements('a');	

	for (i=0; i<allLinks.length; i++){		
		var cLink = allLinks[i];
		var cHref = cLink.getProperty('href');
			cHref = cHref.replace('.php', '');
		var cId = 	cLink.getProperty('id');
		var rel = cLink.getProperty('rel');
		var isSubSection = false;
		
		if (rel != null){
			for (var ii=0; ii<sousSections[rel].length; ii++){
				var url = sousSections[rel][ii];
				if (location.contains(url)){
					isSubSection = true;
				}
			}
		}
		
		//alert(isSubSection+' : '+cHref);
		
		if (location.contains(cHref) || isSubSection==true){
			var img = cLink.getElement('img'); 
			
			cLink.addClass('current');	
			
			if (img != null){
				var src = 	img.getProperty('src');
							img.removeClass('js-btn-over');
							img.setProperty('src', src.replace('_up', '_over'));
			}
		}	
	}
}
