//var myRef = document.referrer.toLowerCase();
//if (document.referrer.indexOf('google.com') > -1)
//    $var = 'this is where you write out the html to be displayed - remember to escape any quotes!';
//else if (document.referrer.indexOf('yahoo.com') > -1)
//    $var = 'this is where you write out the html to be displayed for the yahoo visitors';
//else
//   $reffvar = 'Not Google or Yahoo, but was: ' + myRef;
//$var = $var + '<br>This is a comment';
function adminPop(page) { 
 // args is comma-seperated options such as 'resizeable=no,scrollbars=no'
 var swidth = screen.width;
 var sheight = screen.height;
 var logwin = null;
 var width = 500;
 var height = 550;
 var left = (swidth/2) - (width/2);
 var top = (sheight/2) - (height/2);
 logwin = window.open("","logwin","resizeable=no,scrollbars=yes,height="+height+",width="+width+",left="+left+",top="+top);
 if(logwin != null) {
         if (logwin.opener == null) {
                 logwin.opener = self;
         }
         //used to be logwin.location.href ='/cgi-bin/shop/'+page;
         //logwin.location.href ='/'+page;
         logwin.location.href ='/cgi-bin/shop/'+page;
         if (logwin.blur) logwin.focus();
 }
}
function tellFriend(item) { 
 // args is comma-seperated options such as 'resizeable=no,scrollbars=no'
 var swidth = screen.width;
 var sheight = screen.height;
 var height=500;
 var friend = null;
 var left = swidth/3;
 var top = sheight/3;
 var over = "";
 friend = window.open("","friend","resizeable=yes,scrollbars=no,height="+height+",width=490,left="+left+",top="+top);
 if(friend != null) {
         if (friend.opener == null) {
                 friend.opener = self;
         }
//this used to be friend.location.href ="/cgi-bin/shop/friend.html?item="+item;
         friend.location.href ="friend.html?item="+item;
	 if (friend.blur) friend.focus();
 }
}
function gotoPage(page) {
	alert("gotoPage!");
	window.location=page;
}
function Preloadimgs(length, path, type) {
        for(var i = 1; i<=length; i++) {
                this[i]= new Image();
                this[i].src= path + i + type;
        }
    return this;
}
function closeChildren() {
        if(window.cart) {
                window.cart.close();
        }
}
function newWindow(link, width, height) { 
 // args is comma-seperated options such as 'resizeable=no,scrollbars=no'
 var swidth = screen.width;
 var sheight = screen.height;
 var popup2 = null;
 var left = (swidth/2) - (width/2);
 var top = (sheight/2) - (height/2);
 var over = "";
 popup2 = window.open("","popup2","resizeable=no,scrollbars=no,height="+height+",width="+width+",left="+left+",top="+top);
 if(popup2 != null) {
         if (popup2.opener == null) {
                 popup2.opener = self;
         }
         popup2.location.href = link;
	 if (popup2.blur) popup2.focus();
 }
}
function newFly(link, width, height) { 
 // args is comma-seperated options such as 'resizeable=no,scrollbars=no'
 var swidth = screen.width;
 var sheight = screen.height;
 var fly = null;
 var left = 0;
 var top = 1;
 var over = "";
 fly = window.open("","fly","resizeable=yes,scrollbars=yes,height="+height+",width="+width+",left="+left+",top="+top);
 if(fly != null) {
         if (fly.opener == null) {
                 fly.opener = self;
         }
         fly.location.href = link;
	 if (fly.blur) fly.focus();
 }
}
function showCart() {
 // args is comma-seperated options such as 'resizeable=no,scrollbars=no'
 var swidth = screen.width;
 var sheight = screen.height;
 var height=400;
 var cart = null;
 var left = swidth-(swidth/4);
 var top = sheight/3;
 var over = "";
 cart = window.open("","cart","resizeable=yes,scrollbars=no,height="+height+",width=190,left="+left+",top="+top);
 if(cart != null) {
         if (cart.opener == null) {
                 cart.opener = self;
         }
         cart.location.href ='[area show_cart]';
         if (cart.blur) cart.focus();
 }
}
function tellItem(item) {
 // args is comma-seperated options such as 'resizeable=no,scrollbars=no'
 var swidth = screen.width;
 var sheight = screen.height;
 var height=500;
 var friend = null;
 var left = swidth/3;
 var top = sheight/3;
 var over = "";
 friend = window.open("","friend","resizeable=yes,scrollbars=no,height="+height+",width=490,left="+left+",top="+top);
 if(friend != null) {
         if (friend.opener == null) {
                 friend.opener = self;
         }
//used to be         friend.location.href ="/cgi-bin/shop/friend.html?item="+item;
         friend.location.href ="friend.html?item="+item;
         if (friend.blur) friend.focus();
 }
}
function tellCat(cat) {
 // args is comma-seperated options such as 'resizeable=no,scrollbars=no'
 var swidth = screen.width;
 var sheight = screen.height;
 var height=500;
 var friend = null;
 var left = swidth/3;
 var top = sheight/3;
 var over = "";
 friend = window.open("","friend","resizeable=yes,scrollbars=no,height="+height+",width=490,left="+left+",top="+top);
 if(friend != null) {
         if (friend.opener == null) {
                 friend.opener = self;
         }
         //used to be friend.location.href ="/cgi-bin/shop/friend.html?cat="+cat;
         friend.location.href ="friend.html?cat="+cat;
         if (friend.blur) friend.focus();
 }
}

