
function ClickToTop(phpsessid, action, label, num) { 
	var width = 350;
	var height = 150;

	var top=(screen.height-height)/2;
	var left=(screen.width-width)/2;

//height += 300;

	switch(action) {
// Click Contact
		case "contact":
			var w = window.open("clickto.php?PHPSESSID="+phpsessid+"&action="+action+"","window_clickto", "resizable=no, location=no,"+"width="+width+",height="+height+",left="+left+",top="+top+", menubar=no, status=no, scrollbars=no, menubar=no");
			w.focus();			
		break;

// Click Dial To
		case "dialTo":
			num = escape(num);
			var w = window.open("clickto.php?PHPSESSID="+phpsessid+"&action="+action+"&param_out[dialto]="+num+"&param_out[dialtolabel]="+label+"","window_clickto", "resizable=no, location=no,"+"width="+width+",height="+height+",left="+left+",top="+top+", menubar=no, status=no, scrollbars=no, menubar=no");
			w.focus();
		break;

// Click Dial Call
		case "dialCall":
			if(document.getElementById("lineselOpt")) {
				if(document.getElementById("linesel")) {
					document.getElementById("linesel").value = document.getElementById("lineselOpt").options[document.getElementById("lineselOpt").selectedIndex].value;
				}
			}
			if(document.getElementById("linesel")) { var lineOpt = "&param_out[line_select_dial]="+document.getElementById("linesel").value;}
			if (document.getElementById("dialto"))
				var num = document.getElementById("dialto").value;
			num = escape(num);
			var w = window.open("clickto.php?PHPSESSID="+phpsessid+"&action="+action+"&param_out[dialto]="+num+"&param_out[dialtolabel]="+label+lineOpt+"","window_clickto", "resizable=no, location=no,"+"width="+width+",height="+height+",left="+left+",top="+top+", menubar=no, status=no, scrollbars=no, menubar=no");
			w.focus();
		break;
	}
}

function ClickToTopClose() {
	var w= window;
	if (w) {
		if (w.name == "window_clickto")  { w.close(); }
	}
}