
function intval() {
	var a = arguments;
	var v = a[0];
	var t = typeof(a[0])
	var b = ( (typeof(a[1]) !== 'undefined' && !isNaN(a[1])) ? parseInt(a[1]) : 10 );
	switch (t.substring(0, 1).toLowerCase()) {
	case 'b':
	return ( (v === true) ? 1 : 0 );
	case 's':
	 var r = parseInt(v * 1);
	return ( (!isNaN(v) && isFinite(v)) ? r.toString(b) : 0 );
	case 'n':
	return ( isFinite(v) ? Math.floor(v) : 0 );
	default:
	return 0;
	}
}



	// initialize the jquery code
	$(document).ready(function(){
	// changer links when clicked
	$("a.changer").click(function(){
		//set the div with class mainText as a var called $mainText 
		var $mainText = $('div.testo');
		// set the current font size of .mainText as a var called currentSize
		var currentSize = $mainText.css('font-size');
		// parse the number value out of the font size value, set as a var called 'num'
		var num = parseFloat(currentSize, 10);
		// make sure current size is 2 digit number, save as var called 'unit'
		var unit = currentSize.slice(-2);
		// javascript lets us choose which link was clicked, by ID
		if (this.id == 'linkLarge'){
		num = num * 1.4;
		} else if (this.id == 'linkSmall'){
		num = num / 1.4;
		
		}
		num=parseInt(num);
		// jQuery lets us set the font Size value of the mainText div
		//$mainText.css('font-size', num + unit');
		//$mainText.css('line-height', num + unit');
		//$mainText.css('cssText','font-size:'+num + unit+' !important;');
		//$mainText.css('cssText','line-height:'+ num + unit+' !important;');
		

		//$mainText.css('font-size','32px');
		//$mainText.css('line-height','32px');
		
		// good with ie7 ie8
		$('.testo *').css('font-size', num + unit);
		$('.testo *').css('line-height', num + unit);
		$mainText.css('font-size', num + unit);
		$mainText.css('line-height', num + unit);
		
		
			 return false;
	});
	$("a.changer_new").click(function(){
		//set the div with class mainText as a var called $mainText 
		var $mainText = $('div.testo');
		$my_link=this;
		$('.testo *').each(function() {
			if((this.tagName!='BR')
			&&(this.tagName!='IMG')
			&&(this.tagName!='B')
			&&(this.tagName!='EM')
			&&(this.tagName!='I')
			
			
			) {
			//alert(this.tagName);
			}
			
			// set the current font size of .mainText as a var called currentSize
			var currentSize = $(this).css('font-size');
			// parse the number value out of the font size value, set as a var called 'num'
			var num = parseFloat(currentSize, 10);
			// make sure current size is 2 digit number, save as var called 'unit'
			var unit = currentSize.slice(-2);
			// javascript lets us choose which link was clicked, by ID
			num = num * 1.4;
			num=parseInt(num);
			//if ($my_link.id == 'linkLarge'){
				//num = num * 1.4;
			//} else if ($my_link.id == 'linkSmall'){
				//num = num / 1.4;
			//}
			// jQuery lets us set the font Size value of the mainText div
			$(this).css('font-size', num + unit);
			$(this).css('line-height', num + unit);
    }); 
						 return false;

		
		
	});
	

	// hover for links - toggle css background colors
	$("a.changer").hover(function(){
	$(this).css('background-color', '#0099fb');
	}, function(){
	$(this).css('background-color', '#fff');
	});
	});

