﻿function OpenCertDetails()
{
	thewindow =window.open('https://www.thawte.com/cgi/server/certdetails.exe?code=CAYOUR4-2', 'anew',config='height=400,width=450,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=yes');
}

function calpop(s,form)
{
  html = "calendar.html?dateField=" + s + "&f="+form;
  addWindow = window.open(html,"cal","width=275,height=200,resizable=1,status=1,menubar=0,scrollbars=0,fullscreen=0");
  addWindow.focus();
}

var urlAddress = "http://www.yourtechonline.com";
var pageName = "Online Technical Support - YourTechOnline";

function addToFavorites()
{
 if (window.external)
 {
  window.external.AddFavorite(urlAddress,pageName);
 }
 else
 { 
  alert("Sorry! Your browser doesn't support this function.");
 }
}

function noenter()
{
	return !(window.event && window.event.keyCode == 13);
}

function trim(str)
{
  return str.replace(/^\s+|\s+$/g, '');
}

String.prototype.trim2 = function()
{
  return this.replace(/^\s*|\s*$/g, "");
}


function checknotes(plin)
{

	if (plin.issue_type.value=="training")
	{
		if (plin.issue_desc.value.trim2() === "")
		{
			alert( "Please describe the issue to us." );
			form.issue_desc.focus();
			return false;
		}

		return true;
	}
	else
	{
		if (plin.issue_type.value.trim2() === "")
		{
			alert( "Please choose what kind of issue this is." );
			plin.issue_type.focus();
			return false ;
		}
		if (plin.issue_desc.value.trim2() === "")
		{
			alert( "Please describe the issue to us." );
			plin.issue_desc.focus();
			return false ;
		}
		if (plin.issue_start.value.trim2() === "")
		{
			alert( "Please tell us when you first descovered this issue." );
			plin.issue_start.focus();
			return false ;
		}
		if (plin.fix_attempt.value.trim2() === "")
		{
			alert( "Please Let us know if there has been anything done to try and fix this issue." );
			plin.fix_attempt.focus();
			return false ;
		}
		if (plin.random.value.value.trim2() === "")
		{
			alert( "Please tell us if you can replicate this issue." );
			plin.random.focus();
			return false ;
		}
		return true ;
	}
}

function check_t_c(plin)
{
	if (plin.b_check_t_c.checked===false)
	{
		alert("You must agree to the terms and conditions before proceeding.\n\nPut a check in the 'I have read and understood the terms and conditions' checkbox to continue.");
		plin.b_check_t_c.focus();
		return false;
	}
}