// starttimer

starttime=new Date().getTime();

// lazy shortcut

d=document;

// status bar

window.status= "PAULINGHOF :: www.paulinghof.com :: Ferienort Breitenbach"

// generic popper functions - scroll or no scroll, print toolbar

function popwin(url,name,width,height){
var t=(screen.height-height)/2;
var l=(screen.width-width)/2;
window.open(url,name,'width='+width+',height='+height+',top='+t+',left='+l+',location=0,status=0,scrollbars=0,toolbar=0,resizeable=no,noresize');
}

function popscroll(url,name,width,height){
var t=(screen.height-height)/2;
var l=(screen.width-width)/2;
window.open(url,name,'width='+width+',height='+height+',top='+t+',left='+l+',location=0,status=0,scrollbars=1,toolbar=0,resizeable=no,noresize');
}

function popprint(url,name,width,height){
var t=(screen.height-height)/2;
var l=(screen.width-width)/2;
window.open(url,name,'width='+width+',height='+height+',top='+t+',left='+l+',location=0,status=0,scrollbars=0,toolbar=1,resizeable=no,noresize');
}


// rollover script. images set up in each season's js file



function on(which) {if (d.images) {document[which].src = eval(which + "on.src");}}
function off(which) {if (d.images) {document[which].src = eval(which + "off.src");}}

// content picture writer - writes table with left or right padding only

function picture(side,image,alt){
if (alt==null){alt="copper mountain resort vacations";}
d.write("<table cellpadding=0 cellspacing=0 border=0 align="+side+">");
d.write("<tr>");
if (side=="right"){d.write("<td><img src=images/global/clear.gif width=10 height=1></td>");}
d.write("<td><img src="+image+" alt='"+alt+"'></td>");
if (side=="left"){d.write("<td><img src=images/global/clear.gif width=10 height=1></td>");}
d.write("</tr>");
d.write("<tr>");
d.write("<td colspan=2><img src=images/global/clear.gif width=1 height=5></td>");
d.write("</tr>");
d.write("</table>");
}

// callout box writer

function callout (content){
d.write("<table cellpadding=1 cellspacing=0 border=0 width='100%' align='center'>");
d.write("<td class='tabledark'>");
d.write("<table cellpadding=1 cellspacing=2 border=0 width='100%'>");
d.write("<td bgcolor='ffffff'>");
d.write("<table cellpadding=1 cellspacing=0 border=0 width='100%'>");
d.write("<td class='tabledark'>");
d.write("<table cellpadding=3 cellspacing=1 border=0 width='100%'>");
d.write("<tr bgcolor='ffffff'>");
d.write("<td class='tablelight' align='center'>&nbsp;&nbsp;FYI&nbsp;&nbsp;</td>");
d.write("<td align='center' width='100%'><i>"+content+"</i></td>");
d.write("</tr>");
d.write("</table>");
d.write("</td>");
d.write("</table>");
d.write("</td>");
d.write("</table>");
d.write("</td>");
d.write("</table><br>");
}

// email format checker

function isEmailAddr(email)
{
  var result = false
  var theStr = new String(email)
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}
function checkemailsignup(which){
  if (which.EMAIL.value == ""){
    alert("Please enter a value for the \"email\" field.");
    which.EMAIL.focus();
    return (false);
  }
  if (!isEmailAddr(which.EMAIL.value)){
    alert("Geben Sie Ihre Email in folgender Form ein: IhrName@IhreDomain.de");
    which.EMAIL.focus();
    return (false);
  }   
  if (which.EMAIL.value.length < 3){
    alert("Please enter at least 3 characters in the \"email\" field.");
    which.EMAIL.focus();
    return (false);
  }  
  which.EMAILINDEX.value=which.EMAIL.value;
  return (true);
}