// JavaScript Document

function dothis(test,loc){
	return confirm(test + loc);
}

function confirmDelete(delUrl,Message) {
  if (confirm(Message)) {
    document.location = delUrl;
  }
}

function gotolink(Url) {
CB_Open('href=' + Url+',,width=700,,height=500,,title=Upload'); 
}

function confirmDelete2()
{
    return confirm("Are you sure you want to delete this picture?");
} 

function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
if(document.theForm.Check_All.value=="Check All"){
	CheckValue = true;
   document.theForm.Check_All.value="UnCheck All";
}else{
	CheckValue = false;
	document.theForm.Check_All.value="Check All";
}
  if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
}

function SetAllCheckBoxes2(FormName, FieldName, CheckValue)
{
if(document.theForm.Check_All_B.value=="Check All"){
	CheckValue2 = true;
   document.theForm.Check_All_B.value="UnCheck All";
}else{
	CheckValue2 = false;
	document.theForm.Check_All_B.value="Check All";
}
  if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue2;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue2;
}


function toggle_it(itemID,rr){ 
  // Toggle visibility between none and inline 
  //output_text = itemID+'1';
  //alert(output_text);
  if ((document.getElementById(itemID+'1').style.display == 'none')) 
  { 
  for(var i = 1; i < rr; i++)
	//window.location.reload(true);
	document.getElementById(itemID+i).style.display = ''; 
  } else { 
  for(var i = 1; i < rr; i++)
	document.getElementById(itemID+i).style.display = 'none'; 
  } 
} 

function Check2()
{
if(document.theForm.Check_All.value=="Check All"){
   document.theForm.Check_All.value="UnCheck All";
    for (i=0,n=document.theForm.elements.length;i<n;i++)
        if (document.theForm.elements[i].name.indexOf('id[]') !=-1)
            document.theForm.elements[i].checked = true;
			
}else{			
   document.theForm.Check_All.value="Check All";
    for (i=0,n=document.theForm.elements.length;i<n;i++)
        if (document.theForm.elements[i].name.indexOf('id[]') !=-1)
            document.theForm.elements[i].checked = false;	
}
}

function Check3()
{
if(document.theForm.Check_All.value=="Check All"){
   document.theForm.Check_All.value="UnCheck All";
    for (i=0,n=document.theForm.elements.length;i<n;i++)
        if (document.theForm.elements[i].name.indexOf('houtopties[]') !=-1)
            document.theForm.elements[i].checked = true;
			
}else{			
   document.theForm.Check_All.value="Check All";
    for (i=0,n=document.theForm.elements.length;i<n;i++)
        if (document.theForm.elements[i].name.indexOf('houtopties[]') !=-1)
            document.theForm.elements[i].checked = false;	
}
}

function goToURL(url) { 
window.location = url; 
}


function goToURL2(url) { 
var afmeting1 = document.getElementById("afmeting").selectedIndex;
//var afmeting = document.getElementById("select").getElementsByTagName("afmeting")[selected];
//var afmeting1 = document.getElementById('myform').options[afmeting.selectedIndex].value;
//document.myform.submit();
//alert(afmeting1);
window.location = url + "&afmeting=" + afmeting1 ; 
}

function opslaan() {
	document.getElementById('bezig').style.visibility='visible'
 //var htmlCode = document.getElementById('iframe').contentWindow.document.body.innerHTML;
 //ia = htmlcode.length
 //document.getElementById("Omschrijving").value = htmlCode;
 //setTimeout("alert('Thirty seconds has passed.');",30000);
 document.myform.submit();
 //document.getElementById("form1").submit();
}

function opslaan2() {
  document.getElementById('bezig').style.visibility='visible'
 //var htmlCode = document.getElementById('iframe').contentWindow.document.body.innerHTML;
 //ia = htmlcode.length
 //document.getElementById("Omschrijving").value = htmlCode;
 //setTimeout("alert('Thirty seconds has passed.');",30000);
 document.myform.submit();
 //document.getElementById("form1").submit();
}


