constraintRef.add("Check Test", function(input, fieldNames){
function isSet(val){
val += "";
return (val=="undefined"||val=="null") ? 0 : 1;
}
var names = fieldNames.split(",");
var numChecked = 0;
for (var i=0; i < names.length; i++){
var element = form.getElement(names[i]);
if (isSet(element) && element.checked){
numChecked++;
}
}
return (numChecked > 0 ? true : false);
} );
constraintRef.add("CheckBox Checked Limit", function(input, fieldNames,limit){
function isSet(val){
val += "";
return (val=="undefined"||val=="null") ? 0 : 1;
}
var names = fieldNames.split(",");
var numChecked = 0;
alert( "number checked is:" + numChecked);
for (var i=0; i < names.length; i++){
var element = form.getElement(names[i]);
if (isSet(element) && element.checked){
numChecked++;
}
}
alert( "number checked is:" + numChecked);
return (numChecked > limit ? true : false);
} );
constraintRef.add("Does Not Equal", function (input, value){
return(input != value ? true : false);
});
constraintRef.add("Equals", function (input, value){
return(input == value ? true : false);
});
constraintRef.add("Greater Than", function (input, value){
return(input > value ? true : false);
});
constraintRef.add("Is Alpha Numeric", function (str){
var re = new RegExp("([A-Z|a-z|0-9| ]*)", "");
re.exec(str);
return( RegExp.$1.length == str.length ? true : false);
});
constraintRef.add("Is DOB", function (input, min, max){
// min = (min == null ? "" : min);
// max = (max == null ? "" : max);
function fixYear(year){
if (document.all&&document.getElementById){
return year < 1900 ? year + 1900 : year;
}else{
return year < 1900 ? year + 1900 : year;
}
}
function splitDateStr(dateStr, delimiter){
var dateParts = null;
if (dateStr.indexOf(delimiter) > 0){
dateParts = dateStr.split(delimiter);
}
return dateParts;
}
function getDatePartsFromString(dateStr){
var dateParts;
var i = 0;
var delimiters = new Array();
delimiters[delimiters.length] = "/";
delimiters[delimiters.length] = "\\";
delimiters[delimiters.length] = "-";
delimiters[delimiters.length] = " ";
delimiters[delimiters.length] = ".";
delimiters[delimiters.length] = "_";
delimiters[delimiters.length] = "!";
while ( (dateParts=splitDateStr(dateStr, delimiters[i++])) == null && i < delimiters.length){}
return dateParts;
}
var test = false;
if (input == ""){
return true;
}
var dateParts = getDatePartsFromString(input);
if (dateParts != null && dateParts.length == 3 && dateParts[2] != "") {
dateParts[0] = dateParts[0]*1;
dateParts[1] = dateParts[1]*1-1;
dateParts[2] = fixYear(dateParts[2]*1);
var date = new Date();
date.setDate( dateParts[0] );
date.setMonth( dateParts[1] );
date.setYear( dateParts[2] );
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
date.setMilliseconds(0);
if (date.getDate() == dateParts[0] && date.getMonth() == dateParts[1] && fixYear(date.getYear()) == dateParts[2]){
test = true;
var maxLimit = new Date();
if (max != null){
maxLimit.setYear( fixYear(fixYear(maxLimit.getYear()) - max));
if ( (date.getTime() - maxLimit.getTime()) <= 0){
test = false;
}
}
var minLimit = new Date();
if (min !=null){
minLimit.setYear( fixYear(fixYear(minLimit.getYear()) - min));
if ( (minLimit.getTime() - date.getTime()) <= 0){
test = false;
}
}
}
}
return test;
});
constraintRef.add("Is Email", function (str){
var re = new RegExp("^([A-Za-z0-9\\.\\-\\_]*@[A-Za-z0-9\\.\\-\\_]*)", "");
re.exec(str);
return( RegExp.$1 == str ? true : false);
}
);
constraintRef.add("Is Numeric", function (str){
var re = new RegExp("([0-9| ]*)", "");
re.exec(str);
return( RegExp.$1.length == str.length ? true : false);
});
constraintRef.add("Is SCOTS Master ID", function (input) {
return true;
});
constraintRef.add("Less Than", function (input, value){
return(input < value ? true : false);
});
constraintRef.add("Max Size", function (input, value){
return(input.length <= value ? true : false);
});
constraintRef.add("Not Empty", function (input) {
input+="";
return(input == "" ? false : true);
});
constraintRef.add("Radio Button Test", function(input, fieldName) {
function isSet(val) {
val += "";
return (val=="undefined"||val=="null") ? 0 : 1;
}
var radioButton = document.getElementsByName(fieldName);
var numChecked = 0;
for (var i=0; i < radioButton.length; i++) {
var element = radioButton[i];
if (isSet(element) && element.checked) {
numChecked++;
}
}
return (numChecked > 0 ? true : false);
});
constraintRef.add("Radio Double Test", function(input, name, testValue, fieldName){
if (input == testValue){
var field = form.getElement(fieldName);
return (field.value == "" ? false : true);
}
return true;
});
Alpha Mountaineering
Contact details:
40 Telford Gardens, Inverness, IV3 5LQ
Tel: 07748 275 825
Email:
Alpha Mountaineering
Web: Alpha Mountaineering
Alpha Mountaineering offer all aspects of mountaineering in the Scottish hills. They provide instruction and guiding in walking, scrambling and climbing, both in summer and winter. Whether you want to learn to navigate, climb a sea stack or use ice axes for the first time we can teach you the skills you need.
Nick Carter has been climbing since the early 80's. He has instructed in the outdoors for the last 12 years including working for Plas Y Brenin (The National Mountain Centre for England and Wales).
At Alpha Mountaineering we will create the course that suits you. We don't have set dates for courses, but give you some suggested course itineraries and then let you shape the course to fit your experience and aspirations.
What we do best:
Intro Winter Climbing Courses
In winter the scrambles of the summer turn into fantastic easier winter climbs. If you've done some winter walking or our winter skills course you will probably want to start moving on to more challenging terrain. With the guidance of an Alpha Mountaineering Instructor you can attempt some of the best easy winter climbs that the UK has to offer. Over a 2 day or 5 day course we will look at route finding, moving over steeper ground, anchor choice, winter gear placement and rope work. We run our climbing courses from the end of December to the end of March, either from Fort William or Aviemore.
Intermediate and Advanced Winter Climbing Courses
Now that you are a 'Winter Climber' you'll probably want to tackle something harder. Whether you want to swing your axes at some vertical ice, torque your way up a winter mixed route or have a great day out on a much sort after classic line, this is the course for you. We at Alpha Mountaineering can take you out for 2 or 5 days either in the West or East Highlands. We run our climbing courses from the end of December to the end of March, either from Fort William or Aviemore. Maybe you've heard about a particular winter route or mountain area and you'd like to discover more then why not book your own Mountain Instructor to take you on a guided tour.