<!--
var oDoc = document;
var bNS4 = Boolean(oDoc.layers); 
var bErrors = 0;

function clearText(aObj,aText) {
	if (aObj.value==aText) {aObj.value='';}	
}

function putText(aObj,aText) {
	if (aObj.value=='') {aObj.value=aText;}	
}

function MM_findValue(f,n) {
	var frm=document.forms[f],e=frm.elements[n],t=e.type,v='';
	if (t==undefined){
		t = e[0].type;
		if (t=='checkbox') {
			for (i=0;i<e.length;i++){
			if (e[i].checked==true){
				if (v!='') v += ', '
				v += e[i].value;
			}}		
		} else if(t=='radio') {
			for (i=0;i<e.length;i++){
			if (e[i].checked==true){
				v = e[i].value;
				break; //exist for loop, as target acquired.
			}}
		}
	} else if (t=='select-one') {
		if (e.selectedIndex!=-1) v = e.options[e.selectedIndex].value;
	} else if (t=='checkbox') {
		if (e.checked == true) v = e.value;	
	} else if(t=='radio') {
		if (e.checked == true) v = e.value;	
	} else if ((t=='text') || (t=='textarea') || (t=='button') || (t=='password') || (t=='file') || (t=='hidden')) {
		v = e.value;
	}
	return v;	
}

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_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 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 calcItems(){
	var args=calcItems.arguments;
	var frmName=args[0]; 
	var frm=document.forms[frmName], totalName=args[1], val=0;
	
	
	frm.elements[totalName].value=0;
	for (var i=2; i<args.length; i++) { 
		val=MM_findValue(frmName,args[i]);
		frm.elements[totalName].value = parseInt(frm.elements[totalName].value) + parseInt(val);
		
	}
}

function clearFields() {
	var args = clearFields.arguments;
	var frm=document.forms[args[0]];
	for(var i=1; i<args.length; i++) { 
	if (isObject(frm.elements[args[i]])) {
			frm.elements[args[i]].value = '';
		}
	}
}
function isAlien(a) {
   return isObject(a) && typeof a.constructor != 'function';
}
function isArray(v) {
    return v && typeof v === 'object' && typeof v.length === 'number' &&
		!(v.propertyIsEnumerable('length'));
}
function isBoolean(a) {
    return typeof a == 'boolean';
}
function isEmpty(o) {
    var i, v;
    if (isObject(o)) {
        for (i in o) {
            v = o[i];
            if (isUndefined(v) && isFunction(v)) {
                return false;
            }
        }
    }
    return true;
}
function isFunction(a) {
    return typeof a == 'function';
}
function isNull(a) {
    return a === null;
}
function isNumber(a) {
    return typeof a == 'number' && isFinite(a);
}
function isObject(a) {
    return (a && typeof a == 'object') || isFunction(a);
}
function isString(a) {
    return typeof a == 'string';
}
function isUndefined(a) {
    return typeof a == 'undefined';
} 

