function newWindow(mypage, myname, w, h, features) {
	if (screen.width) {
		var winl = (screen.width-w) / 2;
		var wint = (screen.height-h) / 2;
	} else {
		winl = 0;
		wint = 0;
	}
	w = w-10;
	h = h-10;
	if (winl < 0) winl = 0;
	if (wint < 0) wint = 0;
	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += features;
	win = window.open(mypage, myname, settings);
	win.window.focus();
}

function openPop(name, id) {
	newWindow(name, id, 753, 530, '');
}

function signup() {
	newWindow('http://www.vittoriomusic.com/data/signup/','join',500,480,'scrollbars=1');
}

function openTerms() {
	newWindow('terms.html', 'openterms', 475, 480, 'scrollbars=1');
}

function buylinks() {
	newWindow('buylinks.html', 'buylinks', 475, 500, 'scrollbars=0');
}

var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height)
{
  width = width-5;
  height = height-10;
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

/*function newWindowImage(url, w, 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;
        var settings = 'height=' + h + ',';
        settings += 'width=' + w + ',';
        settings += 'top=300,';
        settings += ',';
        
        settings += '';  //!!!! put in features here to affect all windows !!!! 
        win = window.parent.open(url, 'gallery',settings);
        //win.window.focus();
		/*var args = 'location=0,status=0,scrollbars=1,width='+h+',height='+h;
		window.open(url, "gallery", args);
}*/

