var undefined;

function setShowSWF(){
	if(document.getElementById(strObjId)){
		document.getElementById(strObjId).style.display='';
	}
	clearTswf();
}

function setHideSWF(){
	if(strObjId!=""){
		if(document.getElementById(strObjId)){
			document.getElementById(strObjId).style.display='none';
		}
	clearTswf();
	}
}

var tSWF;
var strObjId= ""
function hideSWF(objId){
	if(document.getElementById("swfContainer")){
		strObjId = objId;
		tSWF = setTimeout("setHideSWF()",115000);
		tSWF;
	}
}
function clearTswf(){
	if(tSWF!=""){
		clearTimeout(tSWF);
	}
}

function showSWF(objId){
	strObjId = objId;
	tSWF = setTimeout("setShowSWF()",115000);
	tSWF;
}



function cleanInputGlobal(strInput){
var regexp;
	regexp = /-->/g
	strInput = strInput.replace(regexp,"");
	regexp = /<\!--\W/g
	strInput = strInput.replace(regexp,"");
	regexp = /<\!--/g
	strInput = strInput.replace(regexp,"");
	regexp = /CMS/g
	strInput = strInput.replace(regexp,"");
	regexp = /CONTENT\d\SHTMLContent/g
	strInput = strInput.replace(regexp,"");
	strInput = GlobalTrim(strInput);
	return strInput;
}
function GlobalTrim(strValue){
	return LGlobalTrim(RGlobalTrim(strValue));
}

function LGlobalTrim(strValue){
	var LGlobalTRIMrgExp = /^\s */;
	return strValue.replace(LGlobalTRIMrgExp, '');
}

function RGlobalTrim(strValue){
	var RGlobalTRIMrgExp = /\s *$/;
	return strValue.replace(RGlobalTRIMrgExp, '');
}

var tMenu;
var menuOpen;
menuOpen="";
function setTmenu(){
	if(menuOpen!=""){
		tMenu = setTimeout("closeMenu(menuOpen)",300);
		tMenu;
	}
}
function clearTmenu(){
	if(tMenu!=""){
		clearTimeout(tMenu);
	}
}
function openMenu(obj){
	if(tMenu!=""){
		clearTimeout(tMenu);
		tMenu="";
	}
	
	if(menuOpen!=""){
		document.getElementById(menuOpen).style.display='none';
	}
	if(document.getElementById(obj)){
		document.getElementById(obj).style.display='';
		menuOpen = obj;
	}
}
function closeMenu(obj){
	if(obj==""){
		if(menuOpen!=""){
			document.getElementById(menuOpen).style.display='none';
		}
	}
	else
	{
		if(document.getElementById(obj)){
			document.getElementById(obj).style.display='none';
		}
	}
	menuOpen = "";
}

function myPos(){
	setInterval("myScroll()",1000);
}

function myScroll(){
	var myScroll;
	var myPosLeft;
	if(window.document.width){
		myScreenWidth = window.document.width;
		myPosLeft = ((myScreenWidth - 783)/2 + 59);

		if(myPosLeft < 59){myPosLeft = 60};
			
	}else if(document.body.clientWidth){
		myScreenWidth = document.body.clientWidth;
		myPosLeft = ((myScreenWidth - 783)/2 + 60);
		if(myPosLeft < 60){myPosLeft = 60};
	}
	
	for(var i=1;i<2;i++){
		if(document.getElementById){ //NN6,IE5?
			if(i==1){
				document.getElementById('menu' + i).style.left = myPosLeft;
			}
			
		}
		else if(document.layers){
			if(i==1){
				document.layers['menu' + i].moveTo(myPosLeft);
			}
			
		}  //NN4?
		else if(document.all){
		if(i==1){
				document.all('menu' + i).style.pixelLeft = myPosLeft;
			}
			
		}
	}
	
}


function isValidDate(year,month,day,hours,minutes,seconds){
	month = parseInt(month - 1);//javascript maanden beginnen bij 0
	var dteDate;
	if(hours==undefined){
		dteDate=new Date(year,month,day);
		return ( (day==dteDate.getDate()) && (month==dteDate.getMonth()) && (year==dteDate.getFullYear()) ); 
	}
	else
	{
		dteDate=new Date(year,month,day,hours,minutes,seconds);
		return ( (day==dteDate.getDate()) && (month==dteDate.getMonth()) && (year==dteDate.getFullYear()) && (hours==dteDate.getHours()) && (minutes==dteDate.getMinutes()) && (seconds==dteDate.getSeconds())); 
		
	}
}





