// Pop up a new window.
function popup(filename, width, height, scrollbars, resize) {
 var etcParams = ",directories=0,location=0,menubar=0,resizable="+(resize ? "1" : "0")+",status=0,toolbar=0,scrollbars=" + (scrollbars ? "1" : "0");
	try {
		win.close();
	}catch(e){		
	}
	var windowName = "newWin"
	win = window.open(filename, windowName, 'height=' +height+ ', width=' +width+ etcParams);	
	win.focus();
/*	
 var popup = window.open(filename, 'newWin', "width=" + width + ",height=" + height + etcParams);
 popup.focus();
*/
}
function openWindow2(url,winName,w,h,resizedata) {
	leftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	topPosition = (screen.height) ? (screen.height-h)/2 : 0;
	
	var windowprops = 'width=' + w + ',height=' + h + ',top='+ topPosition +',left='+ leftPosition+',resizable=' + resizedata +',toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no';
	try {
		popup.close();
	}catch(e){		
	}	
	var popup = window.open(url,winName,windowprops);
	popup.focus();
}

function popup2(filename, width, height, scrollbars) {
 var etcParams = ",directories=0,location=0,menubar=0,resizable=1,status=0,toolbar=0,scrollbars=" + (scrollbars ? "1" : "0");
try {
	popup.close();
}catch(e){		
}
 var popup = window.open(filename, 'newWin', "width=" + width + ",height=" + height + etcParams);
 popup.focus();
}
function popup3(filename, width, height, scrollbars, resize, dir, loc, mnu, sts, tbr) {
 var etcParams = ",directories="+(dir ? "1" : "0")+",location="+(loc ? "1" : "0")+",menubar="+(mnu ? "1" : "0")+",resizable="+(resize ? "1" : "0")+",status="+(sts ? "1" : "0")+",toolbar="+(tbr ? "1" : "0")+",scrollbars=" + (scrollbars ? "1" : "0");
try {
	popup.close();
}catch(e){		
}
 var popup = window.open(filename, 'newWin', "width=" + width + ",height=" + height + etcParams);
 popup.focus();
}
function getWallPapers(arg)
{
	var filename="wallpapers/"+arg;
	var h=screen.height*.7;
	var w=screen.width*.7;
	popup(filename, w, h, 1, 1);
}

function popFullBrowser(url) {
	try {
		win.close();
	}catch(e){		
	}
	win = window.open(url, 'newWin', 'height=650, width=770, resizable=1, status=1, scrollbars=1, location=1, menubar=1, toolbar=1');
	win.focus();		
}

function popWallpaper(url) {
	try {
		win.close();
	}catch(e){		
	}
	win = window.open(url, 'newWin', 'height=700, width=770, resizable=0, status=0, scrollbars=1, location=0, menubar=0, toolbar=0');
	win.focus();		
}