function whichValidate(aFrm) {
	var errors = '', frm = document.forms[aFrm], frmDirect = frm.direction.value;
	if (frmDirect=='register') {
		errors = MM_validateForm(aFrm,'firstname','First name','R','lastname','Last name','R','profession','Profession','R','specialty','Specialty','R','institution','Institution','R','addr1','Address 1','R','city','City','R','state','State','R','postalcode','ZIP code','R','webusername','E-mail','RisEmail','webpassword','Password','RisPassword','confirmpassword','Password','RisSame','optin','Yes, I agree to receive messages about stroke from Genentech.','R');
	} else if (frmDirect=='profile') {
		errors = MM_validateForm(aFrm,'firstname','First name','R','lastname','Last name','R','profession','Profession','R','specialty','Specialty','R','institution','Institution','R','addr1','Address 1','R','addr2','Address 2','C','city','City','R','state','State','R','phone','Phone','C','postalcode','ZIP code','R','webusername','E-mail','RisEmail','oldpassword','Old Password','isProfilePWD','webpassword','New Password','isProfilePWD','confirmpassword','Confirm Password','isProfilePWD');		
	} else if (frmDirect=='password') {
		errors = MM_validateForm(aFrm,'webusername','E-mail (Username)','RisEmail');
	} else if (frmDirect=='resetpassword') {
		errors = MM_validateForm(aFrm,'webusername','E-mail (Username)','RisEmail','oldpassword','Temporary Password','R','webpassword','New Password','RisProfilePWD','confirmpassword','Confirm Password','RisProfilePWD');
	} else if (frmDirect=='emailcolleague') {
		errors = MM_validateForm(aFrm,'name','Your Name','R','email','Your E-mail Address','RisEmail','cemail0','Colleague\'s E-mail','RisEmail','cemail1','Colleague\'s E-mail','isEmail','cemail2','Colleague\'s E-mail','isEmail','cemail3','Colleague\'s E-mail','isEmail','cemail4','Colleague\'s E-mail','isEmail','cemail5','Colleague\'s E-mail','isEmail','cemail6','Colleague\'s E-mail','isEmail','cemail7','Colleague\'s E-mail','isEmail','cemail8','Colleague\'s E-mail','isEmail','cemail9','Colleague\'s E-mail','isEmail','cemail10','Colleague\'s E-mail','isEmail','cemail11','Colleague\'s E-mail','isEmail','cemail12','Colleague\'s E-mail','isEmail','cemail13','Colleague\'s E-mail','isEmail','cemail14','Colleague\'s E-mail','isEmail','cemail15','Colleague\'s E-mail','isEmail','cemail16','Colleague\'s E-mail','isEmail','cemail17','Colleague\'s E-mail','isEmail','cemail18','Colleague\'s E-mail','isEmail','cemail19','Colleague\'s E-mail','isEmail','cemail20','Colleague\'s E-mail','isEmail','cemail21','Colleague\'s E-mail','isEmail','cemail22','Colleague\'s E-mail','isEmail','cemail23','Colleague\'s E-mail','isEmail','cemail24','Colleague\'s E-mail','isEmail','cemail25','Colleague\'s E-mail','isEmail','cemail26','Colleague\'s E-mail','isEmail');
	} else if (frmDirect=='frmsearch') {
		errors = MM_validateForm(aFrm,'q','','R');
	} else if (frmDirect=='bestpractices') {
		errors = MM_validateForm(aFrm,'COE_FNAME','First','Qfirst','COE_MNAME','Middle','C','COE_LNAME','Last','Qlast','COE_TITLE','Title','C','COE_HOSPITAL','Hospital or organization','R','COE_CITY','City','Qcity','COE_STATE','State','R','COE_EMAIL','E-mail address','RisEmail','COE_EMAIL2','Confirm e-mail address','RisSameEmail','COE_PHONE','Phone','C','COE_BEST','Best stroke awareness practices employed at your center','R');
	} else if (frmDirect=='orderregister') {
		calcItems(aFrm,'itemsSelected','strokeAwarenessToolkit','fastwallposter','fastwalletEnglish','fastwalletSpanish');
		errors = MM_validateForm(aFrm,'itemsSelected','- Please select at least one of the materials.\n','OM','firstname','First name','R','lastname','Last name','R','profession','Profession','R','specialty','Specialty','R','institution','Institution','R','addr1','Address 1','R','addr2','Address 2','C','city','City','R','state','State','R','postalcode','ZIP code','R','phone','Phone','C','webusername','E-mail','RisEmail','webpassword','Password','RisPassword','confirmpassword','Password','RisSame','optin','Yes, I agree to receive messages about Genentech Stroke Team.','R');
	} else if (frmDirect=='order') {
		calcItems(aFrm,'itemsSelected','strokeAwarenessToolkit','fastwallposter','fastwalletEnglish','fastwalletSpanish');
		errors = MM_validateForm(aFrm,'itemsSelected','- Please select at least one of the materials.\n','OM','firstname','First name','R','lastname','Last name','R','institution','Institution','R','addr1','Address 1','R','city','City','R','state','State','R','postalcode','ZIP code','R','webusername','E-mail','RisEmail');
	}
	document.MM_returnValue = (errors == '');
}


