var bool=true;
function ui_dialog_titlebar(){
cap=document.getElementById('indexDelta');
rand=(Math.random()*10000000).toString();
rand=rand.substr(0,6);
if(bool){
capurl=cap.src;
bool=false;
}
cap.src=capurl+"/?hl_gl="+rand;


}


function news_upcoming_sm(thisform)
{
var emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;
var email = document.getElementById('rail').value;
  var fields = '';
  var errorcount = 0;
  if(document.getElementById('gn_last').value == "")
  {
    errorcount++;
    if(errorcount > 1)
        fields = fields + " and Name";
    else
        fields = fields + "Name";
  }

  if(document.getElementById('rail').value == "" || email.search(emailRegEx)== -1)
  {
    errorcount++;
    if(errorcount > 1)
        fields = fields + " and Email";
    else
        fields = fields + "Email";
  }
  if(document.getElementById('fp_fx').value != rand)
  {
    errorcount++;
    if(errorcount > 1)
        fields = fields + " and Security";
    else
        fields = fields + "Security";
  }
  
  if(document.getElementById('friendnull_action_text').value == "")
  {
    errorcount++;
    if(errorcount > 1)
        fields = fields + " and Message";
    else
        fields = fields + "Message";
  }

  if(errorcount > 0)
  {
    document.getElementById('section_faculty').innerHTML = '<span class="pp_contractdiv">Invalid Fields: '+fields+'</span>';
    return false;
  }

  return true;
}

