function popup(url)
{
	var windowName,width,height,attributes,call,pos;	
	if(typeof arguments[1]=="string"){if(!/^[01]+$/.test(arguments[1])){((windowName=arguments[1])&&(call=0));}else{attributes=arguments[1];}}else{if(typeof arguments[1]=="number"){if(arguments.length == 2)attributes=arguments[1];else call=1;}}	
	if(typeof call!="undefined"){if(arguments.length%2==Math.abs(call-1))attributes=arguments[arguments.length-1];if(arguments.length>=(3-call)&&(pos=arguments.length-Number(Boolean(attributes))-1))if(!isNaN(arguments[--pos]+arguments[++pos]))((width=arguments[--pos])&&(height=arguments[++pos]));}	
	var features=new Array("menubar","toolbar","location","directories","scrollbars","status","resizable");
	if(typeof attributes=="string"&&!isNaN(parseInt(attributes,2)))attributes=parseInt(String(attributes),2);
	for(var i=0;i<features.length;i++)features[features.length-(++i)]=features[features.length-(i--)]+"="+Number(Boolean(attributes&Math.pow(2,i)));
	if(width&&height)((features[features.length]="width="+width)&&(features[features.length]="height="+height));
	(window[((windowName)?windowName:"_popup")]=window.open(url,windowName,features.join(","))).focus();
}

function popWin(url,x,y,scroll,win_name)
{
	var popWin = window.open(url,win_name,'directories=no,height=' + y + ',location=no,scrollbars=' + scroll + ',menubar=no,personalbar=no,resizeable=no,status=no,toolbar=no,width=' + x + '');
	popWin.focus();
}