var t;
var intI =0;
var imgShow;
imgShow="";
function setT(){
		//imgShow = arrayImg[intI]
		t = setInterval("showImg()",3000);
		t;
}
function clearT(){
	if(t!=""){
		clearTimeout(t);
	}
}
function hideImg(obj){
	if(obj==""){
		if(imgShow!=""){
			if(document.getElementById(imgShow)){
				document.getElementById(imgShow).style.display='none';
			}
		}
	}
	else
	{
		if(document.getElementById(obj)){
		document.getElementById(obj).style.display='none';
		}
	}
	imgShow = "";
}
function showImg(){//numberImg" & Y
		if(document.getElementById(arrayImg[intI])){
			document.getElementById(arrayImg[intI]).style.display='none';
		}
		if(document.getElementById("numberImg" + intI)){
			document.getElementById("numberImg" + intI).className = "clsLinkNumber";
		}
		if(intI == arrayImg.length-1){
			intI = 0;
		}
		else
		{
			intI = intI + 1;
		}
		if(document.getElementById(arrayImg[intI])){
			document.getElementById(arrayImg[intI]).style.display='';
		}
		if(document.getElementById("numberImg" + intI)){
			document.getElementById("numberImg" + intI).className = "clsLinkNumberOver";
		}
		
}
function resetImg(idImg){
	if(document.getElementById(arrayImg[intI])){
		document.getElementById(arrayImg[intI]).style.display='none';
	}
	if(document.getElementById("numberImg" + intI)){
		document.getElementById("numberImg" + intI).className = "clsLinkNumber";
	}
	intI = parseInt(idImg);
	if(document.getElementById(arrayImg[intI])){
		document.getElementById(arrayImg[intI]).style.display='';
	}
	if(document.getElementById("numberImg" + intI)){
		document.getElementById("numberImg" + intI).className = "clsLinkNumberOver";
	}
}

//begin

var StartMilsecleft=0;
var strDay, strHour, strMinute, strSecond, strEndAuction;

