$hintHandler = false;
$hintDelay = 200;
$(document).ready(function() {
$('input[type=button],input[type=submit]').each(function() {
//
// var $html = ''+
// '
'+
// $(this).html()+
// '
'+
// '';
if ($(this).css('background-image').match('http://www.eurobaltronics.com/images/button.png')) {
$(this).addClass("button");
var style = $(this).attr('style');
$(this).attr('style','border: 0px;');
var css = 'margin-left: '+$(this).css('margin-left')+'; ';
css += 'margin-right: '+$(this).css('margin-right')+'; ';
css += 'margin-top: '+$(this).css('margin-top')+'; ';
css += 'margin-bottom: '+$(this).css('margin-bottom')+'; ';
css += 'padding-left: '+$(this).css('padding-left')+'; ';
css += 'padding-right: '+$(this).css('padding-right')+'; ';
css += 'padding-top: '+$(this).css('padding-top')+'; ';
css += 'padding-bottom: '+$(this).css('padding-bottom')+'; ';
//alert(css);
$(this).wrap('');
$('
').insertBefore(this);
$('
').insertAfter(this);
$(this).css({backgroundImage: 'url("/images/mgb.png")', backgroundRepeat: 'repeat-x', margin: '0px', padding: '0px', width: 'auto'});
}
});
$('#fSearch .options INPUT').bind("change", function() {
if ($hintHandler) { clearTimeout($hintHandler); }
$hintHandler = setTimeout("makeSearch()", $hintDelay);
});
$('#search').keyup(function() {
if ($hintHandler) { clearTimeout($hintHandler); }
$hintHandler = setTimeout("makeSearch()", $hintDelay);
});
$('body').click(function(event) {
if ((event.target.className != 'line') && (event.target.className != 'search_results')) {
$('#fSearch .ajax').css('display','none');
}
});
$(document).keypress(function(event) {
if (event.keyCode == 27) {
$('#fSearch .ajax').css('display','none');
}
});
$('#sLogin').blur(function() {
if (this.value == '') {
this.value = 'Login';
}
});
$('#sLogin').click(function() {
this.value = '';
});
$('#sPassword').blur(function() {
if (this.value == '') {
this.value = 'password'
}
});
$('#sPassword').focus(function() {
this.value = '';
});
});
function makeSearch() {
if ($('#search').attr('value').length > 2) {
jQuery.get('/in_site/tools/search.php', $('#fSearch').serialize(), function (data) {
if (data && ($('#search').attr('value').length > 2)) {
$('.ajax').html(data);
$('.ajax .line').hover(
function(){ $(this).addClass("hover"); },
function(){ $(this).removeClass("hover"); }
)
$('.ajax').css('display', 'block');
if ($('.ajax .line').length == 1) {
// vsego 1 rezultat, znachit po SUBMIT-u nado perehoditj na nego!
var $href = $('.ajax .line A.search_title').attr("href");
$('#fSearch').submit(function () {
document.location.href = $href;
return false;
});
$('.ajax').css('display', 'block');
return false;
} else {
$('#fSearch').submit(function () {
this.submit();
});
}
} else {
$('.ajax').css('display', 'none');
}
}, 'html');
} else {
$('.ajax').css('display', 'none');
}
}
/*!
* jQuery Tools v1.2.6 - The missing UI library for the Web
*
* tooltip/tooltip.js
*
* NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
*
* http://flowplayer.org/tools/
*
*/
(function(a){a.tools=a.tools||{version:"v1.2.6"},a.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,fadeIE:!1,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"