
var defaultStyle = "location=yes,menubar=no,resizable=yes,scrollbars=yes,status=yes,titlebar=no,toolbar=yes";

function openWindow(anchor, width, height, style) {
    var s = "width=" + width + ",height=" + height + (style == "" ? "," + defaultStyle : "," + style);
    var wnd = window.open(anchor.href, anchor.target, s);

    wnd.focus();
    return false;
}

function load(anchor) {
    var target = null;

    if (anchor.target != '_opener'){
        target = window.open(anchor.href, anchor.target, defaultStyle);
        return;
    }

    target = window.opener;
    if (target != null) {
        target.location.href = anchor.href;
    }
}

function reload(anchor) {
    var target = null;

    if (anchor.target != '_opener') {
        target = window.open("", anchor.target, defaultStyle);
        target.location.reload(true);
        return;
    }

    target = window.opener;
    if (target != null) {
        target.location.reload(true);
    }
}

function setName(n) {
	window.name = n;
}

function open_ezEnqAnswer() {
    var winEzEnqAnswer =  
            window.open('', 'winEzEnqAnswer', 'width=600,height=200,menubar=no,dependent=yes,directories=no,location=no,resizable=yes,status=no,toolbar=no,scrollbars=yes');
	winEzEnqAnswer.focus();
    with (document.frmEzEnqAnswer) {
        target = "winEzEnqAnswer";
	    submit();
    }
}

var winIcons = null;
function showIcons() {
	var iconCategory = document.designForm.iconCategory.value;
	winIcons = window.open("/showCircleIcons?iconCategory=" + iconCategory, "iconbox", "width=300,height=390,resizable=yes");
	winIcons.focus();
}

function closeIconWindow(){
     if(winIcons != null && !winIcons.closed){
	      winIcons.close();
     }
}