function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,label,args=MM_validateForm.arguments;
  var errors='',errorsEmail='',errorpwd='',errorpwd2='',errors2='',errSymbol='',errorpwdmatch='',erroremailmatch='';
  var frm=args[0], blnLoginEmpty=true;
  var frmObj=document.forms[args[0]];
  var frmDirect = frmObj.direction.value;
  var arrSymbol = new Array("<", ">", "(", ")", "%", "+", "\"", "'", ";", "&" );
  bErrors = 0;

	// regular expressions
	var lc = /[a-z]{1}/; // lowercase letters
	var uc = /[A-Z]{1}/; // uppercase letters
	var nmb = /[0-9]{1}/; // numbers
	var un = /[^A-Za-z0-9]{1}/; // upper- and lower-case letters and numbers
		
  for (i=1; i<(args.length-2); i+=3) { test=args[i+2]; 
  	
  	val=MM_findValue(frm,args[i]); label=args[i+1];
	nm=args[i];
	
	
	if (test.indexOf('isProfilePWD')!=-1 && val.length>0) {
		if (frmObj.elements['oldpassword'].value=='' || frmObj.elements['webpassword'].value=='' || frmObj.elements['confirmpassword'].value=='') {
			errorpwd2 = '- All password fields must be filled out.\n';
			bErrors++;
		}
	}
	
	if (test.indexOf('C')!=-1) {
		//To check symbols for cross site scripting.
	}else if (test.indexOf('isSameEmail')!=-1) {
		if (val!=MM_findValue(frm,args[i-3])) {
			erroremailmatch = '- E-mail address must match.\n';
			bErrors++;
		}
	}else if (test.indexOf('isSame')!=-1) {
		if (val!=MM_findValue(frm,args[i-3])) {
			errorpwdmatch = '- Passwords must match.\n';
			bErrors++;
		}
	}else if ((test.indexOf('isPassword')!=-1) || (test.indexOf('isProfilePWD')!=-1 && val.length>0)){
		
		var score = 0;
		if (val.length < 6 || val.length > 8) {
			errorpwd += '- Password must contain from 6 to 8 characters.';
			bErrors++;
		}	
		
		if (val.match(nmb)) score++;
		if (val.match(lc)) score++;
		if (val.match(uc)) score++;
		
		if (score < 2){
			var arrSpecial = new Array('~','!','@','#','$','^','&','*','_','{','}','|',':','"','?','`','-','=','[',']');
			var blnSpecial = false;
			for(var x=0; x < arrSpecial.length; x++ ) {
				if (val.indexOf(arrSpecial[x])!=-1)  blnSpecial = true;  
			}
			if (blnSpecial) score++;
		}
		if (score < 2) {
			errorpwd += '- Password must include at least two of the following four types of characters:\n\t- Lower case letters\n\t- Upper case letters\n\t- Numbers\n\t- Printable keyboard characters, such as punctuation marks';
			bErrors++;
		}	

	} else if (test.indexOf('isNotEnter')!=-1) {
		if (val=='Enter your Search here') { errors2 += label; bErrors++; } else if (val=='') { errors += '- '+nm+' is required.\n'; bErrors++;}
	} else if (test.indexOf('OM')!=-1) {
		if (val=='0') { errors2 += label; bErrors++; }
	} else if (test.indexOf('CKD')!=-1) {
		if (val=='') { errors2 += '- Please check "' + label + '"\n'; bErrors++; }
	} else if ((test.indexOf('isOther')!=-1) && (test.indexOf('R')==-1)) {
	  	if ((val=='Other') && (MM_findValue(frm,args[i]+'Other')=='')) { errors2 += '- Please fill in the "Other" textbox.\n'; bErrors++; }
	} else if (test.charAt(0) == 'Q') {
		if ((test.indexOf("first")!=-1 && val=="First") || (test.indexOf("last")!=-1 && val=="Last") || (test.indexOf("city")!=-1 && val=="City")) {
			errors += '- '+nm+' is required.\n'; bErrors++;
		}
		
		
	}else if (val!='') {
      if (test.indexOf('isOther')!=-1) {
	  	if ((val=='Other') && (MM_findValue(frm,args[i]+'Other')=='')) { errors2 += '- Please fill in the "Other" textbox.\n'; bErrors++; }
	  } else if (test.indexOf('isMultiOther')!=-1) {
	  	if ((val.indexOf('Other')!=-1) && (MM_findValue(frm,args[i]+'Other')=='')) { errors2 += '- Please fill in the "Other" textbox for the '+args[i+1]+'.\n'; bErrors++; }
	  } else if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');q=val.indexOf('.');
		if (p<1 || q<1) { errorsEmail+='- '+label+' must contain an e-mail address.\n'; bErrors++; }
      } else if (test!='R') {
      	if (isNaN(val)) { errors+='- '+nm+' must contain a number.\n'; bErrors++; }
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) { errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n'; bErrors++; }
      }} else if(nm == 'postalcode')
      {
    	  if(val.match(lc) || val.match(uc)) 
    	  {
    		  errors2+='- '+nm+' must only contain numbers.\n'; bErrors++; 
    	  }
      }      
      } else if (test.charAt(0) == 'R') { errors += '- '+nm+' is required.\n'; bErrors++; }
	
	for(var x=0; x < arrSymbol.length; x++ ) {
		if (val.indexOf(arrSymbol[x])!=-1)  { errSymbol += "- Fields may not contain special characters.\n"; bErrors++; }
	}

  } 
  
  if (errors) { 
  	//alert(errors);
	  trackEnrollFormError(1,"Please complete all required fields.",frmDirect);
  	alert('Please complete all required fields.');
  } else if (errSymbol) {
	  trackEnrollFormError(1,"Fields may not contain special characters.",frmDirect);
   	alert('Fields may not contain special characters.');
	errors = 'charerror';
  } else if (errorpwd) {
	  trackEnrollFormError(1,errorpwd,frmDirect);
   	alert(errorpwd);
	errors = 'passworderror';
  } else if (errorpwd2) {
	  trackEnrollFormError(1,errorpwd2,frmDirect);
   	alert(errorpwd2);
	errors = 'passworderror';	
  } else if (errorpwdmatch) {
	  trackEnrollFormError(1,errorpwdmatch,frmDirect);
   	alert(errorpwdmatch);
	errors = 'errorpwdmatch';	
  } else if (erroremailmatch) {
	  trackEnrollFormError(1,erroremailmatch,frmDirect);
   	alert(erroremailmatch);
	errors = 'erroremailmatch';
  }else if (errorsEmail) {
	  trackEnrollFormError(1,errorsEmail,frmDirect);
   	alert(errorsEmail);
	errors = 'emailerror';
  }else if (errors2) {
	  trackEnrollFormError(1,errors2,frmDirect);
   	alert(errors2);
	errors = 'uniqueerror';
  }
  return errors;
 
}

