	$(document).ready(function() { 
	$("#animateDes_icon").css( {opacity: "0.5"} )
	$("#animateDes_txt").css( {opacity: "0.5"} )
	$("#animateDig_icon").css( {opacity: "0.5"} )
	$("#animateDig_txt").css( {opacity: "0.5"} )
	$("#animateEdu_icon").css( {opacity: "0.5"} )
	$("#animateEdu_txt").css( {opacity: "0.5"} )
	$("#animateCal_icon").css( {opacity: "0.5"} )
	$("#animateCal_txt").css( {opacity: "0.5"} )
	$("#animateNet_icon").css( {opacity: "0.5"} )
	$("#animateNet_txt").css( {opacity: "0.5"} )
	$(".activeicon").css({opacity: ".9", top:'-15px', color:'white'});
	$(".activelabel").css({opacity: ".9" });

	$("#fname").watermark('nombre');
	$("#femail").watermark('e-mail');
	$("#fcomments").watermark('comentarios');

		$('.tooltip').tooltip({
			showURL: false,
			fade: 250
		});
		
		$('.inactiveli')
	.css( {backgroundPosition: "0 -48px"} )
	.mouseover(function(){
		$(this).stop().animate(
			{backgroundPosition:"(0 0)"}, 
			{duration:100})
		})
	.mouseout(function(){
		$(this).stop().animate(
			{backgroundPosition:"(0 -48px)"}, 
			{duration:200})
	})


	});
function boxtitle(num) {
	$("#proyecto" + num).stop().animate(
		{bottom: "0px"}, 
		{duration:500})
}
function hideboxtitle(num) {
	$("#proyecto" + num).stop().animate(
		{bottom: "-48px"}, 
		{duration:500})
}
function scontacto() {
 restoreform();
	$("#fname").watermark('nombre');
	$("#femail").watermark('e-mail');
	$("#fcomments").watermark('comentarios');
	$("#contacto").stop().animate(
		{top: "50%"}
	)
	$("#shadow").fadeIn();
	$(".contactanos").fadeOut();
}
function hcontacto() {
	$("#contacto").stop().animate(
		{top: "-50%"},
		{duration:400}
	)
	$("#shadow").fadeOut();
	$(".contactanos").fadeIn();
	

}
function contacto(parameters)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
url = "http://www.simplycit.com/contacto.php";
   xmlhttp.onreadystatechange = alertContents;
      xmlhttp.open('POST', url, true);
      xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      xmlhttp.setRequestHeader("Content-length", parameters.length);
      xmlhttp.setRequestHeader("Connection", "close");
      xmlhttp.send(parameters);
}
   function alertContents() {
      if (xmlhttp.readyState == 4) {
         if (xmlhttp.status == 200) {
            //alert(xmlhttp.responseText);
            result = xmlhttp.responseText;
            document.getElementById('contactform').innerHTML = result;            
         } else {
            alert('hubo un problema. intenta denuevo o envía un e-mail a contacto@simplycit.com');
         }
      }
   }
   
   function get(obj) {
   	var fname = document.getElementById("fname").value;
   	var femail = document.getElementById("femail").value;
   	var fcomments = document.getElementById("fcomments").value;
	var mensaje = "debes completar todos los campos";
    var valida = true;
    
	if(fname == "") {
		valida = false;
	}
	if(femail == "") {
		valida = false;
	}    
	if(fcomments == "comentarios") {
		valida = false;
	}
	if(isemail(femail) == false) {
		valida = false;
		mensaje = "porfavor ingresa un e-mail válido";
	}
	
    if(valida == true) {
      var poststr = "area=" + encodeURI( document.getElementById("farea").value ) +
      "&name=" + encodeURI(fname) +
		"&email=" + encodeURI(femail) +
		"&comments=" + encodeURI(fcomments);
      contacto(poststr);
     } else {
     $("#mensajes").html(mensaje);
     $("#mensajes").fadeIn();
     }
   }
   function isValidEmail(str) {

   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);

}
function restoreform() {
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",'/cform.php',false);
xmlhttp.send(null);
document.getElementById('contactform').innerHTML=xmlhttp.responseText;
}}
function isemail(email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   if(reg.test(email) == false) {
      return false;
   } else {
   		return true;
   }
}

function animate(sec) {
	$("#animate" + sec + "_icon").stop().animate({opacity: ".9", top:'-15px'},{queue:false, duration:500, easing: 'easeOutBounce'});
	$("#animate" + sec + "_txt").stop().animate( { opacity: ".9" }, {duration:500} );
}
function deanimate(sec) {
	if($("#animate" + sec + "_icon").css("color") == "white") {
	} else {
	$("#animate" + sec + "_icon").stop().animate({opacity: ".5", top:'0px'},{queue:false, duration:500, easing: 'easeOutBounce'});
	$("#animate" + sec + "_txt").stop().animate( { opacity: ".5" }, {duration:500} );
	}
}