
	function getColony(sParent,Server_ID) {
		if ( sParent == "S" ) {
			var theForm = document.SrchImage;
			var WinName = "SrchImage";
			var AllowMultiple = "Y";
			}
		else {
			var theForm = document.InsertImage;
			var WinName = "InsertImage";
			var AllowMultiple = "N";
			}
		if (IsSelect(theForm.LocationID,"Please specify the Location")) {
				return false;
			}
		else {
			ShowColony(Server_ID,WinName,WinName,"ColonyID",theForm.LocationID.value,theForm.ColonyID.value,AllowMultiple)
			}
	}

	function eImage() {
	//alert(window.parent.name)	
	var nCol = document.ChkImage.sCheckBox.value;
	var winName = window.parent.name; // The Parent name where to put the values
		var nChkImage = 0;
		var sImage;	
		if ( nCol != 0) {
			for (var nCnt = 0; nCnt <= nCol; nCnt++) {
				if (document.ChkImage.ImageID[nCnt].checked) {
					nChkImage = nChkImage + 1;
					sImage = nCnt;
					
				}				
			}
			
			if ( nChkImage == 0 ) {
				alert("Please browse for the image or type the path to the file in the box.")
				return false;	
			}
			else if ( nChkImage > 1 ) {
				alert("Please specify a single image for upload")
				return false;
			}
		
			
			// Insert into the allocated text boxes
			if ( winName == "PropertyI" ) {
				
				window.opener.document.Insert.ImageID.value = document.ChkImage.ImageID[sImage].value ;
				window.close();
				}
			else if ( winName == "PropertyE" ) {
				window.opener.document.Default.ImageID.value = document.ChkImage.ImageID[sImage].value ;
				window.close();
				}
		}
		else{
			if ( winName == "PropertyI" ) {
				
				window.opener.document.Insert.ImageID.value = document.ChkImage.ImageID.value ;
				window.close();
				}
			else if ( winName == "PropertyE" ) {
				if (document.ChkImage.ImageID.checked){
					window.opener.document.Default.ImageID.value = document.ChkImage.ImageID.value ;
					window.opener.document.all.genImage1.style.display = 'block';
					window.opener.document.all.genImage2.style.display = 'none';
					window.opener.document.all.genImage3.style.display = 'none';
					window.opener.document.all.genImage4.style.display = 'block';
				}
				else{
					window.opener.document.Default.ImageID.value = "";
				}
				window.close();
				}
		}
	return false;
	}	

	function ShowImage(ImageName,Server_ID,PropertyID) {
		var	URLString = "http://" + window.self.location.host + "/Local/Shared/Image.asp?ImageName="+ ImageName + "&Server_ID=" + Server_ID+"&PropertyID=" + PropertyID;
		PopUp(URLString,"ShowImage","height=400,width=650,screenX=10,left=10,screenY=10,top=10,ScrollBars=yes");
	}
	
	function ShowHomeImage(ImageName,Server_ID) {
		var	URLString = "http://" + window.self.location.host + "/Local/Shared/HomeImage.asp?ImageName="+ ImageName + "&Server_ID=" + Server_ID;
		PopUp(URLString,"ShowImage","height=400,width=650,screenX=10,left=10,screenY=10,top=10,ScrollBars=yes");
	}
	
	function ChkImage() {
		
		if (IsNull(document.InsertImage.ImageName,"Please browse for the image or type the path to the file in the box.")) {
			return false;
			}
		if (IsNull(document.InsertImage.Address,"Please enter the address to which image belongs.")) {
			return false;
			}		
		if (IsSelect(document.InsertImage.LocationID,"Please specify a location")) {
			return false;
			}	
		if (document.InsertImage.ColonyID.value == "") {
			alert ("Please choose a single colony ");
			//document.InsertImage.Loc.focus();
			return false;
			}	
	}