function openWindow(aURL, aWindow, aProperties){
	if (aProperties=='gene')aProperties='width=785,height=600,resizable=1,scrollbars=1,titlebar=1,directories=1,location=1,menubar=1,toolbar=1;status=1';
	if (aProperties=='popup')aProperties='width=516,height=295';
	if (aProperties=='')aProperties='width=785,height=600,resizable=1,scrollbars=1,titlebar=1';
	
	var childWindow=open(aURL,aWindow,aProperties);
    if (childWindow.opener == null) childWindow.opener = self;
	childWindow.focus();
}

function changeVisible(aObj,aForm,aID) {
	var aVisible='';
	if (aObj.options[aObj.selectedIndex].value=='Other') {
		aVisible = 'visible';
	} else {
		aVisible = 'hidden';
		document.forms[aForm].elements[aID].value='';
	}
	if (!bNS4) {
		if (document.getElementById(aID)) {
			var element = document.getElementById(aID);
			element.style.visibility = aVisible;
		}
	}
}
function onInput() {
	var args=onInput.arguments, frm = document.forms[args[0]], aID='', aValue='';
	for (i=1; i<(args.length-1); i+=2) { 
		aID=args[i],aValue=args[i+1];
		frm.elements[aID].value = aValue;
	}
}
function checkClear(aObj,aForm,aID) {
	if (aObj.checked == false) {
		var aElement = document.forms[aForm].elements[aID];
		for (var i=0;i<aElement.length;i++){
		if (aElement[i].checked==true){
			aElement[i].checked = false;
		}}
	}
}

