// ----------------------------------------
//            Ajax Code
//-----------------------------------------

var xmlhttp

function start_vetrina(str, base)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url=base+"vetrina.php?i="+str;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("POST",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
if (xmlhttp.readyState==4)
{
document.getElementById("vetrina").innerHTML=xmlhttp.responseText;
slowhigh(document.getElementById("vetrina"));
}
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}

/***************************************
* Fading Code
* Gradual Highlight image script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var baseopacity=10
var highlighting
var start_opacity
function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity, imgobj)
start_opacity = baseopacity
highlighting=setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2){
cleartimer()
instantset(baseopacity)
}

function instantset(degree, imgobj){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100.0
else if (browserdetect=="ie")
//alert(imgobj.style.filter);
imgobj.style.filter = "alpha(opacity="+degree+")";
//imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 1.00)
else if (browserdetect=="ie" && cur2.style.filter != "alpha(opacity=100)") {
start_opacity += 10;
cur2.style.filter = "alpha(opacity="+start_opacity+")"; }
else if (window.highlighting)
clearInterval(highlighting)
}

