//																Goto Login
//______________________________________________________________________________

function skvrGotoLogin(){
	location.href= skvrHp +'sokever/profile/';
}

function skvrGotoHome(){
	location.href= skvrHp;
}

function skvrFieldSubmit(){
	window.open(  skvrHp +"sokever/structures/fieldSubmit.php","skvrFieldSubmit","toolbar=no,width=590,height=400,directories=no,menubar=no,scrollbars=auto,resizable=yes" );
}


function valClearIf(oFormObj, sValue, sValueReplace){
	if(oFormObj && oFormObj.value==sValue){
		oFormObj.value = sValueReplace;
	}
}


/**
 * Funzione di controllo e invio del form di login
 */
function goLogin(){
	var ok=true;
	
	document.getElementById('emlL').style.color="black";
	document.getElementById('pwdL').style.color="black";
	
	if( document.getElementById('eml').value.length < 7 ){
		document.getElementById('eml').focus();	
		document.getElementById('emlL').style.color="red";
		ok=false;
	}
	
	if( document.getElementById('pwd').value.length < 1 ){
		document.getElementById('pwd').focus();		
		document.getElementById('pwdL').style.color="red";
		ok=false;
	}

	
	if(ok){
		document.forms['skvrLogin'].submit();
	}
}


/**
 * Apertura match
 * @param {Object} sID
 */
function skvrNewMatch(sID){
	location.href= skvrHp +'match.php?wl=nm&s='+ sID;
}
function skvrJoinMatch(mID){
	location.href= skvrHp +'match.php?wl=jm&m='+ mID;
}
function skvrViewStruct(sID){
	location.href= skvrHp +'struc.php?wl=vs&s='+ sID;
}







function testAjax(){
	// redirect è il parametro della funzione che contiene l'id del div da aggiornare sulla pagina chiamante... 
	sylarMakeAjaxRequest ("2.php", testAjaxResult, "redirect");	
}
 
 
 
 
function testAjaxResult(ajax_request, divID) {
	//alert('Test Chiamata Ajax!');
	if (ajax_request.readyState == 4) {
		if (ajax_request.status == 200) {
			var sText = ajax_request.responseText;
			
			document.getElementById(divID).innerHTML = sText;
			
			
			
		} else {
			sylarNotifyAjaxError('There was a problem with the Ajax request.');
		}
	}
} 



//																String Booster
//______________________________________________________________________________


// Funzioni per il potenziamento di explorer con le stringhe

function inizializeStringBuffer(){
	return new Array();
}
function addBuffer(aBuffer, sText) {
 aBuffer[aBuffer.length] = sText;
}
function getStringFromBuffer(aBuffer){
	return aBuffer.join("");
}

// Esempio
// aBS = inizializeStringBuffer();
// addBuffer(aBS, "pippo");
// addBuffer(aBS, "pluto");
// alert( getStringFromBuffer(aBS) );





