function switchPict(newPic){
	
   document.mainPict.src = newPic;
}

function smallWind(whatH, whatW){
	
	window.resizeTo(whatH,whatW);
	window.moveTo(100,100);
}

function newWind(){
	
	document.open("stage.php", "myWind", "width=550,height=850,scrollbars=no");
}

function resize(whatWin){
	
	window.open(whatWin,"newWinn","toolbar=no, scrollbars=no, width=600,height=400");
	}


var win=null;

function NewWindow(mypage,myname,w,h,scroll){
 				
   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 windowAdj(){

	top.window.moveTo(0,0);

	if (document.all){
    	
		top.window.resizeTo(screen.availWidth, screen.availHeight);
	
	} else if (document.layers||document.getElementById){
    	
		if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
       	 
		 top.window.outerHeight = screen.availHeight;
       	 top.window.outerWidth = screen.availWidth;
  	 }
		}
	}
	
	
	
			function resize(whatWin){
	
	window.open(whatWin,"newWinn","toolbar=no, scrollbars=no, width=600,height=450");
	}
		
		function change (img, w, h, txt){
		
				var object = document.getElementById('lz');
				
				object.innerHTML = '<div id="topHD"><h2>'+txt+'</h2></div><img src="'+img+'" width="'+w+'" height="'+h+'" title="'+txt+'" alt="'+txt+' image" border="0" />';
				
				}		
		
		var xmlObj = null;

	function popup(Y,X,t,l){	
					
		//data request object
		//xmlhttp = new XMLHttpRequest();	

		
		if(window.XMLHttpRequest){
					
		//data request object
		xmlObj = new XMLHttpRequest();
		} else {
			try {
				
				xmlObj = new ActiveXObject("Msxml2.XMLHTTP");
				// alert("alert");
			}
			 catch (e){
				 try{
					 
					 xmlObj = new ActiveXObject("Microsoft.XMLHTTP");
					 // alert("alert");
				 }
				 catch (e){
					 
					 xmlObj =0;
					 // alert("alert");
				 }}} 
		
		var n =document.getElementById(l);
		
		var ki = document.getElementById("zap");
		
		xmlObj.open("GET", "elements/content.php?dat="+t, true);
		
		xmlObj.onreadystatechange = function (){
			
			if(xmlObj.readyState == 4 && !ki){
				
			var p1 = document.createElement("span");
				p1.setAttribute("class", "corners");
				p1.setAttribute("id", "zap");
							
				n.appendChild(p1);
				
				p1.style.zIndex = 1000;
				p1.style.width = "300px"
				p1.style.height ="auto"
				p1.style.position ="absolute";
				
				try{
				//p1.style.top = (Y-p1.offsetHeight-l.offsetHeight)+"px";
				//p1.style.left=(X-p1.offsetWidth-l.offsetWidth+40)+"px";
					} catch(e){}
				p1.style.borderRight="2px solid #000";
				p1.style.borderTop="1px solid #111111";
	
				p1.style.borderLeft= "1px solid #111111";
				p1.style.borderBottom="2px solid #000";
				
				try{
				p1.style.backgroundColor="rgba(100,100,100, 0.75)";
				}
				catch(e){
				p1.style.backgroundColor="#777777";
				}
				/*var p2a = document.createTextNode(xmlhttp.responseText)
				p1.appendChild(p2a);*/
					
					p1.innerHTML=xmlObj.responseText;
					
				//
				try{
				setTimeout("rid('"+l+"')", 3000);
							}
							catch(e){}
								
								}
						 }
				//
				xmlObj.send(null)
				
				
				}
	//rollout for popup
	function rid(b){
	
		var d2 = document.getElementById(b);
		
		var d1 = document.getElementById("zap");
		try{
		
			d2.removeChild(d1);
			
			 }catch(e){d2.removeChild(d1)}
			
	}
		//rollover for info popup
	function roll(event,w,k){

		var p5 = document.getElementById(w)
		
		if(!document.getElementById("zap")){
			
			popup(event.clientY,event.clientX,w,k);
			////console.log("zap-not-open");
			} 
			}
	
	
				
	function gog(x,o){
	
		var e1 = document.getElementById(x);
		
		var e2 = document.createElement("span");
				e2.setAttribute("class", "corners");
				e2.setAttribute("id", "zap");
							
				e2.style.zIndex = 1000;
				e2.style.width = "auto"
				e2.style.height ="600px"
				e2.style.paddingTop="20px";
				e2.style.paddingLeft="20px";
				e2.style.paddingRight="20px";
				e2.style.position ="absolute";
				e2.style.borderRight="2px solid #000";
				e2.style.borderTop="1px solid #111111";
				e2.style.borderLeft= "1px solid #111111";
				e2.style.borderBottom="2px solid #000";
				
				e1.appendChild(e2);
				
				try{
				e2.style.backgroundColor="rgba(100,100,100, 0.75)";
				}
				catch(e){
				e2.style.backgroundColor="#777777";
				}
				
				var e3 = document.createElement('img');
					e3.setAttribute('src', o);
					e2.appendChild(e3);
					
	}
			
			
	function view(event,i,pic){
		//console.log("logit"+i+pic);
		gog(i,pic);
	}
	

