var oDoc = document;
var bNS4 = Boolean(oDoc.layers); 
//bIE = Boolean(oDoc.all), bStandard = Boolean(oDoc.getElementById);
var bErrors = 0;

function activeXfix(){
	theObjects = document.getElementsByTagName("object"); 
	for (var i = 0; i < theObjects.length; i++) { 
		//alert(theObjects[i].outerHTML);
		theObjects[i].outerHTML = theObjects[i].outerHTML; 
	}
}

function checkit(aForm,aValue) {
	for (i=0;i<document.forms[aForm].orderitem.length;i++) {
		if (document.forms[aForm].orderitem[i].value==aValue) {
			document.forms[aForm].orderitem[i].checked = true;
		}
	}
	//top.location.href='#cb';
}

function fixCol() {
	if (!bNS4) {
	var args=fixCol.arguments, aMax = 0, i, aID, aElement;
	
	for (i=0; i<args.length; i++) { 
		aID=args[i]; aElement = document.getElementById(aID);		
		//alert(aElement.name);
		if (parseInt(aElement.offsetHeight)>parseInt(aMax)) aMax = parseInt(aElement.offsetHeight);
		//alert(aID + ': ' + aElement.offsetHeight);
		//alert(aID);
  	}
  	for (i=0; i<args.length; i++) { 
		aID=args[i]; aElement = document.getElementById(aID);
		aElement.style.height = aMax + 'px';
		//alert(aID + ': ' + aElement.offsetHeight);
  	}
  	}
}

function disableall(){
	var arrElement = new Array('A','INPUT','SELECT'), i=0, input, count=0;
	for (var n=0;n<arrElement.length;n++) {
		input = document.getElementsByTagName(arrElement[n]);
		count = input.length;
		for (var i=0;i<count;i++) {
		if (arrElement[n]=='A') {
			input[i].removeAttribute("href");
			//input[i].style.cursor='default'; 
		} else if ((arrElement[n]=='INPUT') || (arrElement[n]=='SELECT')) {
			input[i].disabled='true';
		}}
	}
	return true;
} 

function printWindow() {
	if (!bNS4) window.print();
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

//function setCookie(name, value, nDays, path, domain) {
function setCookie(name, value, domain) {
var today = new Date(), expires = new Date(), nDays = 0;
if (nDays==null || nDays==0) nDays=365;
 expires.setTime(today.getTime() + 3600000*24*nDays);

  var curCookie = name + "=" + escape(value) + "; path=/" + 
  	((domain) ? "; domain=" + domain : "") + 
	((expires) ? "; expires=" + expires.toGMTString() : "") + ";";
  document.cookie = curCookie;  
}
function deleteCookie(name, domain) {
  if (getCookie(name)) {
    var curCookie = name + "=; path=/" + 
  	((domain) ? "; domain=" + domain : "") + 
	"; expires=Thu, 01-Jan-70 00:00:01 GMT";
	document.cookie = curCookie;
	//alert(curCookie + '-delete');
  }
}  

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

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='';
	//alert(t);
	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);
		//test=args[i+2]; 
	}
	//alert(frm.elements[totalName].value);
}

