var cn=0;
var cover_swap=0;
//////////////////////////////////////////////////////////////////////////////
function loadXMLDoc(url,tid,param1){
vtid=tid;
clearInterval(cover_swap);
if(vtid == "about"){
    url += "?page=about";
    }
if(vtid == "mission"){
    url += "?page=mission";
    }
if(vtid == "map"){
    url += "?page=map";
    }
if(vtid == "awards"){
    url += "?page=awards";
    }
if(vtid == "newsletters"){
    url += "?page=newsletters";
    }
if(vtid == "contact"){
    url += "?page=contact";
    }

	var xmlHttp;
	try{xmlHttp=new XMLHttpRequest();}
		catch (e){
	try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
	catch (e){
		try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
		catch (e){alert("Your browser does not support AJAX!");
        	return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function(){
      if(xmlHttp.readyState==4){
        if(vtid == "about" && xmlHttp.readyState==4){
            document.getElementById('html_copy').innerHTML=xmlHttp.responseText;
            }
        if(vtid == "mission" && xmlHttp.readyState==4){
            document.getElementById('html_copy').innerHTML=xmlHttp.responseText;
            }
        if(vtid == "map" && xmlHttp.readyState==4){
            document.getElementById('html_copy').innerHTML=xmlHttp.responseText;
            dsp_cover();
            }
        if(vtid == "awards" && xmlHttp.readyState==4){
            document.getElementById('html_copy').innerHTML=xmlHttp.responseText;
            }
        if(vtid == "newsletters" && xmlHttp.readyState==4){
            document.getElementById('html_copy').innerHTML=xmlHttp.responseText;
            }
        if(vtid == "contact" && xmlHttp.readyState==4){
            document.getElementById('html_copy').innerHTML=xmlHttp.responseText;
            }
        if(vtid == "login" && xmlHttp.readyState==4){
            document.getElementById('html_copy').innerHTML=xmlHttp.responseText;
            }

        }
        }
    xmlHttp.open("GET",url,true);
    xmlHttp.send(null);
}

////////////////////////////////////////
function dsp_cover(cover){
    //dsp_covers();
    cover_swap = setInterval("dsp_covers()",4000);
}
////////////////////////////////////////
function dsp_covers(){
    if(cn > 16){cn = 0;}
    document.getElementById('cover').visibility="hidden";
    if(cn==0){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/AZ-LLN.jpg'><div>Lovin' Life After 50 - Arizona</div>";
        }
    if(cn==2){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/CO-BYB.jpg'><div>The Beacon - Colorado</div>";
        }
    if(cn==3){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/MD-SB.jpg'><div>Senior Beacon - Maryland</div>";
        }
    if(cn==4){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/FL-ML.gif'><div>Mature Lifestyles - Florida</div>";
        }
    if(cn==5){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/IA-50P.gif'><div>50 Plus Lifestyles - Indiana</div>";
        }
    if(cn==6){
        }
    if(cn==7){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/IL-SN.gif'><div>Chicagoland's Senior News</div>";
        }
    if(cn==8){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/LA-TBOT.jpg'><div>The Best of Times - LA</div>";
        }
    if(cn==9){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/MA-SA.gif'><div>Fifty Plus Advocate - MA</div>";
        }
    if(cn==10){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/MI-MMMC.gif'><div>FiftyPlus! - Michigan</div>";
        }
    if(cn==11){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/MN-GA.gif'><div>Minnesota Good Age</div>";
        }
    if(cn==12){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/NY-FY.gif'><div>Forever Young - New York</div>";
        }
    if(cn==14){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/VA-50P.gif'><div>Fifty Plus - VA</div>";
        }
    if(cn==15){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/WI-50P.gif'><div>Fifty Plus - WI</div>";
        }
    if(cn==16){
        document.getElementById('cover').innerHTML="<img src='http://maturepublishers.com/img/covers/WI-ML.gif'><div>Fifty Plus Lifestyles- WI</div>";
        }

    ++cn;
    document.getElementById('cover').visibility="visible";

    }
////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
function cover_image_upload(pubid){
    var uploadDoc = window.open('','uploader','width=400,height=200,left=200,top=100,screenX=200,screenY=200');
    uploadDoc.document.open();
    uploadDoc.document.writeln("<FORM NAME='upload' ACTION='http://maturepublishers.com/cgi-bin/cover_img.pl' METHOD='POST' ENCTYPE='multipart/form-data'>");
    uploadDoc.document.writeln("<INPUT NAME='Fileuploader' TYPE='FILE' SIZE='40'> <BR>");
    uploadDoc.document.writeln("<INPUT TYPE='hidden' NAME='pubid' VALUE='|" + pubid + "'>");
    uploadDoc.document.writeln("<INPUT TYPE='submit' VALUE='Upload the cover image'>");
    uploadDoc.document.writeln("</FORM>");
    uploadDoc.document.close();
    }

