function enlarge(picname, width, height) {
	win=window.open("enlarge.html","bigpic","dependent=yes, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=" + String(parseInt(width)+30) + ",height=" + String(parseInt(height)+60));
	win.focus();
	win.document.write("<html><head><title>Fuego y Roc&iacute;o</title>\n");
	win.document.write("<style type='text/css'>\n");
	win.document.write("A{text-decoration: none;}\n");
	win.document.write("A:HOVER{text-decoration: underline;}\n");
	win.document.write("</style></head>\n");
	win.document.write("<body bgcolor='#000000' text='#cfcfcf' link='#ff0000' vlink='#ff0000' alink='#ff0000'><center>\n");
	win.document.write("<img src='../images/"+picname+"' border='0' width='"+width+"' height='"+height+"'><br clear='all'><br><a href='Java" + "Script:window.close();'><font face='Verdana, Helvetica, Arial' size='-1'>Fenster schlie&szlig;en</font></a>\n");
	win.document.write("</center></body></html>\n");
}

MenuNumber = new Array();
MenuNumber["veranstaltungen"] = 0; 
MenuNumber["ensemble"] = 1; 
MenuNumber["repertoire"] = 2; 
MenuNumber["referenzen"] = 3;
MenuNumber["karten"] = 4;
MenuNumber["presse"] = 5; 
MenuNumber["video"] = 6; 
MenuNumber["technik"] = 7; 
MenuNumber["kontakt"] = 8;

function GotoPage(namedMenu) {
	top.frames["navigation"].clicked(MenuNumber[namedMenu]);
}

function XMLcompatible(str) 
{
	// for text input fields only
	if (str == null)
		return true;

	re=/&/gi ;
	rf=/</gi ;
	rg=/>/gi ;
	rh=/;/gi ;
	
	if ((str.search(re) != -1) || (str.search(rf) != -1) || (str.search(rg) != -1) || (str.search(rh) != -1))
		return false;
	else
		return true;
}

var theForm;

function getForm()
{
return document.forms["myform"];
/*
	if (IE)
		return document.myform;
	else
		return document.layers["Text"].document.forms["myform"];	
*/
}

function XMLcompatibleForm(msg)
{
	beginindex=1;
	i=beginindex;
	
	theForm = getForm();

/*	while (document.myform.elements[i] != null)
	{
		if (!(document.myform.elements[i].type=="hidden") && (!XMLcompatible(document.myform.elements[i].value)))
		{
			alert(msg);
			document.myform.elements[i].focus();
          	return false;
		}
		i++;
	}*/
	while (theForm.elements[i] != null)
	{
		if ((theForm.elements[i].type=="text") && (!XMLcompatible(theForm.elements[i].value)))
		{
			alert(msg);
			theForm.elements[i].focus();
          	return false;
		}
		i++;
	}
	return true;
}

function isEmpty(s)
{
	return ((s == null) || (s.length == 0))
}

function isWhitespace(s)
{
	var whitespace = " \t\n\r";
	var i;
	
	if (isEmpty(s))
		return true;

	for (i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		
		if (whitespace.indexOf(c) == -1)
			return false;
	}
	return true;
}


function checkEmpty(field, msg)
{
	// for text input fields only
	theForm = getForm();

	if (isEmpty(eval('theForm.' + field +'.value')))
	{
		alert(msg);
		eval('theForm.' + field + '.focus()');
		return false;
	}
	else
		return true;
}

function checkSelect(field, msg)
{
	theForm = getForm();
	selectfield = eval('theForm.' + field);
	
	if (selectfield.selectedIndex==0) {
		alert(msg);
		return false;
	}

	return true;
}

function checkEmail(field, msg, required)
{
	theForm = getForm();
	emailfield = eval('theForm.' + field);
	
	if (!isEmail(emailfield.value, required))
	{
		alert(msg);
		emailfield.focus();
		return false;
	}
	else
		return true;
}

function isEmail(s, required)
{
	if (isEmpty(s))
		return !required;

	if (isWhitespace(s))
		return false;

	var i = 1;
	var sLength = s.length;
	
	while ((i < sLength) && (s.charAt(i) != "@"))
		i++;

	if ((i >= sLength) || (s.charAt(i) != "@"))
		return false;
	else
		i += 2;
		
	while ((i < sLength) && (s.charAt(i) != "."))
		i++;

	if ((i >= sLength - 1) || (s.charAt(i) != "."))
		return false;
	else
		return true;
}

function alertAndFocus(msg, field)
{
	theForm = getForm();
	alert(msg);
	theForm.elements[field].focus();
}

function checkIntField(val, field)
{
	var dat = val;
	var i;
	
	if (dat.length == 0)
    {
    	reportIntError();
	    field.focus()
    	return (false)
    }
 
 	if (dat.charAt(0) == "-")
    	i = 1;
	else
    	i = 0;
		
	for (i; i < dat.length; i++)
    {
    	if ((dat.charAt(i) < "0") || (dat.charAt(i) > "9"))
            return (false);
    }
	return true;
}

function checkDate(dat, field, msg)
{
  var pos = 0
  var pos2 = 0
  pos2 = dat.indexOf("-",pos)
  if (pos2 == -1)
    {
      alert(msg);
      field.focus()
      return (false)
    }
  y = dat.substring(pos, pos2)
  for (i = 0; i < y.length; i++)
  {
    if (y.charAt(i) > "9" || y.charAt(i) < "0")
    {
      alert(msg);
      field.focus()
      return (false)
    }
  }
  if (y < 1900)
    {
      alert(msg);
      field.focus()
      return (false)
    }
  if (y >= 9999)
    {
      alert(msg);
      field.focus()
      return (false)
    }
  pos=pos2+1
  dat = dat.substring(pos)
  pos2 = dat.indexOf("-")
  if (pos2 == -1)
    {
      alert(msg);
      field.focus()
      return (false)
    }
  m = dat.substring(0,pos2)
  for (i = 0; i < m.length; i++)
  {
    if (m.charAt(i) > "9" || m.charAt(i) < "0")
    {
      alert(msg);
      field.focus()
      return (false)
    }
  }
  if (m < 1)
    {
      alert(msg);
      field.focus()
      return (false)
    }
  if (m > 12)
    {
      alert(msg);
      field.focus()
      return (false)
    }
  pos=pos2+1
  dat = dat.substring(pos)
  d = dat
  for (i = 0; i < d.length; i++)
  {
    if (d.charAt(i) > "9" || d.charAt(i) < "0")
    {
      alert(msg);
      field.focus()
      return (false)
    }
  }
  if (d < 1)
    {
      alert(msg);
      field.focus()
      return (false)
    }
  if (d > 31)
    {
      alert('10');
      field.focus()
      return (false)
    }
  pos=pos2+1
  dat = dat.substring(pos)
  if (d.length<2 && d < 10)
   d = "0" + d
  if (m.length<2 && m < 10)
   m = "0" + m
  field.value= y + "-" + m + "-" + d
  return (true)
 }

	








