//************************************************************
// index of contents:
//************************************************************
// 1.	global variables and functions
// 1a.	browser tests
// 1b.	disable right click
// 1c.	print page
// 1d.	set status message
// 1e.	random number
// 1f.	get mouse position
//
// 2.	image and rollover functions
// 2a.	macromedia rollover functions
// 2b.	alt image rollover function
// 2c.	random image
//
// 3.	date and time
// 3a.	date string manipulations
// 3b.	time manipulations
// 3c.	is it a leap year
//
// 4.	window operations
// 4a.	open window function
// 4b.	a new open window function
// 4c.	parent window location
//
// 5.	get this page name
//
// 6.	query string data
// 6a.	get key-value pairs
//
// 7.	navigation functions
//
// 8.	trim
//
// 9.	cross browser XMLHttpRequest
//
// 10.  changing a named html element
// 10a. empty an element
// 10b. add to an element
// 10c. replace an element
// 10d. change the class of an element
//
// 11.	manipulations with visibility and display of elements
// 11a.	convert object name into a valid object reference
// 11b.	change the visibility-somewhat deprecated
// 11c.	change the display of an object
//
// 12.	locates elements of a certain class
//
// 13.	check variables
// 13a. isEmpty
// 13a. isZero
//
// 14.	cookies
//
// 15.	site/page specific items
// 16. Handler for Omniture custom link tracking
//************************************************************
//
//
//************************************************************
// 1.	global variables and functions
// 1a.	browser tests
//************************************************************

var isNav, isIE, isNavSix;
var coll = "";
var styleObj = "";
if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Netscape") {
		isNav = true;
		if (parseInt(navigator.appVersion) >= 5) {
		isNavSix = true;
		}
	} else {
		isIE = true;
		coll = "all.";
		styleObj = ".style";
	}
}

var ie4 = document.all;
var ns4 = document.layers;
var ns6 = document.getElementById && !document.all;

//************************************************************

function browserInfo() {
	this.codename = navigator.appCodeName;
	this.minorversion = navigator.appMinorVersion;
	this.name = navigator.appName;
	this.version = navigator.appVersion.substring(0,4);
	this.version2 = navigator.appVersion;
	this.cookieEnabled = navigator.cookieEnabled
	this.cpuClass = navigator.cpuClass
	this.mimeTypes = navigator.mimeTypes
	this.opsProfile = navigator.opsProfile
	this.plugins = navigator.plugins
	this.systemLanguage = navigator.systemLanguage
	this.userAgent = navigator.userAgent
	this.userLanguage = navigator.userLanguage
	this.userProfile = navigator.userProfile
	this.platform = navigator.platform;
	this.javaEnabled = navigator.javaEnabled();
	this.screenWidth = screen.width;
	this.screenHeight = screen.height;
}

var thisBrowser = new browserInfo();

// Example:
// alert(thisBrowser.userAgent); 

//************************************************************
// 1b.	disable right click
//************************************************************

