//BROWSERS
var recentBrowser = false;
var isIE=false;
if ((parseInt(navigator.appVersion) >= 4 && navigator.appVersion.indexOf("MSIE") != -1) || ((parseInt(navigator.appVersion) >= 6 && navigator.appName.indexOf("Netscape") != -1))){
recentBrowser = true; //Opera 7 also true for these parameters
isIE=true;
}
if ((parseInt(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape") != -1) || ((parseInt(navigator.appVersion) >= 6 && navigator.appName.indexOf("Netscape") != -1))){
recentBrowser=true;
}
//STYLES BROWSER ADJUSTMENT
if(!isIE){document.write("")}
//BREAK OUT OF FRAMES
if (window.location != top.location){top.location.href=window.location};
//DATE & TIME
var days = new Array(7);
days[1]="Sunday";days[2]="Monday";days[3]="Tuesday";days[4]="Wednesday";days[5]="Thursday";days[6]="Friday";days[7]="Saturday";
var months = new Array(12);
months[1]="Jan";months[2]="Feb";months[3]="Mar";months[4]="Apr";months[5]="May";months[6]="Jun";months[7]="Jul";months[8]="Aug";months[9]="Sep";months[10]="Oct";months[11]="Nov";months[12]="Dec";
var today = new Date();
var day = days[today.getDay() + 1]
var month = months[today.getMonth() + 1]
var date = today.getDate();
var year=today.getYear();
if(year<2000){year = year + 1900;}
//MENU HIGHLIGHTING
var qstring=location.search;
if(qstring.indexOf("&")>0){
var qstringparts=qstring.split("&");
var qstringpageid=qstringparts[0];
var pageidparts=qstringpageid.split("=");
var pageid="id_"+pageidparts[1];
}else{
var pageidparts=qstring.split("=");
var pageid="id_"+pageidparts[1];
}
function highlightMenu(){
if(recentBrowser){
if(document.getElementById(pageid)){
document.getElementById(pageid).className="menubtnactive";
document.getElementById(pageid).childNodes[0].className="menutextactive";
}
}
}
function mouseoverMenu(menuid){
if(recentBrowser){
if (menuid==pageid){
document.getElementById(menuid).style.className="menubtnactive";
document.getElementById(menuid).childNodes[0].className="menutextactive";
}else{
document.getElementById(menuid).className="menubtnover";
document.getElementById(menuid).childNodes[0].className="menutextover";
if (isIE){document.getElementById(menuid).style.cursor="hand";}
}
}
}
function mouseoutMenu(menuid){
if(recentBrowser){
if (menuid==pageid){
document.getElementById(menuid).className="menubtnactive";
document.getElementById(menuid).childNodes[0].className="menutextactive";
}else{
document.getElementById(menuid).className="menubtn";
document.getElementById(menuid).childNodes[0].className="menutext";
}
}
}
function fnmenulink(menulink){
if(recentBrowser){
location.href = "/"+menulink;
}
}
//COOKIE HANDLING
function deletecookies(){//deletes ALL cookies
var cstring=unescape(document.cookie);
var carray=cstring.split(";");
for(i=0;i 730) {
daysago = Math.floor(daysago/365);
unit = 'years';
}
else if (daysago > 60) {
daysago = Math.floor(daysago/30);
unit = 'months';
}
else if (daysago > 14) {
daysago = Math.floor(daysago/7);
unit = 'weeks'
}
var towrite = 'Last modified: ';
if (daysago == 0) towrite += 'Today';
else if (daysago == 1) towrite += 'Yesterday';
else towrite += daysago + ' ' + unit + ' ago';
return towrite+' ('+original+')';
}
function takeYear(theDate) {
x = theDate.getYear();
var y = x % 100;
y += (y < 38) ? 2000 : 1900;
return y;
}
//EMAIL BUILDER
function buildemail(emailname,emaildom){
window.open("mailto:"+emailname+"@"+emaildom);
}
//CHECK EMAIL
function checkemail(emailstr){
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(emailstr)){
return true;
}else{
return false;
}
}
//DYNAMIC STYLES
function setStyleByClass(t,c,p,v){
var elements;
if(t == '*') {
// '*' not supported by IE/Win 5.5 and below
elements = (ie) ? document.all : document.getElementsByTagName('*');
} else {
elements = document.getElementsByTagName(t);
}
for(var i = 0; i < elements.length; i++){
var node = elements.item(i);
for(var j = 0; j < node.attributes.length; j++) {
if(node.attributes.item(j).nodeName == 'class') {
if(node.attributes.item(j).nodeValue == c) {
eval('node.style.' + p + " = '" +v + "'");
}
}
}
}
}
// getStyleByClass: given an element type, a class selector and a property,
// return the value of the property for that element type.
// args:
// t - element type
// c - class identifier
// p - CSS property
function getStyleByClass(t, c, p) {
// first loop over elements, because if they've been modified they
// will contain style data more recent than that in the stylesheet
var elements;
if(t == '*') {
// '*' not supported by IE/Win 5.5 and below
elements = (ie) ? document.all : document.getElementsByTagName('*');
} else {
elements = document.getElementsByTagName(t);
}
for(var i = 0; i < elements.length; i++){
var node = elements.item(i);
for(var j = 0; j < node.attributes.length; j++) {
if(node.attributes.item(j).nodeName == 'class') {
if(node.attributes.item(j).nodeValue == c) {
var theStyle = eval('node.style.' + p);
if((theStyle != "") && (theStyle != null)) {
return theStyle;
}
}
}
}
}
// if we got here it's because we didn't find anything
// try styleSheets
var sheets = document.styleSheets;
if(sheets.length > 0) {
// loop over each sheet
for(var x = 0; x < sheets.length; x++) {
// grab stylesheet rules
var rules = sheets[x].cssRules;
if(rules.length > 0) {
// check each rule
for(var y = 0; y < rules.length; y++) {
var z = rules[y].style;
// selectorText broken in NS 6/Mozilla: see
// http://bugzilla.mozilla.org/show_bug.cgi?id=51944
ugly_selectorText_workaround();
if(allStyleRules) {
if((allStyleRules[y] == c) ||
(allStyleRules[y] == (t + "." + c))) {
return z[p];
}
} else {
// use the native selectorText and style stuff
if(((z[p] != "") && (z[p] != null)) &&
((rules[y].selectorText == c) ||
(rules[y].selectorText == (t + "." + c)))) {
return z[p];
}
}
}
}
}
}
return null;
}