﻿jQuery(document).ready(function($){
        $("#menu_comntainer_export2 a").textShadow();
		$(".top_menu a").textShadow();
		$("#accordion h2").textShadow();
		$("#accordion h2.current").textShadow();
    $("#accordion").tabs("#accordion div.pane", {tabs: 'h2', effect: 'slide', initialIndex: activePane});
		$(".scrollable").scrollable();	
    var width_s = screen.width;
	$(".elements").css('width',width_s+'px');
	
	   // $("#hidden_text").hide();

    $("#read_more").click(function(){
	    //$("#hidden_text").css('overflow','visible');
		//$("#hidden_text").animate({	height: "100%"  }, { queue: false, duration: 3000 } );
		$("#hidden_text").css('height','auto');
		$("#shide").hide();        
		$(this).hide();
		return false;
    });
    jQuery("a.highslide").fancybox({
'showCloseButton' : false,
'showNavArrows': false,
'overlayOpacity' : 0,
'titlePosition'  : 'over',
'padding':0,
'cyclic': true,
'scrolling': 'no',
'centerOnScroll':false,
'hideOnOverlayClick': true,
'hideOnContentClick':false
	});
/*    jQuery("a.highslide").click(function()
    {
    $('html,body').scrollTop(0);
    return false;
    });
*/	
$(".one").click(function(){
			
			var q=$('.target option:selected').val();

			if(q == 1)
			{
				$('.target option:first').removeAttr("selected");
				$('.target option:last').attr("selected","selected");
				$(".one").text($('.target option:last').text());
			} else
			  	{
					$('.target option:first').attr("selected","selected");	
					$('.target option:last').removeAttr("selected");
					$(".one").text($('.target option:first').text());
				}
			
		});
});
function clearText(field){
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}
function delText(field, lang){
	if(lang=='en') search = 'Search...'; else search = 'Поиск...';
    obj = document.getElementById(field);    
	obj.value = search;
	searchJS(obj);
}
function checkValid()
{
    name = jQuery('input[name="name"]').val();
    email = jQuery('input[name="email"]').val();
    message = jQuery('textarea[name="message"]').val();
    err = '';
    i=0;
    var patt = /^\w+([\.-]?\w+)*@(((([a-z0-9]{2,})|([a-z0-9][-][a-z0-9]+))[\.][a-z0-9])|([a-z0-9]+[-]?))+[a-z0-9]+\.([a-z]{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/i;
    if((name == USER_DICT_NAME) || (name == ''))
    {   
        if(i++ == 0)
            err += USER_DICT_NAME;
        else
            err += ', ' + USER_DICT_NAME;   
    }
    if(!patt.test(email))
    {
        if(i++ == 0)
            err += USER_DICT_EMAIL;
        else
            err += ', ' + USER_DICT_EMAIL;
    }
    if(message == '')
    {
        if(i++ == 0)
            err += USER_DICT_MESSAGE;
        else
            err += ', ' + USER_DICT_MESSAGE;
    }
    if(err != '')
    {
        err = USER_DICT_FILL_FIELDS + err;
        jQuery('#error_feedback').html(err);
        return false;
    }
    else
    {
        return true;
    }
    
}


