// JavaScript Document
	
	
	
    var din_medium = {
      src: '/jquery/din_medium.swf'
	  };

    sIFR.activate(din_medium);

    sIFR.replace(din_medium, {
      selector: 'li.link'
      ,css: [
        '.sIFR-root {position:absolute; font-weight: normal; color: #FFFFFF;  font-size:16px; text-transform: uppercase;  margin-right:16px;}'
        ,'a { color: #FFFFFF; text-decoration: none; font-weight: normal;  font-size:16px; text-transform: uppercase;  margin-right:16px;}'
        ,'a:link { color: #FFFFFF; font-weight: normal;  font-size:16px; text-transform: uppercase;  margin-right:16px;}'
        ,'a:hover { color: #bed3e4; font-weight: normal;  font-size:16px; text-transform: uppercase; margin-right:16px; }'
      ]
	  ,wmode: 'transparent'
	  ,forceSingleLine: true
    });

    sIFR.replace(din_medium, {
      selector: '#TitBarNavigatorProd_text'
      ,css: [
        '.sIFR-root {font-weight: normal; color: #4a2f1c;  font-size:34px; }'
      ]
	  ,wmode: 'transparent'
	  ,filters: {
        DropShadow: {
           distance: 1
          ,color: '#666666'
          ,strength: 2
          ,alpha: .5
        }
      }

    });

    sIFR.replace(din_medium, {
      selector: 'li.linko'
      ,css: [
        '.sIFR-root {position:absolute; font-weight: normal; color: #FFFFFF;  font-size:14px; text-transform: uppercase;   margin-right:18px;}'
      ]
	  ,wmode: 'transparent'
	  ,forceSingleLine: true
    });



    sIFR.replace(din_medium, {
      selector: 'li.linko2'
      ,css: [
        '.sIFR-root {position:absolute; font-weight: normal; color: #2f0f0f;  font-size:16px; text-transform: uppercase;   margin-right:18px;}'
      ]
	  ,wmode: 'transparent'
	  ,forceSingleLine: true
    });



//-----------------------------------------------------------------------



function serialscroll(){
	//alert();
	$('#EventsScroller').jScrollPane({showArrows:true, scrollbarWidth:20});
}


//-------------------------------------------------------------------------


// --------- FUNZIONE DEL SEARCHER

var variabileSearcher;
var histstato;
function OpenDivSearcherX(variabileSearcher){

	if (histstato == undefined || histstato != variabileSearcher ){
		if (histstato == undefined){
			$('#'+variabileSearcher).animate({height: 'toggle'},400);
			histstato = variabileSearcher;
		} else {
			$('#'+histstato).animate({height: 'toggle'},400, function() {	
				//timerId = setTimeout('Tendina('+variabileSearcher+')', 10);
				$('#'+variabileSearcher).animate({height: 'toggle'},400, function() {
					histstato = variabileSearcher;
				});
			});
		}
	} else if (histstato == variabileSearcher ) {
		$('#'+variabileSearcher).animate({height: 'toggle'},400, function() {
			histstato = undefined;
		});
	}
	
	//$('#'+variabileSearcher).slideDown('slow', function() {
	// chiamata AJAX
	//});
}


//-------------------------------------------------------------------------
/*
var prezzo;
var histprezzo;
var histNumProd;
var qtyProd;
function FuncAddToBask(prezzo,qtyProd){
	var where_to = confirm('Vuoi aggiungere il prodotto al carrello?');
	
	if (where_to == true){

		if(histprezzo == undefined){
			histprezzo = 0;
			histNumProd = 0;
		}
		
		totprezzo = Number(histprezzo) + Number(prezzo) * Number(qtyProd);
		totProd = histNumProd + Number(qtyProd);
		
		document.getElementById('FieldCart').innerHTML = "Qt. "+totProd+"<br>Tot. € "+totprezzo+",00";
		
		histprezzo = totprezzo;
		histNumProd = totProd;
	}
}
*/


function FuncUpToBask(prezzo,qtyProd){
	var where_to = confirm('Vuoi Aggiornare il Numero di Pordotti nel Carrello?');
	
	if (where_to == true){

		 if(qtyProd != histNumProd ){
			
		totprezzo = Number(prezzo) * Number(qtyProd);
		totProd =  Number(qtyProd);
		
		document.getElementById('FieldCart').innerHTML = "Qt. "+totProd+"<br>Tot. € "+totprezzo+",00";
		document.getElementById('Cellular5').innerHTML = "<strong>&euro; "+totprezzo+",00</strong> (IVA inc.)";
		document.getElementById('TotCartMaster').innerHTML = "<strong>TOT. &euro; "+totprezzo+",00 (IVA inc.)</strong>";
		
		
		histprezzo = totprezzo;
		histNumProd = totProd;
		
		}
		
	}
}


/*
function SvuotaCarrello(){
	var where_toX = confirm('Vuoi Eliminare tutti i Prodotti dal Carrello?');
	
	if (where_toX == true){
		document.getElementById('FieldCart').innerHTML = "Qt. 0<br>Tot. € 0,00";
		histprezzo = undefined;
		histNumProd = undefined;
	} 
}

function SvuotaCarrelloX(){
	var where_toX = confirm('Vuoi Eliminare tutti i Prodotti dal Carrello?');
	
	if (where_toX == true){
		document.getElementById('FieldCart').innerHTML = "Qt. 0<br>Tot. € 0,00";
		document.getElementById('ElementsShoppingCart').innerHTML = "";
		document.getElementById('TotCartMaster').innerHTML = "<strong>TOT. &euro; 0,00 (IVA inc.)</strong>";
		histprezzo = undefined;
		histNumProd = undefined;
	} 
}
*/
//-------------------------------------------------------------------------


$(function() {
	$('a, td, input, img, select, Textarea, area').tooltip({
		track: true,
		delay: 0,
		showURL: false,
		showBody: " - ",
		opacity: 0.95, 
		fade: 250,
		//extraClass: "right" 
		positionLeft: true
	});
});


//-------------------------------------------------------------------------

function alterNate(elm){
	if (!elm.base) elm.base = elm.value
	if (elm.value == elm.base) elm.value = "";
	else if (elm.value == "") elm.value = elm.base;

}


function swapF(from){
	var to,setF=false;
	if(from.type=='password'){
		to=from.form.holder;
	} else {
		to=from.form.PassWord;
		setF=true;
	}
	if(setF || from.value==''){
		to.style.display='block';
		from.style.display='none';
	}
	if(setF) to.focus();
}


function LoginGood(){
	document.getElementById('ContFormLogin').innerHTML = "Ciao <b>Tekmar</b> Accesso al Personal Desk Avvenuto con Successo!<input type='submit' name='LogOut' value='LOGOUT' id='LogOut' onClick='LogOutFunc();' />";
}


function LogOutFunc(){
	document.getElementById('ContFormLogin').innerHTML = "Accedi al Personal Desk <input name='Login' id='Login' value='Login' onBlur='alterNate(this);' onFocus='alterNate(this);'  type='text'><input name='holder' value='Password' id='holder' type='text' onfocus='swapF(this)'><input name='PassWord' id='PassWord' type='password'style='display:none' onblur='swapF(this)' /><input type='submit' name='EnterLogin' value='ENTRA' id='EnterLogin' onClick='LoginGood();' />";

}
