<!--
//*************************************************************
//* Email addresses to use 
//*************************************************************
var CSMail = "CustomerServiceItaly@dnb.com" ;
var MktMail = "MarketingIT@dnb.com" ;
var TstMail = "donnett@dnb.com" ;
var Arrow_Blue = "<font face='Arial' size='1' color='#0066CC'>&#9658;</font>"
function ArrowBlue(){
  document.write(Arrow_Blue);
}

//*************************************************************
//* Message Literals
//*************************************************************

var sEmptyValueEN = "Please enter a value for the " ;
var sEmptyValueIT = "Per cortesia, inserire un valore nel campo " ;
var sEmptyValueFR = "Veuillez remplir le champ " ;
var sEmptyValueNL = "Voer a.u.b een waarde in voor het veld " ;
var sEmptyValueDE = "Tragen Sie bitte einen Wert für das Feld " ;
var sEmptyValueHU = "Kérjük, írja be a(z) mezo adatait - " ;

var sNotSelectedEN = "Please select one of the " ;
var sNotSelectedIT = "Per cortesia, selezionare una delle " ;
var sNotSelectedFR = "Veuillez selectionner une des options " ;
var sNotSelectedNL = "Kies a.u.b. één van de " ;
var sNotSelectedDE = "Wählen Sie bitte eine der Wahlen " ;
var sNotSelectedHU = "Kérjük, válasszon egyet a " ;

var sFirstSelectedEN = "The first " ;
var sFirstSelectedIT = "L'opzione selezionata nel campo " ;
var sFirstSelectedFR = "La premičre option de " ;
var sFirstSelectedNL = "de eerste optie van " ;
var sFirstSelectedDE = "Das Vorkaufsrecht " ;
var sFirstSelectedHU = "A(z) " ;

var sFirstSelectedTEN = " option is not a valid selection.  Please choose one of the other options" ;
var sFirstSelectedTIT = " non č valida: siete pregati di effettuare un'altra selezione" ;
var sFirstSelectedTFR = " n'est pas valide. Choisissez une autre option" ;
var sFirstSelectedTNL = " is niet geldig. Kies één van de andere opties" ;
var sFirstSelectedTDE = " ist nicht eine gültige Vorwähler" ;
var sFirstSelectedTHU = " opció választása helytelen. Kérjük, válasszon másikat" ;

var sNotNumberEN = "Please enter only digit characters in the " ;
var sNotNumberIT = "Inserire esclusivamente valori numerici nel campo " ;
var sNotNumberFR = "Veuillez utiliser uniquement des caractčres numériques dans le champ " ;
var sNotNumberNL = "Voer a.u.b. alleen getallen in het veld " ;
var sNotNumberDE = "Tragen Sie bitte nur Stellenbuchstaben auf dem Gebiet " ;
var sNotNumberHU = "Kérjük, hogy a mezot csak számokkal töltse ki - " ;

var sNotEmailEN = "Please enter a valid e-mail address in the " ;
var sNotEmailIT = "Per cortesia, inserire un indirizzo e-mail valido nel campo " ;
var sNotEmailFR = "Veuillez remplir une adresse e-mail valide dans le champ " ;
var sNotEmailNL = "Voer a.u.b. een geldig e-mail adres in het veld " ;
var sNotEmailDE = "Tragen Sie bitte eine gültige E-mail Adresse auf dem Gebiet " ;
var sNotEmailHU = "Kérjük, írja be a helyes e-mail címet - " ;

var sFieldEN = " field" ;
var sFieldIT = "" ;
var sFieldFR = "" ;
var sFieldNL = "" ;
var sFieldDE = "" ;
var sFieldHU = "" ;

var sOptionEN = " options" ;
var sOptionIT = " opzioni" ;
var sOptionFR = "" ;
var sOptionNL = " opties" ;
var sOptionDE = "" ;
var sOptionHU = " opciókból" ;

var findmsgEnglish = "Please enter a valid search value!";
var findmsgItalian = "Inserisci un valore valido di ricerca!";

var Blackdot ='<font SIZE="2" face="Wingdings" color="#000000">§</font>&nbsp;';
//*************************************************************
//* General Functions
//*************************************************************
function isNumber(checkStr){
  var checkOK = "0123456789-";
  var allValid = true;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++) {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++) {
      if (ch == checkOK.charAt(j))
        break;
    }
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (allValid) return (true);
  return (false)
}

function Show_Error(theForm, theField, txm){
  var cn=eval('theForm.' + theField);
		cn.style.backgroundColor = "#ffcc00";
		cn.select();
		cn.focus();
		alert(txm);
}

//*************************************************************
//* Functions to validate form fields
//*************************************************************
function emptyValue(theForm,theField,lang,theFieldText) {
  var txm=eval('sEmptyValue'+lang) +'"'+ theFieldText +'"'+ eval('sField'+lang) + ".";
  var cn=eval('theForm.' + theField);
	cn.style.backgroundColor = "#ffffff";
  if (cn.value == "") {
		Show_Error(theForm, theField, txm);
    return (true) ;
  }
  return (false);
}

