function InsertImage(siteUrl, baseUrl, txtName, imgField) { 
	myWindow = window.open(siteUrl + "Admin/Controls/ImageGallery/ImageGal2.aspx?textboxname=" + txtName + "&ImgField=" + imgField + "&baseUrl=" + baseUrl, "window", 'width=600,height=470');
} 

//function PopUpWin(siteUrl, width, height) { 
//	myWindow = window.open(siteUrl + , 'Rss', 'width="+width+",height="+height+"');
//} 

function CheckAllDataGridCheckBoxes(aspCheckBoxID, checkVal) {

        re = new RegExp(':' + aspCheckBoxID + '$')  //generated control name starts with a colon

        for(i = 0; i < document.forms[0].elements.length; i++) {

            elm = document.forms[0].elements[i]

            if (elm.type == 'checkbox') {

                if (re.test(elm.name)) {

                    elm.checked = checkVal

                }
            }
        }
    }
    
    
function IsAnyCheckBoxChecked(aspCheckBoxID, Msg){
		
		re = new RegExp(':' + aspCheckBoxID + '$')  //generated control name starts with a colon

        for(i = 0; i < document.forms[0].elements.length; i++) {

            elm = document.forms[0].elements[i]

            if (elm.type == 'checkbox') {

                if (re.test(elm.name)) {
					if ( elm.checked )
						return true;
                }
            }
        }

		alert(Msg);
		return false;
}


function IsAnyCheckBoxChecked02(oSrc, args){
		
		re = new RegExp(':chkSelection$')  //generated control name starts with a colon

        for(i = 0; i < document.forms[0].elements.length; i++) {

            elm = document.forms[0].elements[i]

            if (elm.type == 'checkbox') {

                if (re.test(elm.name)) {
					if ( elm.checked ){
						//args.IsValid = true;
						document.all.cvSelectProducts.style.display = 'none';
						return true;
					}
                }
            }
        }

		document.all.cvSelectProducts.style.display = '';
		return false;
		//args.IsValid = false;
}

//**********************************************************
// IsValidDate function
// To check date if its valid or not.
//**********************************************************
function IsValidDate(year, month, day){
				myDate = new Date(month + "/" + day + "/" + year);

				if (day == 08 || day ==09){
					day = day
				} else day = parseInt(day);
				
				if(parseInt(myDate.getDate()) != day){
					return false;
				}
				else
					return true;
} // end fn isValidDate
			
			
function CheckBoxSelectMe(aspCheckBoxID){
  var elm = eval("document.forms[0]." + aspCheckBoxID)
  if (elm.checked)
		elm.checked = false;
  else	
		elm.checked = true;

}

// MyPopUp - Function to open a new window 
function MyPopUp(siteUrl, features){
	window.open(siteUrl,'',features)
	
}

// DisplayHelp - Function to display help in popup window
function DisplayHelp(helpCode){
	window.open('Help.aspx?HelpCode='+helpCode,'Help','width=400,height=300,scrollbars=1')
}

function imgoverInfo(imgname){
     imgname.src = "../Images/Common/info_over.gif"  
}

function imgoutInfo(imgname){
     imgname.src = "../Images/Common/info.gif"  
}

function imgoverInfo2(imgname){
     imgname.src = "../Images/Common/uitroep_over.gif"  
}

function imgoutInfo2(imgname){
     imgname.src = "../Images/Common/uitroep_knipperend.gif"  
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_openBrWindow2(theURL,winName,features) { //v2.0
 theURL =  theURL + "&url=" + window.location 
 
// alert(theURL)
  window.open(theURL,winName,features);
}

function RedirectPage(url, time){
	setTimeout('window.location.href = ' + url, 5*1000 );
}


function SetFocus(field){
	f = eval("document.Form1" + ".txtKenteken"+field);
	if (f.value.length == 2){
		if (field == "1"){
		ff = eval("document.Form1" + ".txtKenteken2");
		ff.focus();
		}else{
		ff = eval("document.Form1" + ".txtKenteken3");
		ff.focus();
		}
		
	}
		

}
