var commentThreading = 'thread';
function commentThread(thread) {
	if ( thread == 1 && commentThreading == 'thread' || thread == 0 && commentThreading == 'flat' )
		return;

	if ( thread ) {
		commentThreading = 'thread';
		document.getElementById('commentLinkLinear').style.textDecoration = 'underline';
		document.getElementById('commentLinkThread').style.textDecoration = 'none';
		document.getElementById('commentLinkLinear').style.cursor = 'pointer';
		document.getElementById('commentLinkLinear').style.cursor = 'hand';
		document.getElementById('commentLinkThread').style.cursor = 'default';
		document.getElementById('commentLinkThread').style.fontWeight = 'bold';
		document.getElementById('commentLinkLinear').style.fontWeight = 'normal';
	} else {
		commentThreading = 'flat';
		document.getElementById('commentLinkThread').style.textDecoration = 'underline';
		document.getElementById('commentLinkLinear').style.textDecoration = 'none';
		document.getElementById('commentLinkThread').style.cursor = 'pointer';
		document.getElementById('commentLinkThread').style.cursor = 'hand';
		document.getElementById('commentLinkLinear').style.cursor = 'default';
		document.getElementById('commentLinkLinear').style.fontWeight = 'bold';
		document.getElementById('commentLinkThread').style.fontWeight = 'normal';
	}

	if ( !commentPage(1 - commentPaging) )
		changeCommentPage();
}

function inlineVote(id, opinion) {
	var vimg = document.getElementById('submit_vote');
	vimg.style.width='1px';
	vimg.style.height='1px';
	op='liked';
	for ( var i = 0 ; i < opinion.length; i++ )
		if ( opinion[i].checked ) op = opinion[i].value;
	vimg.onload=unhideVotingResults;
	vimg.src='survey.php?inline=1&entry_id='+id+'&opinion='+op+'&r='+Math.random();
	document.getElementById('voting_query').style.display='none';
	unhideVotingResultsTimer = setTimeout("unhideVotingResults(1);", 500);
}

var unhideVotingResultsTimer = null;
function unhideVotingResults (dirty) {
	if ( unhideVotingResultsTimer ) clearTimeout(unhideVotingResultsTimer);
	unhideVotingResultsTimer = null;
	document.getElementById('voting_results').style.display='inline';
}

function setCommentPagingMax(max) {
	commentPagingMax = max;
	document.getElementById('commentPageMax').innerHTML = max;
	if ( seeAllCommentsFlag )
		seeAllComments(1);
	commentPage(0);
}

var commentPagingMax = 999;
var commentPaging = 1;
function commentPage(move, hash) {
	commentPaging = parseInt(commentPaging) + parseInt(move);

	if ( commentPaging < 1 ) {
		move = 0;
		commentPaging = 1;
	}
	if ( commentPaging > commentPagingMax ) {
		move = 0;
		commentPaging = commentPagingMax;
	}

	if ( commentPaging == 1 ) {
		document.getElementById('commentLinkPrevious').disabled = true;
	} else {
		document.getElementById('commentLinkPrevious').disabled = false;
	}

	if ( commentPagingMax == commentPaging ) {
		document.getElementById('commentLinkNext').disabled = true;
	} else {
		document.getElementById('commentLinkNext').disabled = false;
	}

	if ( move || hash ) {
		document.getElementById('commentPageNum').innerHTML = commentPaging;
		changeCommentPage(hash);
		return true;
	}
}

function changeCommentPage(hash) {
	var newpage = 'comments/'+filepart+'_'+commentThreading+commentPaging+'.html?r='+Math.random()+(hash?'#'+hash:'');
	document.getElementById('comment_iframe').src = newpage;
}

function countNumChars() {
  if ( !document.getElementById('div_numchars') )
    return;
  var numChars = document.serendipity_comment.comment.value.length;
  if (numChars > 3000) {
     document.serendipity_comment.comment.value =  document.serendipity_comment.comment.value.substring(0, 3000);
    document.getElementById('div_numchars').innerHTML = 'Your comment is <b>3000 characters</b>';
  }
  else {
    document.getElementById('div_numchars').innerHTML = 'Your comment is <b>'+numChars+'</b> characters.<br><font color=red>3000 character limit</font>.';
  }
  
  if (navigator.appName != "Netscape") {
    setTimeout("countNumChars()", 100);
  }
}