function notSelected(theForm,theField,lang,theFieldText) {
  var txm=eval('sNotSelected'+lang) +'"'+ theFieldText +'"'+ eval('sOption'+lang) + ".";
  var cn=eval('theForm.' + theField);
	cn.style.backgroundColor = "#ffffff";
  if (cn.selectedIndex < 0) {
		Show_Error(theForm, theField, txm);
    return (true) ;
  }
  return (false)
}

function CheckList(theForm,theField,lang,theFieldText) {
  var txm=eval('sNotSelected'+lang) +'"'+ theFieldText +'"'+ eval('sOption'+lang) + ".";
  var cn=eval('theForm.' + theField);
	cn.style.backgroundColor = "#ffffff";
	if(cn.value==cn.defaultValue||cn.value=='') 
	{
		cn.style.backgroundColor = "#ffcc00";
//		cn.select();
		cn.focus();
		alert(txm);
    return (true) ;
	}
  return (false);
}

function firstSelected(theForm,theField,lang,theFieldText) {
  var txm=eval('sFirstSelected'+lang) +'"'+ theFieldText +'"'+ eval('sFirstSelectedT'+lang) + ".";
  var cn=eval('theForm.' + theField);
	cn.style.backgroundColor = "#ffffff";
  if (cn.selectedIndex == 0) {
		Show_Error(theForm, theField, txm);
    return (true) ;
  }
  return (false)
}

function notNumber(theForm,theField,lang,theFieldText) {
  var txm=eval('sNotNumber'+lang) +'"'+ theFieldText +'"'+ eval('sField'+lang) + ".";
  var cn=eval('theForm.' + theField);
	cn.style.backgroundColor = "#ffffff";
  if (isNumber(cn.value) == false) {
		Show_Error(theForm, theField, txm);
    return (true) ;
  }
  return (false)
}

function notEmail(theForm,theField,lang,theFieldText) {
  var txm=eval('sNotEmail'+lang) +'"'+ theFieldText +'"'+ eval('sField'+lang) + ".";
  var cn=eval('theForm.' + theField);
	cn.style.backgroundColor = "#ffffff";
  if (cn.value.indexOf(" ") >= 0 || 
      cn.value.indexOf(".") == -1 ||
      cn.value.indexOf("@") == -1) {
		Show_Error(theForm, theField, txm);
    return (true) ;
  }
  return (false)
}

function RadioNotChecked(theForm,theField,lang,theFieldText)
{
  var txm=eval('sNotSelected'+lang) +'"'+ theFieldText +'"'+ eval('sOption'+lang) + ".";
  var cn=eval('theForm.' + theField);
  var radioSelected = false;
  for (i = 0;  i < cn.length;  i++)
  {
    if (cn[i].checked)
        radioSelected = true;
  }
  if (!radioSelected)
  {
//	cn[0].focus();
    alert(txm);
    return (true);
  }
  return (false);
}

function CheckForm(theForm) {
 var txm = "Sorry, your request is bizarre, this job is blocked!";
 var namtst=theForm.FirstName.value+theForm.LastName.value;
 
 if (theForm.FirstName.value==theForm.LastName.value && namtst.length != 0)
 {alert(txm);
  return (true); }
 
 if (theForm.Feedback.value.indexOf("[url=http") >= 0)
 {alert(txm);
  return (true); }
  
  return (false);
}

//**********************************************************************
//* This function will test checkbox, if yes, add title to list (at end)
//**********************************************************************
function yes_no(theForm,theField,lang,theFieldText) {
  if (eval('theForm.' + theField + '.checked') == true) {
    
    theForm.titles.value = theForm.titles.value + "|" + theFieldText;  
  }
}

//**********************************************************************
//* This will enable/disable a Button if a checkbox is checked or not
//**********************************************************************
 function Enable_Disable(Item1,Item2)
 {  
   if (Item2.checked == false)
    Item1.disabled = true;
   else
    Item1.disabled = false;
 }

//**********************************************************************
//* The Accept checkbox is clicked when the conditions are accepted
//**********************************************************************
 function See_Conditions()
 {
    document.forms['Form1'].elements['Accept'].checked = true;
    document.forms['Form1'].elements['test'].disabled = false;
    window.location.href = "conditions.htm";    
 }
  
//**********************************************************************
//* Disable button when Form cleared
//**********************************************************************
 function Disable_Button()
 {
    document.forms['Form1'].elements['B1'].disabled = true;
 }

//**********************************************************************
//* Function to add a zero if number less than 10
//**********************************************************************
 function Addzero(tst)
 {
    tst=(tst < 10) ? "0" + tst : tst;
    return tst;
 }

