var Resize = 0

		function Size_Alter(i){
			// actually alter the size of things on the page
			Resize= (Resize*1)+(i*1);
			Font_Tags_Resize(i);
//			Document_Body_Resize(i);
			Alter_Span_Tags(i);
			Alter_Anchor_Tags(i);
			setStuff();
		}

		function Font_Tags_Resize(i){
			// CMS font tags need to be resized !
			var fonts = document.getElementsByTagName('font');
			for(var j=0;j<fonts.length;j++){
				if(fonts[j].size!=''){
					fonts[j].size=(fonts[j].size*1)+(i*1);
				} 
			}
		}
		
		function Document_Body_Resize(i){
			// standard body stuff
			iValue=document.body.style.fontSize.replace('%','');
			document.getElementById('img_Smaller').style.display='inline';
			document.getElementById('img_Larger').style.display='inline';
			if (iValue==''){iValue='75';}
			if(iValue<=50){iValue='50';}
			if(iValue>=120){iValue='120';}
			if(iValue<60){document.getElementById('img_Smaller').style.display='none';}
			if(iValue>110){document.getElementById('img_Larger').style.display='none';}
			document.body.style.fontSize = (1*iValue) + (10*(i*1))+ '%';
		}
		
function Alter_Span_Tags(i){
			// for any span entries in the content
			var spans = document.getElementsByTagName('spans');
			for(var j=0;j<spans.length;j++){
				if(spans[j].style.fontSize!=''){
				}
			}
		}
		
function Alter_Anchor_Tags(i){
			// for any span entries in the content
			var anc = document.getElementsByTagName('a');
			
			for(var j=0;j<anc.length;j++){
				if(anc[j].style.fontSize!=''){
					// is this em ?
					var str = anc[j].style.fontSize
					if(str.indexOf('em')>-1){
						str = str.replace('em','')
						str = (1*str)+(i*0.1);
						if(str>1.4){str=1.4}
						if(str<0.7){str=0.7}
						anc[j].style.fontSize= str+'em'
					}
				}
			}
		}		
		
function setCookie(name,value){
			// set the cookie
			var dtm = new Date();dtm.setTime(dtm.getTime()+(2592000000));
			document.cookie= name+'='+value+'; expires='+dtm.toGMTString()+'; path=/';
		}
		
function setStuff(){
			// function used to stop the daft ie error
			setCookie('sft_resize',Resize);
}			
		
function readStuff(){
			// function used to stop the daft ie error
			readCookie('sft_resize');
			Font_Tags_Resize(Resize);
			Alter_Span_Tags(Resize);			
			Alter_Anchor_Tags(Resize);
}		

function readCookie(name){
			// read the cookie
			var cookie_split = document.cookie.split(';');
			for (var i=0;i<cookie_split.length;i++){
				var spl = cookie_split[i].split('=');
				switch (spl[0].replace(' ','')) { 
					case 'sft_resize':
						Resize=spl[1];
						break;
				}
			}
		}

readStuff();
