(function ($) {
  Drupal.behaviors.manipulateFormElements = {
    attach: function(context, settings) {
    // give the login form some love
    $('#user-login-form .login-submit-link').click(function(){
    	$('#user-login-form').submit();
    	return false;
    });
    }
  };
  Drupal.behaviors.correctActiveTrails = {
    attach: function(context, settings) {
      // fix menus that don't respect active trail because drupal links are stoopid
    $('#region-menu ul li.active').parents('li').addClass('active-trail');
    }
  };
})(jQuery);
;
//This javascript handles navigation panel elements, expanding divs and interactions between the two.

(function ($) {
  $(function() {
  
    //Toggle collapsed content referenced by anchor in URL
    function getAnchor(id,pop,px,py){
      if(id==undefined){
        //If no url is passed to function, get anchor from page URL and continue.
        var url = window.location.hash;
      }else if(id){
				//URL was provided, go to page or pop new widow and exit.
				if(!pop){
					window.location=id;
	        var url = window.location.hash;
				}else{
					//Pop provided.  Open in new window.
					var newWindow = window.open(id,"rtpop","menubar=0,resizable=0");
					//Cant set size by variable with window.open, must use resize to accept px and py.
					newWindow.resizeTo(px, py);
					return false;
				}
      }
      
      if(url){
        //Look for the expandedContent class.
				var expandParent = $(url).closest('.expandedContent');
				
				//If it exists, that means the anchor is associated with a collapsed div.
				if(expandParent.length > 0){
					//If the content is in a collapsed parent div, open it.
					if(expandParent.is(":hidden")){
						expandParent.slideToggle("fast");
						//Toggle class for arrow
						var openLink = expandParent.closest('.collapsible').children('.viewMore').children('a');
						openLink.toggleClass('open');
					}
				//Check to see if the anchor is associated with a Views Accordion element.
				}else if($('a[href="' + url + '"]').length > 0){
					//Set url variable so we can slide to that element
					url = $('a[href="' + url + '"]').parent().next('.ui-accordion-content');
				}
				
        //Go to ID, animate sliding.  Needs work, animation not reliable.
        $("html:not(:animated),body:not(:animated)").stop().animate({scrollTop: $(url).offset().top},'slow',function() {});
      }
      return false;
    }
    
		
    //Run on page load in case of URL anchors
    getAnchor();
    
		
    //Attach the anchor functionality to panel links, return requested URL
    $('.topPanel').each(function() {
			var thisLink=$("a",this);
			$(this).click(function(event) {
				//If the url has a 'jspop' class, pass new window specs
				if($("a.jspop",this).length){
					getAnchor(thisLink.attr("href"),true,800,600); 
				}else{
					getAnchor(thisLink.attr("href"));
				}
				event.preventDefault();
				return false;
			});
    });
		
    
    //Normal expand/collapse functionality
    $(function rtToggle(){
      $('.collapsible').each(function() {
        $(".viewMore",this).click(function() {
          //Toggle class for arrow
          $("a",this).toggleClass('open');
          $(this).next().slideToggle("slow");
        });
      });
    });

    
    //Expand/collapse functionality for webinars
    $(function webinarToggle(){
        $(".fieldset > legend").live('click',function() {
          $(this).next('.fieldset-wrapper').slideToggle("slow");
          $(this).toggleClass('open');
          return false;
        });
    });
    
    //Expand/collapse functionality for webinar speakers
    $(function webinarToggle(){
        $(".views-label-field-lwss-spkrbio").click(function() {
          $(this).next('.field-content').slideToggle("slow");
          $(this).toggleClass('open');
          return false;
        });
    });
    
		//Print back to top links for expanded content
		$(function() {
			$(".expandedContent").append('<a href="#">Back to top</a> &#8682;');
		});
    
  });
})(jQuery);;
(function ($) {

  //Reduce width of legacy webinar series body content 
  $(function() {
    $('.views-field-field-lwss-speaker').next('.views-field-body').css('width','500');
  });
  
  //Give views-accordion zebra styling.
  $(function() {
    $(".views-accordion").each(function(){
      $(".ui-accordion-header:odd").addClass("even");
    });
  });
  
  //Give views-accordion zebra styling.
  $(function() {
    $(".blog-post").parents('h1').css('display', 'block');
  });
	
	//Test computer popup
  $(function(){
		$('a#testLink').click(function(){
			window.open(this.href,"RTtest","menubar=0,resizable=0,width=600,height=675");
			return false;
		});
  }); 

})(jQuery);

