function maskEmail(ename, edomain, ext, eclass){
	var linktext = ename + "@" + edomain + "." + ext;
	document.write("<a href=" + "mail" + "to:" + ename + "@" + edomain + "." + ext + " class='"+eclass+"'>" + linktext + "</a>");
}
function submitForm(theform){
		document.getElementById(theform).submit();
}

function getxmlhttp (){
	//Create a boolean variable to check for a valid Microsoft active x instance.
	var xmlhttp = false;
	//Check if we are using internet explorer.
	try {
	//If the javascript version is greater than 5.
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	//If not, then use the older active x object.
	try {
	//If we are using internet explorer.
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
	//Else we must be using a non-internet explorer browser.
	xmlhttp = false;
	}
	}
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}
	return xmlhttp;
}

function fillType(obj){
	xmlhttp = getxmlhttp();
	xmlhttp.open("GET", "/ssi/incl/calculator_ajax.asp?opt=1&website=" + obj);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			var xmlResponse = xmlhttp.responseXML;
			xmlRoot = xmlResponse.documentElement;
			sname = xmlRoot.getElementsByTagName("sname");
			svalue = xmlRoot.getElementsByTagName("svalue");
			type = document.getElementById("type");
			type.options.length = 1;
			for (var i=0; i<sname.length; i++){
				option = document.createElement("OPTION");
				option.value = svalue.item(i).firstChild.data;
				option.text  = sname.item(i).firstChild.data;
				type.options.add(option);
			}	
		}
	}
	xmlhttp.send(null);
}
function rateCalc()
{
	selType =  (document.getElementById("type").value).split("#");
	cost = selType[0];
	rUnit = selType[1];
	
	noImpression = document.getElementById("no_impressions").value;	
	document.getElementById("total").innerHTML = "&euro; " + cost * noImpression / 1000;
}
