




function puwinv1(path,wname,title,w,h) {
	if (path.search('http://')==-1) path='../'+path;
	if (wname=='') wname='puwin';
	if (title=='') title=' ';
	if (w=='') w=100; if (h=='') h=100;
	window.open('php/puwinv1.php?path='+urlencode(path)+'&title='+urlencode(title)+'&w='+w.toString()+'&h='+h.toString(),wname,'width='+w.toString()+',height='+h.toString()+',resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no');
}
function puwin(path,wname,title,w,h) {
	if (wname=='') wname='puwin';
	if (title=='') title=' ';
	if (w=='') w=100; if (h=='') h=100;
	if (!(path.toLowerCase().substring(path.indexOf('.jpg'))=='.jpg')&&
		!(path.toLowerCase().substring(path.indexOf('.gif'))=='.gif')&&
		!(path.toLowerCase().substring(path.indexOf('.png'))=='.png')&&
		!(path.toLowerCase().substring(path.indexOf('.bmp'))=='.bmp')&&
		!(path.toLowerCase().substring(path.indexOf('.avi'))=='.avi')&&
		!(path.toLowerCase().substring(path.indexOf('.wmv'))=='.wmv')&&
		!(path.toLowerCase().substring(path.indexOf('.mpg'))=='.mpg')&&
		!(path.toLowerCase().substring(path.indexOf('.mov'))=='.mov')&&
		!(path.toLowerCase().substring(path.indexOf('.m4v'))=='.m4v')&&
		!(path.toLowerCase().substring(path.indexOf('.mp4'))=='.mp4')&&
		!(path.toLowerCase().substring(path.indexOf('.flv'))=='.flv')&&
		!(path.toLowerCase().substring(path.indexOf('.swf'))=='.swf')) {
		window.open(path,wname,'width='+w.toString()+',height='+h.toString()+',top='+((screen.height-h)/2)+',left='+((screen.width-w)/2)+',resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no');
		return;
	}
	if (path.search('http://')==-1) path='../'+path;
	var bd=document.body;
	var d=document.createElement('div');
	d.style.visibility='hidden';
	var f=document.createElement('form');
	f.action='php/puwin.php'; f.target=wname; f.method="post";
	var hid=0;
	hid=document.createElement('input'); hid.type='hidden';
	hid.name='path'; hid.value=path; f.appendChild(hid);
	hid=document.createElement('input'); hid.type='hidden';
	hid.name='title'; hid.value=title; f.appendChild(hid);
	hid=document.createElement('input'); hid.type='hidden';
	hid.name='w'; hid.value=w; f.appendChild(hid);
	hid=document.createElement('input'); hid.type='hidden';
	hid.name='h'; hid.value=h; f.appendChild(hid);
	d.appendChild(f);
	bd.appendChild(d);
	window.open('',wname,'width='+w.toString()+',height='+h.toString()+',resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no');
	f.submit();
}
function resizepuwin(imgid) {
	var img = document.getElementById(imgid); var ow = img.width; var oh = img.height;
	var fixw=0; var fixh=0;
	if (isie()&&isie()<=6) fixh=60;
	else if (isie()>=7) fixh=80;
	else if (isff()) fixh=85;
	else if (issaf()) {fixw=5; fixh=30;}
	window.moveTo((screen.availWidth-img.width+fixw)/2,(screen.availHeight-img.height+fixh)/2);
	window.resizeTo(img.width+fixw,img.height+fixh);
}
function resizepuwinflv(flvw,flvh) {
	var fixw=0; var fixh=0;
	if (isie()&&isie()<=6) fixh=60;
	else if (isie()>=7) fixh=80;
	else if (isff()) fixh=85;
	else if (issaf()) {fixw=5; fixh=30;}
	window.moveTo((screen.availWidth-flvw+fixw)/2,(screen.availHeight-flvh+fixh)/2);
	window.resizeTo(flvw+fixw,flvh+fixh);
}
function centerpuwin() {
	var winw=0; var winh=0;
	if (isie()) {winw=document.body.clientWidth;winh=document.body.clientHeight;}
	else {winw=window.outerWidth;winh=window.outerHeight;}
	moveTo((screen.availWidth-winw)/2,(screen.availHeight-winh)/2);
}






