var undefined;
function resetPopup(){
	dlg= null;
}

var dlg= null;

function makepopup(parameters) {
	 if(dlg!=null){
		dlg.close();
	 	dlg = null;
	}
	 
	 var arrUrl= new Array();
	 var strTempName;
	 
	 var strUrl = document.URL;
	 if(strUrl.indexOf("http://")!=-1){
		strUrl = strUrl.replace("http://","");
	 }
	 if(strUrl.indexOf("https://")!=-1){
		strUrl = strUrl.replace("https://","");
	 }
	 if(strUrl.indexOf("test.kramerdesign.nl/")!=-1){
		strUrl = strUrl.replace("test.kramerdesign.nl/","");
	 }
	 if(strUrl.indexOf("194.187.45.65/")!=-1){
		strUrl = strUrl.replace("194.187.45.65/","");
	 }
	 if(strUrl.indexOf("10.0.0.1/")!=-1){
		strUrl = strUrl.replace("10.0.0.1/","");
	 }  
	
	 if(strUrl.indexOf("/")!=-1){
		arrUrl =strUrl.split("/");
	 }
	 else
	 {
		arrUrl[0] = strUrl;
	 }
	switch (arrUrl.length){
	case 2:
		strTempName = "forms/showImg.asp";
		break;
	case 3:
		strTempName = "../forms/showImg.asp";
		break;
	case 4:
		strTempName = "../../forms/showImg.asp";
		break;
	}
 	var strPageName; 
 	strPageName =strTempName+"?name="+parameters;
 dlg = window.open(strPageName,'','fullsize=0,width=100,height=100,top=30,left=75,,resizable=yes,menubar=no,scrollbars=1,status=no,toolbar=no,directories=no,location=no,copyhistory=no')

 }


function dlgOpenerClose(){
 	if(dlg!=null){
		dlg.popupClose(false);
	 	dlg = null;
	}
 
 }
 
function resetmyNewWindow(){
	dlg = null;
}

var blnProceed = true;

function popupClose(bln){
	
	if(opener==undefined){
		blnProceed = false;
	}
	
	if( bln!=undefined){
		blnProceed = bln;
	}
	
	if(blnProceed == true){
	
		opener.resetmyNewWindow();
	}
}

