
// Videocall generic Javascript functions

/////////////////////////////////////////////////////////////
function PrintPage(){
if (navigator.appName.indexOf("Netscape") != -1){alert("Sorry, Netscape does not offer the option to print this way,\nplease use your printer option from the browser itself.")}
bg=document.body.background
bgc=document.body.bgColor
document.body.background='';
document.bgColor='#FFFFFF';
window.print();
document.body.background=bg;
document.bgColor=bgc
}


function EmailPage(){
	alert("email function missing")
}


function ValidateFriend(){
	if (window.document.taf.email.value == ''){
		alert('Your email address has not been entered\nPlease enter your email address');
		window.document.taf.email.focus();
		return false;}
	if (document.taf.email.value.indexOf('@') == -1){
		alert('A valid email address has not been entered\nPlease enter a valid email address');
		window.document.taf.email.focus();
		return false;}
	if (document.taf.email.value.indexOf('.') == -1){
		alert('A valid email address has not been entered\nPlease enter a valid email address');
		window.document.taf.email.focus();
		return false;}

	if (window.document.taf.rec_email.value == ''){
		alert('Recipient email address has not been entered\nPlease enter your email address');
		window.document.taf.rec_email.focus();
		return false;}
	if (document.taf.rec_email.value.indexOf('@') == -1){
		alert('A valid email address has not been entered\nPlease enter a valid email address');
		window.document.taf.rec_email.focus();
		return false;}
	if (document.taf.rec_email.value.indexOf('.') == -1){
		alert('A valid email address has not been entered\nPlease enter a valid email address');
		window.document.taf.rec_email.focus();
		return false;}
	return true;
}

function BoxOn(Box,ClientName){
	Box.style.color='#FFFFFF'
	Box.style.background='url(images/box_on.jpg) no-repeat';
	WriteToLayer('clientbox',"&nbsp;"+ClientName)
	if (ClientName.length > 21){document.all('clientbox').style.padding="25px 0 7px 0;"}
	else {document.all('clientbox').style.padding="32px 0 0px 0;"}
}
function BoxOff(Box){
	Box.style.color='#98002B';
	Box.style.background='url(images/box_off.jpg) no-repeat';
}
function BenefitBoxOn(Box,ClientName){
	Box.style.color='#FFFFFF'
	Box.style.background='url(images/benefitbox_on.jpg) no-repeat';
	WriteToLayer('benefit_box','&#8220;'+ClientName+'&#8221;')
}
function BenefitBoxOff(Box){
	Box.style.color='#98002B';
	Box.style.background='url(images/benefitbox_off.jpg) no-repeat';
}
function ChangeLayerBG(LayName,BG){
	if (document.all){
		Lay=document.all(LayName).style.background=''+BG+''
	}
	else if (document.getElementById){
		document.getElementById(LayName).style.background=''+BG+''
	}
	else if (document.layers){
		Lay=document.layers[LayName].background=''+BG+''
	}
}

/////////////////////////////////////////////////////////////
// Layer functions
/////////////////////////////////////////////////////////////

if (document.getElementById){
   var doc = 'document.', vis = '.style.visibility', pos = '.style.top';;
}
else if (document.all) {
   var doc = 'document.all.', vis = '.style.visibility', pos = '.style.top';;
}
else if (document.layers){
	var doc = 'document.document.', vis = '.visibility', pos = '.top';;
}
function show(object) {
	if (document.getElementById){
		eval(doc + "getElementById('"+object+"')" + vis + ' = "visible"');

	}
	else if (document.layers || document.all){
		eval(doc + object + vis + ' = "visible"');
	}
}

function hide(object) {
	if (document.getElementById){
		eval(doc + "getElementById('"+object+"')" + vis + ' = "hidden"');
	}
	else if (document.layers || document.all){
		eval(doc + object + vis + ' = "hidden"');
	}
}
function WriteToLayer(object,content){
	if (document.getElementById){
		document.getElementById(object).innerHTML = content;
	}
	else if (document.all){
		document.all(object).innerHTML = content;
	}
	else if (document.layers) {
		document.layers[object].document.open();
		document.layers[object].document.write(content);
		document.layers[object].document.close();
	}
}