﻿function getObject(objectId) {
    // cross-browser function to get an object
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId);
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId);
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getObject

function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject

function hideit (obj) {
  var the_style = getStyleObject(obj);
  the_style.visibility = 'hidden';
 }
 
function showit (obj) {
  var the_style = getStyleObject(obj);
  the_style.visibility = 'visible';
 }
 

function malesas(objectID, to, subj){
	if(!subj) { //If the optional argument is not there, create a new variable with that name.
		var subj = "";		
	}
	else
	{subj = '?subje' + 'ct=' + subj;}
if ((to == 'sales')& (subj == ""))
subj = '?subje' + 'ct=K2 Info Request';
if ((to== 'support')& (subj == ""))
subj = '?subje' + 'ct=K2 Support Request';
getObject(objectID).innerHTML = '<a href="mai' + 'lto:' + to + '@sas' + 'safras.c' + 'om' + subj + '">' + to  + '@sas' + 'safras.c' + 'om' + '</a>';
}
