// JavaScript Document
function show(div,current) {
	for(i=1;i<5;i++) {
		if(i!=current) {
			document.getElementById('sm'+i).style.visibility='hidden';
		}
	}
	document.getElementById(div).style.visibility='visible';
}

function emptySearchForm(keywords) {
	if(document.searchForm.keywords.value==keywords) {
		document.searchForm.keywords.value='';
	}
}

function showPanel(target) {
	allDivs=target.parentNode.parentNode.parentNode.parentNode;
	for(i=0;i<allDivs.childNodes.length;i++) {
		allDivs.childNodes[i].childNodes[2].innerHTML='';
	}
	target.parentNode.parentNode.parentNode.childNodes[2].innerHTML=target.parentNode.parentNode.parentNode.childNodes[0].innerHTML;
}
function switchTeamPict(target,filename) {
		target.parentNode.parentNode.childNodes[1].childNodes[0].className='team2';
		target.parentNode.parentNode.childNodes[0].childNodes[0].className='team2';
		document.getElementById('teamPict').src="datas/team/"+filename;
}
function clearTeam() {
	List=document.getElementsByTagName('a');
		i=0;
		while(List[i]) {
			if(List[i].className=='team2') {
				List[i].className='team';
			}
			i++;
		}
}
function cleanStyles() {
	tags=Array("p","tr","td","span","br");
	for(i=0;i<tags.length;i++) {
		List=document.getElementById('content').getElementsByTagName(tags[i]);
		t=0;
		while(List[t]) {
			if(List[t].className!='' && List[t].className!='search') {
				List[t].className=null;
			}
			if(List[t].getAttribute('style')) {
				List[t].setAttribute('style','');
			}
			t++;
		}
	}
}
function initialize() {	
}
function GUnload() {
}
function flashEnd(a) {
	document.getElementById('baseline').innerHTML="<div style='width:100%;text-align:center'><img src='medias/flash_baseline.png' /></div>";
}
function getQuote() {
	ajax.requestFile = "http://www.montea.com/getquote.php";
	ajax.method = 'get';
	ajax.element = 'quote';
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;
	ajax.runAJAX();
}
function whenLoading(){
	var e = document.getElementById('quote'); 
	//e.innerHTML = "Loading data...";
}
function whenLoaded(){
	var e = document.getElementById('quote'); 
	//e.innerHTML = "Data Sent...";
}
function whenInteractive(){
	var e = document.getElementById('quote'); 
	//e.innerHTML = "getting data...";
}
function whenCompleted(){
	var e = document.getElementById('quote'); 
	if (ajax.responseStatus){
		//
	} else {
		//
	}
	//e.innerHTML = string+"-";	
}
function doit(){
	//var form = document.getElementById('form');
	//ajax.setVar("myTextBox", form.mytext.value); // recomended method of setting data to be parsed.
	ajax.requestFile = "test.php";
	ajax.method = form.method.value;
	ajax.method = 'get';
	ajax.element = 'replaceme';
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;
	//ajax.runAJAX();
}