var pi = Math.PI;
function degToRad(x) { return ( x/(360/(2*pi)) ); }

function rotate(name, angle){ //convert angle into radians
    var rad = degToRad(angle);
    //calculate cos and sin of the angle
    costheta = Math.cos(rad);
    sintheta = Math.sin(rad);
    //create object reference
    var el = document.getElementById(name);
    if(el) {
        //apply the filter
        el.style.filter = "progid:DXImageTransform.Microsoft.Matrix()";
        //set up the properties
        el.filters.item("DXImageTransform.Microsoft.Matrix").SizingMethod = "auto expand";
        el.filters.item("DXImageTransform.Microsoft.Matrix").FilterType = "bilinear";
        //apply the rotation matrix transformation
        el.filters.item("DXImageTransform.Microsoft.Matrix").M11 = costheta;
        el.filters.item("DXImageTransform.Microsoft.Matrix").M12 = -sintheta;
        el.filters.item("DXImageTransform.Microsoft.Matrix").M21 = sintheta;
        el.filters.item("DXImageTransform.Microsoft.Matrix").M22 = costheta;
    }
}

var wprops3 = 'toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, width=500, height=320, left=' + (screen.width - 500) / 2 + ', top=' + (screen.height - 320) / 2 +', copyhistory=no';

function fprop2(el, cual) {
 var cod
 if (document.all && document.getElementById) {
   cod = el.parentElement.innerText
   cod = cod.substring(0,60)
 }
 else
   cod = cual
 window.open('fmail.htm?'+escape(cod),'Contacto',wprops3)
}

var vernav=navigator.appVersion;
var ie5 = (document.all && vernav.substring(22,25)<"5.5")?1:0;

function onA() { event.cancelBubble=true; sound2.src = "sonido2.au"; }
function offA() { event.cancelBubble=true; }

function ondiv() {
  var el = event.toElement
  el.c = el.currentStyle.color
  el.style.color='#b7f769'
  el.filters("revealtrans").transition=6
  el.filters("revealtrans").duration=1
  if (ie5) el.filters[1].apply()
  else el.filters.revealTrans.apply()
  el.filters("wave").freq=2
  //el.filters("wave").strength=2
  el.style.background='#258020'
  //el.style.letterSpacing='1px'
  //el.style.fontStyle='oblique'
  el.children[0].style.fontStyle='normal'
  if (ie5) el.filters[1].play()
  else el.filters.revealTrans.play()
}

function offdiv() {
  var el = event.fromElement
  if (ie5) el.filters[1].stop()
  else el.filters.revealTrans.stop()
  el.filters("wave").freq=1
  //el.filters("wave").strength=0
  el.style.background='darkgreen'
  //el.style.letterSpacing=''
  //el.style.fontStyle='normal'
  el.style.color=el.c
}

function carga2() {
 var items = document.all.tags("A")
 for (i=0; i<items.length; i++)
 {
  var item = items[i]
  item.attachEvent("onmouseover", onA)
  item.attachEvent("onmouseout", offA)
 }
 //var items2 = document.all.tags("DIV")
 //for (i=0; i<items2.length; i++)
 //{
 // item2 = items2[i]
 // if (item2.className == "vtas" || item2.className == "") {
 //   item2.attachEvent("onmouseover", ondiv)
 //   item2.attachEvent("onmouseout", offdiv)
 // }
 //}
}

if(document.all) window.onload=carga2;
var barvta=' Ver detalles de la propiedad (con fotos)..'
