// JavaScript Document
function Produtos(idC,pagina,destaque,busca,idP) {
	new Ajax.Request('funcoes/mostraProdutos.php', {
		parameters: {
			idC : idC,
			pagina : pagina,
			destaque : destaque,
			busca : busca,
			idP : idP
		},
		method: 'post',
		onSuccess: function(response) {
			$('Produtos').innerHTML = response.responseText;
		},
		onFailure: function() {
			alert("Problema para executar essa função!");	
		}
	});
}

function SWFDelegate(url,width,height,caption) {
   var objLink = parent.document.createElement('a');
   objLink.setAttribute('href',url);
   objLink.setAttribute('rel','lightbox');
   if(caption = 'undefined'){
	}else{
	objLink.setAttribute('title',caption);
	}
   if(typeof width != 'undefined') {
      objLink.setAttribute('width',width);
   }
   if(typeof height != 'undefined') {
      objLink.setAttribute('height',height);
   }
   parent.Lightbox.prototype.start(objLink);
}

function trocaIMG(thumb, img, w, h){
	$('mainIMG').src = thumb+'.php?img='+img+'&w='+w+'&h='+h;
	$('mainLINK').href = "javascript:SWFDelegate('adm/"+img+"')";
}
