// JavaScript Document
function GetCurrentPageName() {
var sPath = window.location.pathname;
var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
return sPage.toLowerCase()
}

$(document).ready(function() {
	var oneToLoad = GetCurrentPageName();
	var x;
	var y;
	
	switch(oneToLoad){
		case "home-audit-assurance":
			x = ".one";
			y = "#content1";
			break;
		case "home-tax-legal":
			x = ".two";
			y = "#content2";
			break;
		case "home-accounting-outsourcing":
			x = ".three";
			y = "#content3";
			break;
		case "home-corporate-secretarial":
			x = ".four";
			y = "#content4";
			break;
		case "home-management-consulting":
			x = ".five";
			y = "#content5";
			break;
		case "home-business-recovery":
			x = ".six";
			y = "#content6";
			break;
		case "introduction":
			x = ".one";
			y = "#content1";
			break;
		case "our-mission-values":
			x = ".two";
			y= "#content2";
			break;
		default:
			x=".one";
			y="#content1";
			break;
	}					   

	//When page loads...
	$(".contentWrapper").hide(); //Hide all content
	$("ul.idTabs li:" + x).addClass("active").show(); //Activate first tab
	$(".contentWrapper:" + y).show(); //Show first tab content

	//On Click Event
	$("ul.idTabs li").click(function() {

		$("ul.idTabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".contentWrapper").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});	
});

$(document).ready(function() {
	var oneToLoad = GetCurrentPageName();
	var x;
	var y;
	
	switch(oneToLoad){
		case "services-audit-assurance":
			x = ".s1";
			y = "#scontent1";
			break;
		case "services-tax-legal":
			x = ".s2";
			y = "#scontent2";
			break;
		case "services-accounting-outsourcing":
			x = ".s3";
			y = "#scontent3";
			break;
		case "services-corporate-secretarial":
			x = ".s4";
			y = "#scontent4";
			break;
		case "services-management-consulting":
			x = ".s5";
			y = "#scontent5";
			break;
		case "services-business-recovery":
			x = ".s6";
			y = "#scontent6";
			break;
		case "general-accounting":
			x = ".s3";
			y = "#scontent7";
			break;
		default:
			x=".s1";
			y="#scontent1";
			break;
	}					   					   
						   
	$(".servicesContentWrapper").hide(); //Hide all content
	$("ul.sidTabs li:." + x).addClass("active").show(); //Activate first tab
	$(".servicesContentWrapper:" + y).show(); //Show first tab content
	
	$("ul.sidTabs li").click(function() {

		$("ul.sidTabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".servicesContentWrapper").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
});

$(document).ready(function() {
	//$(".servicesContentWrapper").hide(); //Hide all content
	//$("ul.sidTabs li:." + x).addClass("active").show(); //Activate first tab
	//$(".servicesContentWrapper:" + y).show(); //Show first tab content
	
	$("ul.accTabs li").click(function() {

		$("ul.accTabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".servicesContentWrapper").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
});

$(document).ready(function() {
	//$(".servicesContentWrapper").hide(); //Hide all content
	//$("ul.sidTabs li:." + x).addClass("active").show(); //Activate first tab
	//$(".servicesContentWrapper:" + y).show(); //Show first tab content
	
	$("ul.backTabs li").click(function() {

		$("ul.backTabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".servicesContentWrapper").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
});

function pdfDownload()
{
var urlindex = document.dForm.dSelect.selectedIndex;
var url = document.dForm.dSelect.options[urlindex].value;

window.open(url,true);
}