function clearFields() {
	var args = clearFields.arguments;
	var frm=document.forms[args[0]];
	//alert(args[0]);
	//var frm=args[0];
	for(var i=1; i<args.length; i++) { 
	//alert(args[i]);
	//alert(isObject(frm.elements[args[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;
	//alert(frmDirect); 
	if (frmDirect=='register') {
		errors = MM_validateForm(aFrm,'firstname','First name','R','lastname','Last name','R','profession','Professional','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','R','optin','Yes, I agree to receive messages about ActivaseŽ.','R');
	} else if (frmDirect=='profile') {
		errors = MM_validateForm(aFrm,'firstname','First name','R','lastname','Last name','R','profession','Professional','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','oldpassword','Old Password','isProfilePWD','webpassword','New Password','isProfilePWD','confirmpassword','Confirm Password','isProfilePWD');
	} else if (frmDirect=='login') {
		errors = MM_validateForm(aFrm,'loginusername','Username','RisEmail','loginpassword','Password','R');
	} 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=='colleague') {
		errors = MM_validateForm(aFrm,'name','Your Name','R','email','Your E-mail Address','RisEmail','cname','Your Colleague\'s Name','R','cemail','Your Colleague\'s E-mail Address','RisEmail');
	} 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=='coe') {
		errors = MM_validateForm(aFrm,'COE_FNAME','First','R','COE_LNAME','Last','R','COE_EMAIL','E-mail address','RisEmail');
	} else if (frmDirect=='bestpractices') {
		errors = MM_validateForm(aFrm,'COE_FNAME','First','Qfirst','COE_LNAME','Last','Qlast','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_BEST','Best stroke awareness practices employed at your center','R');
	} else if (frmDirect=='orderregister') {
		calcItems(aFrm,"itemsSelected","discussionGuide","dosingcard","dosingposter","faqbrochure","fastmagnet","fastposter","fastwallet","flashcard","goldenhrposter","gwtg","knowledgecheck","pedosingcard","profession","specialty","state","strokecard","therapycard","treatment","treatmentspanish");
		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','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 Activase.','R');		
	} else if (frmDirect=='order') {
		if (frm.action.indexOf('resource_materials.jsp')!=-1){//order materials
			calcItems(aFrm,"itemsSelected","discussionGuide","dosingcard","dosingposter","faqbrochure","fastmagnet","fastposter","fastwallet","flashcard","goldenhrposter","gwtg","knowledgecheck","pedosingcard","profession","specialty","state","strokecard","therapycard","treatment","treatmentspanish");
			errors = MM_validateForm(aFrm,'itemsSelected','- Please select at least one of the materials.\n','OM','firstname','First name','R','lastname','Last name','R','profession','Professional','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');
		} else { //clinical journals
			errors = MM_validateForm(aFrm,'article','- Article has not been selected.\n','R','firstname','First name','R','lastname','Last name','R','profession','Professional','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');
		} 
		
	}
	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='',erroremailmatch='';
  var frm=args[0], blnLoginEmpty=true;
  var frmObj=document.forms[args[0]];
  var frmDirect = frmObj.direction.value;
  var arrSymbol = new Array("<", ">", "(", ")", "%", "+", "\"", "'", ";", "&" );
  //alert(isObject(frmObj));
  bErrors = 0;
		
  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('isSameEmail')!=-1) {
		if (val!=MM_findValue(frm,args[i-3])) {
			erroremailmatch = '- E-mail address must match.\n';			
			bErrors++;
		}
	} else if (test.indexOf('isSame')!=-1) {
		//alert(args[i-3]);
		//alert(MM_findValue(frm,args[i-3]));
		//alert(args[i-1]);
		//alert(document.forms[args[-2]].value);
		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)){
		// 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
		
		var score = 0;
		if (val.length < 6 || val.length > 8) errorpwd += '- Password must contain from 6 to 8 characters.';
		
		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';

	} else if (test.indexOf('isNotEnter')!=-1) {
		if (val=='Enter your Search here') errors2 += label; else if (val=='') errors += '- '+nm+' is required.\n';
	} else if (test.indexOf('OM')!=-1) {
		if (val=='0') errors2 += label;
	} else if (test.indexOf('CKD')!=-1) {
		if (val=='') errors2 += '- Please check "' + label + '"\n';
	} 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';
	
	} 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'; 
		}
	}else if (val!='') {
      if (test.indexOf('isOther')!=-1) {
	  	//alert(val +'-'+MM_findValue(frm,args[i]+'Other'));
	  	if ((val=='Other') && (MM_findValue(frm,args[i]+'Other')=='')) errors2 += '- Please fill in the "Other" textbox.\n';
	  } 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';
	  } else if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');q=val.indexOf('.');
		//if ((p<1 || p==(val.length-1)) || (q<1 || q==(val.length-1))) errorsEmail+='- '+label+' must contain an e-mail address.\n';
		if (p<1 || q<1) errorsEmail+='- '+label+' must contain an e-mail address.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        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';
    }}} else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; 
	
	for(var x=0; x < arrSymbol.length; x++ ) {
		if (val.indexOf(arrSymbol[x])!=-1)  errSymbol += "- Fields may not contain special characters.\n";  
	}
	
  } 
  
  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.');
   	//alert(errSymbol);
	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 (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;
  //document.MM_returnValue = (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;
		//alert(aID + '-' + frm.elements[aID].value);
	}
}
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);
			
			//element.className = aClass;
		}
	}
}

//function openNewWindow(aURL,aName,aProperty){
function openArticle(aURL){
	//alert(aURL);
	openWindow(aURL,'popupWindow','popup');
	//window.open(aURL,'','width=760,height=600,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes');
}

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 changeDownload(aID,aFile){
	if (!bNS4) {
		if (document.getElementById(aID)) {
			var element = document.getElementById(aID);
			var strTemp = 'element.href = "' + aFile + '";';
			eval(strTemp);
			
			//element.className = aClass;
		}
	}
}

function changeTrack(aID,aFile){
	if (!bNS4) {
		if (document.getElementById(aID)) {
			
			$('#'+aID).attr('onclick', ''); 
			$('#'+aID).unbind('click').click(function() {
				trackDownload(  aFile );
			});
		}
	}
}

function profileUpdateTrack() {
	
	var optIn = "";
	var _optInYes = $("#radioOptInYes");
	if(_optInYes.attr("checked") != ""){
		optIn = "yes";
	}
	
	var profession = $("select#profession").val();
	var specialty = $("select#specialty").val();
	var institution = $("input#inputInstitution").val();
	
	trackUpdateProfile('profile-update',optIn,"activase",profession,specialty,institution,'','','');	
}

//Tabs 
///////////////////////////////////////////////////////
function tabsSetup()
{
	$('.tabs .1').addClass('open-tab');
	$('.tabs .1').css({ 'background-position' : 'top left' });
	$('.tabs .1 span').css({ 'color' : '#ffffff' });
	$('.tab-body .1').addClass('open-tab').css({'display':'block'});
}

function openTab( tabNumber )
{
	$('.tabs .open-tab').css({ 'background-position' : 'bottom left' });
	$('.tabs .open-tab span').css({ 'color' : '#000000' });
	$('.tab-body .open-tab').css({'display':'none'});
	$('.open-tab').removeClass('open-tab');
	$('.tabs .'+tabNumber).addClass('open-tab');
	$('.tabs .'+tabNumber).css({ 'background-position' : 'top left' });
	$('.tabs .'+tabNumber+' span').css({ 'color' : '#ffffff' });
	$('.tab-body .'+tabNumber).addClass('open-tab').css({'display':'block'});
}


//To avoid layout issues with lists where we want to add our own list item quantifiers (IE Step 1/2/3/etc)
//this manually sizes the list items according to their content size, which is determined by setting a child
//element to being the content node, which is then used to set the li item's height parameter enforcing a
//sane layout.
$(document).ready(function()
{
	$('.simulated_list_item').each(function(index, element)
	{
		$(element).css('height', $('.simulated_list_item_content', element).height() + "px");
	});
});