//Popup function. Should return false in onclick
function pop(url,width,height){
  window.open(url,"ReadyTalk","menubar=0,resizable=0,width="+width+",height="+height);
  return false;
}

;
/**
 * --------------------------------------------------------------------
 * jQuery-Plugin "pngFix"
 * Version: 1.1, 11.09.2007
 * by Andreas Eberhard, andreas.eberhard@gmail.com
 *                      http://jquery.andreaseberhard.de/
 *
 * Copyright (c) 2007 Andreas Eberhard
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 */
 (function ($) {
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([237-9n-zA-Z]|1\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s(m){3.fn.pngFix=s(c){c=3.extend({P:\'blank.gif\'},c);8 e=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 5.5")!=-1);8 f=(o.Q=="t R S"&&T(o.u)==4&&o.u.A("U 6.0")!=-1);p(3.browser.msie&&(e||f)){3(2).B("img[n$=.C]").D(s(){3(2).7(\'q\',3(2).q());3(2).7(\'r\',3(2).r());8 a=\'\';8 b=\'\';8 g=(3(2).7(\'E\'))?\'E="\'+3(2).7(\'E\')+\'" \':\'\';8 h=(3(2).7(\'F\'))?\'F="\'+3(2).7(\'F\')+\'" \':\'\';8 i=(3(2).7(\'G\'))?\'G="\'+3(2).7(\'G\')+\'" \':\'\';8 j=(3(2).7(\'H\'))?\'H="\'+3(2).7(\'H\')+\'" \':\'\';8 k=(3(2).7(\'V\'))?\'float:\'+3(2).7(\'V\')+\';\':\'\';8 d=(3(2).parent().7(\'href\'))?\'cursor:hand;\':\'\';p(2.9.v){a+=\'v:\'+2.9.v+\';\';2.9.v=\'\'}p(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}p(2.9.x){a+=\'x:\'+2.9.x+\';\';2.9.x=\'\'}8 l=(2.9.cssText);b+=\'<y \'+g+h+i+j;b+=\'9="W:X;white-space:pre-line;Y:Z-10;I:transparent;\'+k+d;b+=\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;\';b+=\'J:K:L.t.M(n=\\\'\'+3(2).7(\'n\')+\'\\\', N=\\\'O\\\');\';b+=l+\'"></y>\';p(a!=\'\'){b=\'<y 9="W:X;Y:Z-10;\'+a+d+\'q:\'+3(2).q()+\'z;r:\'+3(2).r()+\'z;">\'+b+\'</y>\'}3(2).hide();3(2).after(b)});3(2).B("*").D(s(){8 a=3(2).11(\'I-12\');p(a.A(".C")!=-1){8 b=a.13(\'url("\')[1].13(\'")\')[0];3(2).11(\'I-12\',\'none\');3(2).14(0).15.J="K:L.t.M(n=\'"+b+"\',N=\'O\')"}});3(2).B("input[n$=.C]").D(s(){8 a=3(2).7(\'n\');3(2).14(0).15.J=\'K:L.t.M(n=\\\'\'+a+\'\\\', N=\\\'O\\\');\';3(2).7(\'n\',c.P)})}return 3}})(3);',[],68,'||this|jQuery||||attr|var|style||||||||||||||src|navigator|if|width|height|function|Microsoft|appVersion|border|padding|margin|span|px|indexOf|find|png|each|id|class|title|alt|background|filter|progid|DXImageTransform|AlphaImageLoader|sizingMethod|scale|blankgif|appName|Internet|Explorer|parseInt|MSIE|align|position|relative|display|inline|block|css|image|split|get|runtimeStyle'.split('|'),0,{}))
})(jQuery);;
//------------------------------------------------------
// Copyright Eloqua Corporation.
//
var elqSiteID = '1904';
var elqVer = 'v200';
//
var elqERoot = 'now.eloqua.com/';
var elqSecERoot = 'secure.eloqua.com/';
//
//------------------------------------------------------
function elqErr(){return true;}
window.onerror = elqErr;
var elqCurESite = '', elqAltESite = '', elqWCount = 0, elqTryI = false;
var elqStr = '', elqTID = null, elqTRun = false, elqLoad = false, elqFail = false;
if (location.protocol == 'https:') { elqCurESite = 'https://' + elqSecERoot; elqAltESite = 'http://' + elqERoot;}
else { elqCurESite = 'http://' + elqERoot; elqAltESite = 'https://' + elqSecERoot;}
var elqCurE = elqCurESite + 'visitor/' + elqVer + '/svrGP.aspx';
if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) > 4)) { elqTryI = true; }
if (((navigator.appName == 'Microsoft Internet Explorer') || (navigator.userAgent.indexOf('AOL') != -1))) { elqTryI = true; }
function elqClearT() { if(elqTRun) { clearTimeout(elqTID); elqTID = null; elqTRun = false;}}
function elqWrite() {
	if ((elqWCount > 75) || elqFail) { elqClearT(); }
	else { elqWCount++;
		if (!elqLoad) {	elqTRun = true;	elqTID = setTimeout('elqInit();', 1000);}
		else { elqClearT();	if (!elqFail) {document.write(elqStr); }}}}
