function other_shop_over(row_id){ $('#shop_row_'+row_id+'_1').css('border-color','#e8f7a2'); $('#shop_row_'+row_id+'_2').css('background-color','#e8f7a2'); $('#shop_row_'+row_id+'_2').css('border-color','#e8f7a2'); } function other_shop_out(row_id){ $('#shop_row_'+row_id+'_1').css('border-color','#e8f7a2'); $('#shop_row_'+row_id+'_2').css('background-color','#cfe75c'); $('#shop_row_'+row_id+'_2').css('border-color','#cfe75c'); $('#shop_row_'+row_id+'_2').css('color','#FF5400'); $('#shop_row_'+row_id+'_2_link').css('color','#585858'); $('#shop_row_'+row_id+'_2_link').css('text-decoration','none'); } function other_shop_source_over(row_id){ $('#source_row_'+row_id+'_2').css('background-color','#cbeef0'); $('#source_row_'+row_id+'_2').css('border-color','#cbeef0'); $('#source_row_'+row_id+'_2').css('color','#585858'); $('#source_row_'+row_id+'_2_link').css('color','#585858'); $('#source_row_'+row_id+'_2_link').css('text-decoration','none'); } function other_shop_source_out(row_id){ $('#source_row_'+row_id+'_2').css('background-color','#bde7e9'); $('#source_row_'+row_id+'_2').css('border-color','#bde7e9'); $('#source_row_'+row_id+'_2').css('color','#585858'); $('#source_row_'+row_id+'_2_link').css('color','#585858'); $('#source_row_'+row_id+'_2_link').css('text-decoration','none'); } function add_product_link_form(product_id){ if(product_id>0){ $('#add_link_form_err').html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_add_link_form.php', data: "product_id="+product_id, success: function(msg){ $('#add_link_form_err').html(''); $('#add_link_form').html(msg); } }); } } function add_product_link_submit(product_id){ if(product_id>0){ $('#add_link_form_err').html(''); var shop_name = $('#shop_name').val(); var link_to_shop = $('#link_to_shop').val(); var price = $('#price').val(); var wrzuc_link_submit = $('#wrzuc_link_submit').val(); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_add_link_submit.php', data: "product_id="+product_id+"&wrzuc_link_submit="+wrzuc_link_submit+"&price="+price+"&link_to_shop="+link_to_shop+"&shop_name="+shop_name, success: function(msg){ if(msg=='ok'){ $('#add_link_form_err').html('Twój link został dodany, wkrótce pojawi się na stronie produktu'); $('#add_link_form').html(''); }else{ $('#add_link_form_err').html(msg); } } }); } } function create_new_link(){ var obj = document.getElementById('no_of_links'); var obj2 = document.getElementById('links_list'); var obj3 = document.getElementById('max_no_of_links'); if (obj){ var no = obj.value; var link = document.getElementById('link_'+no+'').value; var linkname = document.getElementById('linkname_'+no+'').value; if (link.length==0){ alert('Podaj link nr '+no+'!'); return false; } if (no == obj3.value){ alert("Podałeś zbyt dużo linków. Możesz podać maksymalnie ("+obj3.value+") linki!"); return false; } no++; var row = ''; //var row = ''; var newli = document.createElement('li'); newli.setAttribute('class','links_list'); newli.innerHTML = row; document.getElementById('links_list').appendChild(newli); obj.value = no; } } function create_new_link2(){ var obj = document.getElementById('no_of_links'); var obj2 = document.getElementById('links_list'); if (obj){ var no = parseInt(obj.value); no++; var row = ''; //var row = ''; var newli = document.createElement('li'); newli.setAttribute('class','links_list'); newli.innerHTML = row; document.getElementById('links_list').appendChild(newli); obj.value = no; } } function remove_link(no){ var links = new Array(); var obj = document.getElementById('no_of_links'); j = 0; for (i=1; i<=obj.value; i++){ if (i != no){ var link = document.getElementById('link_'+i+'').value; var linkname = document.getElementById('linkname_'+i+'').value; links[j] = new Array(link, linkname); j++; } } document.getElementById('links_list').innerHTML = ''; obj.value = 0; for (i=0; iAnuluj'); } function hide_add_user_comment(comment_id){ $('#user_comments_add_'+comment_id).css('display', 'none'); $('#user_comments_reply_'+comment_id).html('Odpowiedz'); } function add_user_comment(user_id, comment_id){ var message = $('#comment_message_'+comment_id).val(); if(user_id>0 && message!=''){ $('#comment_err_'+comment_id).html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_add_user_comment.php', data: "user_id="+user_id+"&comment_id="+comment_id+"&message="+message, success: function(msg){ $('#comment_message_'+comment_id).val(''); $('#comment_err_'+comment_id).html(msg); $('#user_comments_add_'+comment_id).css('display', 'none'); $('#user_comments_reply_'+comment_id).html('Odpowiedz'); update_user_comments_no(user_id) display_user_comments(user_id,comment_id); } }); } } function update_user_comments_no(user_id){ if(user_id>0){ $('#comments_no').html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_get_user_comment_no.php', data: "user_id="+user_id, success: function(msg){ $('#comments_no').html(msg); } }); } } function display_user_comments(user_id,comment_id){ if(user_id>0){ $('#all_comments_list_'+comment_id).html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_display_user_comments.php', data: "user_id="+user_id+"&comment_id="+comment_id, success: function(msg){ $('#all_comments_list_'+comment_id).html(msg); } }); } } function pogratuluj(profile_id){ if(profile_id>0){ $('#gratulacje_number').html; jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_pogratuluj.php', data: "profile_id="+profile_id, success: function(msg){ $('#gratulacje_number').html(msg); } }); } } function podaj_lape(profile_id){ if(profile_id>0){ $('#podaj_lape_number_err').html; jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_podaj_lape.php', data: "profile_id="+profile_id, success: function(msg){ $('#podaj_lape_number_err').html(msg); } }); } } function share_product(product_id, nlink, ntitle){ $('#share_'+product_id).bookmark({url: nlink,title:ntitle, compact:false}); } function add_comment(product_id, comment_id){ var message = $('#comment_message_'+comment_id).val(); if(product_id>0 && message!=''){ $('#comment_err_'+comment_id).html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_add_comment.php', data: "product_id="+product_id+"&comment_id="+comment_id+"&message="+message, success: function(msg){ $('#comment_message_'+comment_id).val(''); $('#comment_err_'+comment_id).html(msg); $('#product_comments_add_'+comment_id).css('display', 'none'); $('#product_comments_reply_'+comment_id).html('Odpowiedz'); update_product_comments_no(product_id) display_products_comments(product_id,comment_id); } }); } } function update_product_comments_no(product_id){ if(product_id>0){ $('#comments_no').html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_get_product_comment_no.php', data: "product_id="+product_id, success: function(msg){ $('#comments_no').html(msg); } }); } } function display_products_comments(product_id,comment_id){ if(product_id>0){ $('#all_comments_list_'+comment_id).html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_display_products_comments.php', data: "product_id="+product_id+"&comment_id="+comment_id, success: function(msg){ $('#all_comments_list_'+comment_id).html(msg); } }); } } function add_to_favourite(product_id){ if(product_id>0){ $('#product_info_err_'+product_id).html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_add_to_favourite.php', data: "product_id="+product_id, success: function(msg){ $('#product_info_err_'+product_id).html(msg); $('#product_fave_'+product_id).html(''); } }); } } function remove_from_favourite(product_id){ if(product_id>0){ $('#product_info_err_'+product_id).html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_remove_from_favourite.php', data: "product_id="+product_id, success: function(msg){ $('#product_info_err_'+product_id).html(msg); $('#product_fave_'+product_id).html(''); } }); } } function add_to_favourite_det(product_id){ if(product_id>0){ $('#product_info_err_'+product_id).html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_add_to_favourite.php', data: "product_id="+product_id, success: function(msg){ $('#product_info_err_'+product_id).html(msg); $('#product_fave_'+product_id).html(' '); } }); } } function remove_from_favourite_det(product_id){ if(product_id>0){ $('#product_info_err_'+product_id).html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_remove_from_favourite.php', data: "product_id="+product_id, success: function(msg){ $('#product_info_err_'+product_id).html(msg); $('#product_fave_'+product_id).html(' '); } }); } } function copy_details_to_shipping(){ if( document.getElementById('copy_to_shipping').checked ){ var first_name = $('#user_first_name').val(); $('#shipping_first_name').val(first_name); var surname = $('#user_surname').val(); $('#shipping_surname').val(surname); var address = $('#user_address').val(); $('#shipping_address').val(address); var address_2 = $('#user_address_2').val(); $('#shipping_address_2').val(address_2); var address_3 = $('#user_address_3').val(); $('#shipping_address_3').val(address_3); var postcode = $('#user_postcode').val(); $('#shipping_postcode').val(postcode); var city = $('#user_city').val(); $('#shipping_city').val(city); var tel1 = $('#user_tel1').val(); $('#shipping_tel1').val(tel1); }else{ $('#shipping_first_name').val(''); $('#shipping_surname').val(''); $('#shipping_address').val(''); $('#shipping_address_2').val(''); $('#shipping_address_3').val(''); $('#shipping_postcode').val(''); $('#shipping_city').val(''); $('#shipping_tel1').val(''); } } function basket_update_quantity(bid, product_id, action){ if(product_id>0){ var no_of_p = $('#product_quantity_'+bid).val(); if(no_of_p>0){ var data_var = "bid="+bid+"&product_id="+product_id+"&action="+action; if(action=='up'){ no_of_p = Number(no_of_p) + Number(1); $('#product_quantity_'+bid).val(no_of_p); } else if( action=='down' || action=='del' ){ no_of_p = Number(no_of_p) - Number(1); $('#product_quantity_'+bid).val(no_of_p); } jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_basket_update_quantity.php', data: data_var, success: function(msg){ display_basket_page(); display_basket_box(); } }); } } } function add_to_basket(product_id, product_quantity){ if(product_quantity>0){ $('#basket_box').html(''); $('#product_info_err_'+product_id).html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_add_to_basket.php', data: "product_id="+product_id+"&product_quantity="+product_quantity, success: function(msg){ display_basket_box(); $('#product_info_err_'+product_id).html('Produkt został dodany do koszyka'); } }); } } function display_basket_box(){ $('#basket_box').html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_display_basket_box.php', data: "", success: function(msg){ $('#basket_box').html(msg); } }); } function display_basket_page(){ $('#basket_page').html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_display_basket_page.php', data: "", success: function(msg){ $('#basket_page').html(msg); } }); } function log_me_in(){ $('#login_error').html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_log_me_in.php', data: "login="+$('#login').val()+"&password="+$('#password').val(), success: function(msg){ if(msg=='ok'){ document.location.href='http://www.ojezu.pl/'; }else{ $('#login_error').html(msg); } } }); } function open_user_option_box(){ var space_left = ((get_all_width()-886)/2)+720; $('#user_option_box').css("left", space_left); $('#user_option_box').css("display", "block"); } function show_user_option_box_content(){ if ($("#user_option_box_content").is(":hidden")) { $("#user_option_box_content").slideDown("slow"); } else { $("#user_option_box_content").slideUp("slow"); } } function show_login_form(){ if ($("#login_box_form").is(":hidden")) { $("#login_box_form").slideDown("slow"); } else { $("#login_box_form").slideUp("slow"); } } function show_hidden_users_favourite_added(){ $('#hidden_user_favourites_added').css('display', 'inline'); $('#hidden_user_favourites_added_dots').html(' '); $('#show_hidden_users_favourite_added_link').html('Schowaj wszystkich'); } function hide_hidden_users_favourite_added(){ $('#hidden_user_favourites_added').css('display', 'none'); $('#hidden_user_favourites_added_dots').html(' ...'); $('#show_hidden_users_favourite_added_link').html('Pokaż wszystkich'); } function show_product_content(content_id){ $('#product_content_'+content_id).css('display', 'inline'); $('#product_content_dots_'+content_id).html(''); $('#product_content_plus_'+content_id).html('showaj dlugi opis'); } function hide_product_content(content_id){ $('#product_content_'+content_id).css('display', 'none'); $('#product_content_dots_'+content_id).html('... '); $('#product_content_plus_'+content_id).html('showaj dlugi opis'); } function mix_products_images(product_id){ $('#products_listing_box_right_inne_images').html(''); jQuery.ajax({ type: "POST", url: 'http://www.ojezu.pl/ajax_mix_products.php', data: "pid="+product_id, success: function(msg){ $('#products_listing_box_right_inne_images').html(msg); } }); } function show_add_comment(comment_id){ $('#product_comments_add_'+comment_id).css('display', 'block'); $('#product_comments_reply_'+comment_id).html('Anuluj'); } function hide_add_comment(comment_id){ $('#product_comments_add_'+comment_id).css('display', 'none'); $('#product_comments_reply_'+comment_id).html('Odpowiedz'); } function get_all_width(){ var theWidth; // Window dimensions: if (window.innerWidth) { theWidth=window.innerWidth; } else if (document.documentElement.clientWidth) { theWidth=document.documentElement.clientWidth; } else if (document.body) { theWidth=document.body.clientWidth; } return theWidth; } function get_all_height(){ var theHeight; // Window dimensions: if (window.innerHeight) { theHeight=window.innerHeight; } else if (document.documentElement.clientHeight) { theHeight=document.documentElement.clientHeight; } else if (document.body) { theHeight=document.body.clientHeight; } return theHeight; } /* --------------------------------------- */ function check_protx_form(obj){ var my_url = 'http://www.ojezu.pl/ajax_init_protx_payment.php' //show_main_loader('yes'); $('#ajax_loader_indicator').html('Connecting with payment server...'); var query_string = "rel_id="+$('#p_rel_id').val()+"&type="+$('#p_type').val()+"&item_desc="+encodeURIComponent($('#p_item_desc').val())+"&vendortxcode="+$('#p_vendortxcode').val()+"&price="+$('#p_price').val(); $.ajax({ type: "POST", url: my_url, data: query_string, success: function(msg){ if (msg=='ok'){ $('#ajax_loader_indicator').html('Redirecting to PROTX...'); $('#VSPForm').submit(); } else{ //show_main_loader('no'); alert('Unexpected server error. Administrator of this website will check it soon'); return false; } } }); return false; } function text_limit(limit, field, span_field){ if (document.getElementById(field).value.length > limit){ document.getElementById(field).value = document.getElementById(field).value.substring(0, limit); } if(span_field.length > 0){ txt = ""; left_chars = limit - document.getElementById(field).value.length; txt = " " + left_chars + " " + limit + ""; document.getElementById(span_field).innerHTML = txt; } } function check_email(email){ Wzor = /^[0-9a-zA-Z.-_\-]+\@[0-9a-zA-Z.-_\-]+\.[0-9a-zA-Z.]{2,4}$/; if (Wzor.test(email) == false){ return false; } else { return true; } } window_id = ''; function show_image(url){ var divId = createNewWindow(500,500,0,0); window_id = divId; var txt = ''; document.getElementById('windowContent' + divId).innerHTML = txt; } function _change_password(){ if (document.getElementById("password").disabled){ document.getElementById("password").disabled = false; document.getElementById("password2").disabled = false; } else { document.getElementById("password").disabled = true; document.getElementById("password2").disabled = true; } } function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (1) { curleft+=obj.offsetLeft; if (!obj.offsetParent) { break; } obj=obj.offsetParent; } } else if (obj.x) { curleft+=obj.x; } return curleft; } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (1) { curtop+=obj.offsetTop; if (!obj.offsetParent) { break; } obj=obj.offsetParent; } } else if (obj.y) { curtop+=obj.y; } return curtop; } function show_hide_element(id){ h = document.getElementById(""+id+""); h.style.display = (h.style.display == "none") ? "block" : "none"; } function submit_search_form(source){ if (source == 1){ txt = document.getElementById('search_txt'); document.location.href = 'http://www.ojezu.pl/search/'+txt.value+'|1|1'; } else if (source == 2){ txt = document.getElementById('search_txt2'); if (document.getElementById('search_artist').checked || document.getElementById('search_fan').checked){ var art = (document.getElementById('search_artist').checked) ? "1" : "0"; var fan = (document.getElementById('search_fan').checked) ? "1" : "0"; document.location.href = 'http://www.ojezu.pl/search/'+txt.value+'|'+art+'|'+fan+''; } else { alert(''); } } } function lightup(imageobject, opacity){ if (navigator.appName.indexOf("Netscape")!=-1 && parseInt(navigator.appVersion)>=5){ if (imageobject.style.MozOpacity){ imageobject.style.MozOpacity=opacity/100; } else if (imageobject.style.opacity){ imageobject.style.opacity=opacity/100; } } else if (navigator.appName.indexOf("Microsoft")!= -1 && parseInt(navigator.appVersion)>=4){ imageobject.style.filter="alpha(opacity="+opacity+")"; } } function show_description(elid, action){ if(action=="show"){ var obj = document.getElementById(elid); if (obj) obj.style.display = "none"; var obj1 = document.getElementById("l"+elid); if (obj1) obj1.style.display = "block"; }else{ var obj = document.getElementById(elid); if (obj) obj.style.display = "block"; var obj1 = document.getElementById("l"+elid); if (obj1) obj1.style.display = "none"; } } function save_quote(id){ var url = 'http://www.ojezu.pl/ajax_save_quote.php?product='+id+''; new Ajax.Request(url, { method: 'get', onSuccess: function(transport) { if (transport.responseText.match('ok')){ //alert('ok'); } else { //alert('no'); } } }); } /* Function to equal the height of the left and right content - it works on homepage*/ function fixColumns_homepage(){ var h1 = document.getElementById("content_container_homepage").offsetHeight; var h2 = document.getElementById("sidebar").offsetHeight; var max = h1; if(h2 > max) max = h2; /* Set divs to the equal height */ document.getElementById("content_container_homepage").style.height = max + "px"; document.getElementById("sidebar").style.height = max + "px"; } /* Function to equal the height of the left and right content - it works on other pages*/ function fixColumns_other(){ var h1 = document.getElementById("site_content_container_content").offsetHeight; var h2 = document.getElementById("sidebar").offsetHeight; var max = h1; if(h2 > max) max = h2; /* Set divs to the equal height */ document.getElementById("site_content_container_content").style.height = max + "px"; document.getElementById("sidebar").style.height = (max-189) + "px"; } /* Function to equal the height of the left and right content*/ function fixColumns_main(){ var h1 = document.getElementById("main_container_center").offsetHeight; var h2 = document.getElementById("main_container_left").offsetHeight; var max = h1; if(h2 > max) max = h2; /* Set divs to the equal height */ document.getElementById("main_container_center").style.height = max + "px"; document.getElementById("main_container_left").style.height = max + "px"; document.getElementById("main_container_right").style.height = max + "px"; }