
function selectDivs(tagArg,tagVal){
	if (tagVal!=""){
	dojo.query(".listLink").forEach(
		function(inputElement) {
			inputElement.className = "listLinkDisabled";
	   }
	);		
	dojo.query(".listLinkDisabled").forEach(
		function(inputElement) {
			if (inputElement.getAttribute(tagArg) == tagVal){
				inputElement.className = "listLink";
			}
		}
	);
	} else {	
	dojo.query(".listLinkDisabled").forEach(
		function(inputElement) {
			inputElement.className = "listLink";
		}
	);
	}
}
function openLocationEventPane(contentID,name){
	dijit.byId('Dialog').show();dijit.byId('Dialog').setHref('page.php?ID=642&cIDtoSee=' + contentID + '&SstageTemp=previewLive&lang=');
	dijit.byId('Dialog').setTitle(name.replace("+"," ")); 
}
function openLocationPane(contentID,name){
	dijit.byId('Dialog').show();dijit.byId('Dialog').setHref('page.php?ID=642&cIDtoSee=' + contentID + '&SstageTemp=previewLive&lang=');
	dijit.byId('Dialog').setTitle(name.replace("+"," ")); 
}

function openLocationPaneEvent(contentID,name){
	dijit.byId('Dialog').show();dijit.byId('Dialog').setHref('page.php?ID=642&cIDtoSee=' + contentID + '&SstageTemp=previewLive&lang=');
	dijit.byId('Dialog').setTitle(name.replace("+"," ")); 
}
function openLocationEventPane(contentID,name){
	dijit.byId('Dialog').show();dijit.byId('Dialog').setHref('page.php?ID=642&cIDtoSee=' + contentID + '&SstageTemp=previewLive&lang=');
	dijit.byId('Dialog').setTitle(name.replace("+"," ")); 
}
function openGooglePane(lat,longitude,name){
	dijit.byId('GoogleMap').show();dijit.byId('GoogleMap').setHref('DESIGN/locOnMap.php?lng=' + longitude + '&lat=' + lat + '&name=' + name + '');
}
function MM_validatePastryForm() { //v4.0

  var i,p,q,nm,test,num,min,max,errors='',args=MM_validatePastryForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { 
  	test=args[i+2]; 
	val=MM_findObj(args[i]);
	alertObj=MM_findObj("alert"+ args[i]);
	doubleObj=MM_findObj(args[i] + "_2");
	alertVal=alertObj.value;
    if (val) { 
	  nm=val.name; 
	  if ((val=val.value)!="") {
		  if (test.indexOf('isEmail')!=-1) { 
		  	p=val.indexOf('@');
			if (p<1 || p==(val.length-1)) errors+='- '+alertVal+' \n';
		  }  else if (test!='R') { 
					num = parseFloat(val);
					if (isNaN(val)) errors+='- '+alertVal+' \n';
					if (test.indexOf('inRange') != -1) { 
					  p=test.indexOf(':');
					  min=test.substring(8,p); max=test.substring(p+1);
					  if (num<min || max<num) errors+='- '+alertVal+' \n';
					} 
		  } 
	  } else if (test.charAt(0) == 'R') errors += '- '+alertVal+' \n'; 
   }
  } 
  if (errors) alert(errors);
  document.MM_returnValue = (errors == '');
}

