var gcstrResultFootballURL = 'http://www.football.ch/acvf/nis/ls/res.asp?' ;
var gcstrCalendarFootballURL = 'http://www.football.ch/acvf/nis/ls/plan.asp?' ;

function FCCransResult_Show (ls, sg) {
//----------------------------------------------//
// Creation Date : 21/08/2001					//
// Created By    : KGris						//
//----------------------------------------------//

	var strURL = gcstrResultFootballURL + strFootballWebSite_Parameters ( null, ls, sg, null, null ) ;
	// window.document.location.href = strURL ;
	window.open (strURL) ;
}

function FCCransCalendar_Show (ls, sg) {
//----------------------------------------------//
// Creation Date : 21/08/2001					//
// Created By    : KGris						//
//----------------------------------------------//

	var strURL = gcstrCalendarFootballURL + strFootballWebSite_Parameters ( null, ls, sg, null, null ) ;
	// window.document.location.href = strURL ;
	window.open (strURL) ;
}

function strFootballWebSite_Parameters ( sp , ls , sg , or , vid ) {
//----------------------------------------------//
// Creation Date : 21/08/2001					//
// Created By    : KGris						//
//----------------------------------------------//

	var strParameterQueries  = '' ;
	strParameterQueries += 'sp=' + ((sp == null)? 2 : sp) ;
	strParameterQueries += '&ls=' + ((ls == null)? 0 : ls) ;
	strParameterQueries += '&sg=' + ((sg == null)? 0 : sg) ;
	strParameterQueries += '&or=' + ((or == null)? 'acvf' : or) ;
	strParameterQueries += '&vid=' + ((vid == null)? 1058 : vid) ;
	return strParameterQueries ;
}

var gintLastPlayerDisplay = 0 ;

function FCCransPlayer_DisplayInfo (objElt, intPlayerNber) {
//----------------------------------------------//
// Creation Date : 22/08/2001					//
// Created By    : KGris						//
//----------------------------------------------//
	var objDocument = objElt.document ;
	var objPlayer = objDocument.getElementById ('player_' + intPlayerNber) ;
	if (objPlayer == null) {return false ;}
	if (gintLastPlayerDisplay != 0) {
		var objOldPlayer = objDocument.getElementById ('player_' + gintLastPlayerDisplay) ;
		if (objOldPlayer != null) {
			objOldPlayer.style.display = 'none' ;
		}
	}
	gintLastPlayerDisplay = intPlayerNber ;
	objPlayer.style.display = 'block' ;
}

/* **************************************************** */
/*					SPONSORS							*/
/* **************************************************** */

var gobjSponsors_MsgDisplayed = null ;
var gcstrSponsors_FormName = 'sponsoring_form' ;

function FCCransSponsors_ShowDesc (objElt) {
//----------------------------------------------//
// Creation Date : 29/08/2001					//
// Created By    : KGris						//
//----------------------------------------------//
	var objDocument = objElt.document ;
	var strValue = objElt.value ;
	if (strValue == null) {return false ;}
	if (gobjSponsors_MsgDisplayed != null) { gobjSponsors_MsgDisplayed.style.display = 'none' ;}
	var objMsg = objDocument.getElementById ('sponsor_msg_' + strValue) ;
	if (objMsg == null) {return false ;}
	objMsg.style.display = 'block' ;
	gobjSponsors_MsgDisplayed = objMsg ;
}

function FCCransSponsors_SubmitForm (objElt) {
//----------------------------------------------//
// Creation Date : 29/08/2001					//
// Created By    : KGris						//
//----------------------------------------------//
	var objDocument = objElt.document ;
	var objElts = new Array (2) ;
	objElts[0] = objDocument.getElementsByTagName ('INPUT') ;
	objElts[1] = objDocument.getElementsByTagName ('SELECT') ;
	intError = 0 ;
	
	for (var j=0 ; j<objElts.length ; j++) {
		objInput = objElts[j] ;
		for (var i=0 ; i<objInput.length ; i++) {
			strMandatory = objInput[i].getAttribute('mandatory') ;
			if (strMandatory == null) { continue ;}
			if (strMandatory.length == 0) { continue ;}
			if (parseInt(strMandatory) == 1) {
				if (objInput[i].value.length == 0) {
					intError ++ ;
					objInput[i].style.backgroundColor = 'rgb(204,204,204)' ;
					objInput[i].style.color = 0xFF0000 ;
				} else {
					objInput[i].style.backgroundColor = 0xFFFFFF ;
					objInput[i].style.color = 0x000000 ;
				}
			}
		}
	}

	if (intError == 0) {
		objDocument.getElementById(gcstrSponsors_FormName).submit () ;
		} else {
		alert ('ERROR DATA DONT FORGET TO FILL THE ' + intError + ' MANDATORY FIELDS') ;			
	}
}

function FCCransMenu_ShowSubMenu (strIdSubMenu) {
//----------------------------------------------//
// Creation Date : 30/08/2001					//
// Created By    : KGris						//
//----------------------------------------------//

	var objDocument = document ;
	var objSubMenu = objDocument.getElementById (strIdSubMenu) ;
	if (objSubMenu == null) {return false ;}
	objSubMenu.style.display = (objSubMenu.style.display == 'none') ? 'block' : 'none' ;
}

function FCCransGeneral_Display (strId) {
//----------------------------------------------//
// Creation Date : 13/11/2001					//
// Created By    : KGris						//
//----------------------------------------------//

	var objDocument = document ;
	var obj = objDocument.getElementById (strId) ;
	if (obj == null) {return false ;}
	obj.style.display = (obj.style.display == 'none') ? 'block' : 'none' ;
}
