   function getPlot() {
   		 var matchidObj = document.getElementById("MATCHID");
	  	 var selIndex = matchidObj.selectedIndex;
		 var matchid = matchidObj.options[selIndex].value;
		 var matchidText = matchidObj.options[selIndex].text;
		 
		 var detailPlotObj = document.getElementById("DETAIL");
		 var isDetailChecked = detailPlotObj.checked;
		 
		// alert("isDetailChecked "+isDetailChecked);
		 <?php 
		 	$this->load->helper('url');
			$urlstring = site_url();
		 	//$urlstring = $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
		 	//$urlstring = substr($urlstring, 0, strrpos($urlstring, '/')); 
		 ?>
		 var urlstring = "<?php echo $urlstring; ?>";
		 var content = document.getElementById("MATCHPLOT");
		 if (matchid != 0){
		 	if (isDetailChecked == true){
		 		openwindow(urlstring+"/mdplot/match/detailplot/"+ matchid + "/" + matchidText,'detailplotwindow','width=1200,height=1200,scrollbars=yes,resizable=yes, menubar=yes');
			}else{
				openwindow(urlstring+"/mdplot/match/plot/"+ matchid + "/" + matchidText,'plotwindow','width=1200,height=650,scrollbars=yes,resizable=yes, menubar=yes');
			}
		//alert("'" +urlstring+"/mdplot/match/"+ matchid + "/" + matchidText + "'");
		//window.open(urlstring+"/mdplot/match/"+ matchid + "/" + matchidText,'mywindow','width=400,height=200, scrollbars=yes,resizable=yes'); 
		 //content.innerHTML = '<img src="'+urlstring+'/mdplot/match/'+ matchid + '/' + matchidText + '">';
		 }else{
		 	alert("Please select a match to view.");
		 }
   }
   
   function openwindow(url) {    
   	var options = 'scrollbars=yes,resizable=yes,status=no,toolbar=no,menubar=no,location=no';    
	options += ',width=' + screen.availWidth + ',height=' + screen.availHeight;    
	options += ',screenX=0,screenY=0,top=0,left=0';    
	var win = window.open(url, '', options);    
	win.focus();    
	win.moveTo(0, 0);
	}
     
