jQuery(document).ready(function($) {

    var config = {
         timeout: 10
    };

    $(function () {
        
         // z index fix
    $(function() {
            var zIndexNumber = 1000;
            $('div').each(function() {
                    $(this).css('zIndex', zIndexNumber);
                    zIndexNumber -= 10;
            });
    });
    
        $('.dropdown').each(function () {
            $(this).parent().eq(0).hoverIntent(function () {                       
                                
                $(this).addClass('activemenu');                
                $('.dropdown:eq(0)', this).show();
            }, function () {                
                $(this).removeClass('activemenu');
                $('.dropdown:eq(0)', this).hide();
            });
        });
    });
});

function changeFrom(typ) {
    $('#aph').val(typ);
    if(typ=='BTS,VIE,BUD,PRG') {
    	    	
    	$('#tocid').val('');
			$('#rgc').hide();
			$('#rgc').attr('disabled',true);
    	$('#rgc').attr('id','rgc_small');
    	
			$('#rgc_full').show();
			$('#rgc_full').attr('disabled',false);
    	$('#rgc_full').attr('id','rgc');
    	
		} else if(typ=='BTS,KSC,SLD') {
		
		  $('#tocid').val('RUE1');
			$('#rgc').hide();
			$('#rgc').attr('disabled',true);
    	$('#rgc').attr('id','rgc_full');
    	
			$('#rgc_small').show();
			$('#rgc_small').attr('disabled',false);
    	$('#rgc_small').attr('id','rgc');
		
		}
}

function changeType(typ) {
    $('#typid').val(typ);
    $("#lmininp").remove();
}

function changeSub(typ) {
    var element = $('#lmininp').length; // no element found    
    if(element=='0') {    
        $("#lmin").append("<input type=\"hidden\" id=\"lmininp\" name=\"lastmin\" value=\"1\"/>");
    } else if(element=='1') {
        $('#lmin').remove();
    }
}

function doCaptcha() {
   $('#captcha').val(5);
}
