var base = "http://www.mesoweb.com/resources/bibliography.html#";
var base2 = "http://www.mesoweb.com/";
var base3 = "http://";
var base4 = "http://www.mesoweb.com/encyc/";
var base6 = "http://www.mesoweb.com/rubbings/resources/";

function open_window(name)
{
    url=name;
    openwin =
window.open(name,'_blank','toolbar=yes, location=yes, menubar=yes, width=700, height=440, status=yes, scrollbars=yes, resizable=yes');
}

function launch2(name) {
  url=base6+name;
  openwin = window.open(url,'_blank','toolbar=no,location=no,menubar=no,width=500,height=440,status=no,scrollbars=auto,resizable=yes');
}

//function launch(name)
//{
//  url=base+name;
//  openwin = window.open(url,'_blank','toolbar=no,location=no,menubar=no,width=500,height=440,status=no,scrollbars=auto,resizable=yes');
//}

function launch(name)
{
  url=base+name;
  openwin = window.open(url,'_blank','toolbar=no,location=no,width=500,height=640,status=no,scrollbars=yes,resizable=yes');
}




function biblio(name)
{
   url=base+name;
   openwin = window.open(url,'_blank','toolbar=no,location=no,width=500,height=640,status=no,scrollbars=yes,resizable=yes');
}

function encyc(firstname,lastname)
{
    url1=base4+"index.asp?passcall=sitenosearch&passWord="+lastname+"&passwordAND="+firstname
    openwin = window.open(url1,'_blank','toolbar=yes,location=yes,width=700,height=440, status=yes,scrollbars=yes,resizable=yes');
}

function encyc_search(strSearch)
{
    url=base4+"index.asp?passcall=site&passS="+strSearch+"&id2=0&expert=y"
    openwin = 
window.open(url,'_blank','toolbar=yes,location=yes,menubar=no,width=700,height=440,status=yes,scrollbars=yes,resizable=yes');
}

function site(name,w,h)
{
    url=base2+name;
    openwin =
window.open(url,'_blank','toolbar=yes,location=yes,width='+w+',height='+h+',status=yes,scrollbars=yes,resizable=yes');
}

function simple(name,w,h)
{
    url=base2+name;
    openwin =
window.open(url,'_blank','toolbar=no,location=no,width='+w+',height='+h+',status=no,scrollbars=no,resizable=yes');
}

function web(name,w,h)
{
    url=base3+name;
    openwin =
window.open(url,'_blank','toolbar=yes,location=yes,width='+w+',height='+h+',status=yes,scrollbars=yes,resizable=yes');
}

if (document.images) {

	no_returnarrow = new Image
     yes_returnarrow = new Image

     no_returnarrow.src = "media/ReturnGlyph.gif"
     yes_returnarrow.src = "media/ReturnGlyphOver.gif"
}

function chgImg(imgField,newImg) {
         if (document.images) {
           document[imgField].src = eval(newImg + ".src")
          }
}


function getCookie(name) { // use: getCookie("name");
    var re = new RegExp(name + "=([^;]+)");
    var value = re.exec(document.cookie);
    return (value != null) ? unescape(value[1]) : null;
}

  var today = new Date();
  var expiry = new Date(today.getTime() + 28 * 24 * 60 * 60 * 1000); // plus 28 days

function setCookie(name, value) { // use: setCookie("name", value);
    document.cookie=name + "=" + escape(value) + "; expires=" + expiry.toGMTString();
}

function setSessionCookie(name, value) { // use: setCookie("name", value);
    document.cookie=name + "=" + escape(value) 
}
  
function ToggleExactMatchCookie() {
  	if (getCookie("encyc_exactmatch") == "y") {
  	
  	setCookie("encyc_exactmatch","n");
  	
  	} else {
  	
  	setCookie("encyc_exactmatch","y");
  	}
  	
}

function open_window(name)
{
    url=name;
    openwin =
window.open(name,'_blank','toolbar=yes, location=yes, menubar=yes, width=700, height=440, status=yes, scrollbars=yes, resizable=yes');
}