function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function openNewScrolledWindow(target, sizeX, sizeY) {
	LeftPosition = (screen.width) ? (screen.width-sizeX)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-sizeY)/2 : 0;
	window.open(target,'_blank','menubar=false,scrollbars=yes,resizable=yes,top='+TopPosition+',left='+LeftPosition+',width='+sizeX+',height='+sizeY);
}
function openNewWindow(target, sizeX, sizeY) {
	LeftPosition = (screen.width) ? (screen.width-sizeX)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-sizeY)/2 : 0;
	window.open(target,'_blank','toolbar=no,menubar=no,scrollbars=no,resizable=yes,top='+TopPosition+',left='+LeftPosition+',width='+sizeX+',height='+sizeY);
}	
function reloadWindow(){
	window.opener.location.reload();
}
function confirmSubmission(msg){
	if (confirm(msg) == true)
		return true;
	else
		return false;
}
function getPreviousYear(howManyYears) {
    var d = new Date();
    return (d.getFullYear()-howManyYears);
}
function getCurrentYear(){
	var d = new Date();
	return(d.getFullYear());
}
function getYearsEstablished(){
	return('1986');
}
function getYearsExperience(){
	//Set the two dates
	var startingdate=new Date(1981, 1, 1) // Founded: February 1980 but we'll use February, 1981 in calculation (Month is 0-11 in JavaScript)
	var today=new Date()
	
	//Get 1 day in milliseconds
	var one_day=1000*60*60*24
	var one_year=one_day*365
	
	//Calculate difference btw the two dates, and convert to days
	var year_exp = Math.ceil((today.getTime()-startingdate.getTime())/(one_year))
	
	return year_exp;
}
function fullScreen(theURL) {
    window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
}
function increaseFontSize(defaultMax) {    
    if (!defaultMax) { //if var is null
        defaultMax = 18; //default max from function call should be 18 (pixel)
    } else {
        if (defaultMax == "") { // var not null, but empty string
            defaultMax = 18;
        }
    }
    var td = document.getElementsByTagName('td');//change font size of "td" tag
    for (i = 0; i < td.length; i++) {
        if (td[i].style.fontSize) {
            var s = parseInt(td[i].style.fontSize.replace("px", ""));
        } else {
            var s = 12;
        }
        if (s != defaultMax) {
            s += 1;
        }
        td[i].style.fontSize = s + "px"
        //alert(td[i].style.fontSize = s + "px");
    }
}
function decreaseFontSize(defaultMin) {
        if (!defaultMin) { //if var is null
            defaultMin = 8; //default min from function call should be 8 (pixel)
    } else {
        if (defaultMin == "") { // var not null, but empty string
            defaultMin = 18;
        }
    }
    var td = document.getElementsByTagName('td'); //change font size of "td" tag
    for (i = 0; i < td.length; i++) {
        if (td[i].style.fontSize) {
            var s = parseInt(td[i].style.fontSize.replace("px", ""));
        } else {
            var s = 12;
        }
        if (s != defaultMin) {
            s -= 1;
        }
        td[i].style.fontSize = s + "px"
    }
}
