// JavaScript Document

var min = 11;

var max = 13;

// from seandempsey.com
function getElementsByClass(theClass) 
{
    var allPageTags = new Array();

    //Populate the array with all the page tags
    allPageTags=document.getElementsByTagName("*");
	
    var Elements = new Array();

    //Cycle through the tags
    var n = 0;
	
    for (i=0; i<allPageTags.length; i++)
	{
        //Pick out the tags with our class name
        if (allPageTags[i].className==theClass) 
		{
            Elements[n] = allPageTags[i];
            n++;
        }
    }

    return Elements;
}

function increaseFontSizeT() 
{
	var p4 = document.getElementById('contentMainTag');
	if (p4.style.fontSize) 
	{
		var s4 = parseInt(p4.style.fontSize.replace("px",""));
	} 
	else 
	{
		var s4 = 12;
	}
	
	if(s4 != max)
	{
		s4 += 1;
	}
	p4.style.fontSize = s4 + "px";
}

function decreaseFontSizeT() 
{
	var p4 = document.getElementById('contentMainTag');

	if (p4.style.fontSize) 
	{
		var s4 = parseInt(p4.style.fontSize.replace("px",""));
	} 
	else 
	{
		var s4 = 12;
	}
	
	if (s4 != min)
	{
		s4 -= 1;
	}
	
	p4.style.fontSize = s4 + "px";
}



function increaseFontSize() 
{
	var p = document.getElementById('contentInfo');
	
	var p1 = getElementsByClass('articleTitle');
	
	var p2 = getElementsByClass('firstArticleTitle');
	
	var p3 = getElementsByClass('title');
	
	if (p.style.fontSize) 
	{
		var s = parseInt(p.style.fontSize.replace("px",""));
	} 
	else 
	{
		var s = 12;
	}
	
	if(s != max)
	{
		s += 1;
	}
	
	p.style.fontSize = s + "px";
	
	for (i=0; i<p1.length; i++) 
	{
		if(p1[i].style.fontSize) 
		{
			var s1 = parseInt(p1[i].style.fontSize.replace("px",""));
		} 
		else 
		{
			var s1 = 12;
		}
		
		if(s1 != max) 
		{
			s1 += 1;
		}
		
		p1[i].style.fontSize = s1 + "px";
	}
	
	for (i=0; i<p2.length; i++) 
	{
		if(p2[i].style.fontSize) 
		{
			var s2 = parseInt(p2[i].style.fontSize.replace("px",""));
		} 
		else 
		{
			var s2 = 12;
		}
		
		if(s2 != max) 
		{
			s2 += 1;
		}
		
		p2[i].style.fontSize = s2 + "px";
	}
	
	for (i=0; i<p3.length; i++) 
	{
		if(p3[i].style.fontSize) 
		{
			var s3 = parseInt(p3[i].style.fontSize.replace("px",""));
		} 
		else 
		{
			var s3 = 12;
		}
		
		if(s3 != max) 
		{
			s3 += 1;
		}
		
		p3[i].style.fontSize = s3 + "px";
	}
}


function decreaseFontSize() 
{
	var p = document.getElementById('contentInfo');
	
	var p1 = getElementsByClass('articleTitle');
	
	var p2 = getElementsByClass('firstArticleTitle');
	
	var p3 = getElementsByClass('title');
	
	if(p.style.fontSize) 
	{
		var s = parseInt(p.style.fontSize.replace("px",""));
	} 
	else 
	{
		var s = 12;
	}
	
	if(s != min) 
	{
		s -= 1;
	}
	
	p.style.fontSize = s + "px";
	
	for (i=0; i<p1.length; i++) 
	{
		if(p1[i].style.fontSize) 
		{
			var s1 = parseInt(p1[i].style.fontSize.replace("px",""));
		} 
		else 
		{
			var s1 = 12;
		}
		
		if(s1 != min) 
		{
			s1 -= 1;
		}
		
		p1[i].style.fontSize = s1 + "px";
	}
	
	for (i=0; i<p2.length; i++) 
	{
		if(p2[i].style.fontSize) 
		{
			var s2 = parseInt(p2[i].style.fontSize.replace("px",""));
		} 
		else 
		{
			var s2 = 12;
		}
		
		if(s2 != min)  
		{
			s2 -= 1;
		}
		
		p2[i].style.fontSize = s2 + "px";
	}
	
	for (i=0; i<p3.length; i++) 
	{
		if(p3[i].style.fontSize) 
		{
			var s3 = parseInt(p3[i].style.fontSize.replace("px",""));
		} 
		else 
		{
			var s3 = 12;
		}
		
		if(s3 != min)  
		{
			s3 -= 1;
		}
		
		p3[i].style.fontSize = s3 + "px";
	}
	
}