﻿function changeFontSize(crement){
	if(document.getElementById('description-cell')){
		var theCell = document.getElementById('description-cell');
		var newFontSize = getNewFS(theCell,crement);
		theCell.style.fontSize = newFontSize;
	}
	if(document.getElementById('image-cell')){
		var theCell = document.getElementById('image-cell');
		var newFontSize = getNewFS(theCell,crement);
		theCell.style.fontSize = newFontSize;
	}
	if(document.getElementById('comment-cell')){
		var theCell = document.getElementById('comment-cell');
		var newFontSize = getNewFS(theCell,crement);
		theCell.style.fontSize = newFontSize;
	}
	if(document.getElementById('comment_div')){
		var theCell = document.getElementById('comment_div');
		var newFontSize = getNewFS(theCell,crement);
		theCell.style.fontSize = newFontSize;
	}
	if(document.getElementById('text_size')){
		var theCell = document.getElementById('text_size');
		var newFontSize = getNewFS(theCell,crement);
		theCell.style.fontSize = newFontSize;
	}
	if(crement == 1){
		theFontSize = 12;
		//theFontSize = theFontSize + 1;
	}
	else if(crement == 0){
		theFontSize = theFontSize + 1;
		//theFontSize = theFontSize - 1;
	}
	setCookie('settings',parseInt(theFontSize) + '|' + tt_Enabled)
}

function getNewFS(theCell,crement){
	var oFontSize;
	if( window.getComputedStyle ) {
		oFontSize = window.getComputedStyle(theCell,null).fontSize;
	} else if( theCell.currentStyle ) {
		oFontSize = theCell.currentStyle.fontSize;
	}
	if(crement == 1){
		var newFontSize = '12px';
		//var newFontSize = (parseInt(oFontSize) + 1) + 'px';
	}
	else if(crement == 0){
		var newFontSize = (parseInt(oFontSize) + 1) + 'px';
		//var newFontSize = (parseInt(oFontSize) - 1) + 'px';
	}
	else{
		var newFontSize = crement + 'px';
	}
	return newFontSize;
}

function toggleTT(){
	if(tt_Enabled){
		tt_Enabled = false;
		UnTip();
	}
	else{
		tt_Enabled = true;
		Tip(T_info, DELAY, 0);
	}
	setCookie('settings',parseInt(theFontSize) + '|' + tt_Enabled)
}


if(cookieArray[1] == 'false'){
	tt_Enabled = eval(cookieArray[1]);
}

changeFontSize(theFontSize);


