function insertMail() {
	var cc_domain = "cornelcatering.com"
	var cc_user = "info"
	var cc_recipient = cc_user + "@" + cc_domain
	var cc_url = "mailto:" + cc_recipient
	var cc_entire = "<a href=\"" + cc_url + "\">" + cc_recipient + "<\/a>"
	return cc_entire;
}

function insertarPelicula() 
{ 
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="250" height="375" title="Catering">'); 
      document.write('<param name="movie" value="images/flash/SlideShow.swf">'); 
      document.write('<param name="quality" value="high">'); 
      document.write('<embed src="images/flash/SlideShow.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="250" height="375"></embed>'); 
      document.write('</object>'); 
} 

function insertarBuffets() 
{ 
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="250" height="375" title="Buffets">'); 
      document.write('<param name="movie" value="images/buffets/SlideShow.swf">'); 
      document.write('<param name="quality" value="high">'); 
      document.write('<embed src="images/buffets/SlideShow.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="250" height="375"></embed>'); 
      document.write('</object>'); 
} 

function insertarCocktails() 
{ 
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="250" height="375" title="Cocktails">'); 
      document.write('<param name="movie" value="images/cocktails/SlideShow.swf">'); 
      document.write('<param name="quality" value="high">'); 
      document.write('<embed src="images/cocktails/SlideShow.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="250" height="375"></embed>'); 
      document.write('</object>'); 
} 

function insertarMenus() 
{ 
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="250" height="375" title="Menus">'); 
      document.write('<param name="movie" value="images/menus/SlideShow.swf">'); 
      document.write('<param name="quality" value="high">'); 
      document.write('<embed src="images/menus/SlideShow.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="250" height="375"></embed>'); 
      document.write('</object>'); 
} 

function insertarWeddings() 
{ 
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="250" height="375" title="Weddings">'); 
      document.write('<param name="movie" value="images/weddings/SlideShow.swf">'); 
      document.write('<param name="quality" value="high">'); 
      document.write('<embed src="images/weddings/SlideShow.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="250" height="375"></embed>'); 
      document.write('</object>'); 
} 

	function HideContent(d) {
		if (d.length < 1) { 
			return; 
		}
		document.getElementById(d).style.display = "none";
		document.getElementById('gal_general').style.display = "none";
		document.getElementById('tab1').style.background = "#fff";
		document.getElementById('tab2').style.background = "#fff";
		document.getElementById('tab3').style.background = "#fff";
		document.getElementById('tab4').style.background = "#fff";
		document.getElementById('tab5').style.background = "#fff";
	}

	function ShowContent(d,e) {
		if (d.length < 1) { 
			return;
		}
		document.getElementById(d).style.display = "block";
		document.getElementById(e).style.background = "#d5e1df";
	}

	function ReverseContentDisplay(d) {
		if (d.length < 1) { 
			return;
		}
		if (document.getElementById(d).style.display == "none") { 
			document.getElementById(d).style.display = "block"; }
		else { 
			document.getElementById(d).style.display = "none"; 
		}
	}

function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function validarForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=validarForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe contener una direccion de e-mail.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' debe contener un numero.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' debe contener un numero entre '+min+' y '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' es obligatorio.\n'; }
  } if (errors) alert('Se han detectado los siguientes errores:\n'+errors);
  document.returnValue = (errors == '');
}

function validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.returnValue = (errors == '');
}

