
function openwin(url,width,height) {
	if (!width) width = 400;
	if (!height) height = 200;
	var newwin = null;
	LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
	newwin = window.open(url,"newwin","width="+width+",height="+height+",resizable,scrollbars,left="+LeftPosition+",top="+TopPosition+"");
}


// Copy form field data to clipboard
function copy_toclip(field) {
	// Detect browser function
	function browser(string) {
		return detect.indexOf(string) + 1;
	}
	var detect = navigator.userAgent.toLowerCase();

	field.focus()
	field.select()
	
	if (browser('msie')){
		txt=field.createTextRange()
		txt.execCommand("Copy") 
		alert('Data is copied to clipboard.'+"\n"+'To paste this data were it is required press Ctrl+V')
	} else {
		alert('Press Ctrl+C to copy data to clipboard.'+"\n"+'To paste this data were it is required press Ctrl+V')
	}
}