		var feature_id = 1;
		var t = 0;
			
			function init_feature(n) {
				
				feature_current = "#feature_container" + feature_id;
				star_current = "#star" + feature_id;
				
				$(feature_current).children(".feature_image").show();
				$(feature_current).children(".feature_text").show();
				$(star_current).addClass("selected");
				
				t = setTimeout("startRotate()",5000);
			}
			
			function fade_feature(feature_id, feature_next_id) {
				
				feature_current = "#feature_container" + feature_id;
				feature_next = "#feature_container" + feature_next_id;
				star_current = "#star" + feature_id;
				star_next = "#star" + feature_next_id;
				
				$(feature_current).children(".feature_image").fadeOut('slow');
				$(feature_next).children(".feature_image").fadeIn('slow');
				
				$(feature_current).children(".feature_text").hide();
				$(feature_next).children(".feature_text").show();
				
				$(star_current).removeClass("selected");
				$(star_next).addClass("selected");	
			}
			
			function rotate_feature() {
				
				max_feature = 5;
				
				if (feature_id == max_feature)
				feature_next_id = 1;
				else
				feature_next_id = feature_id + 1;
				
				fade_feature(feature_id,feature_next_id);
				
				feature_id = feature_next_id;
			}
			
			function load_feature(feature_next_id) {
				
				stopRotate();
				
				fade_feature(feature_id,feature_next_id);
				
				feature_id = feature_next_id;
				
			}
			
			function startRotate() {
				rotate_feature();
				t = setTimeout("startRotate()",5000);
			}
			
			function stopRotate() {
				clearTimeout(t);
			}

function select_tab(n) {
				selector_code = '<div class="selector"></div>';
				
				$("#body").children("#menu").children("ul").children("li").eq(n).append(selector_code);
				
			}

function cleartext(field){

    if (field.defaultValue == field.value) 
        field.value = '';
    else 
        if (field.value == '') 
            field.value = field.defaultValue;
    
}

function init_page(type) {

$(".dd").mouseover(function(){
	$(this).children().show();
});

$(".dd").mouseout(function(){
	$(this).children('ul').hide();
});



/* $("#google_form input").keyup(function(e) {
					
					if(e.keyCode == 13) {
						
						}
						

						
					}); */
					
	$("#google_form form").submit(function() {
		var actionurl = "/search/?gq=" + $("#google_form input").val();
		$("#google_form form").attr("action", actionurl);
	});

$(".tweet").tweet({
           		 	username: "natsecnet",
					avatar_size: null,
					count: 2,
				});
				
				$(".clearthis").click(function(){
					cleartext(this);
				});
				$(".clearthis").blur(function(){
					cleartext(this);
				});
				
				
				/*var origoffset = 0;
				
				if (type == "home")
					origoffset = 818;
				else
					origoffset = 49

				$("#socnetbar ul li").mouseover(function(){
					var position = $(this).position();
					$("#selector").animate({
						left: origoffset + position.left
						},300);
				});*/
					
}
