function changeCssFont(action) {

	var appliedCssLinkAttri = $("#appliedCss").attr("href");

	var defcss = appliedCssLinkAttri.substring(appliedCssLinkAttri
			.lastIndexOf("/") + 1, appliedCssLinkAttri.indexOf(".css"));

	if (action == 'zoom') {

		switch (size) {

		case 0:
			currentCss = defcss;
			appliedCssLinkAttri = appliedCssLinkAttri.replace(defcss,
					currentCss + "_1");

			if (!css1Exists) {
				size = 0;
			} else {

				$("#appliedCss").attr( {
					href : appliedCssLinkAttri
				});
				size = 1;
			}

			break;

		case 1:

			appliedCssLinkAttri = appliedCssLinkAttri.replace(defcss,
					currentCss + "_2");

			if (!css2Exists) {
				$("#appliedCss").attr( {
					href : defappliedCssLinkAttri
				});
				size = 0;
			} else {
				$("#appliedCss").attr( {
					href : appliedCssLinkAttri
				});
				size = 2;
			}

			break;

		default:

			appliedCssLinkAttri = appliedCssLinkAttri.replace(defcss,
					currentCss);

			$("#appliedCss").attr( {
				href : appliedCssLinkAttri
			});

			size = 0;

		}
	} else {

var css1 = appliedCssLinkAttri.replace(defcss, defcss + "_1");
//preload(css1);
document.write('<link id="css1link" rel="stylesheet" media="braille" href="' + css1 + '" type="text/css"> ');
					
var css2 = appliedCssLinkAttri.replace(defcss, defcss + "_2");
document.write('<link id="css1link" rel="stylesheet" media="braille" href="' + css2 + '" type="text/css"> ');


		/*
		//preload all css

		//load css1

		var css1 = appliedCssLinkAttri.replace(defcss, defcss + "_1");
		css1Exists = UrlExists(css1);

		if (css1Exists) {

			//if css1 exists load css2
			var css2 = appliedCssLinkAttri.replace(defcss, defcss + "_2");
			css2Exists = UrlExists(css2);

		}

		if (css1Exists) {

			//$("head").append($("<link id='css1link' rel='stylesheet' href='"+css1+"' type='text/css' />"));
			document
					.write('<link id="css1link" rel="stylesheet" href="' + css1 + '" type="text/css">');
			var css1link = document.getElementById('css1link');
			css1link.disabled = true;

		}

		if (css2Exists) {

			//$("head").append($("<link id='css2link' rel='stylesheet' href='"+css2+"' type='text/css' />"));

			document
					.write('<link id="css2link" rel="stylesheet" href="' + css2 + '" type="text/css">');
			var css2link = document.getElementById('css2link');
			css2link.disabled = true;

		}
*/
	}
}

//------------------other approach------------------------
var lowcount = 1;
var upcount = 3;
var count = 0;

function changeFont() {
	//alert(count);
	var y = document.getElementById('panel0');
	var currsize = 0;

	if (!y.style.fontSize) {
		currsize = 1;
		//alert('set initial font size '+currsize);				

	} else {

		currsize = parseFloat(y.style.fontSize);
		//alert("default size "+currsize);	
	}

	if (count != upcount) {
		count += 1;
		//alert(count);
		y.style.fontSize = currsize + 0.1 + "em";

	} else {
		count = 0;
		y.style.fontSize = 1 + "em";
		//alert(count);	
	}

}
//------------------other approach------------------------
function UrlExists(urls) {

	var ret=false;

			$.ajax({
				  url: urls,
				cache: false,
					  async:false,
					  type:'GET',
			complete: function(status){
				if(status.status==200){
					ret= true;
				}
				else {
					ret= false;
					}			
			}

		});

			/*var http = new XMLHttpRequest();
			http.open('HEAD', url, false);
			http.send();
			return http.status != 404;*/
return ret;
}
