function show_contact_form() {
	if (document.getElementById('contactform').style.display != 'block') {
		document.getElementById('contactform').style.display = 'block';
		document.getElementById('phonenumbers').style.display = 'none';
		
		//if user made a special offer enquiry first, would like to make a general enquiry, 
		//then remove the hidden special offer title.
		if(document.getElementById('HH')!= null){document.getElementById('HH').value = '';}
		if(document.getElementById('special_offer_msg')!= null){document.getElementById('special_offer_msg').innerHTML = '';}
		//subscribe check box for normal listing
		if(document.frmContactForm.chkSubscribe!= null){document.frmContactForm.chkSubscribe.checked = true;}
		//subscribe check box for priority listing, standard contact us form
		if(document.frmContactForm.GG!= null){document.frmContactForm.GG.checked = true;}
		document.frmContactForm.txtName.focus();
	} else {
		close_contact_form();
	}
}
function close_contact_form() {
	document.getElementById('contactform').style.display = 'none';
}
function special_offer_enquire_form(special_offer) {
	document.getElementById('special_offer_msg').innerHTML = '<p>Special Offer Enquiry: '+special_offer+'</p>';
	document.getElementById('HH').value = special_offer;
	document.getElementById('contactform').style.display = 'block';
	document.getElementById('phonenumbers').style.display = 'none';
	//subscribe check box for priority listing, special offer contact us form
	document.frmContactForm.GG.checked = true;
	document.frmContactForm.txtName.focus();
}

function frmContactForm_onSubmit(objForm) {

	var strMissingInfo = "";
	
	if (objForm.txtName.value == '' ) {
		objForm.txtName.className = 'texterror';
		strMissingInfo += '\n     -  Your name';
		
	} else {
		objForm.txtName.className = 'text';

	}

	if (objForm.txtEmail.value == '' ) {
		objForm.txtEmail.className = 'texterror';
		strMissingInfo += '\n     -  Your email';
		
	} else {
		objForm.txtEmail.className = 'text';

	}

	

	if (objForm.txtEmail.value != objForm.txtCEmail.value) {
		strMissingInfo += '\n     -  Your email address and confirmation must match';
		objForm.txtCEmail.className = 'texterror';
	} else {
		objForm.txtCEmail.className = 'text';
	}

	

	if (strMissingInfo != "") 
	{
		strMissingInfo = "To contact us, you must enter:\n" +
						   "_____________________________________\n" +
		strMissingInfo + "\n_____________________________________" +
		"\n\nPlease re-enter and submit again!";
		alert(strMissingInfo);
		return false;
	}
	else {
		objForm.cmdSubmit.disabled = true;
		return true;
	}
}

function frmContactFormPriority_onSubmit(objForm) {

	var strMissingInfo = "";
	
	if (objForm.AA.value == '' ) {
		objForm.AA.className = 'texterror';
		strMissingInfo += '\n     -  Your name';
		
	} else {
		objForm.AA.className = 'text';

	}

	if (objForm.BB.value == '' ) {
		objForm.BB.className = 'texterror';
		strMissingInfo += '\n     -  Your email';
		
	} else {
		objForm.BB.className = 'text';

	}

	

	if (objForm.BB.value != objForm.CC.value) {
		strMissingInfo += '\n     -  Your email address and confirmation must match';
		objForm.CC.className = 'texterror';
	} else {
		objForm.CC.className = 'text';
	}

	if (objForm.EE.value == '' ) {
		objForm.EE.className = 'textareaerror';
		strMissingInfo += '\n     -  Your message';
		
	} else {
		objForm.EE.className = 'textarea';

	}

	if (strMissingInfo != "") 
	{
		strMissingInfo = "To contact us, you must enter:\n" +
						   "_____________________________________\n" +
		strMissingInfo + "\n_____________________________________" +
		"\n\nPlease re-enter and submit again!";
		alert(strMissingInfo);
		return false;
	}
	else {
		objForm.cmdSubmit.disabled = true;
		return true;
	}
}


function phone(i) {
	if (document.getElementById('phonenumbers').style.display != 'block') {
		document.getElementById('phonenumbers').style.display = 'block';
		document.getElementById('contactform').style.display = 'none';
		document.getElementById('noemailphonenumbers').style.display = 'none';
		frames['frmStats'].location.href = '/counter-phone.php?i=' + i;
	} else {
		document.getElementById('phonenumbers').style.display = 'none';
	}
}

function noemailphone(i) {
	if (document.getElementById('noemailphonenumbers').style.display != 'block') {
		document.getElementById('noemailphonenumbers').style.display = 'block';
		document.getElementById('contactform').style.display = 'none';
		document.getElementById('phonenumbers').style.display = 'none';
		frames['frmStats'].location.href = '/counter-noemailphone.php?i=' + i;
	} else {
		document.getElementById('noemailphonenumbers').style.display = 'none';
	}
}


function website(i) {
	frames['frmStats'].location.href = '/counter-website.php?i=' + i;
}


function phonePriority(i) {
	if (document.getElementById('phonenumbers').style.display != 'block') {
		document.getElementById('phonenumbers').style.display = 'block';
		document.getElementById('contactform').style.display = 'none';
		document.getElementById('noemailphonenumbers').style.display = 'none';
		frames['frmStats'].location.href = '/stats/priority-counter-phone.php?productID=' + i;
	} else {
		document.getElementById('phonenumbers').style.display = 'none';
	}
}

function websitePriority(i) {
	frames['frmStats'].location.href = '/stats/priority-counter-website.php?productID=' + i;
}



