var _googlemap = false;


function ICDV (element,on_focus)
{
	//InputCheckDefautValue
	if (element.value==element.defaultValue)
	{
		if (on_focus)
		{
			element.value = '';			
		}
	} else {
		if (element.value == '')
		{
			element.value = element.defaultValue;			
		}
	}
}

function FTVGUnload()
{
	if (_googlemap)
	{
		GUnload();
	}
	return void (0);
}


/* <![CDATA[ */

$(document).ready(function(){

	$('.sharemail_link').nyroModal ( { width: 600} );
	$('#fixinfo_link').nyroModal({minWidth:700,minHeight:400,padding:5,closeButton:'<a href="#" class="nyroModalClose" id="closeBut" title="close">Close</a>'});
	$('#contactproform').nyroModal ( { width: 600, height: 480 } );
	$('#fixdiv').nyroModal ( { width: 650, height: 580  } );
	$('.ed_pr_fer').nyroModal ( { width: 950, height: 480, 'type' : 'form', 'blocker': '#editor_propiedades_feria'} );
	
	$('a[href*=#]').click(function() {
	
	if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	
	&& location.hostname == this.hostname) {
	
	var $target = $(this.hash);
	
	$target = $target.length && $target
	
	|| $('[name=' + this.hash.slice(1) +']');
	
	if ($target.length) {
	
	var targetOffset = $target.offset().top;
	
	$('html,body')
	
	.animate({scrollTop: targetOffset}, 500);
	
	return false;
	
	}
	
	}
	
	});
	
	

});

function reset_captcha (img,val,valid)
{
	
	$('#'+img).attr('src','/captcha.gif?'+new Date());
	$('#'+val).val('');
	$('#'+valid).val('');
	
}

function scrollto (element,offset)
{
	var p = $(element).position();
	o = offset ? offset : 0;
	$('html').animate({scrollTop:p.top-o});
}

function pp(u,n,w,h,center)
{
	var winW = w ? w : 600;
	var winH = h ? h : 600;
	var winN = n ? n : 'site_popup';
	var x = 0;
	var y = 0;
	if (center)
	{
		x = screen.availWidth / 2 - winW / 2;
		y = screen.availHeight / 2 - winH / 2;
	}
	
	var f = "width="+winW+", height="+winH+",  left="+x+", top="+y+", screenX="+x+", screenY="+y+", scrollbars=yes, statusbar=no, resizable=yes";	
	if (u)
	{
		var win = window.open(u,winN,f);		
	} else {
		var win = window.open("",winN,f);		
	}
	
	win.focus();	
}

function Swap(o, anim)
{
	
	o = document.getElementById(o) ? document.getElementById(o) : false;
	
	if (o)
	{
		if (anim)
		{
			$(o).slideToggle();
		} else {
			$(o).toggle();
		}
		/*
		//Effect.toggle(o,'blind', { delay: 0.01 });
		if (o.style.display == 'none')
		{
			$(o).show();
		} else {
			$(o).hide();
		}*/
	}

}

function bookmark(u,d)
{
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) 
	{
      window.external.AddFavorite(u,d);
	} else {
      if(navigator.appName == "Netscape")
      {
         window.sidebar.addPanel(d,u,"")
      }
   }
}

function feedback (c,u)
{
	pp('/'+c+u,'q',400,300,true);
}

function is_email(emailAddress)
{
	var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
	return pattern.test(emailAddress);
}

/* ]]> */