function changeClass(aID,aClass) {
	if (!bNS4) {
		if (document.getElementById(aID)) {
			var element = document.getElementById(aID);
			element.className = aClass;
		}
	}
}

function changeProperty(aID,aProperty,aValue) {
	if (!bNS4) {
		if (document.getElementById(aID)) {
			var element = document.getElementById(aID);
			var strTemp = 'element.' + aProperty + ' = "' + aValue + '";';
			eval(strTemp);
		}
	}
}

function openFile(aFile){
	s.prop14=s.eVar14=s.channel+':'+aFile;

	s.linkTrackVars='events,prop11,eVar11,prop15,eVar15';
	s.linkTrackEvents='event7';
	s.prop15=s.eVar15=s.channel+':'+aFile;
	s.events='event7';
	s.tl(this,'d',s.pageName+'|'+aFile);
}

function socialMedia(aHref){
	//s.linkTrackVars='prop35,eVar35,prop36,eVar36,prop37,eVar37,prop38,eVar38,events';
    //s.linkTrackEvents='event9';
    //s.events='event9';	
}

function openDisclaimer(aURL){	
	var childWindow=open('include/inc_popup.jsp?url='+aURL,'popup','width=516,height=295');
    if (childWindow.opener == null) childWindow.opener = self;
	childWindow.focus();
}

function openConsumerDisclaimer(aURL){	
	var childWindow=open('../include/inc_popup.jsp?url='+aURL,'popup','width=516,height=295');
    if (childWindow.opener == null) childWindow.opener = self;
	childWindow.focus();
}
/*
function gotocolleague(){
	s.linkTrackVars='events';
	s.linkTrackEvents='event9';
	s.events='event9';
	s.tl(this,'o',s.pageName+'|send_to_a_colleague');
	
}*/

function changeDownload(aID,aFile){
	if (!bNS4) {
		if (document.getElementById(aID)) {
			var element = document.getElementById(aID);
			var strTemp = 'element.href = "' + aFile + '";';
			eval(strTemp);
			
			$("#"+aID).attr("onclick","");
			$("#"+aID).unbind('click');
			$("#"+aID).click(function() {trackDownload(aFile);});
			
			//element.className = aClass;
		}
	}
}

/*SET UP ACCORDIAN*/
function setAccordian() {
	if (navigator.appName == 'Microsoft Internet Explorer')
	{
		$(".accordianContainer > h4").toggle(
		         function() {
		             $(this).siblings(".accordianContent").show("slide", { direction: "up" }, 550);
		             $(this).css("background-position", "bottom left");
		             $(this).children("IMG#accordianButton").attr("src","images/button-shrinkMenu.gif");
		         }, function() {
		             $(this).siblings(".accordianContent").hide("slide", { direction: "up" }, 550);
		             $(this).css("background-position", "top left");
		             $(this).children("IMG#accordianButton").attr("src","images/button-expandMenu.gif");
		         });
		     $(".accordianContainer > h2").toggle(
		         function() {
		             $(this).siblings(".accordianContent").show("slide", { direction: "up" }, 550);
		             $(this).css("background-position", "bottom left");
		             $(this).children("IMG#accordianButton").attr("src","images/button-shrinkMenu.gif");
		         }, function() {
		             $(this).siblings(".accordianContent").hide("slide", { direction: "up" }, 550);
		             $(this).css("background-position", "top left");
		             $(this).children("IMG#accordianButton").attr("src","images/button-expandMenu.gif");
		     });     
	}
	else
	{
		$(".accordianContainer > h4").toggle(
		         function() {
		             $(this).siblings(".accordianContent").slideDown("slow");
		             $(this).css("background-position", "bottom left");
		             $(this).children("IMG#accordianButton").attr("src","images/button-shrinkMenu.gif");
		         }, function() {
		             $(this).siblings(".accordianContent").slideUp("slow");
		             $(this).css("background-position", "top left");
		             $(this).children("IMG#accordianButton").attr("src","images/button-expandMenu.gif");
		         });
		     $(".accordianContainer > h2").toggle(
		         function() {
		             $(this).siblings(".accordianContent").slideDown("slow");
		             $(this).css("background-position", "bottom left");
		             $(this).children("IMG#accordianButton").attr("src","images/button-shrinkMenu.gif");
		         }, function() {
		             $(this).siblings(".accordianContent").slideUp("slow");
		             $(this).css("background-position", "top left");
		             $(this).children("IMG#accordianButton").attr("src","images/button-expandMenu.gif");
		     });
	}
} 

