
	//Cufon.replace('h1');
	Cufon.replace('.fontBigOffers');
	Cufon.replace('#OffersLargeBoxTextFontBig');
	Cufon.replace('#OffersLargeBoxTextFontSmall');
        Cufon.replace('#homeFirstText');
        Cufon.replace('.OrangeWord');
        Cufon.replace('.homeTextOffers');
        Cufon.replace('.homeTextOffers2');
        Cufon.replace('#textForm');
        Cufon.replace('#centerTextHomeBoxes');
        Cufon.replace('.boxTitle');
        Cufon.replace('.titleForm');
        Cufon.replace('.subTitleForm');

        Cufon.replace('#subtitleOffer');
        Cufon.replace('#bodyOffer');
        Cufon.replace('.OrangeWordSmall');
        Cufon.replace('#Offersubtitle');
        Cufon.replace('#OfferTitleBig');

        Cufon.replace('#offerTitlesForm');
        Cufon.replace('#offerTitleForm');
        Cufon.replace('#offerSubTitleForm');

        

// onclick inputbox clear

$(document).ready(function(){

 $('.campiformDX').focus(function(){
//  if(this.value==' enter text to filter candidates')
//  {
  this.value=' '
//  }
 });





//ShadowBox
Shadowbox.init();




//checkbox style & accordion    
 $("#accordion").accordion();
 
 
 //qtip offers
         //***tooltip  
        // Match all link elements with href attributes within the content div
        $('#cb1').qtip(
        {
         content: {

    
         text: "<div id='tooltipVERDE '><img src='images/header_TOOLTIPverde.jpg' />Scegli l'Opzione Verde, disponibile su tutti i prodotti Energia Viva.\n\
Sei sensibile ai temi ambientali e vuoi qualiﬁcare l'immagine della tua impresa?\n\
Riduci l'impatto della tua attività sull'ambiente utilizzando solo energia naturale (idroelettrica, eolica, solare,biomassa).\n\
Sottoscrivendo l'Opzione Verde ti verrà fornita solo energia proveniente da fonte rinnovabile certiﬁ cata dall’Ente Internazionale RECS.\n\
Il tuo impegno andrà a testimoniare l'attenzione verso le tematiche ambientali, riﬂettendo un nuovo modo di fare impresa, più etico, più responsabile, più sostenibile, con grandi vantaggi anche in termini di immagine.\n\
Aderendo all'Opzione Verde riceverai un certiﬁ cato che attesta che l'energia consumata è compensata da una quantità equivalente di energia verde prodotta da fonti rinnovabili, e riceverai in omaggio il kit verde EnergiaViva, utilizzabile per promuovere presso i tuoi clienti la tua sensibilità all'ambiente.\n\
</div>"
      },
          show: { effect: { type: 'slide' } },
          style: { 
                width: 438,
                padding: 5,
                background: '#96c867',
                color: 'white',
                textAlign: 'left',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#67af2d'
                },
              tip: 'rightTop',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           },
             position: {
      corner: {
         target: 'middleLeft',
         tooltip: 'middleRight'
      }
   }



        });
        $('.cb2').qtip(
        {
                   content: {
         text: "<div style='display:inline; position:relative;'><img style='float:left; padding:6px;    ' src='images/tooltipCAMBIOPIANO.jpg' />In un mondo che cambia ogni giorno, EnergiaViva è pronta a cambiare insieme a te. Se attivi l’Opzione Cambio Piano una volta all’anno puoi decidere di passare a un prodotto diverso tra quelli in vendita al momento, scegliendo così l’offerta più conveniente e che meglio si adatta alle esigenze della tua attività commerciale.</div>"
      },
      show: { effect: { type: 'slide' } },
          style: { 
                width: 530,
                padding: 5,
                background: '#f3b668',
                color: 'white',
                textAlign: 'left',
                border: {
                   width: 7,
                   radius: 5,
                   color: '#e89325'
                },
          tip: 'rightTop',
              name: 'dark' // Inherit the rest of the attributes from the preset dark style
           },
             position: {
      corner: {
         target: 'middleLeft',
         tooltip: 'middleRight'
      }
   }
        });




    });




        
  
  
var ajax = new Array();

function getCityList(sel)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('id_comune').options.length = 0;	// Empty city select box
	if(countryCode.length>0){
		var index = ajax.length;
		ajax[index] = new sack();
		
		ajax[index].requestFile = 'templates/offers/getCities.php?countryCode='+countryCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createCities(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}

function createCities(index)
{
	var obj = document.getElementById('id_comune');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
}

function getCityListEE(sel)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('EEId_comune').options.length = 0;	// Empty city select box
	if(countryCode.length>0){
		var index = ajax.length;
		ajax[index] = new sack();
		
		ajax[index].requestFile = 'templates/offers/getCities.php?countryCode='+countryCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createCitiesEE(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}

function createCitiesEE(index)
{
	var obj = document.getElementById('EEId_comune');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
}

function getCityListGAS(sel)
{
	var countryCode = sel.options[sel.selectedIndex].value;
	document.getElementById('GASId_comune').options.length = 0;	// Empty city select box
	if(countryCode.length>0){
		var index = ajax.length;
		ajax[index] = new sack();
		
		ajax[index].requestFile = 'templates/offers/getCities.php?countryCode='+countryCode;	// Specifying which file to get
		ajax[index].onCompletion = function(){ createCitiesGAS(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}

function createCitiesGAS(index)
{
	var obj = document.getElementById('GASId_comune');
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code	
}