function disableRightClick(e) {
  var message = "Right click disabled";
  
  // initialize
  if(!document.rightClickDisabled) {
    if(document.layers) {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if (document.layers || (document.getElementById && !document.all)) {
    if (e.which==2||e.which==3) {
      alert(message);
      return false;
    }
  } else {
    alert(message);
    return false;
  }
}

//call using:
//disableRightClick();

//************************************************************
// 1c.	print page
//************************************************************

function printPage() { print(document); }

function printPage2() {
	if (document.body.firstChild.id == 'print_URL_header') {
		document.body.removeChild(document.body.firstChild);
	} else {
		entete = document.createElement('pre');
		entete.setAttribute('id','print_URL_header');
		entete.appendChild(document.createTextNode(document.URL));
		document.body.insertBefore(entete, document.body.firstChild, null);
		window.print();
	}
}

//************************************************************
// 1d.	set status message
//************************************************************

function setStatusBar(msgStr) { self.status = msgStr; }

//************************************************************
// 1e.	random number
//************************************************************

function randomNumber(limit) {
  return Math.floor(Math.random()*limit);
}

//************************************************************
// 1f.	get mouse position

/* 
Example:
function test()
{
  if (document.layers) getMouseLoc;     //NS
  else if (document.all) getMouseLoc(); //IE
  alert(mouseLocation.x+","+mouseLocation.y);
}
in the BODY:
<a href="#" onmouseover="test()">test</a>
*/

//************************************************************

function Point(x,y) {  this.x = x; this.y = y; }

mouseLocation = new Point(-500,-500);

function getMouseLoc(e)
{
  if(!document.all)  //NS
  {
    mouseLocation.x = e.pageX;
    mouseLocation.y = e.pageY;
  }
  else               //IE
  {
    mouseLocation.x = event.x + document.body.scrollLeft;
    mouseLocation.y = event.y + document.body.scrollTop;
  }
  return true;
}
//NS init:
if(document.layers){ document.captureEvents(Event.MOUSEMOVE); document.onMouseMove = getMouseLoc; }

//************************************************************
// 2.	image and rollover functions
// 2a.	macromedia rollover functions
//************************************************************

// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function clearDefault(obj) {
  obj.value = "";
}

//onMouseOut="MM_swapImgRestore();"
//onMouseOver="MM_swapImage('efficacyRcc','','images/efficacyRccOver.gif',1);"

//************************************************************
// 2b.	alt image rollover function
//************************************************************

function chgImg(imgName, imgSrc) {
	document.images[imgName].src = imgSrc;
}

function simplePreload() { 
  var args = simplePreload.arguments;
  document.imageArray = new Array(args.length);
  
  for(var i=0; i<args.length; i++) {
    document.imageArray[i] = new Image;
    document.imageArray[i].src = args[i];
  }
}

//************************************************************
// 2c.	random image
//
// requires 1e. random number and an image array
// var myArray = new Array ("path","width","height");
//************************************************************

function randomImage(imgArr) {
  var imgSrc, imgW, imgH, r;
  r = randomNumber(imgArr.length / 3)-1;
  
  rndSrc = imgArr[r * 3];
  rndW   = imgArr[(r * 3)+1];
  rndH   = imgArr[(r * 3)+2];

  //document.write("<img src='" + rndSrc + "' width='" + rndW + "' height='" + rndH + "' border='0'>");
}

//************************************************************
// 3.	date and time
// 3a.	date string manipulations
//************************************************************

var monthNames = new Array ("January","February","March","April","May","June","July","August","September","October","November","December");
var now = new Date();
var amPm = (now.getHours() < 12) ? " AM" : " PM";
var hour = (now.getHours() > 12) ? (now.getHours() - 12) : (hour == 0) ? "12" : now.getHours();
var min = (now.getMinutes() < 10) ? ("0" + now.getMinutes()) : (now.getMinutes());
var theYear = (now.getYear() < 1900) ? (now.getYear() + 1900) : now.getYear();

var theDateString = monthNames[now.getMonth()] + " " + now.getDate() + ", " + theYear + " " + hour + ":" + min + amPm;

if (isIE) {
	if (navigator.platform.match("Mac")) {
		theDateString = monthNames[now.getMonth()] + " " + now.getDate() + ", " + theYear;
	}		
}

//************************************************************
// 3b.	time manipulations
//************************************************************

var timeStamp = new Date();

var timeStampMonth = timeStamp.getMonth() + 1;
var timeStampDate = timeStamp.getDate();

//document.write(timeStampMonth + "/" + timeStampDate + "  ");

var timeStampHours = timeStamp.getHours();
var timeStampMins = timeStamp.getMinutes();

if (timeStampHours >= 12) {
	var timeStampTime = " P.M.";
} else {
	var timeStampTime = " A.M.";
}

if (timeStampHours > 12) {
	timeStampHours -= 12;
}

if (timeStampHours == 0) {
	timeStampHours = 12;
}

if (timeStampMins < 10) {
	timeStampMins = "0" + timeStampMins;
}

//document.write(timeStampHours + ":" + timeStampMins + timeStampTime);

//************************************************************
// 3c.	is it a leap year
//************************************************************

function IsLeapYear(intYear) {
  if (intYear % 100 == 0) {
    if (intYear % 400 == 0) {
      return true;
    }
  } else {
    if ((intYear % 4) == 0) {
      return true;
    }
  }

  return false;
}

//************************************************************
// 4.	window operations
// 4a.	open window function
//************************************************************

function openNewWindow(page,name,width,height,top,left,propSet) {

	var windowProps = new Array (8);
	windowProps[0] = "resizable=yes";
	windowProps[1] = "scrollbars=yes";
	windowProps[2] = "titlebar=yes";
	windowProps[3] = "toolbar=yes";
	windowProps[4] = "menubar=yes";
	windowProps[5] = "location=yes";
	windowProps[6] = "status=yes";
	windowProps[7] = "directories=yes";
	
	var myProps = "";
	var mySize = "";
	
	if (propSet == 'one') {
		 myProps = ',' + windowProps[0] + ',' + windowProps[1];
	} else if (propSet == "full") {
		myProps = ',' + windowProps.join(",");
	} else {
		myProps = "";
	}	
	
	if ((width > 50)||(height > 50)) {
		var mySize = 'width=' + width + ',' + 'height=' + height + ',' + 'top=' + top + ',' + 'left=' + left;
	}
	
	var myString = mySize + myProps;
	window.open(page,name,myString);
	
}

//************************************************************
/*
function popGlossary(theUrl) {
	openNewWindow(theUrl,"gloss",484,289,0,0,"none");
}*/

//************************************************************
// 4b.	a new open window function
//************************************************************

function externalLinks() {
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a"); 
	for (var i=0; i<anchors.length; i++) { 
		var anchor = anchors[i]; 
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") anchor.target = "_blank";
	} 
}

//window.onload = externalLinks;

//************************************************************
// 4c.	parent window location
//************************************************************

function sendParent(theUrl) {
	window.opener.location.href=theUrl;
}

//************************************************************
// 5.	get this page name
//************************************************************

var parts = new Array;
var thisSite = new Array;
var test;

//check the current page
test = location.href.substring(location.href.lastIndexOf("/"));
parts = test.split('?');
thisSite.thisPage = parts[0].replace("/","");

var myPageName = thisSite.thisPage;

//************************************************************
// 6.	query string data
// 6a.	get key-value pairs
//************************************************************

// qs is query string to parse
function Querystring(qs) { // optionally pass a querystring to parse
	this.params = new Object()
	this.get=Querystring_get;
	
	if (qs == null)
		qs=location.search.substring(1,location.search.length)

	if (qs.length == 0) return

// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ')
	var args = qs.split('&') // parse out name/value pairs separated via &
	
// split out each name=value pair
	for (var i=0;i<args.length;i++) {
		var value;
		var pair = args[i].split('=')
		var name = unescape(pair[0])

		if (pair.length == 2)
			value = unescape(pair[1])
		else
			value = name
		
		this.params[name] = value
	}
}

function Querystring_get(key, default_) {
	// This silly looking line changes UNDEFINED to NULL
	if (default_ == null) default_ = null;
	
	var value=this.params[key]
	if (value==null) value=default_;
	
	return value
}

var qs = new Querystring();

//************************************************************
// 6b.	test for common query strings in url
//************************************************************
// flash
var qsFlash = qs.get("flash");
var isFlash = true;

if (qsFlash == "false" || qsFlash == "FALSE" || qsFlash == "False") {
	isFlash = false;
} else {
	isFlash = true;
}

// printable version
// keys: print, PrinterFriendly, printable
var qsPrintable1 = qs.get("print");
var qsPrintable2 = qs.get("PrinterFriendly");
var qsPrintable3 = qs.get("printable");

var isPrinter = false;

if (qsPrintable1 == "true" || qsPrintable1 == "TRUE" || qsPrintable1 == "True") {
	isPrinter = true;
} else if (qsPrintable2 == "true" || qsPrintable2 == "TRUE" || qsPrintable2 == "True") {
	isPrinter = true;
} else if (qsPrintable3 == "true" || qsPrintable3 == "TRUE" || qsPrintable3 == "True") {
	isPrinter = true;
}

//************************************************************
// 7. navigation functions
//************************************************************

function goForward(theUrl) {
	window.location = theUrl;
}

function goBack() {
	window.history.back(-1);
}

function returnToPage() {
	if (document.referrer != "") {
        window.location.href = document.referrer;
	} else {
	    window.location.href = "index.aspx";
	}
}

//***************************************************************
// 8. trim
//************************************************************

function trim(strToTrim) { 
	// leading spaces 
	while (strToTrim.substring(0,1) == ' ') {
		strToTrim = strToTrim.substring(1, strToTrim.length);
	}
	
	// trailing spaces 
	while (strToTrim.substring(strToTrim.length-1,strToTrim.length) == ' ') {
		strToTrim = strToTrim.substring(0, strToTrim.length-1);
	}
	return strToTrim;
}

//************************************************************
// 9. cross browser XMLHttpRequest
//************************************************************

function getHTTPObject() {
	var objType = false;
	if (window.XMLHttpRequest) {
		objType = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		try {
      		objType = new ActiveXObject("Msxml2.XMLHTTP");
    	} catch(e) {
      		try {
        		objType = new ActiveXObject("Microsoft.XMLHTTP");
      		} catch(e) {
       		 objType = false;
      		}
    	}
  	}
  	return objType;
}

// read an xml file from the server
function grabFile(file) {
	var request = getHTTPObject();
	if (request) {
		request.onreadystatechange = function() {
		parseResponse(request);
	};
	request.open("GET", file, true);
    request.send(null);
  }
}

// parse the response
function parseResponse(request) {
	if (request.readyState == 4) {
		if (request.status == 200 || request.status == 304) {
			var data = request.responseXML;
			//var data = request.responseText
			return data;
		}
	}
}

function parseData(which) {
	myData = data.getElementsByTagName(which)[0].firstChild.nodeValue;
	return myData;
}


//************************************************************
// 10.  changing a named html element
// 10a. empty an element
//************************************************************
function clearOut(anElement) {
	var myElement = document.getElementById(anElement);
	myElement.innerHTML = "";
}

//************************************************************
// 10b. add to an element
//************************************************************
function addTo(anElement, addThis) {
	var myElement = document.getElementById(anElement);
	var startHere = myElement.innerHTML
	myElement.innerHTML = startHere + addThis;
}

//************************************************************
// 10c. replace an element
//************************************************************
function changeTo(anElement, newStuff) {
	var myElement = document.getElementById(anElement);
	myElement.innerHTML = newStuff;
}

//************************************************************
// 10d. change the class of an element
//************************************************************
function changeClass(anElement, theClass) {
	document.getElementById(anElement).className = theClass;
}

//************************************************************
// 11.	manipulations with visibility and display of elements
// 11a.	convert object name into a valid object reference
//************************************************************

function getObject(obj) {
	theObj = document.getElementById(obj).style;
	return theObj;
}

function getObject2(obj) {
	var theObj;
	if (typeof obj == "string") {
		theObj = eval("document." + coll + obj + styleObj);
	} else {
		theObj = obj;
	}
	if (isNavSix) {
	theObj = document.getElementById(obj).style
	}
	return theObj;
}


//************************************************************
// 11b.	change the visibility-somewhat deprecated
//************************************************************

// Setting the visibility of an object to visible
// deprecate the visibility functions
function show(obj) {
	var theObj = getObject(obj);
	theObj.visibility = "visible";
}

// Setting the visibility of an object to hidden
// deprecate the visibility functions
function hide(obj) {
	var theObj = getObject(obj);
	theObj.visibility = "hidden";
}

//************************************************************
// 11c.	change the display of an object
//************************************************************

// Setting the display of an object to none
function unDisplay(obj) {
	var theObj = getObject(obj);
	theObj.display = "none";
}

// Setting the display of an object to block
function displayBlock(obj) {
	var theObj = getObject(obj);
	theObj.display = "block";
}

// Setting the display of an object to inline
function displayInline(obj) {
	var theObj = getObject(obj);
	theObj.display = "inline";
}

// toggle display of an object
function toggleDisplayBlock(obj) {
	var theObj = getObject(obj);
	if (theObj.display == "none") {
		theObj.display = "block";
	} else {
		theObj.display = "none";
	}
}

// toggle display of an object
function toggleDisplayInline(obj) {
	var theObj = getObject(obj);
	if (theObj.display == "none") {
		theObj.display = "inline";
	} else {
		theObj.display = "none";
	}
}

//************************************************************
// 12. locates elements of a certain class
// strClass:
// string containing the class(es) that you are looking for
// strTag (optional, defaults to '*'):
// An optional tag name to narrow the search to specific tags e.g. 'a' for links.
// objContElm (optional, defaults to document):
// An optional object container to search inside. Again this narrows the scope of the search
//************************************************************

function getElementsByClassName(strClass, strTag, objContElm) {
	strTag = strTag || "*";
	objContElm = objContElm || document;
	var objColl = objContElm.getElementsByTagName(strTag);
	if (!objColl.length && strTag == "*" && objContElm.all) objColl = objContElm.all;
	var arr = new Array();
	var delim = strClass.indexOf('|') != -1 ? '|' : ' ';
	var arrClass = strClass.split(delim);
	for (var i = 0, j = objColl.length; i < j; i++) {
		var arrObjClass = objColl[i].className.split(' ');
		if (delim == ' ' && arrClass.length > arrObjClass.length) continue;
		var c = 0;
		comparisonLoop:
		for (var k = 0, l = arrObjClass.length; k < l; k++) {
			for (var m = 0, n = arrClass.length; m < n; m++) {
				if (arrClass[m] == arrObjClass[k]) c++;
				if (( delim == '|' && c == 1) || (delim == ' ' && c == arrClass.length)) {
					arr.push(objColl[i]);
					break comparisonLoop;
				}
			}
		}
	}
	return arr;
}

//************************************************************

// to cover Mac IE 5.0's lack of the push method
// but this may interfere with some ajax scripts
//Array.prototype.push = function(value) {
//	this[this.length] = value;
//}

/*
//usage examples:
//all elements of class "one"
var myObjColl = getElementsByClassName('one');
for (var i = 0, j = myObjColl.length; i < j; i++) {
   // Do your thing here.
}

//all links ('a') of class "one" in container id "container"
var cont = document.getElementById('container');

var myObjColl = getElementsByClassName('one', 'a', cont);
for (var i = 0, j = myObjColl.length; i < j; i++) {
   // Do your thing here.
}

//all spans of classes "one" OR "two" in container id "container"
var cont = document.getElementById('container');

var myObjColl = getElementsByClassName('one|two', 'span', cont);
for (var i = 0, j = myObjColl.length; i < j; i++) {
   // Do your thing here.
}

//all spans of classes "one" AND "two" in container id "container"
var cont = document.getElementById('container');

var myObjColl = getElementsByClassName('one two', 'span', cont);
for (var i = 0, j = myObjColl.length; i < j; i++) {
   // Do your thing here.
}


// now loop through the results and do something
var c = getElementsByClassName('blah');

for(var i=0;j=c.length; i<j; i++){
  c[i].style.display = 'none';
}
*/

//************************************************************
// 13. check variables
// 13a. isEmpty
// Determine whether a variable is considered to be empty based on its type
// types = number, string, boolean, object, function, undefined
//	Returns FALSE if var has a non-empty and zero value:
//	"" (an empty string)
//	null (an empty string)
//	0 (an empty number)
//	false (an empty boolean)
//	0 (an empty value length of an object)
//	null (an empty value of an object)
//	undefined (an empty object type)
//************************************************************

function isEmpty(variable) {
	if(typeof variable == "number") {
		if (variable == 0){
			return true;
		}
	} else if (typeof variable == "string") {
		if(variable == null || variable == "" || variable.length <= 0){
			return true;
		}
	} else if (typeof variable == "boolean") {
		if (variable == false){
			return true;
		}
	} else if (typeof variable == "object") {
		if (variable.value.length == 0 || variable.value == null){
			return true;
		} else if(variable.type == "select-one") {
			if(variable.value.toLowerCase().indexOf('--') > 0) {
				return true;
			}
			if(variable.value.toLowerCase().indexOf("please select") > 0) {
				return true;
			}
			if(variable.value.toLowerCase().indexOf("select one") > 0) {
				return true;
			}
		}	
	} else if (typeof variable == "function") {
		return false;
	} else if (typeof variable == "undefined") {
		return true;
	} else if (typeof variable == "null") {
		return true;
	}
	return false;
}

//************************************************************
// 13a. isZero
//************************************************************

function isZero(variable) {
	if (typeof variable == "number") {
		if (variable == 0) {
			return true;
		} else {
			return false;
		}
	} else {
		return false;
	}
}


//************************************************************
// 14. cookies
// Derived from the Bill Dortch code at http://www.hidaho.com/cookies/cookie.txt
//************************************************************

function expDays(howMany) {
	var today = new Date();
	var expiry = new Date(today.getTime() + howMany * 24 * 60 * 60 * 1000);
	return expiry;
}

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) { endstr = document.cookie.length; }
	return unescape(document.cookie.substring(offset, endstr));
}

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 deleteCookie(name,path,domain) {
	if (GetCookie(name)) {
		document.cookie = name + "=" +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

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" : "");
}

//************************************************************
// 15.	site/page specific items
//************************************************************

/*
get query string data for pain assessment tools
*/

var qsDPN = qs.get("dpn");
var qsSB = qs.get("sb");

/*
the PE number function
*/

/*
this is set to true on the site home page
to eliminate issues where no file name
appears in address bar such as:
http://www.lyrica.com/
*/
var isIndex = false;

function writePE()
{
    document.write("PBP01545/285966-01");
}

//************************************************************
// 16. Handler for Omniture custom link tracking
//************************************************************
 
function scLink(obj, pageTitle, reportName){
      if (pageTitle!=null && pageTitle.length>0) {
            s.tl(this,'o', pageTitle + ' : ' + reportName); 
      } else {
            s.tl(this,'o', reportName);   
      }
}
