function $(i){return document.getElementById(i);}
function Menu(id){$(id).style.visibility='visible';}
function Hide(id){$(id).style.visibility='hidden';}
function Load(url,id,load){
	var x;
	try{x=new XMLHttpRequest();}
	catch(e){
		try{x=new ActiveXObject("Msxml2.XMLHTTP");}
		catch(e){
			try{x=new ActiveXObject("Microsoft.XMLHTTP");}
			catch(e){return;}
		}
	}
	if(load)$(id).innerHTML='<p><img src="i/loading.gif"/> <strong>You request is loading... please wait</strong></p>';
	x.onreadystatechange=function(){if(x.readyState==4)$(id).innerHTML=x.responseText;}
	x.open("GET",url,true);
	x.send(null);
}
function Date(e,m,y,page){
	var d=parseInt(e.target?e.target.innerHTML:e.srcElement.innerHTML);
	if(d>0)Load(page+'?select='+m+'/'+d+'/'+y,'calendar',1);
}
function Gallery(x,t){
	var c=parseInt($('current').value);
	c=(c+x==0?t:(c+x>t?1:c+x));
	$('gallery').innerHTML='<a href="i/g/'+c+'.jpg"><img src="i/g/t'+c+'.jpg"/></a>';
	$('count').innerHTML=c+' of '+t;
	$('current').value=c;
	$('testimonial').innerHTML=(tm[c]?'<strong>Testimonial:</strong><br/>'+tm[c]:'');
}
