


function change_class(id, newClass) {
  identity=document.getElementById(id);
  identity.className=newClass;
}

	function show_tab(tab){

      var tabs = ["","top_cont_1","top_cont_2"];

        for(i=1; i < tabs.length; i++){
          var obj = document.getElementById(tabs[i]);
          change_class("ttab_nav_"+i, "tab_main_inactive")
          obj.style.display = "none";
        }
          
        var obj = document.getElementById("top_cont_"+tab);
        obj.style.display = "block";
        change_class("ttab_nav_"+tab, "tab_main_active")
      }
	  
	

function change_class_click(id, newClass) {
  identity=document.getElementById(id);
  identity.className=newClass;
}

	function show_tab_click(tab){

var tabs = ["","top_cont_click1","top_cont_click2","top_cont_click3","top_cont_click4","top_cont_click5","top_cont_click6","top_cont_click7","top_cont_click8","top_cont_click9"];

        for(i=1; i < tabs.length; i++){
          var obj = document.getElementById(tabs[i]);
          change_class_click("ttab_nav_click"+i, "tab_main_inactive_click")
          obj.style.display = "none";
        }
          
        var obj = document.getElementById("top_cont_click"+tab);
        obj.style.display = "block";
        change_class_click("ttab_nav_click"+tab, "tab_main_active_click")
      }
	  




//script for top stories slide show
function change_class_slide(id, newClass) {
  identity=document.getElementById(id);
  identity.className=newClass;
}

	function show_tab_slide(tab){

var tabs = ["","top_cont_slide1","top_cont_slide2","top_cont_slide3","top_cont_slide4","top_cont_slide5","top_cont_slide6"];

        for(i=1; i < tabs.length; i++){
          var obj = document.getElementById(tabs[i]);
          change_class_slide("ttab_nav_slide"+i, "tab_main_inactive_slide")
          obj.style.display = "none";
        }
          
        var obj = document.getElementById("top_cont_slide"+tab);
        obj.style.display = "block";
        change_class_slide("ttab_nav_slide"+tab, "tab_main_active_slide")
      }
//script for top stories slide show ends 
	  
	  


function validate(form1,email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.forms[form1].elements[email].value;
   if(reg.test(address) == false) {
      alert('Invalid Email Address');
      return false;
   }
}
function selecttext() 
{ 
document.form1.email.select()
} 



function selectname()
{
document.loginForm.login.select()
}

function dologin(form,login_url)
{
	loginname = form.login.value.split("@");
	if(loginname[1])
		form.login.value=loginname[0];
}







function validate_gsearch()

  {
   if(document.gsearch.q.value=="")
   {
    window.alert("Please enter the Keyword");
    document.gsearch.q.focus();
    return false;
   }

   return true;
  }



function parse( )
{
  var regexS = "[\\?&]"+q+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var tmpURL = window.location.href;
  var results = regex.exec( tmpURL );
  if( results == null )
    return "";
  else
    return results[1];
}


function isValid() {
 var mail=document.form1.email.value;
 if (mail.indexOf(' ')==-1 
      && 0<mail.indexOf('@')
      && mail.indexOf('@')+1 < mail.length
 ) return true;
 else alert ('Invalid email address!')
 return false;
}


function togDisp(e){stopB(e);var obj=document.getElementById('more');var dp="";if(obj.style.display==""){dp="none";}obj.style.display=dp;return false;}
function stopB(e){if(!e)e=window.event;e.cancelBubble=true;}
document.onclick=function(event){if(document.getElementById('more').style.display==""){togDisp(event);}}


