var popup_current = '';
 
function popup_click(id, drag_id, exit_id, position){

 if  (popup_current != "")
    var element = document.getElementById(popup_current);
	if (element != null )
	if (element.style.visibility != 'hidden'){
       element.style.visibility = 'hidden';
       element.style.display    = 'none';

	}
 popup_current = id;
 popup_show(id, drag_id, exit_id, position, +10, -10);
}

function newWindow_standard(mypage,myname,w,h,features) {
	var settings = 'height=' + h + ',';
	if(screen.width) {
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
		if (screen.width <= 850 || screen.height <= 700) {
			settings += 'scrollbars=yes,'; 
		}
	} else {
		winl = 0;
		wint = 0;
	}
	if (winl < 0) {
		winl = 0;
	}
	if (wint < 0) { 
		wint = 0; 
	}
	settings += 'resizable = 1,';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += 'status=1,';
	settings += features;
	popup = window.open(mypage,myname,settings);
	popup.focus();
}
function newWindow_scroll(mypage,myname,w,h) {
	var settings = 'height=' + h + ',';
	if(screen.width) {
		var winl = (screen.width-w)/2;
		var wint = (screen.height-h)/2;
	} else {
		winl = 0;
		wint = 0;
	}
	if (winl < 0) {
		winl = 0;
	}
	if (wint < 0) { 
		wint = 0; 
	}
	settings += 'resizable = 1,';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += 'status=1,';
	settings += 'scrollbars=yes'; 
	popup = window.open(mypage,myname,settings);
	popup.focus();
}

 function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+'='+escape(cookieValue)
                 + ';expires='+expire.toGMTString();
  }

 function init_pics(){
    if (document.images) 
    { 
      var img_a = new Array(2);
      img_a[0] = new Image();     img_a[0].src = "GFX/p2p-logo1.gif";
      img_a[1] = new Image();     img_a[1].src = "GFX/p2p-logo2.gif";
      img_a[2] = new Image();     img_a[2].src = "GFX/Button_1_1_on.gif";
      img_a[3] = new Image();     img_a[3].src = "GFX/Button_1_2_on.gif";
      img_a[4] = new Image();     img_a[4].src = "GFX/Button_2_1_on.gif";
      img_a[5] = new Image();     img_a[5].src = "GFX/Button_2_2_on.gif";
      img_a[6] = new Image();     img_a[6].src = "GFX/Button_2_3_on.gif";
      img_a[7] = new Image();     img_a[7].src = "GFX/Button_2_5_on.gif";
      img_a[8] = new Image();     img_a[8].src = "GFX/Button_2_4_on.gif";
      img_a[9] = new Image();     img_a[9].src = "GFX/Button_2_4_on.gif";
      img_a[10] = new Image();    img_a[10].src = "GFX/Button_1_3_on.gif";
  }
  SetCookie('Pier2PierScreen',screen.width+'	'+screen.height,5);
  }
  
  function Load_Pic(){
     var settings = '';
     
     settings  += "<IMG SRC=GFX/p2p-logo1.gif BORDER=0>";
     settings  += "<IMG ID=pbar SRC=GFX/p2p-logo2.gif BORDER=0>";
     
     LOAD_PIC.innerHTML = settings;
     LOAD_PIC.style.display = '';
  }


