//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
      case "z-index":
	  ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
var info_lhs = "info";
var bijal_lhs = "bijal";
var chris_lhs = "chris";
var steve_lhs = "steve";
var david_lhs = "david";

var jean_lhs = "jeanclaude";
var phil_lhs = "phil";
var phil_lhs = "donna";

var woodhousefamilycellars_rhs = "woodhousefamilycellars.com";
var woodhousefamilycellars_rhs2 = "woodhousefamilycellars.com?subject=Please add me to the Woodhouse Family Cellars mailing list&body=Please type your name, street address, phone number and email address:";
function print_mail_to_info() 
{
   document.write("<A HREF=\"mailto");
   document.write(":" + info_lhs + "@");
   document.write(woodhousefamilycellars_rhs2 + "\">" + info_lhs + "@" + woodhousefamilycellars_rhs + "<\/a>");
}

function print_mail_to_bijal() 
{
   document.write("<A HREF=\"mailto");
   document.write(":" + bijal_lhs + "@");
   document.write(woodhousefamilycellars_rhs + "\">" + bijal_lhs + "@" + woodhousefamilycellars_rhs + "<\/a>");
}
function print_mail_to_chris() 
{
   document.write("<A HREF=\"mailto");
   document.write(":" + chris_lhs + "@");
   document.write(woodhousefamilycellars_rhs + "\">" + chris_lhs + "@" + woodhousefamilycellars_rhs + "<\/a>");
}


function print_mail_to_steve() 
{
   document.write("<A HREF=\"mailto");
   document.write(":" + steve_lhs + "@");
   document.write(woodhousefamilycellars_rhs + "\">" + steve_lhs + "@" + woodhousefamilycellars_rhs + "<\/a>");
}






function print_mail_to_jeanclaude() 
{
   document.write("<A HREF=\"mailto");
   document.write(":" + jeanclaude_lhs + "@");
   document.write(woodhousefamilycellars_rhs + "\">" + jeanclaude_lhs + "@" + woodhousefamilycellars_rhs + "<\/a>");
}

function print_mail_to_david() 
{
   document.write("<A HREF=\"mailto");
   document.write(":" + david_lhs + "@");
   document.write(woodhousefamilycellars_rhs + "\">" + david_lhs + "@" + woodhousefamilycellars_rhs + "<\/a>");
}

function print_mail_to_phil() 
{
   document.write("<A HREF=\"mailto");
   document.write(":" + phil_lhs + "@");
   document.write(woodhousefamilycellars_rhs + "\">" + phil_lhs + "@" + woodhousefamilycellars_rhs + "<\/a>");
}
function print_mail_to_donna() 
{
   document.write("<A HREF=\"mailto");
   document.write(":" + donna_lhs + "@");
   document.write(woodhousefamilycellars_rhs + "\">" + donna_lhs + "@" + woodhousefamilycellars_rhs + "<\/a>");
}

function changeDiv(the_div,the_change)
{
  var the_style = getStyleObject(the_div);
  if (the_style != false)
  {
    the_style.visibility = the_change;
  }
}

function hideAll()
{
  changeDiv("ShowLayer1","hidden");
  changeDiv("ShowLayer2","hidden");
}

function biteMe()
{
  changeDiv("ShowLayer2","visible");
}

function getStyleObject(objectId) {
  if (document.getElementById && document.getElementById(objectId)) {
    return document.getElementById(objectId).style;
  } else if (document.all && document.all(objectId)) {
    return document.all(objectId).style;
  } else {
    return false;
  }


}


function footer() {
  document.write('<p align="center" class="footer">'
				 +'<a href="index2.html">about woodhouse</a>'
				 + ' | '
				 + '<a href="javascript:;" onclick="hideAll(); biteMe()">'
				 + 'kennedy\'s kitchen'
				 + '</a>'
				 + ' | '
				 );

  document.write('<a href="events.html">events</a> | <a href="whatsinaname.html">our wines</a> | <a href="hours.html">tasting room</a> | <a href="stories.html">news and press</a> | <a href="contact.html">contact us</a></p> ');
}

