	hs.graphicsDir = '/highslide/graphics/';
	hs.align = 'center';
	hs.transitions = ['expand', 'crossfade'];
	hs.wrapperClassName = 'wide-border';
	hs.fadeInOut = true;
	hs.dimmingOpacity = .75;
    hs.loadingText = 'Ielādē...';
    hs.closeTitle = 'Aiavērt';
	hs.fullExpandTitle  = 'Palielināt attēlu';
	hs.loadingTitle  = 'Spiest lai atceltu';
	hs.focusTitle  = 'Spiest lai izvirzītu uz priekšu';
	hs.creditsText  = '';
	hs.creditsTitle  = '';
	hs.previousText  = 'Iepriekšējā';
	hs.nextText  = 'Nākošā';
	hs.moveText  = 'Pārvietot';
	hs.closeText  = 'Aivērt';
	hs.closeTitle  = 'Aizvērt (esc)';
	hs.resizeTitle  = 'Mainīt izmēru';
	hs.playText  = 'Sākt spēlēt';
	hs.playTitle  = 'Spēlēt (spacebar)';
	hs.pauseText  = 'Pause';
	hs.pauseTitle  = 'Sākt spēlēt  (spacebar)';
	hs.previousTitle  = 'Iepriekšējā (arrow left)';
	hs.nextTitle  = 'Nākošā (arrow right)';
	hs.moveTitle  = 'Pārvietot';
	hs.fullExpandText  = 'Pilnais izmērs';
	hs.number = 'Attēls %1 no %2';
	hs.restoreTitle  = '';

	// Add the controlbar
	if (hs.addSlideshow) hs.addSlideshow({
		//slideshowGroup: 'group1',
		interval: 5000,
		repeat: false,
		useControls: true,
		fixedControls: 'fit',
		overlayOptions: {
			opacity: .6,
			position: 'bottom center',
			hideOnMouseOut: true
		}
	});

jQuery(document).ready(function() {
      jQuery('#userpassword').keypress(function(e) {
          if(e.which == 13) {
              jQuery(this).blur();
              jQuery('#submit').focus().click();
          }
      });

      jQuery('.bannertracker').click(function(e) {
        link = '/bannertracker.php?tracker='+this.id;
        dataString = '';
		jQuery.ajax({
            type: "POST",
            data: dataString,
            url: link,
            success: function(data) {
            }
        });
    });

    jQuery(".member_photo img").hover(function(){
        jQuery(this).animate({
            opacity: 0.70
        }, 500);
    });

    jQuery(".member_photo img").mouseout(function(){
         jQuery(this).animate({
            opacity: 1
        }, 500);
    });

})

function deleteRow(item_id) {
    jQuery('#'+item_id).fadeOut('slow',function(){
        jQuery.post('/'+language+'/profils/action/delete/',{ F_ID_ACTION: item_id });
    });
}

function editRow(item_id) {
    jQuery('#'+item_id).children(".action_text").css("background-color","white");
}

function saveRow(item_id) {
    jQuery('#'+item_id).children(".action_text").css("background-color","#F5F5F5");
        var actionText = jQuery('#'+item_id).children(".action_text").html();
        jQuery.post('/'+language+'/profils/action/edit/'+item_id+'/',{ F_TEXT: actionText }, function(data) {
          jQuery("#"+item_id).children(".action_text").html(data);
          jQuery("#"+item_id).children(".action_text").children(".item_saved").fadeOut("slow", function(){
               jQuery(this).html(''); // ie6 hacks
          });
    });
}


function genpasts(prefix,postfix)
{
	if (prefix!='' && postfix!='')
	{
		var pasts=prefix;
			pasts=pasts+'@';
			pasts=pasts+postfix;

		document.write('<a href="mailto:'+pasts+'"  <font>'+pasts+'</font></a>');
	}
	else document.write('-');
}

function questionSubmit(l){
    var dataString = jQuery('#applicationform').serialize();

    jQuery('#question_loading').show();
        jQuery.ajax({
            type:'post',
            data: dataString,
            url:'/'+language+'/questions/',
            success: function (data) {
                 jQuery("#questionFormDiv").html(data);
                 jQuery('#question_loading').hide();
              }
            }
        );
}

function page(l){
    var notice = $('contentRefresh');
    $('templates_loading').show();
        var url = SERVER_URL+'gallery/?l='+ l +'&b=1';
        //alert(url);
        var aj = new Ajax.Request(
            url, {
            method:'get',
            onCreate: function(){
              notice.innerHTML = '';
            },
            //parameters: $("questionForm").serialize(),
            onSuccess: function (transport) {
                 var transport_text = transport.responseText;
                 notice.innerHTML = transport_text;
                 $('templates_loading').hide();
              }
            }
        );
}

