var pippo;

function center_me(w,h){
	if(navigator.appName.indexOf('Explorer')+1){
		var win_width=w;
		var win_height=h;
	} else {
		var win_width=window.outerWidth;
		var win_height=window.outerHeight;
	}
	var pos_x=(screen.width-win_width)/2;
	var pos_y=(screen.height-win_height)/2;
	moveTo(pos_x,pos_y);
}
var win_height='100%';
var win_width='100%';

function open_01(url,w,h){
	v1=window.open(url,'pop','height='+h+',width='+w+'location=no,resizable=yes,scrollbars=yes');
}

function open_02(url,w,h){
	v1=window.open(url,'pop','height='+h+',width='+w+'location=no,resizable=no,scrollbars=no');
}

function open_pop(url,w,h){
	if(pippo) pippo.close();
	pippo= window.open(url,'pop','height='+h+',width='+w+'location=no,resizable=no,scrollbars=no');
}

function open_pop_02(url,w,h){
	if(pippo) pippo.close();
	pippo= window.open(url,'pop','height='+h+',width='+w+'location=no,resizable=no,scrollbars=yes');
}

function close_pop(){
	if(pippo) pippo.close();
}

//______________________________________________________________________________________
//SLIDE IMMAGINI LEFT

var imageRotate1=new Image()
imageRotate1.src="images/rotate/img_01.jpg"
var imageRotate2=new Image()
imageRotate2.src="images/rotate/img_02.jpg"
var imageRotate3=new Image()
imageRotate3.src="images/rotate/img_03.jpg"
var imageRotate4=new Image()
imageRotate4.src="images/rotate/img_04.jpg"
var imageRotate5=new Image()
imageRotate5.src="images/rotate/img_05.jpg"
var imageRotate6=new Image()
imageRotate6.src="images/rotate/img_06.jpg"
var imageRotate7=new Image()
imageRotate7.src="images/rotate/img_07.jpg"


//______________________________________________________________________________________
//IMMAGINE EMOZIONI


window.onload = function() {
		setFooter();
		
		myHeight = new fx.Height('container', {duration: 500});  // INDICA LA DURATA DI VELOCITà IN APERTURA
				
			if (location.search){ 
				var vals=location.search.substr(1).split("&");
				var request= new Array(); 
					for (var i in vals) { 
					vals[i] = vals[i].replace(/\+/g, " ").split("="); 
					request[unescape(vals[i][0])] =unescape(vals[i][1]); 
					} 
				 //if (request["showcart"]!='true'){
				 if (request["showcart"]=='true'){
					 //myHeight.hide();
					 //}else{
			//max dart //
			if(document.getElementById){
				document.getElementById('container').style.display = "block";
				}
			//--------//
						 
						 }
			}else{
				//myHeight.hide();
				document.getElementById('container').style.display = "none";
				}
	}
	

	window.onresize = function() {
		setFooter();
	} 


	function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
		return windowHeight;
	}
	
	function setFooter() {
		if (document.getElementById) {
			var windowHeight = getWindowHeight();
			if (windowHeight > 0) {
				
				var contentHeight;
				
				if (document.getElementById('content') == null) {
					contentHeight = document.getElementById('contentProductDetail').offsetHeight;
				}else{	
					contentHeight = document.getElementById('content').offsetHeight;
				}
				
				var footerElement = document.getElementById('footer');
				var footerHeight  = footerElement.offsetHeight;
				if (windowHeight - (contentHeight + footerHeight) >= 0) {
					footerElement.style.position = 'absolute';
					footerElement.style.top = (windowHeight - footerHeight) + 'px';
					
				}
				else {
					footerElement.style.position = 'static';
				}
			}
		}
	}


