var activeid = "";
var firststat=0;
$(document).ready(function() {

	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {
		
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").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
		set_height_index();
		return false;
	});
	
	
	
	
	
	
	//When page loads...
	$(".tab_content1").hide(); //Hide all content
	$("ul.tabs1 li:first").addClass("active").show(); //Activate first tab
	$(".tab_content1:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs1 li").click(function() {
		
		$("ul.tabs1 li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content1").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
		set_height_index();
		return false;
	});
	
	

});

function fun_show_article_blog_application()
{
	firststat=1
	document.getElementById("newsarticle").style.display="none";
	document.getElementById("newsid").style.borderBottom = "none";
	document.getElementById("newsid").style.color = "#666666";
	
	document.getElementById("blogarticle").style.display="block";
	document.getElementById("blogid").style.borderBottom = "5px solid #505050";
	document.getElementById("blogid").style.color = "#000000";
	activeid = "blogid";
}

function funchangestyle_blog()
{
	document.getElementById("blogid").style.borderBottom = "5px solid #505050";
	document.getElementById("blogid").style.color = "#000000";
}

function funchangestyle1_blog()
{	
		if (activeid != "blogid")
		{
			document.getElementById("blogid").style.borderBottom = "none";
			document.getElementById("blogid").style.color = "#666666";
		}
}

function fun_show_article_news_application()
{	
	firststat=1
	document.getElementById("blogarticle").style.display="none";
	document.getElementById("blogid").style.borderBottom = "none";
	document.getElementById("blogid").style.color = "#666666";	
	
	document.getElementById("newsarticle").style.display="block";
	document.getElementById("newsid").style.borderBottom = "5px solid #505050";
	document.getElementById("newsid").style.color = "#000000";
	activeid = "newsid";
}
/////////
function fun_show_article_blog()
{
	document.getElementById('bamore').href="http://blog.treselle.com";
	firststat=1
	document.getElementById("newsarticle").style.display="none";
	document.getElementById("newsid").style.borderBottom = "none";
	document.getElementById("newsid").style.color = "#666666";

	document.getElementById("pdfarticle").style.display="none";
	document.getElementById("pdfid").style.borderBottom = "none";
	document.getElementById("pdfid").style.color = "#666666";	
	
	document.getElementById("blogarticle").style.display="block";
	document.getElementById("blogid").style.borderBottom = "5px solid #505050";
	document.getElementById("blogid").style.color = "#000000";
	activeid = "blogid";
}

function fun_show_article_news()
{	
	document.getElementById('bamore').href="resources/article.html";	
	firststat=1
	document.getElementById("blogarticle").style.display="none";
	document.getElementById("blogid").style.borderBottom = "none";
	document.getElementById("blogid").style.color = "#666666";
	
	document.getElementById("pdfarticle").style.display="none";
	document.getElementById("pdfid").style.borderBottom = "none";
	document.getElementById("pdfid").style.color = "#666666";		
	
	document.getElementById("newsarticle").style.display="block";
	document.getElementById("newsid").style.borderBottom = "5px solid #505050";
	document.getElementById("newsid").style.color = "#000000";
	activeid = "newsid";
}

function fun_show_article_pdf() //newsarticle,blogarticle,pdfarticle   // blogid, newsid, pdfid
{	
	document.getElementById('bamore').href="resources/index.html";	
	firststat=1
	document.getElementById("blogarticle").style.display="none";
	document.getElementById("blogid").style.borderBottom = "none";
	document.getElementById("blogid").style.color = "#666666";	
	
	document.getElementById("newsarticle").style.display="none";
	document.getElementById("newsid").style.borderBottom = "none";
	document.getElementById("newsid").style.color = "#666666";	
	
	document.getElementById("pdfarticle").style.display="block";
	document.getElementById("pdfid").style.borderBottom = "5px solid #505050";
	document.getElementById("pdfid").style.color = "#000000";
	activeid = "pdfid";
}
//////////////


function funchangestyle_news()
{
	document.getElementById("newsid").style.borderBottom = "5px solid #505050";
	document.getElementById("newsid").style.color = "#000000";
}

