function showzvonok(){
    $('#zpopup').fadeIn(); 
    $("#zpopup").css("z-index", "3000");
    $('.shadow').fadeIn();
    $('.shadow').height($(document).height());    
}

function showrass(){
    $('#rpopup').fadeIn(); 
    $("#rpopup").css("z-index", "3000");
    $('.shadow').fadeIn();
    $('.shadow').height($(document).height());    
}

function showstrax(){
    $('#straxpopup').fadeIn(); 
    $("#straxpopup").css("z-index", "3000");
    $('.shadow').fadeIn();
    $('.shadow').height($(document).height());    
}

function showtar(){
    $('#tarifpopup').fadeIn(); 
    $("#tarifpopup").css("z-index", "3000");
    $('.shadow').fadeIn();
    $('.shadow').height($(document).height());    
}

function showairline(){
    $('#airlinepopup').fadeIn(); 
    $("#airlinepopup").css("z-index", "3000");
    $('.shadow').fadeIn();
    $('.shadow').height($(document).height());    
}


function SearchEvent() {
	var depat0 = outRoundBrackets('otplace');
	var arriv0 = outRoundBrackets('toplace');
	var data = $("#fromz").val();
	recordEvent('Search', depat0 +'-'+arriv0, data);
}

function outRoundBrackets (id) {
	var text = $("#" + id).val();
	var pattern = /\((.*?)\)/g;  
	var text1 = String(text.match(pattern));
	//alert('dep:'+text1.substring(1,4));
	if (text1 !='null') {
		return text1.substring(1,4);
	}
	else return "";
}

function recordEvent(category, action, label) {
//	alert (category+'\r\n'+action+'\r\n'+label);
	var gaURL = (location.href.indexOf('https') == 0 ? 'https://ssl' : 'http://www'); gaURL += '.google-analytics.com/ga.js';
	$.getScript(gaURL, function(){
		try {
		var pageTracker = _gat._getTracker("UA-6547235-1");
		pageTracker._trackEvent(category,  action, label);
  }catch(err){}
  });
}


<!--
// IE
function moveCaretToStart(inputObject)
{
 if (inputObject.createTextRange)
 {
  var r = inputObject.createTextRange();
  r.collapse(true);
  r.select();
 }
}
function moveCaretToEnd(inputObject)
{
 if (inputObject.createTextRange)
 {
  var r = inputObject.createTextRange();
  r.collapse(false);
  r.select();
 }
}

// Mozilla/Gecko
function moveCaretToStart(inputObject)
{
if (inputObject.selectionStart)
{
 inputObject.setSelectionRange(0,0);
 inputObject.focus();
}
}
function moveCaretToEnd(inputObject)
{
if (inputObject.selectionStart)
{
 var end = inputObject.value.length;
 inputObject.setSelectionRange(end,end);
 inputObject.focus();
}
}//-->

function showsbus(idss, lang){
    if(idss>0){
        $('#bus_tur').fadeIn(); 
        $("#bus_tur").css("z-index", "3000");
        $('.shadow').fadeIn();
        $('.shadow').height($(document).height());
            
        $.post("/modules/pages/subactions/setdata_" + lang + ".php", { idss: idss}, function(data){
            $("#opis_kuda").html(data);
        });        
    }    
}
