// JavaScript Document

function ShowHide(id)
{

if (id != '')
 {
  var itm = null;
  if (document.getElementById) { itm = document.getElementById(id); }
  else if (document.all) { itm = document.all[id]; }
  else if (document.layers) { itm = document.layers[id]; }
  
   if (!itm) { /* do nothing */ }
  else if (itm.style)
  {
   if (itm.style.display == "none") { itm.style.display = "";

    

    }
   else { itm.style.display = "none";
  }
  }
  else { itm.visibility = "show";

       }
 }
 
  // id.style.display="visible";
}

function isValidEmail(email) {
    
	re = /^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i;

	return re.test(email);
}
        
        
function makeCheck(address) {
            
        	if (isValidEmail(address)) {
        		return true;
        	} else {
        		return false;
        	}
       return false;
}


function empty( mixed_var ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Philippe Baumann
    // *     example 1: empty(null);
    // *     returns 1: true
 
    return (mixed_var === "" || mixed_var === 0   || mixed_var === "0" || mixed_var === null  || mixed_var === false || mixed_var===undefined);
}

hs.graphicsDir = './images/zoom/';
hs.outlineType = 'outer-glow';


$(document).ready(function() {

	// PNG FIX in IE 5.5 and 6.0
	 $(document).pngFix({ blankgif:'images/pix.gif' });

	$('.main_link').toggle(function() {
		$(this).css({'color':'#FFFFFF', 'text-decoration':'none'});

//		$(this).parents('.de_active').animate({backgroundPosition : '0px 0px'});
		$(this).parents('.de_active').animate({backgroundPosition : '0px 0px'}, 600);
		$(this).next('.sub_level').show('normal');
//		$(this).removeClass('main_link');
//		$(this).addClass('main_link_act');
		var href=$(this).attr('href');
		if (!empty(href)) {
			document.location.href=href;
		}
//		$(this).css({'color':'#FFFFFF', 'text-decoration':'none'});
	
		
	},function() {
		$(this).css({'color': '#0660a3', 'text-decoration':'underline'});
  		$(this).parents('.de_active').css({backgroundPosition : '-232px 0px'});
		$(this).next('.sub_level').hide('normal');
//		$(this).removeClass('main_link_act');
//		$(this).addClass('main_link');
	});
	
	$('.main_link_act').toggle(function() {
		$(this).css({'color': '#0660a3', 'text-decoration':'underline'});
  		$(this).parents('.active').css({backgroundPosition : '-232px 0px'});
		$(this).next('.sub_level_act').hide('normal');
		$(this).addClass('main_link');
		$(this).removeClass('main_link_act');
		
	},function() {
		$(this).css({'color':'#FFFFFF', 'text-decoration':'none'});		
  		$(this).parents('.active').css({backgroundPosition : '0px 0px'});
		$(this).next('.sub_level_act').show('normal');
//		$(this).addClass('main_link_act');
//		$(this).removeClass('main_link');		
	});

	$('#query').focus(function() {
							    $('#query').attr('value', '');
							   }, function() {
								$('#query').attr('value', 'input string for search');	   
							   });
	
	
	$('.slidedown').toggle(function(){
  		$(this).next('.slidedata').slideDown('normal');
	},function(){
  		$(this).next('.slidedata').slideUp('normal');
	});
 
	 
}); // end document ready

   function AddBookmark() {
		window.external.addFavorite('http://www.pana.kz' , '????????? ???????? ???? ????????');
	}
