


// LOGIN

function loginCheck()
{
	document.getElementById('loginTxt').value = document.getElementById('loginAlt').value;
	document.getElementById('passwordTxt').value = document.getElementById('passwordAlt').value;
//	qc.pA('PaginaForm', 'c4', 'QClickEvent', '', '');
	qc.pB('PaginaForm', 'loginButtonMain', 'QClickEvent', '');
//	document.getElementById('loginTxt').value = '';
//	document.getElementById('passwordTxt').value = '';
	return false;
}
// LOGIN


// E-PROCUREMENT
function invioOfferta(idTxt)
{
	txt = document.getElementById(idTxt).value;
	
	if(txt == ''){
		alert("Non è stato inserito un messaggio. Inserire un messaggio e riprovare, grazie");
		return false;
	}
}
//E-PROCUREMENT

// ALTRO
function showHide(element)
{
	if(document.getElementById(element).style.display=="block")
	{
		document.getElementById(element).style.display="none";
	}
	else
	{
		document.getElementById(element).style.display="block";
	}
}

function newsletterAddBox(){}
// ALTRO


// MOUSE

function creatediv(id){
par = document.getElementById(id);
newdiv = document.createElement("div");
newdiv.setAttribute('id','child-'+id); 
newdiv.setAttribute('class','thumbFollow'); 
par.appendChild(newdiv); 
} 


function isIE(){
if(document.all){ 
return 1; 
}else{ 
return 0; 
}
}
/*
function isIE(){ 
if (navigator.appVersion.indexOf("MSIE") != -1){
return true; 
}else{ 
return false; 
} 
} 
*/



function movemouse(id,strImg,e,strNome){

	if(strNome==undefined)
		strNome="";
	
	// new div
	if(!document.getElementById('child-'+id)){ 
	creatediv(id,strImg);
		// fade in
		$('#child-'+id).css({opacity: 0.0}).animate({opacity: 1.0}, 500); 
	}
	
	per = document.getElementById('child-'+id);
	per.innerHTML = '<div><img src="'+strImg+'" style="width:160px;" /><br><div style="padding:5px; font-weight:bold; text-align:center;" >'+strNome+'</div></div>';
	per.style.position = 'fixed';
	per.style.width = '160px';

	//
	$(e.target).removeAttr('title');

	//
	var vscroll = (document.all ? document.scrollTop : window.pageYOffset);
	
	$('#child-'+id).css({
	       left:  e.pageX + 20,
	       top:   e.pageY - vscroll
	    });

}




function movemouse_bak(id,strImg,e){
	if(!document.getElementById('child-'+id)){ 
	creatediv(id,strImg); 
	} 
	per = document.getElementById('child-'+id);
	per.style.position = 'fixed';
	
	if (isIE()==1){ 
		// var e = window.event;
		e = window.event;
		posx = e.clientX;// alert(posx);
		posy = e.clientY;// alert(posy);
//		top = document.documentElement.scrollTop; //alert(top); ERRORE
		per.style.top = posy+10+'px';
	}
	else
	{
		posx = e.pageX;
		posy = e.pageY;
		top = document.documentElement.scrollTop;
		per.style.top = posy-top+10+'px';
	}
	per.style.left = posx+10+'px'; 
	
//	alert(per.style.top);
	
	/*
	per.style.border = '2px solid #666'; 
	per.style.background = '#fff';
	per.style.background = '#fff';
//	per.innerHTML = 'x: '+posx+' y: '+posy;
//	per.innerHTML = '<img src='+strImg+' />;
	*/
	per.innerHTML = '<img src="'+strImg+'" style="width:160px;" />';
	 
}

function removediv(id){
par = document.getElementById(id);
per = document.getElementById('child-'+id);
par.removeChild(per);
}

//function setImg(div, strHtml){
//	document.getElementById(div).innerHTML = strHtml;
//}

// MOUSE



//PANNELLO RICERCA AVANZATA
function showSearchPanel(eleId)
{
	var ele = document.getElementById(eleId);
	ele.style.border="2px solid yellow";
}
//PANNELLO RICERCA


// PREFERITI-BROWSER
function addfav()
{
	if (window.sidebar) {
		window.sidebar.addPanel(document.title,self.location,'')
	} else if (window.external) {
		window.external.AddFavorite(self.location,document.title)
	} else if (window.opera) {
	s.appendChild(newT);
		alert("eh..");
	}
}
//



// JQUERY
$(function() {
	    	
	// product gallery 
    $('#FTgallery1 a').lightBox();
    
    // tooltip
    $('.withTooltip').tooltip({ 
	    track: true, 
	    delay: 0, 
	    showURL: false, 
	    showBody: " - ", 
	    fade: 250 
	});
	
});
//---------