//**********************************************************************
//* Find and format Date and Time + send to hidden variables
//**********************************************************************
 function Set_Time() 
 {
    var now = new Date();
    year = new String(now.getYear());
    
    month = new String(Addzero(now.getMonth() + 1));
    
    date = new String(Addzero(now.getDate()));
	
    hours = new String(Addzero(now.getHours()));
	
    minutes = new String(Addzero(now.getMinutes()));
	
    seconds = new String(Addzero(now.getSeconds()));
	
    showdate = new String;
    showdate = date + "/" +  month + "/" + year;
    showtime = new String;
    showtime = hours + ":" + minutes + ":" + seconds;
    
    document.forms['Form1'].elements['Date'].value= showdate;
    document.forms['Form1'].elements['Time'].value= showtime;
 
 }
 
//**************************************************
//* Read Dates from variables and write in the Form
//**************************************************
function WriteFormDates(lng){
 var xn = 0;
 var tx = '<tr>';
 for (n = 1; n <= nD; n++){
 c1Str = eval("D" + n);	
 c2Str = eval("YN" + n);	
 xn = xn + 1;
 tx = tx + '<td width="50%"><input type="radio" name="date_training" value="' + c1Str + '" tabindex="1"';
 if (c2Str == "Full") {
   tx = tx + ' disabled>' + c1Str + '&nbsp;<script type="text/javascript">ItsFull("' + lng + '")</script></td>';
   
   }
 else {
   tx = tx + '>' + c1Str + '</td>';
   }
 if (xn==2) {					  
   tx = tx + '</tr>';					 
   document.write(tx);
   tx = '<tr>';
   xn = 0;
  }
 }	
 if (xn==1) {					  
  tx = tx + '<td width="50%">&nbsp;</td></tr>';					 
  document.write(tx);
 }
}

//****************************************************
//* Read Dates from variables and write in the Agenda
//****************************************************
function WriteAgendaDates(lng){
 var xn = 0;
 var tx = '<tr>';
 for (n = 1; n <= nD; n++){
 c1Str = eval("D" + n);	
 c2Str = eval("YN" + n);	
 xn = xn + 1;
 tx = tx + '<td width="50%">'+ Blackdot ;
 if (c2Str == "Full") {
   tx = tx + c1Str + '&nbsp;<script type="text/javascript">ItsFull("' + lng + '")</script></td>';
   
   }
 else {
   tx = tx + c1Str + '</td>';
   }
 if (xn==2) {					  
   tx = tx + '</tr>';					 
   document.write(tx);
   tx = '<tr>';
   xn = 0;
  }
 }	
 if (xn==1) {					  
  tx = tx + '<td width="50%">&nbsp;</td></tr>';					 
  document.write(tx);
 }
}

function SetListValue(MyList,tEventNam) {
  for (i=0; i<MyList.length; i++) {
    tVal = MyList.options[i].value;
      if (tVal == tEventNam){
        MyList.selectedIndex = i;
      } 
    }                  
  }      

//  Function: btnSubmit_onClick()
//  Purpose : This function validates that the user has filled
//            in the values of the text boxes correctly.
//            It then builds the URL for candidates.asp
//            and invokes it.
//
function btnSubmit_onClick(flag) {
  var sReq 
  var sName = ""
  var sBillingRef = ""
  var Ctry = "BE"
  var Lang = "EN"
  var sCurrCharSetPref = "ISO-8859-1"
//  var id = "43C76182714043232643"
  var id = "B5206D10383063365756"
  var sURL = "https://toolkit.dnb.com/locked/candidates.asp?id=" + id + "&Lang=" + Lang + "&Ctry=" + Ctry + "&Tab=name&"
    
	//Condition added by CTS Offshore for Trade Credit Changes
	if (flag==1)
	{
 			var sName = window.document.all('Name').value
			sName = escape(sName)

			// Check for required fields
			if (sName == "") {
                alert("Please enter the name of the company that you are searching for.");
				window.document.all('Name').focus()
				return;
			}

		sReq = "Name=" + sName

		sReq  = sReq + "&CharSetPref=" + sCurrCharSetPref
		sURL = sURL  + sReq;
		sURL = sURL.replace(" ", "%20");
		self.location = sURL
	}
	else
	{
		//Else Part added by CTS Offshore for Trade Credit changes
		if ("" == "Y")
		{
			sURL = sURL + "Prod=Small Business Risk New Account Score&PI=PI1" + "&" + sReq;
			sURL = sURL.replace(" ", "%20");
		}
		else
		{
			sURL = sURL  + "Prod=Small Business Risk New Account Score" + "&" + sReq;
			sURL = sURL.replace(" ", "%20");
		}
		self.location = sURL;
	}
}
function CheckName(theForm, lang) {
  var cn=theForm.CompanyName
	cn.style.backgroundColor = "#ffffff";
	if(cn.value==cn.defaultValue||cn.value=='') 
	{
		alert(eval('findmsg'+lang));
    	cn.style.backgroundColor = "#ffcc00";
		cn.select();
		cn.focus();
		return false;
	}
	return true;
}


//**********************************************************************
//* Replace Submit Button with a function to do different actions
//**********************************************************************
function Push_Submit(thisform)
 {
  if (FrontPage_Form1_Validator(thisform)== true)
  {
   thisform.submit();
   window.history.back();
   popUpN('New_Customer.htm', 'No', 'No', '300', '250');  
   }
 }
// -->