function elqInit(){	elqClearT(); elqWrite();}
function elqReplace(string,text,by) {
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;
    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;
    var newstr = string.substring(0,i) + by;
    if (i+txtLength < strLength)
        newstr += elqReplace(string.substring(i+txtLength,strLength),text,by);
    return newstr; }
function elqQString(strVariable, strDefault, intUnencode) {
	var strSearchString = strVariable.toLowerCase() + '=';
	var strQString = location.search + '&';
	var strQStringLower = strQString.toLowerCase();
	var intStart = strQStringLower.indexOf(strSearchString);
	if (intStart != -1) {
		strQString = strQString.substring(intStart);
		strQString = strQString ? strQString.substring(strQString.indexOf('=') + 1, strQString.indexOf('&')) : '';}
	if ((intStart == -1) || (strQString == '')) { strQString = strDefault;}
	if (intUnencode == 1) {	strQString = elqReplace(strQString,'%26','&');}
	else if (intUnencode == 2) { strQString = elqReplace(elqReplace(strQString,'%26','&'),'%23','#');}
	return encodeURI(strQString);}
function elqAddQS(strURL, strAdd) {
	if ((strAdd == '') || (strURL == '')) {return strURL;}
	var intP = strURL.indexOf('?');
	var intH = (strURL.indexOf('#') != -1) ? strURL.indexOf('#') : strURL.length;
	if (intP == -1) {return (strURL.substring(0,intH) + '?' + strAdd + strURL.substring(intH,strURL.length));}
	if (intP == strURL.length - 1) { return (strURL + strAdd);}
	return (strURL.substring(0,intP+1) + strAdd + '&' + strURL.substring(intP+1,strURL.length));}
;
// Copyright Eloqua Corporation.
var elqWDt = new Date(20020101);
var elqDt = new Date();
var elqMs = elqDt.getMilliseconds();
var elqTzo = elqWDt.getTimezoneOffset();
var elqRef2 = '';
if (typeof elqCurE != 'undefined'){
if (document.referrer) { elqRef2 = escape(document.referrer); }
if ((typeof elqRef2 == 'undefined') || (elqRef2 == 'undefined') || (elqRef2 == '')) { elqRef2 = 'elqNone'; }
if (navigator.appName == 'Netscape' || navigator.userAgent.indexOf("Opera")!=-1) { document.write('<la' + 'yer hidden=true><im' + 'g src="' + elqCurE + '?pps=3&siteid=' + elqSiteID + '&ref2=' + elqRef2 + '&tzo=' + elqTzo + '&ms=' + elqMs + '" border=0 width=1 height=1 ><\/la' + 'yer>');}
else { document.write('<im' + 'g style="display:none" src="' + elqCurE + '?pps=3&siteid=' + elqSiteID + '&ref2=' + elqRef2 + '&tzo=' + elqTzo + '&ms=' + elqMs + '" border=0 width=1 height=1 >');}
}
;

