var _PinError_ = "Per favore, inserisci il tuo PIN";
var _ObjectSelectionError_ = "Per favore, effettua la tua selezione prima di continuare";
var _AgreeError_ = "Per favore, leggi e accetta i Termini e le Condizioni d'uso prima di continuare";
var _NumberFormatError_ = "Per favore, inserisci un numero di telefono valido (solo cifre)";
    var	_NumberFormatError_TooShort_ = "Per favore, inserisci un numero di telefono valido (solo cifre)";

var _CarrierSelectError_ = "Per favore, seleziona il tuo operatore";
var _CodeError_ = "Per favore, inserisci il codice di sicurezza";
var _HeadsetSelectError_ = "Please select your headset";

var _MaxPhoneLength_ = 10;
var _MinPhoneLength_ = 9;
var _PhoneRE_ =/^\d+$/ ; 

var _MaxPinLength_ = 10;

function CheckAgree(oForm)
{
    if (!oForm.agree.checked){
        alert(_AgreeError_);
        return false;
    }
    return true;
}


// 40a7b73d - Google Italy
// 713ff6c4 - Google Italy 123cellulare
// d0261fd4 - Google Italy Radio DJ
// 395ea6f0 - Google Italy Vodafone


function gup( name , google_msg , normal_msg )
{
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp( regexS );
	var regexS1 = "[\\?&]g=([^&#]*)";
	var regex1 = new RegExp( regexS1 );
	var results = regex.exec( window.location.href );
	var results1 = regex1.exec( window.location.href );
	var chbox =  '<input type="checkbox" name="agree" value="checkbox"  />';
	
	if(results1 != null){
		if(results1[1] == '1'){
			return chbox + google_msg;
		}
		else{
			return normal_msg;
		}
	}
	else{
		return normal_msg;
	}
	
	/*if(results == null){
		if(results1 != null){
			if(results1[1] == '1'){
				return chbox + google_msg;
			}
			else{
				return normal_msg;
			}
		}
		else{
			return normal_msg;
		}
	}
	else {
		//if( results[1] == '395ea6f0' || results[1] == 'd0261fd4' ){
		//	return chbox + google_msg;
		//}
		//else{
			return normal_msg;
		//}
	}*/
}