/*
File Name....: tpc.js
Description..: JavaScript Library - tpconsult.com
Author.......: TPC (10-10-2008)
Modified By..:
Modifications:
*/


/* ---------- Copyright Year ---------- */

function printYear()
{
	var time=new Date();
  	var year=time.getYear();
  	if (year < 2000)
    	year = year + 1900; 
    document.write(year);
}


/* ---------- Open Contact Us Response Window -------- */
function rspContactWindow()
{
	newWindow = window.open('./rspContact.htm','','height=250,width=450,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no');
}   


/* ---------- Open Voucher Response Window -------- */
function rspVoucherWindow()
{
	newWindow = window.open('./rspVoucher.htm','','height=250,width=450,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no');
}


/* ---------- Open Privacy Policy -------- */
function privacyPolicy()
{
	newWindow = window.open('./privacy.htm','','height=500,width=450,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no');
}   

/* ---------- Open Guarantee -------- */
function guarantee()
{
	newWindow = window.open('./guarantee.htm','','height=500,width=450,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no');
}   

/* ---------- Open Services -------- */
function network()
{
	newWindow = window.open('./services/network.htm','','height=500,width=450,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no');
}

function breakFix()
{
	newWindow = window.open('./services/breakFix.htm','','height=500,width=450,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no');
}

function develop()
{
	newWindow = window.open('./services/develop.htm','','height=500,width=450,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no');
}

function purchasing()
{
	newWindow = window.open('./services/purchasing.htm','','height=500,width=450,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no');
}

function recovery()
{
	newWindow = window.open('./services/recovery.htm','','height=500,width=450,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no');
}

function security()
{
	newWindow = window.open('./services/security.htm','','height=500,width=450,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no');
}

function trams()
{
	newWindow = window.open('./services/trams.htm','','height=500,width=450,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no');
}

function checkActivateVoucher()
{
	if(document.ActivateVoucher.Name.value=="" || document.ActivateVoucher.Company.value=="" || 
	document.ActivateVoucher.Address.value==""||document.ActivateVoucher.City.value=="" || 
	document.ActivateVoucher.Zip.value=="" || document.ActivateVoucher.Email.value=="" || document.ActivateVoucher.Phone.value=="")
	{
		window.alert("Please fill in all fields")
		document.ActivateVoucher.Name.focus()
		return
	}
	document.ActivateVoucher.submit();
	document.ActivateVoucher.reset();
	rspVoucherWindow();
}

function checkContactUs()
{
	if(document.ContactUs.Name.value=="" || document.ContactUs.Email.value=="" || document.ContactUs.Phone.value=="")
	{
		window.alert("Please provide a name, email address and phone number")
		document.ContactUs.Name.focus()
		return
	}
	document.ContactUs.submit();
	document.ContactUs.reset();
	rspContactWindow();
}

function checkFreeReport()
{
	if(document.FreeReport.Name.value=="" || document.FreeReport.Company.value=="" || document.FreeReport.Address.value=="" || document.FreeReport.City.value=="" || 
	document.FreeReport.Zip.value=="" || document.FreeReport.Email.value=="" || document.FreeReport.Phone.value=="")
	{
		window.alert("Please fill in all fields")
		document.FreeReport.Name.focus()
		return
	}
	document.FreeReport.submit();
	document.FreeReport.reset();
	newWindow = window.open('./reports/most_expensive.pdf','','height=750,width=550,resizable=yes,status=no,toolbar=no,location=no,scrollbars=no')
}

/* ---------- End Source ---------- */