    // Start required fields code
function checkOrder(form)
{
	if (form.Contact_LastName.value=="")
	{
		alert('You have left Your Name field blank. Please fill in all required fields.');
		form.Contact_LastName.focus();
		return false;
	}
	if (form.Account_AccountName.value=="")
	{
		alert('You have left the Company Name field blank. Please fill in all required fields.');
		form.Contact_LastName.focus();
		return false;
	}
	if (form.Contact_EMail.value=="")
	{
		alert('You have left the Email field blank. Please fill in all required fields.');
		form.Contact_Email.focus();
		return false;
	}
	if (form.Contact_WorkPhone.value=="")
	{
		alert('You have left the Phone field blank. Please fill in all required fields.');
		form.Contact_WorkPhone.focus();
		return false;
	}
	if (form.Contact_Inquiry.value=="")
	{
		alert('You have left the request field blank. Please fill in all required fields.');
		form.Contact_Inquiry.focus();
		return false;
	}
	return true;
}


    // End required fields code
	
	
// The scripts  below are proprietary and as such are copyrighted 2001-2003 by
// The High Bridge Design Group. The scripts contained herein may be modified
// for use with the SalesVantage.com web site but not copied for use with a different web site.
// Re-use of these scripts without the express permission of The High Bridge Design Group
// constitutes theft of intellectual property.
//
// 7/17/2004 - HEAVILY MODIFIED BY BILL DIMM to coordinate names of various components of each
// menu item.  Now the names related to the menu items appear only in the "menu_items" array,
// so that is all you need to change in this file if you add menu items.


var timerID = null;
var timerID2 = null;

 /* List of menu item names.  These names correspond to three things:
  * 1) the basename of the image for menu item minus the ".gif"
  * 2) after prefixing "img:", the "name" attribute for the <img> tag holding the menu item image
  * 3) the "id" attribute of the <div> holding the submenu
  * NOTE: this above mentioned array has been removed because flyout menu is not being used
  */



statsArray = new Array("\"SalesVantage.com has become an integral source of quality leads in our online channel. Not only has our traffic increased, but our brand image has been raised.\"<br><br>- Dan Kurani, President, Kurani Multimedia",
														"\"While searching for a fulfillment house to handle our online sales, I came across the <i>ASK SalesVantage</i> referral service and realized that I wouldn't have to reinvent the wheel. I contacted <i>ASK SalesVantage</i> and within minutes I received calls from 4 fulfillment houses - by the end of the day I had four proposals in my hand.\"<br><br>- Nancy Levin, Marketing Director, cherylrichardson.com",
														"\"The SalesVantage Newsfeed has been the one resource I count on for a quick, concise overview of pertinent articles and events that help me stay on top of business.\"<br><br>-Larry Brophy, President, FindMoreBuyers List Brokerage",
														"\"Our SalesVantage.com Directory Sponsorship gives our business the direct, targeted exposure it needs to generate top-quality, income-producing leads.\"<br><br>- Jordan Whiley, President, The High Bridge Design Group",
														"\"As a result of our Sponsorship on SalesVantage.com we can attribute an increase of 20% in our annual sales to your website. We consider SalesVantage to be integral part of marketing plan and would not hesitate to recommend your Directory to anyone who wishes to increase their sales.\"<br><br>- Drew Gallaher, President, SalesForce 911",

		"\"I found your SalesVantage.com website this morning and found it very helpful.  While researching area fulfillment/mailing centers listed on your site, I contacted several businesses.  The listing of names, phone numbers and addresses was very helpful; I wish more businesses had a link to their website.\"<br><br>- Karen Higgins, Teleconference Manager, Hospice Foundation of America");

//this function swaps out an image (rollover effect)
/*
function swapImage(imgName,imgToggle)
{
	if (document.images)
		document['img:' + imgName].src = menu_images[imgName][imgToggle].src;
}
*/ 
function swapImage(imgName,imgToggle)
{
	if (imgToggle=="on"){
		document.getElementById(imgName).bgColor = "#002D68";
	}else{
		document.getElementById(imgName).bgColor = "#336699";
	}
		
}

function swapImage_specialty(imgName,imgToggle)
{
	if (imgToggle=="on"){
		document.getElementById(imgName).bgColor = "#B0BABF";
	}else{
		document.getElementById(imgName).bgColor = "#E3EDF2";
	}
		
}

//this function rotates the testimonials on the web page

function switchStats(i)
{
	/*
	i++;
	if (i > 2) 
		i = 0;
	document.getElementById("statsbox").innerHTML = statsArray[i];
	document.getElementById("statsbox2").innerHTML = statsArray[i+3];
	funcVar = "switchStats(" + i + ")";
	timerID2 = setTimeout(funcVar,10000);
	*/
}

//this function opens a window with a specified width and height

function popUpDyno(URL,width,height) 
{
	popUpWin = open(URL, 'popUpWin', 'scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width='+width+',height='+height);
}

//this function shows the requested pop-up menu
// Bill: Test for existance of if the <div> (e.g. if (styleObj)) so we don't have
// to worry about hideAll calling this for a menu item that has no submenu.

