function msgAlert(msg,layer) {
var x=document.getElementById(layer);
div1="<div id='close' style='position:absolute; width:33px; height:33px;	z-index:7; left: 370px; top: 0px;'><a href='javascript:void()' onclick=clearLayer("+"'"+layer+"'"+") ><span style='font-weight:bold; color:#000000; font-size:14px;'><img src='/images/closeButton.gif' alt='close' width='33' height='33' border='0'/></span></a></div>";
div2="<div id='close' align='center' style='position:absolute; width:250px; height:150px; z-index:7; left: 75px; top: 50px;'>"+msg+"</div>";
imgsrc2="<div align='center' style='position:absolute; top:0px; width:400px; height:250px; border:double'>"+div1+div2+"</div>";
x.innerHTML=imgsrc2;
x.show();
}

function clearLayer(layer) {
msg=''
var x=document.getElementById(layer);
imgsrc2="<div align='center' style='position:absolute; top:0px; width:150px; height:75px;'>"+msg+"</div>";
x.innerHTML=imgsrc2;
x.show();
}

function popImg(imgsrc, ht, bkg) {
vspace=15;
hgt=420*ht+30;
var x=document.getElementById("photo");
imgsrc2="<div align='center' style='position:absolute; top:0px; width:450px; height:"+hgt+"px; background-image:url("+bkg+")'><img vspace="+vspace+" src="+imgsrc+" width='420'></div>";
x.innerHTML=imgsrc2;
x.show();
}

function clearImg(imgsrc) {
var x=document.getElementById("photo");
imgsrc2="";
x.innerHTML=imgsrc2;
x.show();
}

function popImgMain(imgsrc, ht, bkg) {
vspace=7;
hgt=420*ht+14;
var x=document.getElementById("ivyMsg");
imgsrc2="<div onmouseover=ajax('clearMsg.php','ivyMsg') align='center' style='position:absolute; top:3px; left:-5px; width:434px; height:"+hgt+"px; background-image:url("+bkg+")'><img vspace="+vspace+" src="+imgsrc+" width='420'></div>";
x.innerHTML=imgsrc2;
x.show();
}

function popImgMain2(imgsrc, ht, bkg) {
vspace=7;
hgt=420*ht+14;
var x=document.getElementById("msgAlert");
imgsrc2="<div onmousedown=ajax('clearMsg.php','msgAlert') align='center' style='position:absolute; top:3px; left:-5px; width:434px; height:"+hgt+"px; background-image:url("+bkg+")'><img vspace="+vspace+" src="+imgsrc+" width='420'></div>";
x.innerHTML=imgsrc2;
x.show();
}

function clearImgMain() {
var x=document.getElementById("ivyMsg");
imgsrc2="";
x.innerHTML=imgsrc2;
x.show();
}

function clearImgMain2() {
var x=document.getElementById("msgAlert");
imgsrc2="";
x.innerHTML=imgsrc2;
x.show();
}

function popup3(imgsrc,ht)
{
tiptop=7*ht;
hgt=337*ht;
var mywindow=window.createPopup();
var pbody=mywindow.document.body;
imgsrc2="<div align='center' style='position:relative; top:"+tiptop+"px;'><img src="+imgsrc+" width='323'></div>";
pbody.style.backgroundColor="#CE714F";
//pbody.style.border="solid 13px";
//pbody.style.borderColor="#CE714F";
xpos=event.clientX+10;
ypos=event.clientY - hgt;
//pbody.style.backgroundImage="url("+ bkg + ")";
pbody.innerHTML=imgsrc2;
mywindow.show(xpos,ypos-15,337,hgt,document.body);
}

function popup2(imgsrc,ht,bkg)
{
tiptop=15*ht;
hgt=365*ht;
var mywindow=window.createPopup();
var pbody=mywindow.document.body;
imgsrc2="<div align='center' style='position:relative; top:"+tiptop+"px;'><img src="+imgsrc+" width='335'></div>";
pbody.style.backgroundColor="white";
//pbody.style.border="solid 13px";
//pbody.style.borderColor="#CE714F";
pbody.style.backgroundImage="url("+ bkg + ")";
pbody.innerHTML=imgsrc2;
mywindow.show(637,0,365,hgt,document.body);
}

function popupTxt()
{
var mywindow=window.createPopup();
var pbody=mywindow.document.body;
msg='Donate $15 and get 3 month premium privileges. Get top priority in the sort list, 3 month expiration and 15 free postings daily. Your donation helps maintain this free site. Thank you.';
pbody.style.backgroundColor="#F1F3F1";
pbody.style.border="solid 5px";
pbody.style.borderColor="#CE714F";
xpos=event.clientX;
ypos=event.clientY;
//pbody.style.backgroundImage="url("+ bkg + ")";
pbody.innerHTML=msg;
mywindow.show(xpos-330,ypos,345,90,document.body);
}

function clearWindow()
{
var mywindow=window.createPopup();
var pbody=mywindow.document.body;
msg='';
//pbody.style.backgroundColor="transparent";
//pbody.style.border="solid 5px";
//pbody.style.borderColor="#CE714F";
//xpos=event.clientX;
//ypos=event.clientY;
//pbody.style.backgroundImage="url("+ bkg + ")";
pbody.innerHTML=msg;
mywindow.show(0,0,0,0,document.body);
}

function popup(imgsrc,ht,bkg)
{
ht=475*ht;
var mywindow=window.createPopup();
var pbody=mywindow.document.body;
imgsrc2="<img src="+imgsrc+" width='500'>";
pbody.style.backgroundColor="white";
pbody.style.border="solid 13px";
pbody.style.borderColor="#CE714F";
pbody.innerHTML=imgsrc2;
mywindow.show(503,0,500,ht,document.body);
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());
}

function setBkgImg(imgsrc, layer) {
c_name='bkgimg';
value=imgsrc;
expiredays=1;
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());

var x=document.getElementById(layer);
x.style.backgroundImage="url("+imgsrc+")";
x.show();
}

function setBkgTxt(imgsrc, layer) {
c_name='bkgtxt';
value=imgsrc;
expiredays=1;
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());

var x=document.getElementById(layer);
x.style.backgroundImage="url("+imgsrc+")";
x.show();
}
  
function recnum(pageNum, totalPages, layer) {
var x=document.getElementById(layer);
if (pageNum>=totalPages) {msg= "Last Page "+totalPages;}
else if (pageNum<=1) {msg= "First Page";}
else {msg= "p"+pageNum+" of "+totalPages;}
txt="<div align='center' style='width:103px; height:15px'>"+msg+"</div>";
x.innerHTML=pageNum;
x.show();
}