function profileUpdateTrack() {
	
	var optIn = "";
	var _optInYes = $("#radioOptInYes");
	if(_optInYes.attr("checked") != ""){
		optIn = "yes";
	}
	
	var optInEmail = $("input#inputEmail").val();
	var profession = $("select#profession").val();
	var specialty = $("select#specialty").val();
	var institution = $("input#inputInstitution").val();
	
	trackUpdateProfile('profile-update',optIn,optInEmail,profession,specialty,institution,'','','');	
}

function jqModalPopup(modal, site, height) 
{
	divId = "#" + modal;
	jQuery(divId).jqmShow();
	
	 $(".jqmOverlay").fadeIn(10);
	 
	createCookie("siteCookie", site);
}

function leaveSite() {
	omniExitLinkClick(readCookie("siteCookie"), 'ExitDisclaimer');
	window.open(readCookie("siteCookie"), '_blank');
}

/* Cookies Start                                     */
///////////////////////////////////////////////////////

function createCookie(name, value, days) {
	if (days) {
	var date = new Date();
	date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
	var expires = "; expires=" + date.toGMTString();
	}
	else var expires = "";
	document.cookie = name + "=" + value + expires + "; path=/";
}

function readCookie(name) 
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
	var c = ca[i];
	while (c.charAt(0)==' ') c = c.substring(1,c.length);
	if (c.indexOf(nameEQ) == 0) 
	return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function delCookie(NameOfCookie) 
{
	
	// The function simply checks to see if the cookie is set.
	// If so, the expiration date is set to Jan. 1st 1970.
	
	if (readCookie(NameOfCookie)) {
	document.cookie = NameOfCookie + "=" +
	"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	}
}

//Tabs 
///////////////////////////////////////////////////////
		function tabsSetup()
		{
			$('.tabs .1').addClass('open-tab');
			$('.tabs .1').css({ 'background-position' : 'bottom left' });
			$('.tab-body .1').addClass('open-tab').css({'display':'block'});
			$('.tabs .1 span').css({ 'color' : '#ffffff' });
		}
		
		function openTab( tabNumber )
		{
			$('.tabs .open-tab').css({ 'background-position' : '0 0px' });
				$('.tabs .open-tab span').css({ 'color' : '#455560' });
			$('.tab-body .open-tab').css({'display':'none'});
			$('.open-tab').removeClass('open-tab');
			$('.tabs .'+tabNumber).addClass('open-tab');
			$('.tabs .'+tabNumber).css({ 'background-position' : 'bottom left' });
				$('.tabs .'+tabNumber+' span').css({ 'color' : '#ffffff' });
			$('.tab-body .'+tabNumber).addClass('open-tab').css({'display':'block'});
		}
		
		
// Order Items
///////////////////////////////////////////////////////
	
	function simpleLogin( type , tracking )
	{
		// type = download Location or LMS
		
		if(type != "LMS")
		{
			createCookie("download", type);
			createCookie("tracking", tracking);
		}
		
		$.ajax({
	         url: "../handler/simplelogin-checker.jsp",
	         data: { 	
						actionType: type
			 	   },			 			
	         dataType: 'html',
	         success: function (data) {
	        	$('#response').empty();
	            $('#response').append(data);
	         }
	    });	
	}
	
	function registrationCheck( actionType )
	{
		 $.ajax({
	         url: "../handler/registration-handler.jsp",
	         data: { 
			 			itemsSelected: "one",
			 			firstname: $("#firstname").val(),
			 			lastname: $("#lastname").val(),
			 			profession: $("#profession").val(),
			 			specialty: $("#specialty").val(),
			 			institution:  $("#inputInstitution").val(),
			 			addr1: $("#addr1").val(),
			 			addr2: $("#addr2").val(),
			 			city: $("#city").val(),
			 			state: $("#state").val(),
			 			postalcode: $("#postalcode").val(),
			 			phone: $("#phone").val(),
			 			webusername: $("#inputEmail").val(),
			 			webpassword: $("#webpassword").val(),
			 			confirmpassword: $("#confirmpassword").val(),
			 			optin: "Y",
			 			type: actionType
			 		},			 			
	         dataType: 'html',
	         success: function (data) {
	        	$('#response').empty();
	            $('#response').append(data);
	         }
	     });
	}
	
	function OrderRegistrationCheck( )
	{
				$.ajax({
		         url: "handler/orderRegistration-handler.jsp", 
		         data: { 
				 			direction: "orderregister",
				 			itemsSelected: $("#itemsSelected-reg").val(),
				 			strokeAwarenessToolkit: $("#strokeAwarenessToolkit-reg").val(),
				 			fastwallposter: $("#fastwallposter-reg").val(),
				 			fastwalletEnglish: $("#fastwalletEnglish-reg").val(),
				 			fastwalletSpanish: $("#fastwalletSpanish-reg").val(),
				 			firstname: $("#firstname").val(),
				 			lastname: $("#lastname").val(),
				 			profession: $("#profession").val(),
				 			specialty: $("#specialty").val(),
				 			institution:  $("#inputInstitution").val(),
				 			addr1: $("#addr1").val(),
				 			addr2: $("#addr2").val(),
				 			city: $("#city").val(),
				 			state: $("#state").val(),
				 			postalcode: $("#postalcode").val(),
				 			phone: $("#phone").val(),
				 			webusername: $("#inputEmail").val(),
				 			webpassword: $("#webpassword").val(),
				 			confirmpassword: $("#confirmpassword").val(),
				 			optin: "Y"
				 		},			 			
		         dataType: 'html',
		         success: function (data) {
		        	$('#response').empty();
		            $('#response').append(data);
		         }
		     });	
	}

	function orderCheck( )
	{
			$.ajax({
		         url: "handler/orderRegistration-handler.jsp", 
		         data: { 
				 			direction: "order",
				 			itemsSelected: $("#itemsSelected-order").val(),
				 			strokeAwarenessToolkit: $("#strokeAwarenessToolkit-order").val(),
				 			fastwallposter: $("#fastwallposter-order").val(),
				 			fastwalletEnglish: $("#fastwalletEnglish-order").val(),
				 			fastwalletSpanish: $("#fastwalletSpanish-order").val(),
				 			firstname: $("#firstname-order").val(),
				 			lastname: $("#lastname-order").val(),
				 			profession: $("#profession").val(),
				 			specialty: $("#specialty").val(),
				 			institution:  $("#inputInstitution").val(),
				 			addr1: $("#addr1-order").val(),
				 			addr2: $("#addr2-order").val(),
				 			city: $("#city-order").val(),
				 			state: $("#state").val(),
				 			postalcode: $("#postalcode-order").val(),
				 			phone: $("#phone-order").val(),
				 			webusername: $("#webusername-order").val()
				 		},			 			
		         dataType: 'html',
		         success: function (data) {
		        	$('#response').empty();
		            $('#response').append(data);
		         }
		     });	
		
	}
	
	function loginCheck( actionType )
	{
		var checked = "false";
		
		if($("#popup-chk-rememberMe").attr("checked") == true)
		{
			checked = "true";
		}
		 $.ajax({
	         url: "../handler/login-handler.jsp",
	         data: { 
			 			login: "ems",
			 			username: $("#username").val(), 
			 			password: $("#password").val(), 
			 			rememberMe: checked,
			 			type: actionType
			 		},			 			
	         dataType: 'html',
	         success: function (data) {
	        	$('#login-response').empty();
	            $('#login-response').append(data);
	         }
	     });
	}
		
	function accessContent( type ){
		var checked = "false";
		
			if($("#popup-chk-rememberMe").attr("checked") == true)
			{
				checked = "true";
			}
		
		if(type == "LMS")
		{
			 $.ajax({
		         url: "../handler/ems-handler.jsp",
		         data: { 
			 			username: $("#username").val(), 
			 			password: $("#password").val(), 
			 			rememberMe: checked
			 		},	
		         dataType: 'html',
		         success: function (data) {
			 		$('#login-response').empty();
			        $('#login-response').append(data);
		         }
		     });
		}
		else 
		{
			var link = readCookie("download");
			if(link != 'download')
			{
				trackDownload(readCookie("tracking"));
				window.open(link, '_blank');
			}
		}		
	}
		
	function OrderItem() {    
		
		 $.ajax({
	         url: "handler/item-select-handler.jsp",
	         data: { 	
			 			strokeAwarenessToolkit: $("#strokeAwarenessToolkit option:selected").val(), 
			 			fastwallposter: $("#fastwallposter option:selected").val(), 
			 			fastwalletEnglish: $("#fastwalletEnglish option:selected").val(), 
			 			fastwalletSpanish: $("#fastwalletSpanish option:selected").val()
			 	   },			 			
	         dataType: 'html',
	         success: function (data) {
	        	$('#response').empty();
	            $('#response').append(data);
	         }
	     });			
    }
	
	function orderLogin( item1, item2, item3, item4 ) {    
		var checked = "false";
		
		if($("#popup-chk-rememberMe").attr("checked") == true)
		{
			checked = "true";
		}
		
		 $.ajax({
	         url: "handler/login-handler.jsp",
	         data: { 
			 			login: "order",
			 			username: $("#username").val(), 
			 			password: $("#password").val(), 
			 			rememberMe: checked,
			 			strokeAwarenessToolkit: item1, 
			 			fastwallposter: item2, 
			 			fastwalletEnglish: item3, 
			 			fastwalletSpanish: item4
			 		},			 			
	         dataType: 'html',
	         success: function (data) {
	        	$('#login-response').empty();
	            $('#login-response').append(data);
	         }
	     });			
    }
	
	function placeOrder( item1, item2, item3, item4 ) {    
		
		 $.ajax({
	         url: "handler/order-handler.jsp",
	         data: { 
			 	strokeAwarenessToolkit: item1, 
	 			fastwallposter: item2, 
	 			fastwalletEnglish: item3, 
	 			fastwalletSpanish: item4
		 	 },			 			
	         dataType: 'html',
	         success: function (data) {
		 		jQuery('#LoginWindow').jqmHide();
	        	$('#OrderWindow .interstitialContent').empty();
	            $('#OrderWindow .interstitialContent').append(data);
	            jqModalPopup('OrderWindow', 'order.jsp');
	         }
	     });			 
   }
	
	function registrationBoxSize( id , size1, size2 )
	{
		var windowSize = $(window).height();
		
		if(windowSize <= size2) //546
		{
			$('#'+id).css('height', '160px' );
		}
		else if (windowSize <= size1) //850
		{
			$('#'+id).css('height', windowSize-400 ); 
		}
		else 
		{
			$('#'+id).removeAttr("style"); 
		}
		
	}
	
	function checkbox(idName){
		
		if($('#'+idName).attr("checked") == true)
		{
			$('#'+idName).attr('checked', false);
		}
		else 
		{
			$('#'+idName).attr('checked', true);
		}
		
	}
	
	function submitOrder()
	{
		$.ajax({
            url: "handler/order-handler.jsp",
            data: { },
            dataType: 'html',
            success: function (data) {
            	alert(data);
            }
		});
		
		/*
        $.ajax({
            url: "../handler/login.jsp",
            data: { username: $("#username").val(), password: $("#password").val(), rememberMe: $("#rememberMe").attr('checked') },
            dataType: 'html',
            success: function (data) {
            	$('.interstitialContent').empty();
                $('.interstitialContent').append(data);
            }
        });*/
	}



$(document).ready(function()
{
	setAccordian();
});



//-->
