// JavaScript Document


// Image Slider Settings - homepage
function tabb(divid){	
		
		if (divid == 'c1') {
						
				var buttons = { previous:$('#lofslidecontent45 .lof-previous') ,
						next:$('#lofslidecontent45 .lof-next') };
						
				$obj = $('#lofslidecontent45').lofJSidernews( { interval : 4000,
												direction		: 'opacitys',	
											 	easing			: 'easeInOutExpo',
												duration		: 1200,
												auto		 	: false,
												maxItemDisplay  : 4,
												navPosition     : 'horizontal', // horizontal
												navigatorHeight : 76,
												navigatorWidth  : 74,
												mainWidth:341,
												buttons			: buttons} );
		}
				
		if (divid == 'c2') {
			
				var buttons = { previous:$('#lofslidecontent46 .lof-previous') ,
						next:$('#lofslidecontent46 .lof-next') };
						
				$obj = $('#lofslidecontent46').lofJSidernews( { interval : 4000,
												direction		: 'opacitys',	
											 	easing			: 'easeInOutExpo',
												duration		: 1200,
												auto		 	: false,
												maxItemDisplay  : 4,
												navPosition     : 'horizontal', // horizontal
												navigatorHeight : 76,
												navigatorWidth  : 74,
												mainWidth:341,
												buttons			: buttons} );	
		}
				
		if (divid == 'c3') {
				var buttons = { previous:$('#lofslidecontent47 .lof-previous') ,
						next:$('#lofslidecontent47 .lof-next') };
						
				$obj = $('#lofslidecontent47').lofJSidernews( { interval : 4000,
												direction		: 'opacitys',	
											 	easing			: 'easeInOutExpo',
												duration		: 1200,
												auto		 	: false,
												maxItemDisplay  : 4,
												navPosition     : 'horizontal', // horizontal
												navigatorHeight : 76,
												navigatorWidth  : 74,
												mainWidth:341,
												buttons			: buttons} );
		}		
		
		if (divid == 'c4') {
				var buttons = { previous:$('#lofslidecontent48 .lof-previous') ,
						next:$('#lofslidecontent48 .lof-next') };
						
				$obj = $('#lofslidecontent48').lofJSidernews( { interval : 4000,
												direction		: 'opacitys',	
											 	easing			: 'easeInOutExpo',
												duration		: 1200,
												auto		 	: false,
												maxItemDisplay  : 4,
												navPosition     : 'horizontal', // horizontal
												navigatorHeight : 76,
												navigatorWidth  : 74,
												mainWidth:341,
												buttons			: buttons} );
		}
		
}


// Page Select
function extractPageName(hrefString)
{
	var arr = hrefString.split('/');
	return  (arr.length < 2) ? hrefString : arr[arr.length-2].toLowerCase() + arr[arr.length-1].toLowerCase();
}
 
function setActiveMenu(arr, crtPage)
{
	for (var i=0; i < arr.length; i++)
	{
		if(extractPageName(arr[i].href) == crtPage)
		{
			if (arr[i].parentNode.tagName != "td")
			{
				arr[i].className = "selected";
				//arr[i].parentNode.className = "selected";
			}
		}
	}
}
 
function setPage()
{
	hrefString = document.location.href ? document.location.href : document.location;
 
	if (document.getElementById("nav") !=null )
	setActiveMenu(document.getElementById("nav").getElementsByTagName("a"), extractPageName(hrefString));
}
