﻿var FunctionBar={	
	opened:0,	
	openAdd:function(q){
		var el=$(q);
		if(FunctionBar.opened==0){
			el.style.visibility="visible";
			FunctionBar.opened=1
		}else{
			el.style.visibility="hidden";
			FunctionBar.opened=0
		}
	},
	openPrint:function(pagename){
		var path="http://www.formazzasport.com/printTemplate/"+pagename+"?p=1";
		window.open(path, "printPopup", "width=630,scrollbars=yes");
	},
	addbookmark:function(){
		if(document.all){
			window.external.AddFavorite (location.href,document.title);
		}else if(window.sidebar){
			window.sidebar.addPanel(document.title, location.href, "");
		}
	}	
};

function trim(stringa){
	while (stringa.substring(0,1) == ' '){
		stringa = stringa.substring(1, stringa.length);
	}
	while (stringa.substring(stringa.length-1, stringa.length) == ' '){
		stringa = stringa.substring(0,stringa.length-1);
	}
	return stringa;
}

function h(){
	location.href="index.php";
}
function hh(){
	location.href="../index.php";
}


function c(cn) {
	var temp=new Array();
	var co=0;
	var aht=document.getElementsByTagName("*");
	for(i=0; i<aht.length; i++){
		if (aht[i].className==cn) {
			temp[co]=aht[i];
			co++;
		}
	}
	return temp;
}


function è(obj, evType, fn){ 
	if (obj.addEventListener){ 
		obj.addEventListener(evType, fn, false); 
		return true; 
	} else if (obj.attachEvent){ 
		var r = obj.attachEvent("on"+evType, fn); 
		return r; 
	} else { 
		return false; 
	} 
}

function a(){
	var req=null;
	try{
		req=new XMLHttpRequest();
	}catch(e1){
		try{
			req=new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e2){
			try{
				req=new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e3){
				req=false;
			}
		}
	}
	return req;
}

function $(id){return document.getElementById(id);}

function hilight(el){$(el).style.color='#F60';}