function collapseComments( icon, table )
{
	var ct = document.getElementById(table);
	if ( ct.style.display == 'none' )
	{
		try { ct.style.display='table'; } catch (e) { ct.style.display='block'; }
		icon.src='templates/godaddy/img/img_minus.gif';
	}
	else
	{
		ct.style.display='none';
		icon.src='templates/godaddy/img/img_plus.gif';
	}

	return false;
}

function selectComment( id )
{
  if ( document.serendipity_comment['serendipity[replyTo]'] )
    var ele = document.serendipity_comment['serendipity[replyTo]'];
  else
    var ele = document.serendipity_comment.replyTo;

  ele.value = id;
/*
  if ( document.serendipity_comment['serendipity[replyTo]'] )
    var ele = document.serendipity_comment['serendipity[replyTo]'].options;
  else
    var ele = document.serendipity_comment.replyTo.options;

  for (var i = 0; i < ele.length; i++)
  {
    if( ele[i].value == id )
    {
      ele[i].selected = true;
    }
  }
*/
  

  document.getElementById('in_reply_to').style.display = 'block';
  document.getElementById('in_reply_to').innerHTML = "";
  document.getElementById('in_reply_to').style.height = 'auto';
  document.getElementById('in_reply_to').style.overflow = 'hidden';

//  document.serendipity_comment.scrollIntoView();
  focusRef('serendipity_comment');
  focusRef('comment_header');
  if ( document.serendipity_comment['serendipity[name]'] )
     document.serendipity_comment['serendipity[name]'].focus();
  else
    document.serendipity_comment.name.focus();


  var cbid = window.frames['comment_iframe'];
  if ( !cbid ) cbid = document.getElementById('comment_iframe');
  if ( !cbid ) return;
  if ( cbid.document ) cbid = cbid.document;
  if ( cbid.contentDocument ) cbid = cbid.contentDocument;
  var csid = cbid.getElementById('cs_'+id);
  cbid = cbid.getElementById('cb_'+id);


  if ( ! cbid )
    return ResetCommentHeader('Add Comment');

  document.getElementById('in_reply_to').innerHTML = 
	"<div class=\"serendipity_commentBody\">"+
		cbid.innerHTML+
	"</div>"+
	"<div class=\"serendipity_comment_source\">"+
		csid.innerHTML.replace(/Reply<\/a>/i, "</a>")+
	"</div>";

  ResetCommentHeader('Add Reply');
}

function ResetCommentHeader(text) {
  var h3 = document.getElementsByTagName('h3');
  for ( var i = 0; i < h3.length; i ++ )
    if ( h3[i].innerHTML == 'Add Comment' || h3[i].innerHTML == 'Add Reply' )
      h3[i].innerHTML = text;

  if ( text == 'Add Comment' ) {
    document.getElementById('in_reply_to').innerHTML = '';
    document.serendipity_comment.replyTo.value = "";
    document.getElementById('in_reply_to').style.overflow = 'hidden';
    document.getElementById('in_reply_to').style.height = '0px';
    document.getElementById('in_reply_to').style.display = 'none';
    return;
  }

  document.getElementById('in_reply_to').style.display = 'block';
  if ( document.getElementById('in_reply_to').scrollHeight > 240 ) {
    document.getElementById('in_reply_to').style.height = '200px';
    document.getElementById('in_reply_to').style.overflow = 'auto';
  } else {
//    document.getElementById('in_reply_to').style.height = document.getElementById('in_reply_to').offsetHeight + 'px';
    document.getElementById('in_reply_to').style.overflow = 'hidden';
    document.getElementById('in_reply_to').style.height = 'auto';
  }
}

