//-- Menulist --------------------------------------------------------------------------------------------------------------------------------

function menulist( )
{
document.write("&nbsp;<a href=\"index.htm\" title=\"Main Home Page\">Home</a> |&nbsp;");
document.write("<a href=\"about.htm\" title=\"About Cockermouth Art & Craft\" onclick=\"NewWindow(this.href,\'Calendar\',\'900\',\'700\',\'yes\');return false\">About Us</a> |&nbsp;");
document.write("<a href=\"contacts.htm\" title=\"Contact details\">Contact Us</a> |&nbsp;");
document.write("<a href=\"gallery.htm\" title=\"See what's in our gallery at the moment\">Gallery</a> |&nbsp;");
document.write("<a href=\"links.htm\" title=\"Links to other sites\">Links</a> |&nbsp;");
document.write("<a href=\"news.htm\" title=\"News\">News</a> |&nbsp;");
document.write("<a href=\"photos.htm\" title=\"Photos\">Photos</a> |&nbsp;");
//-- document.write("<br>&nbsp;| ");
//-- document.write("<a href=\"postcard.htm\" title=\"Postcard Competition Entries\">Postcard Comp</a>|&nbsp;");
document.write("<a href=\"press.htm\" title=\"Press Cuttings\">Press</a>|&nbsp;");
document.write("<a href=\"smudgeguard2.htm\" title=\"Never get smudges again! SmudgeGuard2 now also available.\">SmudgeGuard&reg;</a> |&nbsp;");
document.write("<a href=\"staff.htm\" title=\"Meet our staff\">Staff</a> |&nbsp;");
document.write("<a href=\"tips.htm\" title=\"Tips, techniques, and useful information\">Tips &amp; Techniques</a> |&nbsp;");
document.write("<a href=\"workshop.htm\" title=\"Workshops & Demonstrations\">Workshops</a>&nbsp;");
}


//-- Legal --------------------------------------------------------------------------------------------------------------------------------

function legal( )
{
document.write("<a href=\"pdf/termsandconditions.pdf\" title=\"Terms and Conditions\" onClick=\"return pdfpopup(this, \'pdf\')\">Terms & Conditions</a> |&nbsp;");
document.write("<a href=\"pdf/privacypolicy.pdf\" title=\"Privacy Policy\" onClick=\"return pdfpopup(this, \'pdf\')\">Privacy Policy</a> |&nbsp;");
document.write("<a href=\"pdf/disclaimer.pdf\" title=\"Disclaimer\" onClick=\"return pdfpopup(this, \'pdf\')\">Disclaimer</a> |&nbsp;");
document.write("<a href=\"site.htm\" title=\"Site Map\">Site Map</a>");
}

//-- old Legal --------------------------------------------------------------------------------------------------------------------------------

function old_legal( )
{
document.write("<table border=0 cellpadding=0 cellspacing=0>");
document.write("<colgroup class=legal span=3></colgroup>");
document.write("<tr>");
document.write("<td width=100><a href=\"pdf/termsandconditions.pdf\" title=\"Terms and Conditions\" onClick=\"return pdfpopup(this, \'pdf\')\">Terms & Conditions</a></td>");
document.write("<td width=100><a href=\"pdf/privacypolicy.pdf\" title=\"Privacy Policy\" onClick=\"return pdfpopup(this, \'pdf\')\">Privacy Policy</a></td>");
document.write("<td width=50><a href=\"pdf/disclaimer.pdf\" title=\"Disclaimer\" onClick=\"return pdfpopup(this, \'pdf\')\">Disclaimer</a></td>");
document.write("</tr>");
document.write("</table>");
}

//-- Menu (old version) ---------------------------------------------------------------------------------------------------------------------------

function menu( )
{
document.write("<table border=0 cellpadding=0 cellspacing=0>");
document.write("<colgroup class=menu span=12 width=69></colgroup>");
document.write("<tr>");
document.write("<td><a href=\"index.htm\" title=\"Main Home Page\">Home</a></td>");
document.write("<td><a href=\"about.htm\" title=\"About Cockermouth Art & Craft\" onClick=\"return sitepopup(this, \'site\')\">About Us</a></td>");
document.write("<td><a href=\"blog.htm\" title=\"Cockermouth Art & Craft Comments blog\">Blog</a></td>");
document.write("<td><a href=\"contacts.htm\" title=\"Contact details\">Contact Us</a></td>");
document.write("<td><a href=\"gallery.htm\" title=\"See what's in our gallery at the moment\">Gallery</a></td>");
document.write("<td><a href=\"links.htm\" title=\"Links to other sites\">Links</a></td>");
document.write("<td><a href=\"news.htm\" title=\"News\">News</a></td>");
document.write("<td><a href=\"photos.htm\" title=\"Photos\">Photos</a></td>");
document.write("<td><a href=\"press.htm\" title=\"Press Cuttings\">Press</a></td>");
document.write("<td><a href=\"site.htm\" title=\"Site Map\" onClick=\"return sitepopup(this, \'site\')\">Site Map</a></td>");
document.write("<td><a href=\"staff.htm\" title=\"Meet our staff\">Staff</a></td>");
document.write("<td><a href=\"javascript:history.go(-1);\" title=\"Back to previous page\">Back</a></td>");
document.write("</tr>");
document.write("</table>");
}

//-- auto-center window popup ----------------------------------------------------------------------------------------------------

/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll)
{
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}


//-- PDF popup ------------------------------------------------------------------------------------------------------------------------

function pdfpopup(pdflink, pdfwindow)
{
if (! window.focus)return true;
var href;
if (typeof(pdflink) == 'string')
   href=pdflink;
else
   href=pdflink.href;
window.open(href, pdfwindow, 'top=25,left=200,width=500,height=700,resizable=yes,scrollbars=yes');
return false;
}

