function VeriSignSecure()
{
	var url='https://seal.verisign.com/splash?form_file=fdf/splash.fdf&dn=WWW.LOGOWORKS.COM&lang=en';
	window.open(url, "VeriSign", "width=550,height=450,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes");
}
function focusForm()
{	
	//this form is located on all of the gallery pages
	if(document.galleryMoreIdeas != null)
	{
		document.galleryMoreIdeas.email.focus();
	}
	
	//this form is located on the promo products page
	if(document.promoNewsForm != null)
	{
		document.promoNewsForm.name.focus();
	}
}
function setOmnitureNews(linkID)
{
	s_linkTrackVars='s_eVar6,s_eVar1,s_eVar2';
	s_linkTrackEvents='None';
	s_linkType='o';
	s_linkName=linkID;
	s_eVar1='Article';
	s_eVar2='Article';
	s_eVar6=linkID;
	s_lnk=s_co(this);
	s_gs('logoworkscom');
}


function flashMoviePop(destination)
{
	url = destination;
	window.open(url, "flashMovie", "width=640,height=240,toolbar=no,menubar=no,status=no,scrollbars=yes,resizable=yes");
}
function captureRef()
{
 var docref = document.referrer.substring(0,100);
 var longenterpage = document.location;
 a = docref.indexOf('//');
 b = docref.indexOf('/', a + 2);
 // e1 = longenterpage.lastIndexOf('/')
 
 // e2 = longenterpage.lastIndexOf('.')
 //var enterpage = longenterpage.substring(e1 + 1, e2) 
 


 var cook = document.cookie;
 document.cookie="session_referrer=" + docref + ";path=/;domain=.logoworks.com";
 
 if (cook.indexOf("initial_referrer") == -1)
 {
 var today = new Date();
 var year = today.getFullYear();
 var month = today.getMonth();
 var day = today.getDate();
 day = day + 30;
 if (day > 28)
 {
 day = day - 28;
 month = month + 1;
 }
 if (month > 11)
 {
 month = 0;
 year = year + 1;
 }
 var expdate = new Date(year, month, day);
 document.cookie="initial_referrer=" + docref + ">>" + longenterpage + "; expires=" + expdate.toGMTString() + ";path=/;domain=.logoworks.com";
 }
}


function setOmnitureVars(linkID)
{
	s_linkTrackVars='s_eVar1,s_eVar2,s_prop2';
	s_linkTrackEvents='None';
	s_linkType='o';
	s_linkName=linkID;
	s_eVar1='Gallery Pages';
	s_eVar2='Gallery Pages';
	s_prop2=linkID;
	s_lnk=s_co(this);
	s_gs('logoworkscom');
}
/***********************************************************
* checkform() is used to check the form data on the
* gallery pages. USAGE: onsubmit="return checkForm(this)"
***********************************************************/
function checkForm(form,str)
{
	var noReq = new Array;
	var fn = true;
	var ln = true;
	var em = true;
	var ph = true;
	if(typeof str != "undefined")
	{
	 noReq = str.split(",");
	 for(i=0;i<noReq.length;i++)
	 switch (noReq[i])
	 {
	 case "fn": fn = false; break;
	 case "ln": ln = false; break;
	 case "em": em = false; break;
	 case "ph": ph = false; break;
	 default: break;
	 }
	}
	var fname = form.first_name;
	var lname = form.last_name;
	var email = form.email;
	var phone = form.phone;
	var name = '';
	var msg = '';
	var obj = null;
	var passfn = true; if(fname.value == "") passfn = false;
	var passln = true; if(lname.value == "") passln = false;
	var passem = true; if(email.value == "" || !checkEmail(email.value)) passem = false;
	var passph = true; if(phone.value == "") passph = false;
	if(fn == true && (fname.value == "" || lname.value == ""))
	{
		msg += "- your name is empty.\n";
		obj = fname;
	}
	if(em == true && (email.value == ""))
	{
		msg += "- your email is empty.\n";
		if (!obj)
		 obj = email;
	}
	if(em == true && (!checkEmail(email.value)))
	{
		msg += "- your email address format is not correct.\n";
		if (!obj)
		 obj = email;
	}
	if(ph == true && (phone.value == ""))
	{
		msg += "- your phone number is empty.\n";
		if (!obj)
		 obj = phone;
	}
	if (msg != '')
	{
	 s_linkTrackVars='s_prop11';
	 s_linkTrackEvents='None';
	 s_linkType='o';
	 s_linkName="Lead Gen Failure";
	 s_prop11='fn='+passfn+'|'+'ln='+passln+'|'+'em='+passem+'|'+'ph='+passph;
	 s_lnk=s_co(this);
	 s_gs(s_account);
	 alert('The following error(s) occurred:\n\n' + msg + '\nPlease correct and press the "send my request" button again.');
	 if (obj)
		obj.focus();
	 return false;
	}
	name.value = fname.value + " " + lname.value;
	return true;
}

/**
* Reference: Sandeep V. Tamhankar (stamhankar@hotmail.com),
* http://javascript.internet.com
*/
function checkEmail(emailStr) 
{
 if (emailStr.length == 0) 
 {
	 return true;
 }
 var emailPat=/^(.+)@(.+)$/;
 var specialChars="@,;:\\\\\\\"\\.\\[\\'>\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
 var validChars="\[^\\s" + specialChars + "\]";
 var quotedUser="(\"[^\"]*\")";
 var ipDomainPat=/^(\d{1,3})[.](\d{1,3})[.](\d{1,3})[.](\d{1,3})$/;
 var atom=validChars + '+';
 var word="(" + atom + "|" + quotedUser + ")";
 var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
 var domainPat=new RegExp("^" + atom + "(\\." + atom + ")*$");
 var matchArray=emailStr.match(emailPat);
 if (matchArray == null) 
 {
	 return false;
 }
 var user=matchArray[1];
 var domain=matchArray[2];
 if (user.match(userPat) == null) 
 {
	 return false;
 }
 var IPArray = domain.match(ipDomainPat);
 if (IPArray != null) 
 {
	 for (var i = 1; i <= 4; i++) 
	 {
		 if (IPArray[i] > 255) 
		 {
			return false;
		 }
	 }
	 return true;
 }
 var domainArray=domain.match(domainPat);
 if (domainArray == null) 
 {
	 return false;
 }
 var atomPat=new RegExp(atom,"g");
 var domArr=domain.match(atomPat);
 var len=domArr.length;
 if ((domArr[domArr.length-1].length < 2) || (domArr[domArr.length-1].length > 3)) 
 {
	 return false;
 }
 if (len < 2) 
 {
	 return false;
 }
 return true;
}





