var pippo;
var ciccio;
var zoom;
var pop;

function insertValueQuery() {
    var myQuery = document.form_news.link;
    var myListBox = document.form_news.links;
    //alert (myListBox.options[myListBox.options.selectedIndex].value);
     myQuery.value= myListBox.options[myListBox.options.selectedIndex].value;
    /*if(myListBox.options.length > 0) {
        var chaineAj = "";
        var NbSelect = 0;
        for(var i=0; i<myListBox.options.length; i++) {
            if (myListBox.options[i].selected){
                NbSelect++;
                if (NbSelect > 1)
                    chaineAj += ", ";
                chaineAj += myListBox.options[i].value;
            }
        }

        //IE support
        if (document.selection) {
            myQuery.focus();
            sel = document.selection.createRange();
            sel.text = chaineAj;
            document.form_news.insert.focus();
        }
        //MOZILLA/NETSCAPE support
        else if (document.form_news.link.selectionStart || document.form_news.link.selectionStart == "0") {
            var startPos = document.form_news.link.selectionStart;
            var endPos = document.form_news.link.selectionEnd;
            var chaineSql = document.form_news.link.value;

            myQuery.value = chaineSql.substring(0, startPos) + chaineAj + chaineSql.substring(endPos, chaineSql.length);
        } else {
            myQuery.value += chaineAj;
        }
    } */
}

function center_me(w,h){
	if(navigator.appName.indexOf('Explorer')+1){
		var win_width=w;
		var win_height=h;
	} else {
		var win_width=window.outerWidth;
		var win_height=window.outerHeight;
	}
	var pos_x=(screen.width-win_width)/2;
	var pos_y=(screen.height-win_height)/2;
	moveTo(pos_x,pos_y);
}

function open_pop(url,w,h){
	if(pippo) pippo.close();
	pippo = window.open(url,'pop','height='+h+',width='+w+'location=no,resizable=no,scrollbars=yes');
}

function close_pop(){
	if(pippo) pippo.close();
}


function open_it(url,w,h){
	if(ciccio) ciccio.close();
	ciccio = window.open(url,'pop','height='+h+',width='+w+'location=no,resizable=no,scrollbars=yes');
}

function close_it(){
	if(ciccio) ciccio.close();
}

function open_scroll(url,w,h){
	if(zoom){
	      zoom.close();
           }
	now=new Date();
	zoom=window.open(url,'pop'+now.getMinutes()+now.getMilliseconds(),'width='+w+',height='+h+'location=no,resizable=no,scrollbars=yes');
}



function open_noscroll(url,w,h){
	if(zoom){
	      zoom.close();
           }
	zoom=window.open(url,'pop','height='+h+',width='+w+'location=no,resizable=no,scrollbars=no');
}

function open_auto_pop(url){
	if(pop){
	      pop.close();
           }
	now=new Date();
	pop=window.open(url,'pop'+now.getMinutes()+now.getMilliseconds(),'location=no,resizable=yes,scrollbars=no');

}