function funchangestyle1_news()
{
	if (activeid != "newsid")
	{
		document.getElementById("newsid").style.borderBottom = "none";
		document.getElementById("newsid").style.color = "#666666";
	}
}
////////////////////////
function funchangestyle_pdf()
{
	document.getElementById("pdfid").style.borderBottom = "5px solid #505050";
	document.getElementById("pdfid").style.color = "#000000";
}

function funchangestyle1_pdf()
{
	if (firststat==1)
	{
		if (activeid != "pdfid")
		{
			document.getElementById("pdfid").style.borderBottom = "none";
			document.getElementById("pdfid").style.color = "#666666";
		}
	}
}
///////////////////











/************ for why treselle box ****/

var activeid1 = "";
var firststat1=0;


function funchangestyle_whyus()
{
	document.getElementById("whyusid").style.borderBottom = "5px solid #505050";
	document.getElementById("whyusid").style.color = "#000000";
}

function funchangestyle1_whyus()
{	
		if (firststat1==1)
		{
		if (activeid1 != "whyusid")
		{
			document.getElementById("whyusid").style.borderBottom = "none";
			document.getElementById("whyusid").style.color = "#666666";
		}
		}
}


/////////
function fun_show_article_whyus()
{
	
	document.getElementById('waysmore').href="whyus.html";
	firststat1=1
	document.getElementById("solutionsarticle").style.display="none";
	document.getElementById("solutionsid").style.borderBottom = "none";
	document.getElementById("solutionsid").style.color = "#666666";

	document.getElementById("yourrolearticle").style.display="none";
	document.getElementById("yourroleid").style.borderBottom = "none";
	document.getElementById("yourroleid").style.color = "#666666";	
	
	document.getElementById("whyusarticle").style.display="block";
	document.getElementById("whyusid").style.borderBottom = "5px solid #505050";
	document.getElementById("whyusid").style.color = "#000000";
	activeid1 = "whyusid";
	set_height_index();
}

function fun_show_article_solutions()
{	
	document.getElementById('bamore').href="resources/article.html";	
	firststat1=1
	document.getElementById("whyusarticle").style.display="none";
	document.getElementById("whyusid").style.borderBottom = "none";
	document.getElementById("whyusid").style.color = "#666666";
	
	document.getElementById("yourrolearticle").style.display="none";
	document.getElementById("yourroleid").style.borderBottom = "none";
	document.getElementById("yourroleid").style.color = "#666666";		
	
	document.getElementById("solutionsarticle").style.display="block";
	document.getElementById("solutionsid").style.borderBottom = "5px solid #505050";
	document.getElementById("solutionsid").style.color = "#000000";
	activeid1 = "solutionsid";
		set_height_index();
}

function fun_show_article_yourrole() //newsarticle,blogarticle,pdfarticle   // blogid, newsid, pdfid
{	
	document.getElementById('waysmore').href="yourneeds.html";	
	firststat1=1
	document.getElementById("whyusarticle").style.display="none";
	document.getElementById("whyusid").style.borderBottom = "none";
	document.getElementById("whyusid").style.color = "#666666";
	
	document.getElementById("solutionsarticle").style.display="none";
	document.getElementById("solutionsid").style.borderBottom = "none";
	document.getElementById("solutionsid").style.color = "#666666";	
	
	document.getElementById("yourrolearticle").style.display="block";
	document.getElementById("yourroleid").style.borderBottom = "5px solid #505050";
	document.getElementById("yourroleid").style.color = "#000000";
	activeid1 = "yourroleid";
		set_height_index();
}
//////////////


function funchangestyle_solutions()
{
	document.getElementById("solutionsid").style.borderBottom = "5px solid #505050";
	document.getElementById("solutionsid").style.color = "#000000";
}

function funchangestyle1_solutions()
{
	if (activeid1 != "solutionsid")
	{
		document.getElementById("solutionsid").style.borderBottom = "none";
		document.getElementById("solutionsid").style.color = "#666666";
	}
}
////////////////////////
function funchangestyle_yourrole()
{
	document.getElementById("yourroleid").style.borderBottom = "5px solid #505050";
	document.getElementById("yourroleid").style.color = "#000000";
}

function funchangestyle1_yourrole()
{
	
	
		if (activeid1 != "yourroleid")
		{
			document.getElementById("yourroleid").style.borderBottom = "none";
			document.getElementById("yourroleid").style.color = "#666666";
		}
	 
}
///////////////////

/******* why treselle box ends here ***/