function OnSubmitForm(url)
{
  if ( document.getElementById("background_draft") )
    document.getElementById("background_draft").value = '';
  if(document.pressed == 'Submit Comment')
  {
    document.serendipity_comment.action = 'comments.php';
    document.serendipity_comment.target="";
  }
  else
  if(document.pressed == 'Done Editing')
  {
    // document.serendipity_comment.action=url;
    document.serendipity_comment.action = 'comments.php';
    document.serendipity_comment.target="";
  }
  else
  if(document.pressed == 'Check Spelling')
  {
    document.serendipity_comment.action ="spellcheck.php";
    window.open('spellcheck.php', 'spellcheck', 'menubar=no,width=540,scrollbars=yes');
    document.serendipity_comment.target ="spellcheck";
  }
  else
  if(document.pressed=='- Check Spelling -')
  {
    document.serendipityEntry.action ="spellcheck.php";
    window.open('spellcheck.php', 'spellcheck', 'menubar=no,width=540,scrollbars=yes');
    document.serendipityEntry.target ="spellcheck";
  }
  else
  if(document.pressed == '- Auto Draft -')
  {
    document.serendipityEntry.action=url;
    document.serendipityEntry.target="saveDraft";
    document.getElementById("background_draft").value = '2';
  }
  else
  if(document.pressed == '- Save Draft -')
  {
    document.serendipityEntry.action=url;
    document.serendipityEntry.target="saveDraft";
    document.getElementById("background_draft").value = '1';
  }
  else
  if(document.pressed == '- Save -' || document.pressed == '- Preview -')
  {
    document.serendipityEntry.action=url;
    document.serendipityEntry.target="";
  }
  return true;
}

function padLeft( str, pad, count )
{
	count = count - str.toString().length;
	for ( var i = 0; i < count; i ++ )
		str = pad + str;
	return str;
}
function writeDraftStatus (status) {
  var now = new Date();
  if ( status )
    document.getElementById('draft_status').innerHTML=status;
  else
    document.getElementById('draft_status').innerHTML='Auto Draft at '+padLeft(now.getHours(), '0', 2)+':'+padLeft(now.getMinutes(), '0', 2)+':'+padLeft(now.getSeconds(), '0', 2);
}

function setInReplyTo( id )
{
/*
  for (var i=0; i<document.serendipity_comment['replyTo'].options.length; i++)
  {
    if ( document.serendipity_comment['replyTo'].options[i].value == id )
    {
      document.serendipity_comment['replyTo'].options[i].selected = true;
      return;
    }
  }
*/
  selectComment(id);
}

var dbl_click_prevention = new Array();
function preventDoubleClick( index )
{
  if ( dbl_click_prevention[index] == null )
  {
    dbl_click_prevention[index] = true;
    return true;
  }
  return false;
}

function videoRedirect(page) {
	if ( WATCHSET )
	{
		if ( page.match(/watch=|20[01][0-9].html$|index.html/) )
			;
		if ( page.match(/[.]html[?]/) )
			page = page.replace(/[.]html[?]/, ".html?watch=1&");
		else
			page = page.replace(/[.]html/, ".html?watch=1");
	}
	window.location.href = page
}

