// Functions -- prototype functions added by Warren .. Olivos by Design 2008
/*------------------------------------------------------------------------*/
function Blur(elem, opacity) {
	
	var element = $(elem); 
	element.setOpacity(opacity); 
	
}
function SwapBTN(id,type,ext) {
	if (ext == null) { ext='gif'; }
	if (type == 1) {
		$(id).src = 'gfx/'+id+'over.'+ext;
	} else {
		$(id).src = 'gfx/'+id+'.'+ext;
	}
}
this.numPop=0
function pop_imagen(photoid,pageid){
this.numPop+=1;
var winl = (screen.width-600)/2;
var wint = (screen.height-600)/2;
var settings ='height=600,';
settings +='width=600,';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars=no,';
settings +='resizable=yes';
win=window.open('muestra_foto.php?photoid='+photoid+'&pageid='+pageid,'Verfoto'+numPop,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
function MM_openBrWindow(theURL,winName,features) { 
window.open(theURL,winName,features);
}
function pop_imagenAD(url){
this.numPop+=1;
var winl = (screen.width-600)/2;
var wint = (screen.height-600)/2;
var settings ='height=600,';
settings +='width=600,';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars=no,';
settings +='resizable=yes';
win=window.open('muestra_foto_ad.php?id='+url,'Verfoto'+numPop,settings);
if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
}
function MM_openBrWindow(theURL,winName,features) { 
window.open(theURL,winName,features);
}
/*------------------------------------------------------------------------*/
function SendAmigo() {

	var params = $('enviar').serialize();
	$('enviar').disable();
	$('Error1').hide();
	$('Error2').hide();
	$('Error3').hide();
	$('Error4').hide();
	
	new Ajax.Request('ajax/sendcontact.php', {
		method:'post',
		encoding:'ISO-8859-1',
		parameters: params,
		onSuccess: function(transport){
					var response = transport.responseText || "no response text";
					res = response.split('***');
					errors = res.size();
					if (errors == 1) {
						$('ContactForm').hide();
						$('ThankYou').show();
					}
					res.each(function(s) {
							$('Error'+s).show();
						}); 
					
					},
		onFailure: function(){ 
					alert('There was an error \n Please try again.')
					$('enviar').enable();
					}
	}); 
	$('enviar').enable();

}
/*------------------------------------------------------------------------*/