function showMenu(boxName,x,y) {
	clearTimeout(timerID);
	if (document.layers) {
		styleObj = eval('document.' + boxName);
		if (styleObj)
			{
			styleObj.top = y+7;
			styleObj.left = x+10;
			}
	} else if (navigator.userAgent.indexOf("Opera") != -1) {
		styleObj = eval('document.all.' + boxName);
		if (styleObj)
			{
			styleObj.style.pixelTop = y+25;
			styleObj.style.pixelLeft = x;
			}
	} else if (document.all && !document.getElementById) {
		styleObj = eval('document.all.' + boxName);
		if (styleObj)
			{
			styleObj.style.pixelTop = y;
			styleObj.style.pixelLeft = x;
			}
	} else if (document.getElementById) {
		obj = document.getElementById(boxName);
		if (obj)
			{
			obj.style.top = y + "px";
			obj.style.left = x + "px";
			}
	}
}

// this function hides a specific pop-up menu

function hideMenu(menuName) {
	funcVar = "showMenu('" + menuName + "',-400,-300)";
	timerID = setTimeout(funcVar,800);
}

// this function hides all the pop-up menus

function hideAll() {
	for (var i = 0; i < menu_items.length; ++i)
		showMenu(menu_items[i], -400 ,300);
}


//
// "Internal" function to return the decoded value of a cookie
//

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}


//
//  Function to return the value of the cookie specified by "name".
//

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
	i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}


//
//  Function to create or update a cookie.
//    name - String object containing the cookie name.
//    value - String object containing the cookie value.  May contain
//      any valid string characters.
//    [expires] - Date object containing the expiration data of the cookie.  If
//      omitted or null, expires the cookie at the end of the current session.
//    [path] - String object indicating the path for which the cookie is valid.
//      If omitted or null, uses the path of the calling document.
//    [domain] - String object indicating the domain for which the cookie is
//      valid. If omitted or null, uses the domain of the calling document.
//    [secure] - Boolean (true/false) value indicating whether cookie transmission
//      requires a secure channel (HTTPS).  
//
//  The first two parameters are required.  The others, if supplied, must
//  be passed in the order listed above.  To omit an unused optional field,
//  use null as a place holder.  For example, to call SetCookie using name,
//  value and path, you would code:
//
//      SetCookie ("myCookieName", "myCookieValue", null, "/");
//
//  Note that trailing omitted parameters do not require a placeholder.
//
//  To set a secure cookie for path "/myPath", that expires after the
//  current session, you might code:
//
//      SetCookie (myCookieVar, cookieValueVar, null, "/myPath", null, true);
//

function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}


function popUp(URL) 
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,left=5,top=5,width=500,height=670');");
}


function popUpNews(URL,windowName,width,height)
{
	popUpWin = open(URL, 'popUpWin', 'scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width='+width+',height='+height);
	popUpWin.blur();
}

// POPUP WINDOW FUNCTION FOR EMAIL TO FRIEND
function popup(file,width,height,sbars) {

// POPUP ATTRIBUTES
	var name = 'popwin';
	sbars = sbars + "" == "undefined" ? "yes" : sbars;
	width = width + "" == "undefined" ? "" : "width="+width+",";
	height = height + "" == "undefined" ? "" : "height="+height+",";
	var attributes = 'scrollbars='+sbars+',resizable=yes,target=popwin,' + width + height + '';
	p = window.open(file, name, attributes);
}


function randomPopup()
{
	/*RandomInt = Math.round(Math.random()*1); 		//generate random integer either 0 or 1
	if(RandomInt > 0)		//show newsletter subscription
	{
		if(!GetCookie("newsletter"))		//make sure user has not closed window before
			popUpNews('newsletter_popup.html','newsletter',400,540);
		else		//if user has opted out for newsletter, then show submit window
		{
			if(!GetCookie("submit"))		//make sure user has not closed window before
				popUpNews('submit_popup.html','submit',550,420);
		}
	}
	else		//show site submit option
	{
		if(!GetCookie("submit"))		//make sure user has not closed window before
			popUpNews('submit_popup.html','submit',550,420);
		else		//if user has opted out for submit, then show newsletter window
		{
			if(!GetCookie("newsletter"))		//make sure user has not closed window before
			popUpNews('newsletter_popup.html','newsletter',400,540);
		}
	}*/	
	if(!GetCookie("submit"))		//make sure user has not closed window before
			popUpNews('submit_popup.html','submit',550,420);

}

function CreateBookmarkLink()
{
	title = "SalesVantage.com - Web Search Directory For Sales &amp; Marketing"; 
	url = "http://www.salesvantage.com";
	if (window.sidebar)
	{ // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	}
	else if( window.external)
	{ // IE Favorite
		window.external.AddFavorite( url, title); 
	}
	else if(window.opera && window.print)
	{ // Opera Hotlist
		return true;
	}
	else
		alert("Your browser doesn't support this.\n Please use top menu to bookmark it.");
}

function getQuotes(){
	window.location.href="http://www.salesvantage.com/quotes/getquotes.php";
}