var currentVid = "";
function checkVideoBlog(vid, force, forcePlay, stop)
{
  if ( ! vid ) return;
  if ( force ) WATCHSET = 1;

  if (!window.location.href.match("watch=") ) WATCHSET = 1;

  if (window.location.href.match("watch=1") || WATCHSET) 
  {
    document.getElementById('flashcontent').innerHTML = '';
    currentVid = vid;
    WATCHSET = 1;
    if ( window.location.href.match("wnow=0") ) {
        stop = true;
    } else {
	forcePlay = true;
    }
    var so = new SWFObject("BASE_FLV_PLAYER.swf?theVid="+vid+(forcePlay?"&doPlay=true&play=true":''), "videoPlayer", "350", "350", "7", "#FFFFFF");
    /* MAKE FLASH HAVE A TRANSPARENT BACKGROUND */
    so.addParam("wmode", "transparent");

    if ( ( (typeof getCookie == 'function' && getCookie('vid_force_play')) || ( force && !window.location.href.match("watch=1") ) || window.location.href.match("wnow=1") || forcePlay ) && !stop )
    {
      if ( (typeof deleteCookie == 'function') )
        deleteCookie('vid_force_play', '/');
      so.addVariable("doPlay", "true");
      if ( forcePlay )
        so.addVariable("play", "true");
    } else {
      so.addVariable("doPlay", "false");
    }
    /* PASS FLASH VARS INTO FLASH */
    so.addVariable("theVid", vid);
  
 	  so.write("flashcontent");
	  if ( document.getElementById('serendipity_entry_body_folded') )
	    document.getElementById('serendipity_entry_body_folded').style.display='none';
    if ( typeof AddEvent == 'function' )
	    AddEvent("onload", watchOnload);
  } else if (force) {
    window.location.href=window.location.href+(window.location.href.match(/[?]/,window.location.href)?'&watch=1':'?watch=1');
  }
}

function showFTAF (id)
{
	x=window.open('ftaf.php?id='+id+((window.location.href.match("watch=1") || WATCHSET)?'&watch=1':''), 'sendtoafriend', 'width=460,height=580');
	x.focus();
}

function showQBC_Share (id)
{
	x=window.open('qbc_share.php?id='+id+((window.location.href.match("watch=1") || WATCHSET)?'&watch=1':''), 'sendtoqbc', 'width=460,height=420');
	x.focus();
}

function showSuperBowlAd09()
{
  var window_options = "width=780,height=488";
  if(navigator.userAgent.indexOf("Safari") > 0)
  {
    /*To avoid safari scrollbars*/
    window_options = 'scrollbars=0,width=790,height=505';
  }

  x=window.open('http://videos.godaddy.com/popups/AVPlayerPopup_sb09.aspx?se=%2B&app%5Fhdr=&ci=14056&mediaID=SB09CommercialsPopup', 'sbad09', window_options);
  x.focus();
  return false;
}


function showSuperBowlAd09Shower()
{
  var window_options = "width=780,height=488";
  if(navigator.userAgent.indexOf("Safari") > 0)
  {
    /*To avoid safari scrollbars*/
    window_options = 'scrollbars=0,width=790,height=505';
  }
  x=window.open('http://event.godaddy.com/videos/popups/AVPlayerPopup_sb09.htm?ci=14327&mediaId=SB09ShowerIOPopup', 'sbad09', window_options);
  x.focus();
  return false;
}


function showSuperBowlAd09Baseball()
{
  var window_options = "width=780,height=488";
  if(navigator.userAgent.indexOf("Safari") > 0)
  {
    /*To avoid safari scrollbars*/
    window_options = 'scrollbars=0,width=790,height=505';
  }
  x=window.open('http://event.godaddy.com/videos/popups/AVPlayerPopup_sb09.htm?ci=14327&mediaId=SB09BaseballIOPopupi9O7z', 'sbad09', window_options);
  x.focus();
  return false;
}


function showvideo (media_list,show_ads)
{
	var width = 934; /* default is 934 for multiple videos, 700 for showing just 1 video */
	var height = 520;
 	
//	var gdtv_video_url = 'http://www.test.godaddy-tv.ide/bobsblog/avplayerpopup.aspx?mediaIds='+media_list;
	var gdtv_video_url = 'http://www.godaddy.tv/bobsblog/avplayerpopup.aspx?mediaIds='+media_list;

	if ( media_list.indexOf(",") == -1) {
		width = 700;
	}

	if ( show_ads != null) {
		gdtv_video_url = gdtv_video_url + '&link=ads';
		width = 934; /* */
	}

	x=window.open(gdtv_video_url, 'GoDaddyTV_Video_Player', 'menubar=no,width='+width+',height='+height+',scrollbars=no');
	x.focus();
}

