// JavaScript Document
		var _html , url, idQuickView, idQuickViewfilho, bMoveInProgress , quickShow , imgTimerID ,imgOn, oMoveDiv , idProd;				
		/* Configuração do PopUp */
		idQuickView = 0;
		var iWidth = 619;
		var iHeight = 314;
		/* Url para Carregar Pagina */
		url = "pop_big.asp";
			
		function quickOn(obj){
			imgOn = true;	
			obj.src = "imagens/botao_pre1.gif"
		}		
		
		function showQuickView(id, name, idfilho) {		
		    if (idQuickView != 0 && idQuickView != id)
				hideQuickView();
			
			imgOn = true;				
			var obj = document.getElementById(name);
			//document.getElementById("imagemQuick").useMap ="#map" + name									
			divQuickView = document.getElementById("divProduto" + id);
			var iTop = getDistance(obj, "top");
			var iLeft = getDistance(obj, "left");		
			document.getElementById("imgQuick").style.visibility = "";	
			document.getElementById("imgQuick").style.position = "absolute";
			document.getElementById("imgQuick").style.top = iTop + (	obj.height /2 );
			document.getElementById("imgQuick").style.left = iLeft + (	obj.width /2 ) -38;
			document.getElementById("imgQuick").style.display = "";			
			idQuickView = id;
			idQuickViewfilho = idfilho;
		}		
		
		function hideImgQuickView(obj){
			imgOn= false;								
			imgTimerID = window.setTimeout ("checkToHide()" , 1000);			 
			if(obj)
			obj.src = "imagens/botao_pre.gif";

		}
		
		function checkToHide(){
			if (!imgOn)
				document.getElementById('imgQuick').style.display = 'none';																
		}
		
		function hideQuickView() {
			if (bMoveInProgress)
				return false;
			
			if (quickShow == true){
				quickView(idQuickView , 1 );
				quickShow = false;
			}
			//document.getElementById('fomcategoria').style.visibility = '';				
			document.getElementById('formorder').style.visibility = '';				
			//document.getElementById('order').style.visibility = '';
		}
				
		function loadQuickView(id, posicao) {
			//document.getElementById('fomcategoria').style.visibility = 'hidden';				
			document.getElementById('formorder').style.visibility = 'hidden';				
			
			/*if (posicao<1)
			{
			
				document.getElementById('order').style.visibility = 'hidden';
			}*/
			
			idQuickView = id;
			var xhttp;
			try	{   
				// Firefox, Opera 8.0+, Safari    
				xhttp=new XMLHttpRequest();    
				}
			catch (e)
				{    
				// Internet Explorer    
				try	{      
					xhttp=new ActiveXObject("Msxml2.XMLHTTP");      
					}
				catch (e)
					{      
						try{        
							xhttp=new ActiveXObject("Microsoft.XMLHTTP");        
							}
						catch (e)
							{        
								//alert("Sem suporte para AJAX!");        
							return false;        
							}      
					}    
				}
			xhttp.onreadystatechange = function(){	

			if (xhttp.readyState == 4){	
				//alert(xhttp.status);
				if (xhttp.status == 200){
					_html = xhttp.responseText;
					quickShow = true;			
					quickView(id , -1,0 );
				}
			}
			
		}
			var randomnumber=Math.floor(Math.random()*11)
			//xhttp.open("GET", url + "?x=" + idQuickView + "&z=" + <%=idQuickView+second(now())%>, true);
			url = "pop_big.asp";
			xhttp.open("GET", url + "?a=" + randomnumber + "&x=" + idQuickView + "&y=" + idQuickViewfilho + "&z=", true);
			xhttp.send(null);
		}

		
		/* Função para pegar distancias entre objetos */
		function getDistance(oObj, sDistanceTo){
			var i, bFindBottom, bFindRight, bFindLeft, bFindTop;
			bFindBottom = (sDistanceTo == "bottom");
			bFindRight = (sDistanceTo == "right");
			bFindLeft = (sDistanceTo == "left" || bFindRight);
			bFindTop = (sDistanceTo == "top" || bFindBottom);
			if(bFindRight){
				i = oObj.offsetWidth;
			}else if(bFindBottom){
				i = oObj.offsetHeight;
			}else{
				i = 0;
			}
			while("object" == typeof(oObj) && oObj.tagName.toLowerCase() != "body"){
				i += bFindTop ? oObj.offsetTop : oObj.offsetLeft;
				oObj = oObj.offsetParent;
			}
			return i;
		}
		
		/* Função Para mover o objeto */
		function quickView( id , iStep, iUpd){
			divQuickView = document.getElementById("divProduto" + id)

			if(divQuickView == null) return;
			var iStartLeft, iStartTop, iFinishLeft, iStartWidth, iStartHeight, iDistance, iSteps;
			var oDocBody = document.body;
			var iTop = getDistance(divQuickView, "top") - document.getElementById("divContainer" + id).scrollTop;
			var iLeft = getDistance(divQuickView, "left");		
			var oSourceObject = document.getElementById("eLink" + id )
			var iSourceObjectTop = getDistance(oSourceObject, "top") + oSourceObject.offsetHeight;
			var iSourceObjectLeft = getDistance(oSourceObject, "left") + oSourceObject.offsetWidth;
			oMoveDiv = divQuickView.cloneNode(true);
			oMoveDiv.style.display = "none";	
			oDocBody.insertBefore(oMoveDiv);
			oMoveDiv.id = "eMoveDiv" + id;
			oMoveDiv.style.backgroundColor = "white";	
			oMoveDiv.innerHTML = _html;								
			if(iStep == 1){
				iStartTop = getDistance(divQuickView, "top") - 100;								
				iStartLeft = 200;
				iFinishTop = iSourceObjectTop - 150;
				iFinishLeft = getDistance(oSourceObject, "left")+ 100;
			}
			else{		
				iFinishLeft =  200;
				iStartTop = iSourceObjectTop - 150;				
				iStartLeft = getDistance(oSourceObject, "left")  + 100;
				iFinishTop = iTop - 150;
			}
			iSteps = 15;
			if(iStep == 1){
				iStartWidth = iWidth;
				iStartHeight = iHeight;
			}else{
				iStartWidth = iWidth/iSteps;
				iStartHeight = iHeight/iSteps;
			}
			try {
				moveDivStyle = document.getElementById("eMoveDiv"+ id).style;
				moveDivStyle.position = "absolute";
				moveDivStyle.overflow = "hidden";
				moveDivStyle.left = iStartLeft;
				moveDivStyle.top = iStartTop;
				moveDivStyle.width = iStartWidth;
				moveDivStyle.height = iStartHeight;
				var iLeftInc = (iFinishLeft - iStartLeft)/iSteps;
				var iTopInc = (iFinishTop - iStartTop)/iSteps;
				var iWidthInc = iStep*iWidth/iSteps;
				var iHeightInc = iStep*iHeight/iSteps;
				move(iWidthInc, iHeightInc, iLeftInc, iTopInc, 0, iSteps, iStep);
				}		
			catch(e) {
			}
	}
	/* Função Para mover o objeto */
	function move(iWidthInc, iHeightInc, iLeftInc, iTopInc, i, iMax, hideShow){
		bMoveInProgress = true;
		//oMoveDiv.innerHTML ="";

		var iDivWidth = moveDivStyle.posWidth - iWidthInc;
		if(iDivWidth > iWidth )
			iDivWidth = iWidth ;
	
		var iDivLeft = moveDivStyle.posLeft + iLeftInc;
		if(iDivLeft + iDivWidth > document.body.clientWidth) {
			//iDivWidth = document.body.clientWidth - iDivLeft - 100;
		}

		moveDivStyle.posTop += iTopInc;
		moveDivStyle.posWidth = iDivWidth;
		moveDivStyle.posHeight -= iHeightInc;	
		moveDivStyle.posLeft += iLeftInc;
		moveDivStyle.display = "block";
		if(moveDivStyle.posHeight == 0) moveDivStyle.posHeight = -1;
		if(++i < iMax){
			moveDiveTimer = window.setTimeout("move(" + iWidthInc + ", " + iHeightInc + ", " + iLeftInc + ", " + iTopInc + ", " + i + ", " + iMax + "," + hideShow +")", 25);
		}else{
			bMoveInProgress = false;
			window.clearTimeout(moveDiveTimer);			
			
		}
	}	
