// JavaScript Document
var dnnhostpath = ""
$(document).ready(function(){
    $('ul.main-menu-links li').hover(function(){ $(this).addClass('menu-hover');  },function(){ $(this).removeClass('menu-hover');  });
	
			$('.headlink_panel').hide();
			$('li.headlink').toggle(
			function() { 
			     //$('.headlink_panel').hide();
 				 $('ul', this).css('display', '');
 				 $(this).addClass('current');
				  $('img.headerlink_arrow').attr('src',dnnhostpath + 'images/global/down-arrow.gif')
				 $('img.headerlink_arrow',this).attr('src',dnnhostpath + 'images/global/up-arrow.gif')
		    },
			function() { 
			     $('ul', this).css('display', 'none'); 
			     $('img.headerlink_arrow',this).attr('src',dnnhostpath + 'images/global/down-arrow.gif')
			});
 			
		$('.left-menu-panel li').hover(
			function() { $(this).addClass('mover');   },
			function() { $(this).removeClass('mover'); });
 
      // var thref = $('a',this).attr('href'); if
		$('.left-menu-panel li a').click(function(){
		     if($(this).attr('href')!=undefined  && $(this).attr('href')!='#' &&  $(this).attr('href')!=''){
				   self.location = $(this).attr('href'); 
			 }										
		});

			$('.faq_section  .content').hide();
			$('.faq_section li').toggle(
			function() { 
			     $('a',this).click(function(){
				   self.location = $(this).attr('href');						
				 });
		         $('.content',this).show();
			},
			function() { 
			     $('a',this).click(function(){
				   self.location = $(this).attr('href');						
				 });
		         $('.content',this).hide();
			});
			
			
		    $('.current .headlink_panel').css('display', '');
		    $('.current  img.headerlink_arrow').attr('src',dnnhostpath + 'images/global/up-arrow.gif');
			
			
	   //   $('ul.head-menu-link-panel').css('display', 'none');
 		  $('li.head-menu-link').hover(
			function() { 
 			
					$('ul', this).css('display', '');
			},
			function() {
					$('ul', this).css('display', 'none');
			});
		  
 		  $('li.head-menu-link').show();
	      $('ul.head-menu-link-panel').css('display', 'none');
		  
		 $('div.title_vis').hide();
		 $('div.c_footer').hide();

	      $('input#mlainput').keypress(function(e){
				if(e.keyCode==13){ 
				    //__GSMS_UI();
				    return false;
				} 	return true;						   

		});
		 
		 $('img#mlabutton').click(function(){ __GSMS_UI(); });


});

function __GSMS_UI(){
    if($('input#mlainput').val()!=''){
		 var feedback_url = "http://mlawstg.comwerks.net/Default.aspx";
		 var contact_url = "http://mlawstg.comwerks.net/Default.aspx";
 	     self.location = 'http://sgms.internet.gov.sg/search?q='+ escape($('input#mlainput').val()) + '&site=' + $("input[@name='mlasite']:checked").val()+ '&feedback_url=' + escape(feedback_url) + '&contact_url=' + escape(contact_url) + '&client=default&proxystylesheet=default&output=xml_no_dtd';
    }else{
		alert("please enter atleast 1 or more keywords");
    }return false;
}


function __ForwardFriend(){
	self.location = '/ForwardtoaFriend/tabid/453/Default.aspx?forward_url=' + escape(document.location.href);
}
