function showSizeGuide(guide) {
sizeGuideWin = window.open(guide, "SizeGuide" , "height=336, width=560,toolbar=no,status=no,scrollbar=no,location=no,menubar=no,resizeable=no")
} 

function DisplayPrice(elementName) {
var selSize = document.forms[0].elements[elementName];
var y = selSize.options[selSize.selectedIndex].title;
document.getElementById("SizePrice").innerHTML =  "£" + y;
}

function emailLink() {
var _u = "info";
var _d = "canvasetc.com";
var _l = _u + "@" + _d;
document.write("<a href='mailto:"+_l+"'>"+_l+"</a>");
}

function addToOrder() {
y=document.cartform.itemname3.options[document.cartform.itemname3.selectedIndex].title
if (y =="") {
alert("Please Select a Size before adding the canvas to your order")
} else {
document.cartform.submit()
}
}

function openGallery(gallery) {
if (gallery!="") {
document.location = gallery;
}}

function cl(t){
if (t.defaultValue==t.value) t.value = '';
}


function displayLink(p_type, p_url, p_title, p_link_text) {

  var agt = navigator.userAgent.toLowerCase();
  var p_here = top.location.href

  if (p_type == 3)
  {
    if ((agt.indexOf("opera") != -1)) // || (agt.indexOf("firefox") != -1))
    {
      document.write("<a href=\""+p_here+"\" title=\"" + p_title + "\"  rel=\"sidebar\">" + p_link_text + "</a>");
    } else
    {
      document.write("<a href=\"javascript:addBookmark('"+p_title+"',top.location.href);\" title=\"" + p_title + "\" >" + p_link_text + "</a>");
    }
  } else
  {
    if (agt.indexOf("opera") != -1) 
    {
      document.write("<a href=\"" + p_url + "\" title=\"" + p_title + "\" rel=\"sidebar\">" + p_link_text + "</a>");
    } else
    {
      document.write("<a href=\"javascript:addBookmark('"+p_title+"','"+p_url+"');\" title=\"" + p_title + "\" >" + p_link_text + "</a>");
    }
  }
}


function addBookmark(title,url) {

  var msg_netscape = "NetScape message";
  var msg_opera    = "This function does not work with this version of Opera.  Please bookmark us manually.";
  var msg_other    = "Your browser does not support automatic bookmarks.  Please bookmark us manually.";
  var agt          = navigator.userAgent.toLowerCase();


  if (agt.indexOf("opera") != -1) 
  {
    if (window.opera && window.print)
    {
      return true;
    } else 
    {
      alert(msg_other);
    }
  }    
  else if (agt.indexOf("firefox") != -1) window.sidebar.addPanel(title,url,"");
  else if ((agt.indexOf("msie") != -1) && (parseInt(navigator.appVersion) >=4)) window.external.AddFavorite(url,title); 
  else if (agt.indexOf("netscape") != -1) window.sidebar.addPanel(title,url,"")         
  else if (window.sidebar && window.sidebar.addPanel) window.sidebar.addPanel(title,url,""); 
  else alert(msg_other);
  
}
