// JavaScript Document

window.addEvent('domready', function() {


//set the cookie
	function setCookie(name, value, expires) { 
		document.cookie = name + "=" + escape(value) + "; path=/" + ((expires == null) ? "" : "; expires=" + expires.toGMTString()); 
	} 
	var exp = new Date();     //set new date object 
	exp.setTime(exp.getTime() + (1000 * 60 * 60 * 24 * 30));     //set it 30 days ahead 	



    var fontSize = $ES('.productCopy');
    if(fontSize.length == 0)
    {
	    fontSize = $ES('.categoryCopy');
    }

    if(fontSize.length >= 0)
    {
	    var fontFx = new Fx.Styles(fontSize[0]);
	    var bigRun = $('bigRun');
	    var smallRun = $('smallRun');

	    $ES('.bigRun').addEvent('click', function() {
		    fontFx.start({
			    'font-size':['12', '16'],
			    'line-height':['18','23'] 
			    });
    			
				setCookie('myCookie','large', exp);

		if(ie == 1){
	    smallRun.className="smallRun";
	    bigRun.className="bigRunActive";
		}
		
		//Firefox doesnt understand className
		$('smallRun').setAttribute("class", "smallRun");
		$('bigRun').setAttribute("class", "bigRunActive");
    	});	
    			
	    $ES('.smallRun').addEvent('click', function() {
		    fontFx.start({
			    'font-size':['16', '12'],
			    'line-height':['23','18']
			    });
			
    			setCookie('myCookie','small', exp);
				
		if(ie == 1){		
	    bigRun.className="bigRun";
	    smallRun.className="smallRunActive";
		}
		//Firefox doesnt understand className
		$('bigRun').setAttribute("class", "bigRun");
		$('smallRun').setAttribute("class", "smallRunActive");
	    });
    }


});