$(document).ready(function () {
  center();
  $(window).resize(center);
  $('#contacto').click(contact);
});

function center()
{
  aux=parseInt((($(document.documentElement).attr('clientHeight'))-($("#wrap").height()))/2);
  if (aux<0) aux=0;
  $("#wrap").css('top', aux+'px');
  $("#contact").css('top', aux+'px');
}

function contact()
{
  $('#wrap').append('<div id="contact"></div>');
  $('#contact').html('<img src="img/contactop.png" width="151" height="28" alt="contactop"/><a id="close">cerrar x</a><br /><p>Si deseas ampliar información sobre Fast Track y sus servicios,<br />contacta con nosotros</p><div>fast track<br />Macarena, 35<br />28016 Madrid</div><div>T: +34 <span class="blue">91 343 02 18</span><br />F: +34 <span class="blue">91 359 19 39</span></div><div>Email:&nbsp;<a class="subra2" href="mailto:contacto@fasttrackagency.com">contacto@fasttrackagency.com</a><br />RRHH:&nbsp;<a class="subra2" href="mailto:rrhh@fasttrackagency.com">rrhh@fasttrackagency.com</a></div>');
  $('#close').click(function(){$('#contact').remove()})
  $("#contact").css('top', $("#wrap").css('top')+'px');

}

function preCarga() {
	if (!document.images) return;
	var ar = new Array();
	var arguments = preCarga.arguments;
	for (var i = 0; i < arguments.length; i++) {
	ar[i] = new Image();
	ar[i].src = arguments[i];
	}
}


function correctPNG() // Hack para hacer los PNG transparentes en IE 5.5 & 6.
{
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5 && version < 7) && (document.body.filters))
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='noscale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
}

window.attachEvent("onload", correctPNG);	