function edPopup(url, name){

if (name=="window1"){

var width="588";
var height="335";

var position="topL";

var offsetX="30";
var offsetY="20";

var resizable="no";
var scrollbars="no";
var directories="no";
var menubar="no";
var toolbar="no";
var location="no";
var status="no";

}

var defaultOffsetX="15";
var defaultOffsetY="48";

if (document.layers||document.all||document.getElementById){
	
	var screenWidth=screen.availWidth; 
	var screenHeight=screen.availHeight;

	//checking if offset position values are blank
	if (offsetX==""&&position!=""){
    offsetX=defaultOffsetX;
    }
    if (offsetY==""&&position!=""){
    offsetY=defaultOffsetY;
    }
    
    //checking if the window fits into the screen (position)
    
	if (offsetX > screenWidth - width){
	    offsetX=defaultOffsetX;
	}
	if (offsetY > screenHeight - height){
	    offsetY=defaultOffsetY;
	}
	
	//checking if the window fits into the screen (size)
	
	if (width > screenWidth - (offsetX*2)){
		width = screenWidth - (offsetX*2);
	}
	if (height > screenHeight - (offsetY*2)) {
		height = screenHeight - (offsetY*2);
	}
	
	var left="";
    var top="";
    //deciding the popup's position
    if (position !=""){
    	if (position=="topL"){
		left = offsetX;
		top = offsetY;
		}
		else if (position=="topR"){
		left = screenWidth - offsetX - width;
		top = offsetY;
		}
		else if (position=="botL"){
		left = offsetX;
		top = screenHeight - offsetY - height;
		}
		else if (position=="botR"){
		left = screenWidth - offsetX - width;
		top = screenHeight - offsetY - height;
		}
		else if (position=="center"){
		left = (screenWidth - offsetX - width)/2;
		top = (screenHeight - offsetY - height)/2;
		}
		else{
		}
	}
	else{
		left = offsetX;
		top = offsetY;
	}
	
	//setting parameters for v4+ browsers
	var params = "width="+width+",height="+height+",resizable="+resizable+",scrollbars="+scrollbars+",directories="+directories+",menubar="+status+",toolbar="+toolbar+",location="+location+",status="+status+",left="+left+",top="+top+")";
}
else{
	//setting parameters for v3 browsers
	var params = "width="+width+",height="+height+",resizable="+resizable+",scrollbars="+scrollbars+",directories="+directories+",menubar="+status+",toolbar="+toolbar+",location="+location+",status="+status+")";
}
 
	//open window
	var newpopup = window.open(url, name, params);
	//controlling focus
	newpopup.focus();
	//checking if the window opened properly
	if (newpopup.opener == null) newpopup.opener = window;newpopup.opener.name = "edhardPopup";
	
}


function edWinClose(){
window.close();
}

//-----------------------------------------------------------------------