function submitSmallLogin() {
    var dataString = jQuery('#loginForm').serialize();
    //alert(dataString);
    jQuery('#login_small').hide();
    jQuery('#login_loading').show();
        jQuery.ajax({
            type:'post',
            data: dataString,
            url:'/'+language+'/login/small/',
            success: function (data) {
                 jQuery("#login_small").html(data);
                 jQuery('#login_loading').hide();
                 jQuery('#login_small').show();
              }
            }
        );
}

function submitLargeLogin() {
    var dataString = jQuery('#loginLargeForm').serialize();
    //jQuery('#login_small').hide();
    jQuery('#login_loading_circle').show();
        jQuery.ajax({
            type:'post',
            data: dataString,
            url:'/'+language+'/login/large',
            success: function (data) {
                 jQuery("#login_content").html(data);
                 jQuery('#login_loading_circle').hide();
                 //jQuery('#login_').show();
              }
            }
        );
}


function passwordReset() {
   var dataString = jQuery('#passwordResetForm').serialize();
    //jQuery('#login_small').hide();
    //jQuery('#login_loading').show();
        jQuery.ajax({
            type:'post',
            data: dataString,
            url:'/'+language+'/login/password_reset/',
            success: function (data) {
                 jQuery("#login_content").html(data);
                 //jQuery('#login_loading').hide();
                 //jQuery('#login_small').show();
              }
            }
        );
}

function addToCart() {
   var dataString = jQuery('#gym_form').serialize();
        jQuery.ajax({
            type:'post',
            data: dataString,
            url:'/'+language+'/cart/add/',
            success: function (data) {
                 jQuery("#cart_wrapper").html(data);
              }
            }
        );
}

function deleteFromCart(item) {
   var dataString = jQuery('#cart_form').serialize();
   var in_cart;
   //alert('/'+language+'/cart/delete/'+item+'/');
        jQuery.ajax({
            type:'post',
            data: dataString,
            url:'/'+language+'/cart/delete/'+item+'/',
            success: function (data) {
                 jQuery("#cart_details").html(data);
                 in_cart = jQuery("#cart_counter").attr("title");
                 in_cart = in_cart-1;
                 if (in_cart<1) in_cart = '0';
                 jQuery("#cart_counter").attr("title",in_cart);
                 jQuery("#cart_counter").html(in_cart);
              }
            }
   );
}

function userImageDelete() {
  var dataString = jQuery('#profileForm').serialize();
        jQuery.ajax({
            type:'post',
            data: dataString,
            url: '/'+language+'/profils/delete_profile_image/',
            success: function (data) {
                 jQuery("#swfuContent").html(data);
              }
            }
        );
}

function submitcomment(){

        var dataString = jQuery('#commForm').serialize();
        var link = jQuery('#link').val();

        jQuery('#commentform').height(jQuery('#commentform').height());
        jQuery('#commentform').html("");

        jQuery('#commentform').addClass("loadingcommentform");

        jQuery.ajax({
            type: "POST",
            url: "/"+language+"/news/",
            data: dataString,
            success: function(data) {
                if(data=='1'){
                    window.location.reload();
                }else{
                    jQuery('#commentform').html(data);
                    jQuery('#commentform').height('');
                    jQuery('#commentform').removeClass("loadingcommentform");
                }
            }
        });
}

function saveProfile() {
    var dataString = jQuery('#profileForm').serialize();
        jQuery.ajax({
            type:'post',
            data: dataString,
            url:'/'+language+'/profils/save/',
            success: function (data) {
                 jQuery("#profile_edit").html(data);
              }
            }
        );
}

function addUserAction() {
   if (jQuery("#F_ACTION").val()=='') {
     alert('Aizpildiet ievadlauku!');
     return false;
   }
   var dataString = jQuery('#actionPerform').serialize();
        jQuery.ajax({
            type:'post',
            data: dataString,
            url:'/'+language+'/profils/action/add/',
            success: function (data) {
                 //jQuery.get('http://localhost:91/jvs/profile.js');
                 jQuery("#action_list").html(data);
                 jQuery("#F_ACTION").val('');
              }
            }
   );
}

function submitRegister() {
   jQuery("#registrationForm").submit();
}



    /*jQuery.post('/'+language+'/profils/action/delete/',{ F_ID_ACTION: id_action }, function(data) {
        jQuery("#action_list").html(data);
        jQuery(".item_saved").fadeOut("slow", function(){
        jQuery(this).html(''); // ie6 hacks
    });*/









