// global vars, functions for tnt webdesigns site

var site_version = "06.70.01";

function get_copyRight(holder) {
	lastmod = document.lastModified;
	d = new Date(lastmod);
	day = d.getDate();
	
	if (day < 10) {
		day = "0" + day;
	}
	month = d.getMonth() +1;
	if (month < 10) {
		month = "0" + month;
	}
	
	year = d.getYear();
	year = year.toString();
	temp = year.charAt(0);
	if (temp == "1") {
		year = year.replace(/1/,"20");
	}
	return  "copyright &copy "+month+"."+day+"."+year+" "+holder ; 

}

function get_short_copyRight(holder) {
	lastmod = document.lastModified;
	d = new Date(lastmod);
	
	year = d.getYear();
	year = year.toString();
	temp = year.charAt(0);
	if (temp == "1") {
		year = year.replace(/1/,"20");
	}
	return  "copyright &copy "+year+" "+holder ; 

}


function showSubMenu(clue) {

	if (clue == "about") {

		// show about menu

		window.top.frames["tnt_sub"].location.href="tnt_sub_about.html";

	} else if (clue == "portfolio") {

		//show portfolio menu
		window.top.frames["tnt_sub"].location.href="tnt_sub_portfolio.html";

	} else {
	
		//show blank menu
		window.top.frames["tnt_sub"].location.href="tnt_sub_blank.html";

	}

}




function loadPage(clue) {

	switch (clue) {
		
		case "company" : 		window.top.frames["tnt_mid"].location.href="tnt_about_company.html"; break;
		case "policy" : window.top.frames["tnt_mid"].location.href="tnt_about_policy.html"; break;
		case "site" : window.top.frames["tnt_mid"].location.href="tnt_about_site.html"; break;
		case "awards" : window.top.frames["tnt_mid"].location.href="tnt_about_awards.html"; break;
		case "websites" : window.top.frames["tnt_mid"].location.href="tnt_portfolio_ws.html"; break;
		case "digitalgraphics" : window.top.frames["tnt_mid"].location.href="tnt_portfolio_dg.html"; break;
		case "photographics" : window.top.frames["tnt_mid"].location.href="tnt_portfolio_pg.html"; break;

	}

}

var maxFontSize = 13;
var minFontSize = 7;
var curFontSize = 10;
var curFontFace = 0;
var curFontColor = 0;
var familyArray = new Array('arial,helvetica,san-serif','times,"Times roman",serif','"courier new"');
var colorArray = new Array('#cbb175','#dcc286','#edd397','#FEE4A8','ffffff');


function changeFontSize(id,direction) {

	if (document.getElementById) {

		curFontSize = top.sessionFontSize;

		if (direction == "up") {
			if (curFontSize < maxFontSize) {
				curFontSize++;
			}

		} else {
			if (curFontSize > minFontSize) {
				curFontSize--;
			}
		}
		tnt_mid.document.getElementById(id).style.fontSize = curFontSize+"pt";

		aLength = tnt_mid.document.links.length;
		if (aLength > 0) {
			for (i = 1; i <= aLength; i++) {
				tnt_mid.document.links[i-1].style.fontSize = curFontSize+"pt";
			}
		}

		top.sessionFontSize = curFontSize;

	} else {
		return;
	}

}


function changeFontFace(id) {

	if (document.getElementById) {

		curFontFace = top.sessionFontFace;

		if (curFontFace < familyArray.length - 1) {
			curFontFace++;
		} else {
			curFontFace = 0;
		}
		tnt_mid.document.getElementById(id).style.fontFamily = familyArray[curFontFace];
		aLength = tnt_mid.document.links.length;
		if (aLength > 0) {
			for (i = 1; i <= aLength; i++) {
				tnt_mid.document.links[i-1].style.fontFamily = familyArray[curFontFace];
			}
		}
		top.sessionFontFace = curFontFace;

	} else {
		return;
	}
}



function changeFontColor(id) {

	if (document.getElementById) {

		curFontColor = top.sessionFontColor;

		if (curFontColor < colorArray.length - 1) {
			curFontColor++;
		} else {
			curFontColor = 0;
		}
		tnt_mid.document.getElementById(id).style.color = colorArray[curFontColor];
		top.sessionFontColor = curFontColor;

	} else {
		return;
	}
}


function hideFontManager(id,state) {

	if (document.getElementById) {

		if (state == "show") {
			top.document.getElementById('font_manager').style.visibility = 'visible';
			
			document.getElementById(id).style.fontSize = top.sessionFontSize+"pt";
			document.getElementById(id).style.fontFamily = familyArray[top.sessionFontFace];
			document.getElementById(id).style.color = colorArray[top.sessionFontColor];
			aLength = document.links.length;
			if (aLength > 0) {
				for (i = 1; i <= aLength; i++) {
					document.links[i-1].style.fontSize = top.sessionFontSize+"pt";
					document.links[i-1].style.fontFamily = familyArray[top.sessionFontFace];
				}
			}			
			
		}
		else {
			top.document.getElementById('font_manager').style.visibility = 'hidden';
		}


	} else {
		return;
	}
}