function myEndDate(myDate, dayStr, hourStr, minuteStr, secondStr, endAuction){

	var strReturn ="";	
	var arrArray=new Array();
	var arrDate = new Array();
	var arrTime = new Array();	
	if(myDate!=""){
		if(myDate.indexOf(":") !=-1){
			arrArray = myDate.split(" ");
			arrDate = arrArray[0].split("-");
			arrTime = arrArray[1].split(":");
		}
		else
		{
			arrDate = myDate.split("-");
			arrTime[0]=0;
			arrTime[1]=0;
			arrTime[2]=0;
		}
	
		var dateToCheck = new Date();
		if(arrDate[0].length > 2){
			dateToCheck.setYear(arrDate[0]);
			dateToCheck.setMonth((arrDate[1]-1));
			dateToCheck.setDate(arrDate[2]);
		}
		else
		{
			dateToCheck.setYear(arrDate[2]);
			dateToCheck.setMonth((arrDate[1]-1));
			dateToCheck.setDate(arrDate[0]);
		}
		dateToCheck.setHours(arrTime[0]);
		dateToCheck.setMinutes(arrTime[1]);
		dateToCheck.setSeconds(arrTime[2]);
		var checkDate = dateToCheck.getTime();	
		
		var dateNow = new Date();
		var intDateNow = dateNow.getTime();
		
		
		strDay = dayStr;
		strHour = hourStr;
		strMinute = minuteStr;
		strSecond = secondStr;
		strEndAuction = endAuction;
		
		StartMilsecleft =(checkDate-intDateNow);

		if (isNaN(StartMilsecleft))
		{
			// 
		}
		else if(StartMilsecleft>=1000)
		{
			dday=Math.floor(StartMilsecleft/(60*60*1000*24)*1)
			dhour=Math.floor((StartMilsecleft%(60*60*1000*24))/(60*60*1000)*1)
			dmin=Math.floor(((StartMilsecleft%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
			dsec=Math.floor((((StartMilsecleft%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
	
			if(dday<=0&&dhour<=0&&dmin<=0&&dsec<1)
			{
			}
			else 
			{
				strReturn="<b>"+dday+"</b>"+strDay +" <b>"+dhour+"</b>"+strHour+"<b> "+dmin+"</b>"+strMinute+"<b> "+dsec+"</b>"+strSecond;
			}
			
			
			
		}
		else
		{
			strReturn="<img src=\"images/hammer_down.gif\" width=21 height=19 alt=\""+strEndAuction+"\" title=\"veiling gesloten\" align=\"absmiddle\"> <span class=\"clsDefaultRed\">"+strEndAuction+"</span>";
			
		}
	}
	return strReturn;
}

//eind


function isNumeric(myObj){
	
	
	if(myObj.value!=""){
		if(myObj.value != parseFloat(myObj.value)){
			myObj.value = "";
		}
	}
}

var myTempX=screen.width;
var myTempY=screen.height;
var intTempLeft;
var intTempTop;

	if(myTempX>795){
		intTempLeft = (myTempX-785)/2;
	}
	else
	{
		intTempLeft = 0;
	}
	if(myTempY>750){
		intTempTop = (myTempY-750)/2;
	}
	else
	{
		intTempTop = 0;
	}
var newChildWin = null;
function openWindow(varUrl) {
	
	if(newChildWin!=null){
		newChildWin.close();
	 	newChildWin = null;
	}

	var strAttr ="fullsize=0, width=690,  height=750,top="+intTempTop+",left="+intTempLeft+",,resizable=no,menubar=yes,status=yes,scrollbars=yes,toolbar=yes,directories=yes,location=yes,copyhistory=yes";
	newChildWin = window.open(varUrl,"newChildWin",strAttr)	
		
 }

function closeNewChildWin(){
	if(newChildWin!=null){
	 	newChildWin = null;
	}
}

function myPageClose(){
	if(newChildWin!=null){
		newChildWin.close();
	 	newChildWin = null;
	}
}


var myDay;
var myMonth;
var myYear;
var myNumber = "1900";
var oneDate = new Date();
var theYear = oneDate.getFullYear();

function validate(theForm,myBtn){
	document.body.className="BODYwait";
	



var radGroupName = "";
var strRadioName;

var blnCHKTRUE2 = false
var blnCHKTRUE = false;
var blnCheck = true;
var blnCheckbox = false;
var blnCheckRad = false;
var blnCheckDay = false;
var blnCheckMonth = false;
var blnCheckYear = false;
var blnCheckBirthday;
var myForm;
var myObject;
var theForm;
var strLanguage;
var strResponse;
	
	if (mySubmit()==false){
	
		if(typeof theForm =="object"){
			myForm = theForm.name;
		}
		else
		{
			myForm = theForm
		}
		
		 theForm = eval("document." + myForm);
	
		if(document.getElementById('myBtn')){
			document.getElementById('myBtn').disabled=true;
		}
		strLanguage = theForm["LANGUAGE"].value;
		
		for(var i=0;i<document.forms[myForm].elements.length;i++){
			if(document.forms[myForm].elements[i].id ){
				if(document.forms[myForm].elements[i].id.indexOf("required")!=-1){
					document.forms[myForm].elements[i].value = GlobalTrim(document.forms[myForm].elements[i].value);
					switch (document.forms[myForm].elements[i].type.toUpperCase()){
						
						case "HIDDEN":
							if(document.forms[myForm].elements[i].value == ""){
								blnCheck = false;
								if(strLanguage == "NLD"){
									strResponse ="U hebt een van de verplichte velden niet in gevuld"; 
								}
								else
								{
									strResponse ="You forgot to fill in one of the required fields"; 
								}
								if(document.getElementById("td" + myForm + document.forms[myForm].elements[i].name)){
									document.getElementById("td" + myForm + document.forms[myForm].elements[i].name).className="clsDefaultRed";
								}
							}
							break;
						
						case "TEXT":
							if(document.forms[myForm].elements[i].value == ""){
								blnCheck = false;
								if(strLanguage == "NLD"){
									strResponse ="U hebt een van de verplichte velden niet in gevuld"; 
								}
								else
								{
									strResponse ="You forgot to fill in one of the required fields"; 
								}
								if(document.getElementById("td" + myForm + document.forms[myForm].elements[i].name)){
									document.getElementById("td" + myForm + document.forms[myForm].elements[i].name).className="clsDefaultRed";
								}
							}
							
							
							if(document.forms[myForm].elements[i].name.toUpperCase().indexOf("BIRTHYEAR")!=-1){
								
								
								if(document.forms[myForm].elements[i].value != ""){
									blnCheckYear = true;
									if(document.forms[myForm].elements[i].value.length < 4){
										blnCheck = false;
										if(strLanguage == "NLD"){
											strResponse ="Geboortejaar onjuist ingevuld \n bijvoorbeeld: 1968";
										}
										else
										{
											strResponse = "Year of birth incorrect\nexample: 1968" ;
										}
									}
									else
									{
										myYear = parseInt(document.forms[myForm].elements[i].value);
										if((myYear > parseFloat(theYear)) || (myYear < myNumber)){
											blnCheck = false;
											if(strLanguage == "NLD"){
												strResponse ="Geboortejaar onjuist ingevuld";
											}
											else
											{
												strResponse = "Year of birth incorrect." ;
											}
										}
									}
								}
								else
								{
									blnCheck = false;
										if(strLanguage == "NLD"){
											strResponse ="Geboortejaar niet ingevuld";
										}
										else
										{
											strResponse = "Year of birth left open." ;
										}
								}
							}
							
							if(document.forms[myForm].elements[i].name.toUpperCase().indexOf("BIRTHMONTH")!=-1){
								//blnCheck = true;
								if(document.forms[myForm].elements[i].value != ""){
									blnCheckMonth = true;
									if(document.forms[myForm].elements[i].value > 12){
										//blnCheckMonth = false;
										blnCheck = false;
										if(strLanguage == "NLD"){
											strResponse ="Geboortemaand onjuist ingevuld";
										}
										else
										{
											strResponse = "Month of birth incorrect." ;
										}
									}
									myMonth = parseFloat(document.forms[myForm].elements[i].value);
								}
								
							}
							
							
							if(document.forms[myForm].elements[i].name.toUpperCase().indexOf("BIRTHDAY")!=-1){
								//blnCheck = true;
								if(document.forms[myForm].elements[i].value != ""){
									blnCheckDay = true;
									if(document.forms[myForm].elements[i].value > 31){
										//blnCheckDay = false;
										blnCheck = false;
										if(strLanguage == "NLD"){
											strResponse ="Geboortedag onjuist ingevuld";
										}
										else
										{
											strResponse = "Day of birth incorrect." ;
										}
									}
								myDay = parseFloat(document.forms[myForm].elements[i].value);
								}
								
							}
							
							
							break;
						
						
						case "PASSWORD":
							if(document.forms[myForm].elements[i].value == ""){
								blnCheck = false;
								if(strLanguage == "NLD"){
									strResponse ="U hebt een van de verplichte velden niet in gevuld"; 
								}
								else
								{
									strResponse ="You forgot to fill in one of the required fields"; 
								}
							}
							break;
						case "TEXTAREA":
							if(document.forms[myForm].elements[i].value == ""){
								blnCheck = false;
								if(strLanguage == "NLD"){
									strResponse ="U hebt een van de verplichte velden niet in gevuld"; 
								}
								else
								{
									strResponse ="You forgot to fill in one of the required fields"; 
								}
								if(document.getElementById("td" + myForm + document.forms[myForm].elements[i].name)){
									document.getElementById("td" + myForm + document.forms[myForm].elements[i].name).className="clsDefaultRed";
								}
							}
							break;
						case "SELECT-ONE":
							if(document.forms[myForm].elements[i].value == "" && document.forms[myForm].elements[i].style.display == ""){
								blnCheck = false;
								if(strLanguage == "NLD"){
									strResponse ="U hebt een van de verplichte velden niet in gevuld"; 
								}
								else
								{
									strResponse ="You forgot to fill in one of the required fields"; 
								}
								if(document.getElementById("td" + myForm + document.forms[myForm].elements[i].name)){
									document.getElementById("td" + myForm + document.forms[myForm].elements[i].name).className="clsDefaultRed";
								}
							}
							break;
						case "RADIO" :
							blnCHKTRUE2 = true;
							
							elName = document.forms[myForm].elements[i].name;
							if(radGroupName != elName){
								blnCheckRad = false;
							}
							for(var y = 0; y < document.forms[myForm][elName].length; y++){
								if(document.forms[myForm][elName][y].checked == true){
									blnCheckRad = true;
								}
							}
							radGroupName = elName;
							if(blnCheckRad == false){//i = document.forms[myForm].elements.length;}
								if(document.getElementById("td" + myForm + document.forms[myForm].elements[i].name)){
									document.getElementById("td" + myForm + document.forms[myForm].elements[i].name).className="clsDefaultRed";
								}
							}
							break;
						case "CHECKBOX":
							blnCHKTRUE = true;
							if(document.forms[myForm].elements[i].checked == true){
								blnCheckbox = true;
							}
							else
							{
								if(document.getElementById("td" + myForm + document.forms[myForm].elements[i].name)){
									document.getElementById("td" + myForm + document.forms[myForm].elements[i].name).className="clsDefaultRed";
								}
							}
							break;
					}
					
				}
			}
		}
			
		
		
		if(document.forms[myForm]["PASSWORD"] && document.forms[myForm]["PASSWORD2"]){
				var myPassword1 = document.forms[myForm]["PASSWORD"].value;
				var myPassword2 = document.forms[myForm]["PASSWORD2"].value;
				
				if(myPassword1 != myPassword2){
					blnCheck = false;
					
					if(strLanguage == "NLD"){
						strResponse ="De wachtwoorden komen niet overeen"; 
					}
					else
					{
						strResponse ="The given passwords don't match"; 
					}
				}
		}
		
		
		
		
		
		if(document.forms[myForm]["WEBSITE"]){
			if(document.forms[myForm].elements[i].name.toUpperCase() == "WEBSITE" && document.forms[myForm].elements[i].value != ""){
				var myValue = document.forms[myForm].elements[i].value;
				if(myValue.indexOf(".")!=-1){	
					if(myValue.toUpperCase().indexOf("WWW.")==-1 && myValue.toUpperCase().indexOf("HTTP://")==-1){
						document.forms[myForm].elements[i].value = "http://www." + myValue.toLowerCase()
					}
					else if(myValue.toUpperCase().indexOf("WWW.")==-1 && myValue.toUpperCase().indexOf("HTTP://")!=-1){
						document.forms[myForm].elements[i].value = document.forms[myForm].elements[i].value.toLowerCase().replace("http://","http://www.");
					}
					else if(myValue.toUpperCase().indexOf("WWW.")!=-1 && myValue.toUpperCase().indexOf("HTTP://")==-1 && myValue.toUpperCase().indexOf("HTTP//")==-1 && myValue.toUpperCase().indexOf("HTTP:/")==-1){
						document.forms[myForm].elements[i].value = "http://" + myValue.toLowerCase()
					}
					else if(myValue.toUpperCase().indexOf("HTTP")!=-1 && myValue.indexOf(":")==-1){
						blnCheck = false;
						strResponse ="Controleer de URL van de website AUB.\nBV: HTTP://www.steinerveiling.nl";
					}
				}
				else
				{
					blnCheck = false;
					strResponse ="Controleer de URL van de website AUB.";
				}
			}
							
		}
		
		
		if(blnCheck == true){ // alles is ingevuld nu check op juiste geboortedatum
			if((document.getElementById("BIRTHMONTH_required"))  &&  (document.getElementById("BIRTHDAY_required")) && (document.getElementById("BIRTHYEAR_required"))){
				
				if((blnCheckDay == true) && (blnCheckMonth == true) && (blnCheckYear == true)){
					blnCheckBirthday = isValidDate(myDay,myMonth,myYear);
					if(blnCheckBirthday == false){
						blnCheck = false;
						if(strLanguage == "NLD"){
							strResponse="Geboortedatum bestaat niet";
						}
						else
						{
							strResponse = "Date of birth does not exist." ;
						}
					}
				}
			}
		}
		
		
		if(blnCheckbox == false && blnCHKTRUE == true){
			if(strLanguage == "NLD"){
				strResponse ="U hebt een van de verplichte keuzevakjes niet in gevuld"; 
			}
			else
			{
				strResponse ="You forgot to check one of the required checkboxes"; 
			}
			blnCheck = false;
		}
		if(blnCheckRad == false && blnCHKTRUE2 == true){
			if(strLanguage == "NLD"){
				strResponse ="U hebt een van de verplichte keuzerondjes niet in gevuld"; 
			}
			else
			{
				strResponse ="You forgot to check one of the required options"; 
			}
			blnCheck = false;
		}	
		
		
		if(blnCheck == false){
			blnFormSubmit = false;
			document.body.className="BODY";
			if(document.getElementById('myBtn')){
				document.getElementById('myBtn').disabled=false;
			}
			alert(strResponse);
		}
		
		return blnCheck;
	}
	else
	{
		return false;
	}
}		

var blnFormSubmit = false;

function mySubmit(){
	
	if(blnFormSubmit==false){
		blnFormSubmit = true;
		return  false;
	}
	else
	{
		return  true;
	}
}



function myReset(theForm){
	for(var i=0;i<document.forms[theForm].elements.length;i++){
	//alert(document.forms[theForm].elements[i].type.toUpperCase());
				switch (document.forms[theForm].elements[i].type.toUpperCase()){
				case "TEXT":
					document.forms[theForm].elements[i].value = "";
					break;
				case "PASSWORD":
					document.forms[theForm].elements[i].value = "";
					break;
				case "TEXTAREA":
					document.forms[theForm].elements[i].value = "";
					break;
				case "SELECT-ONE":
					document.forms[theForm].elements[i].selectedIndex = 0;
					document.forms[theForm].elements[i].disabled = false;
					break;
				case "CHECKBOX":
					document.forms[theForm].elements[i].checked = false;
					document.forms[theForm].elements[i].disabled = false;
					break;
				case "RADIO":
					document.forms[theForm].elements[i].checked = false;
					document.forms[theForm].elements[i].disabled = false;
					break;
				case "HIDDEN":
					if(document.forms[theForm].elements[i].name.indexOf("hidCATMERK")!=-1){
						document.forms[theForm].elements[i].value = "";
					}
				break;
				}
	}
}
function myResetCbo(myVarArray){
	for(var i=0;i<myVarArray.length;i++){
		if(myVarArray[i].indexOf("cbo")!= -1){
			//document.frm_Select[myVarArray[i]].selectedIndex = 0;
			document.getElementById(myVarArray[i]).selectedIndex = 0;
		}
	}
}
function myResetLoc(){
	if(document.frm_Select.hidSPECIAL.value = "False"){
		document.frm_Select.hidLOC.value = "";
	}
}


var myArrayObj = new Array();
var myArrayVis =new Array();

function myVisible(myObj){
	var mblnDone = false;	
	for(var i=0;i<myArrayObj.length;i++){
		if(myArrayObj[i] == myObj){
			if(myArrayVis[i] == "visible"){
				myArrayVis[i] = "none";
				document.getElementById("tr_" + myObj).style.display = "none";
			}
			else
			{
				myArrayVis[i] = "visible";
				document.getElementById("tr_" + myObj).style.display = "";
			}
			
			mblnDone = true;
		}
		else
		{
			myArrayVis[i] = "none";
			document.getElementById("tr_" + myArrayObj[i]).style.display = "none";
		}
	}
	if(mblnDone == false){
		document.getElementById("tr_" + myObj).style.display = "";
		myArrayObj[myArrayObj.length] = myObj;
		myArrayVis[myArrayVis.length] = "visible";
	}
}

function resetPopup(){
	dlg= null;
}

function closeDlgPopup(){
	if(dlg!=null){
		dlg.close();
	 	dlg = null;
	}
}

var dlg= null;
function makepopup(parameters,path) {
	 
	 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+"&path="+path;
 	dlg = window.open(strPageName,'dlg','fullsize=1,width=100,height=100,top=30,left=75,,resizable=yes,menubar=no,scrollbars=yes,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();
	}
}
 
 function isDouble(myObj,myForm){
		
	var tempValue;
	var arrTemp;
	if(myObj.value != "" ){
		if(myObj.value.indexOf(",")!=-1 || myObj.value.indexOf(".")!=-1){
			if(myObj.value.indexOf(".")==-1 && myObj.value.indexOf(",")!=-1 && myObj.value.indexOf(",") == myObj.value.lastIndexOf(",")){
				
				arrTemp = myObj.value.split(",")
				arrTemp[0]=formatNumber(arrTemp[0],"0");
				arrTemp[1]=formatNumber(arrTemp[1],"0");
				if(arrTemp[0]!= null && arrTemp[1]!= null){
					myObj.value = arrTemp[0] + ","  + arrTemp[1]
				}
				else
				{
					
					myObj.value = "";
				}
			
			}
			else if(myObj.value.indexOf(",")==-1 && myObj.value.indexOf(".")!=-1 && myObj.value.indexOf(".") == myObj.value.lastIndexOf(".")){			
				arrTemp = myObj.value.split(".")
				arrTemp[0]=formatNumber(arrTemp[0],"0");
				arrTemp[1]=formatNumber(arrTemp[1],"0");
				if(arrTemp[0]!= null && arrTemp[1]!= null){
					myObj.value = arrTemp[0] + ","  + arrTemp[1]
				}
				else
				{
					myObj.value = "";
				}
			}
			else
			{
				myObj.value = "";
			}
		}
		else
		{
			tempValue=formatNumber(myObj.value,"0");
			if(tempValue!= null){
				myObj.value = tempValue;
			}
			else
			{
				myObj.value = "";
			}
		}
	}
}
 
 
 function checkNumber(myObj,myForm,myFormat){
	var tempValue;
	if(myObj.value != "" ){
		tempValue=formatNumber(myObj.value,myFormat);
		if(tempValue!= null){
			myObj.value = tempValue;
		}
		else
		{
			myObj.value = "";
		}
	}

}
 
 // CONSTANTS
var separator = ",";  // use comma as 000's separator
var decpoint = ".";  // use period as decimal point
var percent = "%";
var currency = "€";  // use dollar sign for currency
 
function formatNumber(number, format, print) {  // use: formatNumber(number, "format")
	
	 
	if (print) document.write("formatNumber(" + number + ", \"" + format + "\")<br>");
 
 	if (number - 0 != number) return null;  // if number is NaN return null
	var useSeparator = format.indexOf(separator) != -1;  // use separators in number
	var usePercent = format.indexOf(percent) != -1;  // convert output to percentage
    var useCurrency = format.indexOf(currency) != -1;  // use currency format
    var isNegative = (number < 0);
    number = Math.abs (number);
    if (usePercent) number *= 100;
    format = strip(format, separator + percent + currency);  // remove key characters
    number = "" + number;  // convert number input to string
 
     // split input value into LHS and RHS using decpoint as divider
    var dec = number.indexOf(decpoint) != -1;
    var nleftEnd = (dec) ? number.substring(0, number.indexOf(".")) : number;
    var nrightEnd = (dec) ? number.substring(number.indexOf(".") + 1) : "";
 
     // split format string into LHS and RHS using decpoint as divider
    dec = format.indexOf(decpoint) != -1;
    var sleftEnd = (dec) ? format.substring(0, format.indexOf(".")) : format;
    var srightEnd = (dec) ? format.substring(format.indexOf(".") + 1) : "";
 
     // adjust decimal places by cropping or adding zeros to LHS of number
    if (srightEnd.length < nrightEnd.length) {
      var nextChar = nrightEnd.charAt(srightEnd.length) - 0;
      nrightEnd = nrightEnd.substring(0, srightEnd.length);
      if (nextChar >= 5) nrightEnd = "" + ((nrightEnd - 0) + 1);  // round up
 
 // patch provided by Patti Marcoux 1999/08/06
      while (srightEnd.length > nrightEnd.length) {
        nrightEnd = "0" + nrightEnd;
      }
 
      if (srightEnd.length < nrightEnd.length) {
        nrightEnd = nrightEnd.substring(1);
        nleftEnd = (nleftEnd - 0) + 1;
      }
    } else {
      for (var i=nrightEnd.length; srightEnd.length > nrightEnd.length; i++) {
        if (srightEnd.charAt(i) == "0") nrightEnd += "0";  // append zero to RHS of number
        else break;
      }
    }
 
     // adjust leading zeros
    sleftEnd = strip(sleftEnd, "#");  // remove hashes from LHS of format
    while (sleftEnd.length > nleftEnd.length) {
      nleftEnd = "0" + nleftEnd;  // prepend zero to LHS of number
    }
 
    if (useSeparator) nleftEnd = separate(nleftEnd, separator);  // add separator
    var output = nleftEnd + ((nrightEnd != "") ? "." + nrightEnd : "");  // combine parts
    output = ((useCurrency) ? currency : "") + output + ((usePercent) ? percent : "");
    if (isNegative) {
      // patch suggested by Tom Denn 25/4/2001
      output = (useCurrency) ? "(" + output + ")" : "-" + output;
    }
    return output;
  }
 
  function strip(input, chars) {  // strip all characters in 'chars' from input
    var output = "";  // initialise output string
    for (var i=0; i < input.length; i++)
      if (chars.indexOf(input.charAt(i)) == -1)
        output += input.charAt(i);
    return output;
  }
 
  function separate(input, separator) {  // format input using 'separator' to mark 000's
    input = "" + input;
    var output = "";  // initialise output string
    for (var i=0; i < input.length; i++) {
      if (i != 0 && (input.length - i) % 3 == 0) output += separator;
      output += input.charAt(i);
    }
    return output;
  }

