// set root directory

var dir = '';

function getyearstr(){
var today = new Date()
var year = today.getYear()
if (year<1000){
year+=1900
}
return year;
}

function encrypt(username,hostname,linktext,subject,message){
var username = username || 'info';
var hostname = hostname || 'withanopenmind.com';
var address = username + '&#64;' + hostname;
var linktext = linktext || address;
var subject = subject || '';
if(subject != ''){
	subject = '?subject=' + subject;
}
var message = message || '';
if(message != ''){
	message = '?body=' + message;
}
var output = '<a href="&#109;&#97;&#105;&#108;' + '&#116;&#111;&#58;'+ address + subject + message +'">'+ linktext +'</a>';
document.write(output);
}

$(document).ready(function() {

$('a.iframe').each(function() { // for each a tag with class iframe
var defaultWidth = 915;
var defaultHeight = 512;
var customWidth = 0;
var customHeight = 0;
var classes = $(this).attr("class").split(" ");
for (var i = 0; i < classes.length; i++) { // for each class
var thisClass = classes[i];
var splitClass = thisClass.split("_");
var customValue = Number(splitClass[1]); 
switch (splitClass[0]) { // check for w or h
case 'w':
customWidth = customValue;
break;
case 'h':
customHeight = customValue;
break;
} // end check for w or h
} // end for each class
var boxWidth = (customWidth) ? customWidth : defaultWidth;
var boxHeight = (customHeight) ? customHeight : defaultHeight;
$(this).fancybox({
width: boxWidth,
height: boxHeight,
overlayColor: '#000',
overlayOpacity: 0.7,
type: 'iframe'
});
}); // end for each a tag with class iframe

});