function seeAllComments(justResize) {
	var ifdoc, iframe;
	if ( ! pageLoaded )
		return setTimeout('seeAllComments();', 10);
	ifdoc = window.frames['comment_iframe'];
	iframe = document.getElementById('comment_iframe');
	if ( !ifdoc ) ifdoc = iframe;
	if ( ifdoc.document ) ifdoc = ifdoc.document;
	if ( ifdoc.contentDocument ) ifdoc = ifdoc.contentDocument;
	var cb = ifdoc.getElementById('commentBlock');
	if (!justResize)
		seeAllCommentsFlag = !seeAllCommentsFlag;
	if ( !cb ) return;

	if ( cb.offsetHeight && seeAllCommentsFlag ) {
		if(document.getElementById('see_all_comments'))
		{
			document.getElementById('see_all_comments').src = 'templates/godaddy/img/but_seelesscmnts.gif';
		}
		iframe.style.height = (cb.offsetHeight + 20) + 'px';
		iframe.style.border = '0px';
	} else if ( cb.offsetHeight > 340 && !seeAllCommentsFlag && !justResize ) {
		if(document.getElementById('see_all_comments'))
		{
			document.getElementById('see_all_comments').src = 'templates/godaddy/img/but_seeallcmnts.gif';
		}
		iframe.style.height = 360 + 'px';
		iframe.style.border = '2px solid gray';
	}
}
var seeAllCommentsFlag = false;

function watchOnload ()
{
	document.getElementById('video_section').style.display='block';
        if(document.getElementById("watch_video_again"))
        {
        	document.getElementById('watch_video_again').style.display='inline';
        }
	document.getElementById('now_playing_float').style.visibility='visible';
	document.getElementById('serendipity_entry_body').style.display='none';
	var tags = document.getElementsByTagName('a');
	for ( var i = 0 ; i < tags.length; i ++ ) {
		if (  tags[i].href.match(/watch=|20[01][0-9].html$|index.html/) )
			continue;
		if ( tags[i].href.match(/[.](html|php)[?]/) )
			tags[i].href = tags[i].href.replace(/[.](html|php)[?]/, ".$1?watch=1&");
		else
			tags[i].href = tags[i].href.replace(/[.](html|php)/, ".$1?watch=1");
	}
	if ( document.getElementById('voteWatch') )
		document.getElementById('voteWatch').value = '1';
}

function onLoadSetFocus()
{
 var shouldI = getQueryVariable('focus')
 if ( shouldI != null )
 {
   setTimeout("document.serendipity_comment['name'].focus();", 200);
 }

 
 var comment_captcha_cookie = getCookie('comment_captcha_display');
 if(comment_captcha_cookie && comment_captcha_cookie == 'show' && document.getElementById('comment_captcha_div') != null)
 {
  //only if this cookie is set and we are on a page with the captcha should we display it.
  document.getElementById('comment_captcha_div').style.display = "block";
 }
 
   
 var errmsg = getCookie('errmsg');
 if ( errmsg && document.serendipity_comment && document.serendipity_comment['name'])
 {
   document.serendipity_comment['name'].value = getCookie('comment_form_name');
   document.serendipity_comment['email'].value = getCookie('comment_form_email');
   document.serendipity_comment['url'].value = getCookie('comment_form_url');
   document.serendipity_comment['comment'].value = getCookie('comment_form_comment');
   document.serendipity_comment['pubvid'].value = getCookie('comment_form_pubvid');
   document.serendipity_comment['subscribe'].checked = ( getCookie('comment_form_subscribe') != '' );
   setTimeout("setInReplyTo("+getCookie('comment_form_replyto')+")", 200);
   document.getElementById('errmsg').innerHTML = '<span style="color:red; font-weight: bold">ERROR: Your comment could not be posted.<br>' + errmsg + '</span>';
//   setTimeout("location.href = '#serendipity_CommentForm';", 500);
 }

 if ( document.serendipity_comment && document.serendipity_comment['pubvid'] )
 {
  if ( typeof allowVideoUpload != 'undefined' )
  {
    if (document.serendipity_comment['pubvid'].value )
    {
      document.getElementById('vidattached').style.display='block';
      document.getElementById('attachvid').style.display='none';
    } else {
      document.getElementById('vidattached').style.display='none';
      document.getElementById('attachvid').style.display='block';
    }
  }
 }

 var successmsg = getCookie('successmsg');
 if ( successmsg && document.serendipity_comment && document.serendipity_comment['name'])
 {
   document.getElementById('errmsg').innerHTML = '<span style="color:green; font-weight: bold">SUCCESS: ' + successmsg + '</span>';
   setTimeout("focusCommentForm();", 500);
 }

 deleteCookie('errmsg', '/');
 deleteCookie('comment_form_email', '/');
 deleteCookie('comment_form_url', '/');
 deleteCookie('comment_form_comment', '/');
 deleteCookie('comment_form_pubvid', '/');
 deleteCookie('comment_form_subscribe', '/');
 deleteCookie('comment_form_replyto', '/');

 deleteCookie('successmsg', '/');

 
}