//-- Listen popup ----------------------------------------------------------------------------------------------------------------------

function cdpopup(mylink, cdwindow)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, cdwindow, 'top=25,left=50,width=750,height=675,scrollbars=no');
return false;
}

//-- Jpeg popup ----------------------------------------------------------------------------------------------------------------------

function jpgpopup(jpglink, jpgwindow)
{
if (! window.focus)return true;
var href;
if (typeof(jpglink) == 'string')
   href=jpglink;
else
   href=jpglink.href;
window.open(href, jpgwindow, 'top=25,left=50,width=875,height=550,location=no,resizable=yes,scrollbars=yes');
return false;
}

//-- Photo popup ----------------------------------------------------------------------------------------------------------------------

function picpopup(mylink, picwindow)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, picwindow, 'top=100,left=100,width=850,height=650,location=no,titlebar=no,resizable=yes,scrollbars=yes');
return false;
}

//-- Poster popup ----------------------------------------------------------------------------------------------------------------------

function pstpopup(posterlink, posterwindow)
{
if (! window.focus)return true;
var href;
if (typeof(posterlink) == 'string')
   href=posterlink;
else
   href=posterlink.href;
window.open(href, posterwindow, 'top=25,left=50,width=600,height=550,scrollbars=no');
return false;
}

//-- Word popup ----------------------------------------------------------------------------------------------------------------------

function wordpopup(wordlink, wordwindow)
{
if (! window.focus)return true;
var href;
if (typeof(wordlink) == 'string')
   href=wordlink;
else
   href=wordlink.href;
window.open(href, wordwindow, 'top=45,left=200,width=500,height=650,menubar=yes,resizable=yes,scrollbars=yes');
return false;
}

//-- Blog popup ----------------------------------------------------------------------------------------------------------------------

function blogpopup(bloglink, blogwindow)
{
if (! window.focus)return true;
var href;
if (typeof(bloglink) == 'string')
   href=bloglink;
else
   href=bloglink.href;
window.open(href, blogwindow, 'top=50,left=50,width=800,height=600,menubar=yes,resizable=yes,scrollbars=yes');
return false;
}

//-- Sitemap popup ----------------------------------------------------------------------------------------------------------------------

function sitepopup(sitelink, sitewindow)
{
if (! window.focus)return true;
var href;
if (typeof(sitelink) == 'string')
   href=sitelink;
else
   href=sitelink.href;
window.open(href, sitewindow, 'top=50,left=50,width=800,height=600,menubar=yes,resizable=no,scrollbars=yes');
return false;
}

//-- Calendar popup ----------------------------------------------------------------------------------------------------------------------

function calendarpopup(calendarlink, calendarwindow)
{
if (! window.focus)return true;
var href;
if (typeof(calendarlink) == 'string')
   href=calendarlink;
else
   href=calendarlink.href;
window.open(href, calendarwindow, 'top=50,left=50,width=800,height=600,menubar=no,resizable=no,scrollbars=yes');
return false;
}

//--SPL calc ----------------------------------------------------------------------------------------------------------------------

function compute (obj) {

with (Math) {

Dist=eval(obj.Dist.value);
S=eval(obj.Sens.value);
Lv=eval(obj.Lspl.value);
hr=eval(obj.Ahrm.value);
p=eval(obj.p.value);
Amp=eval(obj.Amp.value);

r=20*(0.43429*log(Dist));
m=S+(10*(0.43429*log(Amp)));
n=m-r;

x=Lv-S+(20*(Math.LOG10E*log(Dist)));
d=x + hr;

y=d / 10;
q=10;
p=Math.pow(q, y);

a=p*1;

obj.p.value=Math.round(a);
obj.h.value=Math.round(r);
obj.j.value=Math.round(m);
obj.k.value=Math.round(n);
 }	
}

//-- Audio Player ----------------------------------------------------------------------------------------------------------------------

function changeaudio(name)
{
document.getElementById('player').innerHTML="<object id='Player1' classid='clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6' align='middle' height='65' width='250'><param id='audiourl' name='URL' value='audio/cds003/"+name+".mp3'><param name='playCount' value='1'><param name='autoStart' value='1'></object>";
}

//--Message Scroller----------------------------------------------------------------------------------------------------------------------

/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",60)', delayb4scroll) //increase 30 to 45 or more to slow scroll speed
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee

//---Scroller 2nd instance------------------------------------------------------------------------------------------------------------------------------------------------------------------

/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll1=1000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed1=2 //Specify marquee scroll speed (larger is faster 1-10)
var pausei1t=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed1=marqueespeed1
var pausespeed1=(pauseit==0)? copyspeed1: 0
var actualheight1=''

function scrollmarquee1(){
if (parseInt(cross_marquee1.style.top)>(actualheight1*(-1)+8))
cross_marquee1.style.top=parseInt(cross_marquee1.style.top)-copyspeed1+"px"
else
cross_marquee1.style.top=parseInt(marqueeheight1)+8+"px"
}

function initializemarquee1(){
cross_marquee1=document.getElementById("vmarquee1")
cross_marquee1.style.top=0
marqueeheight1=document.getElementById("marqueecontainer1").offsetHeight
actualheight1=cross_marquee1.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee1.style.height=marqueeheight1+"px"
cross_marquee1.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee1()",30)', delayb4scroll1) //increase 30 to 45 or more to slow scroll speed
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee1, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee1)
else if (document.getElementById)
window.onload=initializemarquee1

//---------------------------------------------------------------------------------------------------------------------------------------------------------------------
