$(function() { $("#tabscolo").tabs(); }); function prepocet(){ if ($('#currency').val()=='2') $('#prep1').html('Informatívna hodnota: '+Math.round($('#credsum').val()*(25.733)*100)/100+' CZK'); else $('#prep1').html('Informatívna hodnota: '+Math.round($('#credsum').val()/(25.733)*100)/100+' kreditov'); } $(function() { $("#smsdialog").dialog({ bgiframe: true, hide: {effect:"puff",options:{direction:"down"},speed:2000} , resizable: false, autoOpen: false, height: 400, width:600, modal: false, buttons: { 'Zavrieť': function() { $(this).dialog('close'); } }, close: function() { return false; } }); }); $(function() { $("#dialog_kredit").dialog({ bgiframe: true, hide: {effect:"puff",options:{direction:"down"},speed:2000} , resizable: false, autoOpen: false , height: 320, width:540, title:'Navýšiť kredit', modal: true, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { 'Navýšiť kredit': function() { $("#dialog_kredit_info").html(' '); if (document.getElementById("dialog_kredit_OK")) ($("#dialog_kredit_info").html('
')) else $("#dialog_kredit_data").load (encodeURI('/inc/ajax_predfaktura.php' +"?credsum="+$("#credsum").val() +"¤cy="+$("#currency").val() +"&sid="+Math.random() )) }, 'Zavrieť': function() { $(this).dialog('close'); } } }); }); $(function() { $("#dialogecho").dialog({ bgiframe: true, hide: {effect:"puff",options:{direction:"down"},speed:2000} , resizable: false, autoOpen: true, height: 160, width:450, modal: true, overlay: { backgroundColor: '#000', opacity: 0.5 }, buttons: { 'Zavrieť': function() { $(this).dialog('close'); } } }); }); $(function() { $(".click").editable("/inc/ajax_editable.php", { indicator : "
",
tooltip : "Click to edit...",
submit : "OK",
cssclass : "editable",
tooltip : "Kliknite pre zmenu hodnoty...",
style : "inherit"
});
});
$(function() {
$("#dialog_save").dialog({
bgiframe: true,
resizable: false,
autoOpen: false,
height: 380,
width:500,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
modal: true,
buttons: {
'Uložiť preferenciu ': function() {
var link=$("#preferenceurl").val();;
link2=link.replace(/&/g, "%xxx");
$("#dialog_saved").load
( encodeURI('/inc/ajaxsavepref.php'
+"?name="+$("#name").val()
+"&preference="+link2
+"&news="+$("#news").val()
+"&public="+$("#public").val()
+"&celkom="+$("#divcelkom").html()
+"&sid="+Math.random()
), function() {setTimeout('if($("#dialog_save").dialog("isOpen")) $( "#dialog_save" ).dialog( "close" )', 2000);}
);
//$(this).dialog('close');
},
'Zavrieť': function() {
$(this).dialog('close');
}
},
close: function() { $("#message_info_block1sp").hide();
}
});
});
function zmenreklamu(){
$("#leftadds").load('/reklama/search_'+$('#kategoria').val()+'.php');
}
function ppsinfo()
{
if ($('#ppsinfo').html()=="Posledné príspevky") $('#ppsinfo').html("Posledné témy");
else $('#ppsinfo').html("Posledné príspevky");
}
$(function() {
$("#dialog_alertus").dialog({
bgiframe: true,
resizable: false,
autoOpen: false,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
height: 370,
width:500,
modal: true,
buttons: {
'Zavrieť': function() {
$(this).dialog('close');
},
'Odoslať upozornenie adminovi ': function() {
$("#dialog_alertus").load
(encodeURI('/inc/ajaxalertus.php'
+"?email="+$("#aus_email").val()
+"&sprava="+$("#aus_note").val()
+"&kod="+$("#aus_kod").val()
+"&input="+$("#aus_input").val()
+"&sid="+Math.random()
))
}
},
close: function() {
}
});
});
$(function() {
$('#checkAllAuto').click(
function()
{
if ($('#checkAllAutoTxt').html()=="Vyber všetko") $('#checkAllAutoTxt').html("Odznač všetko");
else $('#checkAllAutoTxt').html("Vyber všetko");
if ($('#checkAllAuto').attr("title")=="Pridá do výberu všetky zobrazené inzeráty") $('#checkAllAuto').attr("title", "Odznačí všetky vybrané inzeráty");
else $('#checkAllAuto').attr("title", "Pridá do výberu všetky zobrazené inzeráty");
$("INPUT[type='checkbox']").attr('checked', $('#checkAllAuto').is(':checked'));
}
)
});
function CreateBookmarkLink() {
title = "Autobazar.EU";
url = "http://kupimauto.sk";
if (window.sidebar) {
// Mozilla Firefox Bookmark
window.sidebar.addPanel(title, url,"");
} else if( window.external ) {
// IE Favorite
window.external.AddFavorite(location.href, document.title)
}
else if(window.opera && window.print) {
// Opera Hotlist
return true; }
}
function SetCookie(cookieName,cookieValue,nDays) {
var today = new Date();
var expire = new Date();
if (nDays==null || nDays==0) nDays=1;
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie = cookieName+"="+escape(cookieValue)+";path=/"+";domain=.kupimauto.sk"+";expires="+expire.toGMTString();
}
$(function() {
$("#dialog_msg").dialog({
bgiframe: true,
resizable: false,
autoOpen: false,
height: 230,
width:450,
modal: true,
buttons: {
'Zavrieť': function() {
$(this).dialog('close');
}
}
});
});
$(function() {
$("#colorpickerdiv").dialog({
bgiframe: true,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
resizable: false,
autoOpen: false,
height: 560,
width: 660,
modal: true,
overlay: {
backgroundColor: '#000',
opacity: 0.5
},
buttons: {
'Zavrieť': function() {
//alert('zmenim farbu');
var red = $("#red").slider("value"),green = $("#green").slider("value"),blue = $("#blue").slider("value")
,hex = "#" + hexFromRGB(red, green, blue);
//pozadie
$("body").css("background-color", hex);
hex2=hex.replace("#","");
SetCookie("bodycolor",hex2,365);
//normal font
var red = $("#red2").slider("value"),green = $("#green2").slider("value"),blue = $("#blue2").slider("value"),hex = "#" + hexFromRGB(red, green, blue);
$("#top_bar").css("color", hex); $(".cesta").css("color", hex);
hex2=hex.replace("#",""); SetCookie("bodyfont1",hex2,365);
//bold font
var red = $("#red3").slider("value"),green = $("#green3").slider("value"),blue = $("#blue3").slider("value"),hex = "#" + hexFromRGB(red, green, blue);
$("#top_bar >#lang_bar strong").css("color", hex);$("#classic_footer").css("color", hex); $("#top_bar >#lang_bar strong").css("color", hex);
hex2=hex.replace("#",""); SetCookie("bodyfont2",hex2,365);
//link color
var red = $("#red4").slider("value"),green = $("#green4").slider("value"),blue = $("#blue4").slider("value"),hex = "#" + hexFromRGB(red, green, blue);
$("#classic_footer > a ").css("color", hex); $(".loggeduser > a").css("color", hex);$("#pathway_bar > h1").css("color", hex); $("#pathway_bar > h1 > a").css("color", hex);
$(".pathway_heading").css("color", hex);
$(".cloud > a:link").css("color", hex);$(".cloud > a:visited").css("color", hex); $(".rss a").css("color", hex); $(".rsstitle a").css("color", hex);
$("#tickercolor").html(hex);
hex2=hex.replace("#",""); SetCookie("bodyfont3",hex2,365);
$(this).dialog('close');
}
}
});
});
function h2d(h) {return parseInt(h,16);}
function hexFromRGB (r, g, b) {
var hex = [
r.toString(16),
g.toString(16),
b.toString(16)
];
$.each(hex, function (nr, val) {
if (val.length == 1) {
hex[nr] = '0' + val;
}
});
return hex.join('').toUpperCase();
}
function refreshSwatch() {
var red = $("#red").slider("value")
,green = $("#green").slider("value")
,blue = $("#blue").slider("value")
,hex = hexFromRGB(red, green, blue);
$("#swatch").css("background-color", "#" + hex);
var red = $("#red2").slider("value"),green = $("#green2").slider("value"),blue = $("#blue2").slider("value"),hex = hexFromRGB(red, green, blue);
$("#swatchtext1").css("color", "#" + hex);
var red = $("#red3").slider("value"),green = $("#green3").slider("value"),blue = $("#blue3").slider("value"),hex = hexFromRGB(red, green, blue);
$("#swatchtext2").css("color", "#" + hex);
var red = $("#red4").slider("value"),green = $("#green4").slider("value"),blue = $("#blue4").slider("value"),hex = hexFromRGB(red, green, blue);
$("#swatchtext3").css("color", "#" + hex);
}
$(function() {
$("#dialog_friend").dialog({
bgiframe: true,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
resizable: false,
autoOpen: false,
height: 480,
width:500,
modal: true,
buttons: {
'Zavrieť': function() {
$(this).dialog('close');
},
'Odoslať priateľovi': function() {
$("#dialog_friend").load
(encodeURI('/inc/ajaxmailfriend.php'
+"?name="+$("#friend_name").val()
+"&email="+$("#friend_email").val()
+"&emailto="+$("#friend_emailto").val()
+"&predmet="+$("#friend_predmet").val()
+"&sprava="+$("textarea#friend_sprava").val()
+"&kod="+$("#friend_kod").val()
+"&sid="+Math.random()
), function() { })
//$(this).dialog('close');
}
},
close: function() {
}
});
});
$(function() {
$("#dialog_pdf").dialog({
bgiframe: true,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
resizable: false,
autoOpen: false,
height: 450,
width:500,
modal: true,
buttons: {
'Zavrieť': function() {
$(this).dialog('close');
},
'Exportovať do PDF súboru': function() {
$("#dialog_pdf").load
(encodeURI('/inc/ajaxpdfvozidla.php'
+"?choice="+$('input[name=pdf_choice]:checked').val()
+"&kod="+$("#kodpdf").val()
+"&idpdf="+$("#idpdf").val()
+"&sprava="+$("#pdf_note").val()
+"&sid="+Math.random()
), function() {})
}
},
close: function() {
}
});
});
$(function() {
$("#dialog_admin").dialog({
bgiframe: true,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
resizable: false,
autoOpen: false,
height: 550,
width:500,
modal: true,
buttons: {
'Zavrieť': function() {
$(this).dialog('close');
},
'Upozorniť administrátora': function() {
$("#dialog_admin").load
(encodeURI('/inc/ajaxmailadmin.php'
+"?email="+$("#admin_email").val()
+"&sprava="+$("#admin_note").val()
+"&choice="+$('input[name=admin_choice]:checked').val()
+"&kod="+$("#admin_kod").val()
+"&idz="+$("#admin_id_inz").val()
+"&sid="+Math.random()
), function() {})
}
},
close: function() {
}
});
});
$(function() {
$("#dialog_rate").dialog({
bgiframe: true,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
resizable: false,
autoOpen: false,
height: 580,
width:570,
modal: true,
buttons: {
'Zavrieť': function() {
$(this).dialog('close');
},
'Hodnotiť': function() {
$("#dialog_rate").load
(encodeURI('/inc/ajaxrate.php'
+"?sprava="+$("#rate_note").val()
+"&choice="+$('input[name=rate_choice]:checked').val()
+"&kod="+$("#rate_kod").val()
+"&idra="+$("#idra").val()
+"&whom="+$("#whom").val()
+"&sid="+Math.random()
), function() {})
}
},
close: function() {
}
});
});
$(function() {
$("#dialog_kontakt").dialog({
bgiframe: true,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
resizable: false,
autoOpen: false,
height: 480,
width:500,
modal: true,
buttons: {
'Zavrieť': function() {
$(this).dialog('close');
},
'Odoslať správu predajcovi': function() {
$("#dialog_kontakt").load
(encodeURI('/inc/ajaxmailpredajca.php'
+"?name="+$("#predaj_name").val()
+"&email="+$("#predaj_email").val()
+"&tel="+$("#predaj_tel").val()
+"&idp="+$("#idp").val()
+"&otazka="+$("textarea#predaj_otazka").val()
+"&kod="+$("#predaj_kod").val()
+"&nazov="+$("#nazov").val()
+"&menopredajcu="+$("#menopredajcu").val()
+"&emailpredajcu="+$("#emailpredajcu").val()
+"&sid="+Math.random()
), function() {})
//$(this).dialog('close');
}
},
close: function() {
}
});
});
$(function() {
$("#dialog_mapa").dialog({
bgiframe: true,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
resizable: false,
autoOpen: false,
height: 520,
width:680,
modal: true,
overlay: {
backgroundColor: '#000',
opacity: 0.5
},
buttons: {
'Zavrieť': function() {
$(this).dialog('close');
}
}
});
});
$(function() {
$("#dialog_cena").dialog({
bgiframe: true,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
resizable: false,
autoOpen: false,
height: 480,
width:500,
modal: true,
buttons: {
'Zaslať cenovú ponuku': function() {
$("#dialog_cena").load
(encodeURI('/inc/ajaxmailcena.php'
+"?name="+$("#cena_name").val()
+"&email="+$("#cena_email").val()
+"&tel="+$("#cena_tel").val()
+"&idc="+$("#idc").val()
+"&mena="+$("#mena").val()
+"&cena="+$("#cena_cena").val()
+"&kod="+$("#cena_kod").val()
+"&nazov="+$("#nazovc").val()
+"&menopredajcu="+$("#menocena").val()
+"&emailcena="+$("#emailcena").val()
+"&sid="+Math.random()
), function() {})
},'Zavrieť': function() {
$(this).dialog('close');
}
},
close: function() {
}
});
});
$(function() {
$("#dialog_bezpecnost").dialog({
bgiframe: true,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
resizable: false,
autoOpen: false,
height: 400,
width:600,
modal: false,
buttons: {
'Zavrieť': function() {
$(this).dialog('close');
}
},
close: function() {
return false;
}
});
});
$(function() {
$("#dialog_add").dialog({
bgiframe: true,
hide: {effect:"puff",options:{direction:"down"},speed:2000} ,
resizable: false,
autoOpen: false,
height: 300,
width:500,
modal: false,
buttons: {
'Zavrieť': function() {
$(this).dialog('close');
},
'OK': function() {
document.getElementById('formular').submit();
$(this).dialog('close');
}
},
close: function() {
return false;
}
});
});