var objGroupMenu;
var blnShowingMenu = false;
var objTimeout;

function doPrint(){
	window.print();
}	
function PopUp(strPath){
 window.open(strPath,'','status=yes,resizable=yes,width=600,height=700');
 
}
function o(photo,path) {
  var strPath = 'popup.aspx?image=' + photo + '&amp;path=' + path; 
  window.open(strPath,'','status=yes,resizable=yes,width=600,height=622');
}
function getField(fldName) {
  var arrCheck = new Array;
  var arrSplit = new Array;
  var blnFound = false;
	arrObjects = document.getElementsByTagName('INPUT');
  
  for (i=0; i<arrObjects.length; i++) {
	  arrSplit = arrObjects[i].id.split("_");
	  for (j=0; j<arrSplit.length; j++) {
		  if (arrSplit[j] == fldName) {
  			blnFound = true;
				break;
			}
		}
  	if (blnFound == true) {
		  break;
		}
  }
	
	if (blnFound == false) {
    // soms op zoek naar select, dan?
  	arrObjects = document.getElementsByTagName('SELECT');
  	
    for (i=0; i<arrObjects.length; i++) {
	    arrSplit = arrObjects[i].id.split("_");
	    for (j=0; j<arrSplit.length; j++) {
		    if (arrSplit[j] == fldName) {
  		  	blnFound = true;
			  	break;
			  }
		  }
  	  if (blnFound == true) {
		    break;
		  }
    }  	
	}
	
	if (blnFound == false) {
	  window.status += 'getField:object not found';
		arrObjects[0] = new object;
		i = 0;
	}
  
  return arrObjects[i];
}

function postFocus(e, value) {
  if(event.keyCode==13){
    getField(value).focus();
  }
}

function doSizeTable() {
  var objSizeTable = document.getElementById('tblSizeTable');
	if (objSizeTable.style.display == 'block') {
	  objSizeTable.style.display = 'none';
	} else {
	  objSizeTable.style.display = 'block';
	}
	
	return void(null);
}

function checkSize() {
  var objSize = getField('ddlSize');
  if(objSize.options[0].selected) {
    alert('Kies eerst een maat!');
    return false;
  } else {
    return true;
  }
}

function showGroupMenu() {
  objGroupMenu = document.getElementById('shop_choosegroup');
  objGroupMenu.style.display = 'inline';
	clearTimeout(objTimeout);
}

function hideGroupMenu() {
  if (blnShowingMenu == false) {
    objGroupMenu = document.getElementById('shop_choosegroup');
    objGroupMenu.style.display = 'none';
  }
}