﻿//params prepared in surrounding inc file:
//var jsviewstate 
//var jslocationcookiename 
//var jslancookiename

function gobasket() { goAndStoreLocation(basketurl)}

function goAndStoreLocation(url)
{
    setCookie(jslocationcookiename, escape(document.location.href), '', '/') //Mon, 01-Jan-2020 00:00:00 GMT
    document.location.href = url;
}

function goBackToStoredLocation() 
{
    var backcookie = getCookie(jslocationcookiename)
    if (backcookie != '') { document.location.href = unescape(backcookie) }
}

var refreshonfocus = 'N'
window.onfocus = function()  {if (refreshonfocus!='N') {dorefresh();} }
function dorefresh() {document.location.reload();refreshonfocus = 'N';}
 
function enlargeImage(id,w,h) {enlargeCommon('imageviewer.asp', id, w, h )}
function enlargeVideo(id,w,h) {enlargeCommon('videoviewer.asp', id, w, h )}

var largeimagewindow
function enlargeCommon(page, id, w, h )
{    
    largeimagewindow = window.open(page +'?id=' + id + '&w=' + w + '&h=' + h,'xxxx','titlebar=no,resizable=no,scrollbars=no,status=no,left=160,top=68,width=' + (w + 20) + ',height=' + (h + 40))
}

function makeMailLink (p1, p2, p3)
{
    var url = 'ma'
    url += 'il'
    url += 'to:'
    url += p1 + '@'
    url += p2 + '.'
    url += p3
    document.location.href= url
}

function setcookielan(val)
{
    var expires_date = new Date( new Date().getTime() + (365 * 60 * 60 * 24 * 1000) );
    setCookie (jslancookiename, val, expires_date.toGMTString(), '', '', '')
}

var stdpopwindow
function openstdpopup(url, w, h) {stdpopwindow = window.open(url,'xxzzxx','status=1,resizable=yes,scrollbars=yes,left=350,top=68,width=' + w + ',height=' + h)}