function focusCommentForm() {
  document.serendipity_comment.hiddenfocus.focus();
  if ( document.serendipity_comment['serendipity[name]'] )
     document.serendipity_comment['serendipity[name]'].focus;
  else
    document.serendipity_comment.name.focus();

}

function focusRef(id) {
	if ( id && id.type != 'load' ) {
		id = document.getElementById(id);
	} else {
		id = window.location.href.match(/ref=([^\&]*)/);
		if ( !id || !id[1] )
			return;
		id = document.getElementById(id[1]);
	}
	if ( id && id.scrollIntoView ) {
		id.scrollIntoView();
	}
}

function stopVideo() {
  window.scrollTo(0,0);
  checkVideoBlog(currentVid, false, false, true);
}

function restartVideo() {
	window.scrollTo(0,0);
//	window.location.href = window.location.href.replace(/[#].*/,'')+'#';
	window.location.href = window.location.href.replace(/\&wnow=0/,'');
	checkVideoBlog(currentVid, true, true);
//	window.location.href = window.location.href.replace(/[#].*/,'').replace(/([?&])r=[^&][&]?/, '$1')+'&r='+Math.random();
}



//this will show the alert box for the comment unsubscribe
function commentUnsubscribePopin(email_address)
{
  //strip tags
  email_address = email_address.replace(/[^-A-Za-z_0-9@.#,]/g,""); 
  
  alert_div = document.createElement("div");
  if(!alert_div)
  {
    //alert(email_address + " will no longer receive emails when new comments are posted to this article.");
    alert("You will no longer receive emails when new comments are posted to this article."); 
  }
  else
  {
    alert_div.style.border = "1px solid black";
    alert_div.style.width =  "402px";
    alert_div.style.height = "254px";
    alert_div.style.display = "block";
    alert_div.style.position = "absolute";
    alert_div.style.top = "268px";
    alert_div.style.left = "300px";
    alert_div.style.backgroundImage = "url(/templates/godaddy/img/get_email_alerts_bg.jpg)";
    alert_div.style.fontSize = "10pt"; 
    //alert_div.innerHTML = "<div style=\"margin: 50px 30px 20px 30px;\">" + email_address + " will no longer receive emails when new comments are posted to this article.</div>";
    alert_div.innerHTML = "<div style=\"margin: 50px 30px 20px 30px;\">You will no longer receive emails when new comments are posted to this article.</div>";  
    alert_div.innerHTML = alert_div.innerHTML + "<div style=\"text-align: center;\"><a href=\"#\" onclick=\"return closeUnsubscribePopin();\"><img src=\"/btn_close.gif\" width=\"140\" height=\"19\" alt=\"Close This Window\" border=\"0\" /></a></div>";
 
    document.body.appendChild(alert_div);
   }
}


//this function goes along with the alert to close it when called
function closeUnsubscribePopin()
{
  alert_div.style.display = "none";
  return false;
}


function subPopin (addr, type) {
  if ( addr == 'Enter your email address' ) addr = '';
  if ( !type ) type = 'emailaddr';
  addr = escape(addr);
  var ifr = document.getElementById('subPopin');
  if ( !ifr && document.createElement ) {
    ifr = document.createElement('iframe');
    if ( ifr ) {
      ifr.src = "submail.php?"+type+"="+addr+"&i=1";
      ifr.id = "subPopin";
      ifr.frameBorder = "0";
      ifr.style.border = '1px solid black';
      ifr.style.width =  '402px';
      ifr.style.height = '254px';
      ifr.style.overflow = 'hidden';
      ifr.style.display = 'block';
      ifr.style.position = 'absolute';
      ifr.style.top = '268px';
      ifr.style.left = '300px';
      document.body.appendChild(ifr);
    }
    var ifr = document.getElementById('subPopin');
  }
  if ( navigator.appVersion.match('MSIE 6') || !document.createElement )
  {
    if ( ifr ) ifr.style.display = 'none';
    ifr = null;
  }
  if ( ifr ) {
    ifr.style.display = 'block';
    ifr.src = 'submail.php?'+type+'='+addr+'&i=1';
  }
  if ( !ifr ) {
    if ( ! window.open('submail.php?'+type+'='+addr+'&i=0', 'submail', 'width=412,height=264') )
      if ( type == 'unsub' )
	alert ('Your email address, '+unescape(addr)+' has been removed from BobParsons.ME Email Alerts.');
      else
	alert ('Please disable your popup blocker to subscribe');
  }
}

if ( typeof AddEvent == 'function' ) {
  AddEvent("onload", focusRef);
}

if ( typeof AddEvent == 'function' )
AddEvent("onload", function () {
var subconf;
if ( subconf = window.location.href.match(/subconf=(.*)/) ) {
  var scdiv = document.getElementById('subconf');
  if ( scdiv ) {
    scdiv.style.display = 'block';
    scdiv.firstChild.innerHTML=unescape(subconf[1]).replace(/[^-A-Za-z_0-9@.#,]/g,'')+' VERIFIED<br><br><a href="#" onclick="document.getElementById(\'subconf\').style.display=\'none\'; return false;"><img src="btn_close2.gif" align="right" border="0" style="margin-right: 10px;"></a>Thanks for staying in tune with BobParsons.me!  Keep reading below to check out our latest episodes.';
  }
} else if ( subconf = window.location.href.match(/unsub=(.*)/) ) {
  subPopin(unescape(subconf[1]), 'unsub');
}
else if(window.location.href.indexOf("?sub=") > -1 && window.location.href.indexOf("email=") > -1 && window.location.href.indexOf("&wnow=") == -1) 
{
  //show the alert box for the comment unsubscribe 
  //the tweak part aint pretty but its a quick fix... feel free to input a better way to ditch any extra params
  unsubscribe_email = window.location.href.match(/email=(.*)/);  
  tweaked_unsubscribe_email = unescape(unsubscribe_email[1]);
  if(tweaked_unsubscribe_email.indexOf("&") > -1)
  {
    tweaked_unsubscribe_email = tweaked_unsubscribe_email.split("&", 1)[0];
  }
  commentUnsubscribePopin(tweaked_unsubscribe_email); 
}
});


function getVar(key) {
	var r = new RegExp('[?&]'+key+'=([^&#]*)');
	r = r.exec(window.location.href);
	return r ? r[1] : null;
}


function searchSomething()
{
  var return_boolean = false;
  var dkstr = document.getElementById("serendipityQuickSearchTermField").value.replace(/ /g, "");
  if (dkstr.length < 2 )
  {
    alert("Your search query must be at least 2 characters");
    document.getElementById("serendipityQuickSearchTermField").focus();
  }
  else
  {
    return_boolean = true;
  }

  return return_boolean;
}



if ( typeof getCookie == 'function' && !getCookie('refsite') && !getCookie('refpage') ) {
  var today = new Date();
  today.setDate(today.getDate() + 1);
  setCookie('refsite', document.referrer?document.referrer:(window.location.href.match("rss=1")?'rss':''), today);
  setCookie('refpage', window.location.href, today);
}

var WATCHSET = 0; 
