var base_url_="http://127.0.0.1/52Parchate/";
//var base_url_="http://www.parchate.com.mx/";

var value_input_seleccionado;

function paginacion_proyectos(){
	$("#proyectos").easySlider({
					continuous: true,
					nextId: "slider1next",
					prevId: "slider1prev"
	});
}

function paginacion_fotos_proyecto(){
	if ($("#fotos>ul").length > 0){
		$("#fotos").easySlider({
					continuous: true,
					nextId: "slider2next",
					prevId: "slider2prev"
		});
	}	
}

function onFocus(elemento){
	input_seleccionado = elemento.attr('id');
	if ( elemento.val() == 'Nombre' || elemento.val() == 'Mail' || elemento.val() == 'Empresa' || elemento.val() == 'Su Mensaje'){				
			elemento.val('');
	}
}

function onBlur(elemento){
	if (elemento.val() == '') 
		switch(input_seleccionado){
			case 'nombre': elemento.val('Nombre');
				break;
			case 'mail': elemento.val('Mail');
				break;
			case 'empresa': elemento.val('Empresa');
				break;
			case 'mensaje': elemento.val('Su Mensaje');
				break;
	}
}

$(document).ready(function (){
	$("a[rel='proy_ind']").click(function (){
		var ID = $(this).attr('id');
		var URL = $(this).attr('href');
		$.fn.colorbox({href:URL, open:true, scrollbars:false, width:650, height:570},paginacion_fotos_proyecto);
		return false;
	});
	
	$(".cerrar_reciente").click(function(){
		if ($(".proyecto_reciente").is(":hidden")) {
			$(".proyecto_reciente").slideDown("slow");
		} else {
			$(".proyecto_reciente").slideUp("slow");
		} 										 
	});
	
	$("input").focus(function(){ onFocus($(this)); });
	$("input").blur(function () { onBlur($(this)); });	
	$("textarea").focus(function(){ onFocus($(this)); });
	$("textarea").blur(function () { onBlur($(this)); });

	$("div.proyecto > a > img").mouseover(function (){
		$(this).animate({width: "90%",height:"90%"},{duration:500,easing: 'easeOutElastic'});
	});
	$("div.proyecto > a > img").mouseout(function (){
		$(this).animate({width: "100%",height:"100%"},{duration:500,easing: 'easeOutElastic'});
	});

	setTimeout('$(".proyecto_reciente").slideUp("slow")', 5000);
	
	
	//$("a[rel='proy_ind']").colorbox({iframe:true, width:800, height:600});	
	//$("a[rel='proy_ind']").colorbox({rel:'ID_1'});
});