// JavaScript Document


// add formating to pages with nav or sidebar
jQuery(document).ready(function(){
  try
  { 
    jQuery("#idMainContainer:has(#idNav), #idMainContainer:has(#idSidebar)").prepend('<div class="HideVerticalRules"></div>');
    jQuery("#idMainContainer:has(#idNav), #idMainContainer:has(#idSidebar)").append('<div class="HideVerticalRules"></div>');
    jQuery("#idMainContainer:has(#idNav)").addClass("WithNavOnly");
    jQuery("#idMainContainer:has(#idSidebar)").addClass("WithSidebarOnly");
    jQuery("#idMainContainer:has(#idNav)#idMainContainer:has(#idSidebar)").removeClass("WithNavOnly");  
    jQuery("#idMainContainer:has(#idNav)#idMainContainer:has(#idSidebar)").removeClass("WithSidebarOnly");  
    jQuery("#idMainContainer:has(#idNav)#idMainContainer:has(#idSidebar)").addClass("WithNavAndSidebar");
    jQuery("input[type='checkbox']").css("border","none");
    jQuery("input[type='radio']").css("border","none");
    jQuery("#idSidebar").append('<br /><img src="/common/images/cleardot.gif" id="idFF_PreventScrollbar" width="1" height="1">');
  } 
  catch(er) {} 
});



function sbRedirectIn(sRedirectTo,isecondsToWait)
{
    setTimeout('sbRedirect("' + sRedirectTo + '")',isecondsToWait * 1000);
}


function sbRedirect(sRedirectTo)
{
  window.location.href = sRedirectTo;
}


function fnExcapeFormData(sFormName)
{
  rExp = /,/gi;
  o = eval('document.'+ sFormName);  
  for(i=0;i<o.length;i++)
  {
    sOrgData = new String(o[i].value);
    if(sOrgData.length > -1 )
      o[i].value = sOrgData.replace(rExp, '`')
  }
}


function sbJumpTo()
{
  sLocation = new String(location.hash);
  sLocation = sLocation.substr(1);
  if((sLocation.length > 0) && (navigator.appName !="Microsoft Internet Explorer") )
    window.location.hash = sLocation.toString(); 
}


function sbTestLengthOfIntroText(o)
{
  document.getElementById('idCurrenCountShortProfile').value=o.value.length;
  if(o.value.length > 199)
    o.value = o.value.substr(0,200); 
}


function fnRemoveHTMLTags(strInputCode)
{
 	return strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
}


