function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}


function modifyThumbs(ic) {
var ty

		 if (ic<curICount) {
		 
		 	 for (ty=--lastId;ty>(lastId-(curICount-ic));ty--) {
			

			 var toRem=findDOM("imgP" + idList[ty],0)
			 var thdd=findDOM("imageThumbList",0)
		 	  	thdd.removeChild(toRem);
		 		
		 		}
				lastId=lastId-(curICount-ic)
				curICount=ic
		 }
		 if (ic>curICount) {
		 	var nodeText=""
			var fragment = document.createDocumentFragment();
			var origId=lastId+1
		 	for (ty=lastId;ty<(lastId+(ic-curICount));ty++) {
				nodeText=""
				lastId
				//nodeText="<P class='streamList' id='imgP" + idList[lastId] + "'>"
				nodeText+="<a href='http://easygome.com/photo-shariing/photo-flirt.asp?imgId=" + idList[ty] + "' title='click to view and comment on this sample'>"
				nodeText+="<img src='imgs/imgsmall" + idList[ty] + ".jpg' width='87' height='100' ><\/a>"
				
				var eDIV = document.createElement("p");
				eDIV.setAttribute("id","imgP" + idList[ty]);
				eDIV.setAttribute("class","streamList");
				
				eDIV.className="streamList"
				
				eDIV.innerHTML=nodeText
				// eDiv.appendChild(textNode)
				fragment.appendChild(eDIV)
				eDiv=null
				
				if (ty>=idList.length) {
				   ty=5000
				  }
				}
				 lastId=lastId+(ic-curICount)
				 curICount=lastId
				var ttthhh=findDOM("imageThumbList",0)
				
				ttthhh.insertBefore(fragment,ttthhh.firstChild)
				curICount=ic
						}
						
		 }


