function openPage(){
	var pageName=document.getElementById("pageName").value;
	window.open(pageName)
}

var autoNextPic;
function picsInterval(){
	autoNextPic=setInterval("nextPic('no')",2000)
}

function nextPic(obj){
	var http = createRequestObject();

	id=document.getElementById("numId").value;
	var postdata= 'id='+id+'&sendMail='+obj

	http.open("POST", "includes/findPartnerNextPic.asp", true);

	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", postdata.length);

	http.onreadystatechange = function() {

		if(http.readyState == 4 && http.status == 200) {

			var str=http.responseText;

			if (str!=""){
				str=str.split("&&&")

				var numId=str[0];
				numId=numId.split("=")
				numId=numId[1];

				var bigPic=str[1];
				bigPic=bigPic.split("=")
				bigPic='images/members/'+numId+'/'+bigPic[1];

				var pageName=str[2];
				pageName=pageName.split("=")
				pageName=pageName[1]+'.asp';
				URLencode(pageName)

				document.getElementById("bigPic").src=bigPic;
				document.getElementById("pageName").value=pageName;

				document.getElementById("numId").value=numId;
			}else{
				if(document.getElementById("buttons")!=null){
					document.getElementById("buttons").style.display='none';
				}
				document.getElementById("sentToAll").style.display='block';
				clearInterval(autoNextPic);
			}

		}
	}
	http.send(postdata);
}



function URLencode(strText){
strText=strText.toString();
strText=strText;
strText=strText.replace(/à/g,"&#1488;");
strText=strText.replace(/á/g,"&#1489;");
strText=strText.replace(/â/g,"&#1490;");
strText=strText.replace(/ã/g,"&#1491;");
strText=strText.replace(/ä/g,"&#1492;");
strText=strText.replace(/å/g,"&#1493;");
strText=strText.replace(/æ/g,"&#1494;");
strText=strText.replace(/ç/g,"&#1495;");
strText=strText.replace(/è/g,"&#1496;");
strText=strText.replace(/é/g,"&#1497;");
strText=strText.replace(/ë/g,"&#1498;");
strText=strText.replace(/ì/g,"&#1499;");
strText=strText.replace(/î/g,"&#1500;");
strText=strText.replace(/ð/g,"&#1501;");
strText=strText.replace(/ñ/g,"&#1502;");
strText=strText.replace(/ò/g,"&#1503;");
strText=strText.replace(/ô/g,"&#1504;");
strText=strText.replace(/ö/g,"&#1505;");
strText=strText.replace(/÷/g,"&#1506;");
strText=strText.replace(/ø/g,"&#1507;");
strText=strText.replace(/ù/g,"&#1508;");
strText=strText.replace(/ú/g,"&#1509;");
strText=strText.replace(/í/g,"#1510;");
strText=strText.replace(/ï/g,"#1511;");
strText=strText.replace(/ó/g,"#1512;");
strText=strText.replace(/õ/g,"#1513;");
strText=strText.replace(/ê/g,"#1514;");
strText=strText.replace(/ /g,"%20");
//alert(strText);
return strText;
}

