//Avoiding MooTools.lang dependency
(function() {
host_ppath='/';
if (window.location.href.match(/panel/))
host_path='/panel/';
else
host_path='/';
var phrases = {
'fileName': '{name}',
'cancel': 'null',
'retry': 'null',
'add': 'null',
'add_file': 'null',
'choice_file': 'null',
'cancelTitle': 'null',
'validationErrors': {
'duplicate': 'null',
'sizeLimitMin': 'null',
'sizeLimitMax': 'null',
'fileListMax': 'null',
'fileListSizeMax': 'null'
},
'host_path':host_path,
'host_ppath':host_ppath,
'errors': {
'httpStatus': 'Server returned HTTP-Status #{code}',
'securityError': 'Security error occured ({text})',
'ioError': 'Error caused a send or load operation to fail ({text})'
},
'linuxWarning': 'Warning: Due to a misbehaviour of Adobe Flash Player on Linux,\nthe browser will probably freeze during the upload process.\nDo you want to start the upload anyway?'
};
if (MooTools.lang) {
MooTools.lang.set('en-US', 'FancyUpload', phrases);
} else {
MooTools.lang = {
get: function(from, key) {
return phrases[key];
}
};
}
})();
function activate_now(){
var rc_w=new rc_windows({
id:'rc_window2',
container: $(document.body),
useOverlay: true,
width:800,
height:400,
type:'div',
title: 'null',
contentAJAX:MooTools.lang.get('FancyUpload', 'host_path')+'/ajax/activate/index/',
varAJAX:{"pid":1,"item":1},
contentHTML: MooTools.lang.get('FancyUpload', 'host_path')+'/ajax/activate/index/',
onComplete: function(){
var exV = new fValidator("f_activate", { languageConfig:{l:{}},
msgClass: "rc_div_alert",
msgContainerTag: "div",
submitBt: "activate_bt",
fValidate_send:function(){
//payU
$('f_activate').submit();
return false;
//payU end
$('f_activate').set('send', {onComplete: function(data) {
close_window_out($('rc_window2'));
var rc_w=new rc_windows({
id:'rc_alert0',
container: $(document.body),
useOverlay: true,
width:800,
height:400,
title: 'null',
contentAJAX:MooTools.lang.get('FancyUpload', 'host_path')+'/ajax/activate/info/',
varAJAX:{"pid":1,"item":1},
contentHTML: MooTools.lang.get('FancyUpload', 'host_path')+'/ajax/activate/info/'
});
}});
$('f_activate').send();
}
});
}
})
}
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name) {
createCookie(name,"",-1);
}
function calculateAddCost(obj,poid,id)
{
var valueNetto = obj.value;
if(valueNetto > 0 && valueNetto != '')
{
var priceBrutto = $('products_price_brutto').value;
var tax = 1.23;
var taxTemp = $('tax_id').value.split('-');
tax = parseFloat(taxTemp[0]);
var valueBrutto = valueNetto * tax;
var addCost = valueBrutto - priceBrutto ;
addCost = parseFloat(addCost);
if(addCost > 0)
{
$('direct\['+poid+'\]\['+id+'\]').value = '+';
}
else
{
$('direct\['+poid+'\]\['+id+'\]').value = '-';
}
$('kind\['+poid+'\]\['+id+'\]').value = '$';
$('poi\['+poid+'\]\['+id+'\]').value = Math.abs(addCost);
}
else
$('poi\['+poid+'\]\['+id+'\]').value = '';
}
function injectnew(params)
{
var j=JSON.parse(params);
if($(parent.document.body).getElementById(j.input))
{
new Element('option', {'value': j.id, 'text':j.name,'selected':'selected'}).inject($(parent.document.body).getElementById(j.input));
}
var ss = $(parent.document.body).getElementsByTagName('select');
for (var i = 0; i < ss.length; i++) {
var s = ss[i];
s.setStyle('visibility', 'visible');
}
$(parent.document.body).getElementById('OverlayContainer_rcw').dispose();
$(parent.document.body).getElementById('rc_window0').dispose();
}
function send_password(){
var rc_w=new rc_windows({
id:'rc_window3',
container: $(document.body),
useOverlay: true,
width:600,
height:250,
type:'div',
title: '"Przypomnij has\u0142o"',
contentAJAX:MooTools.lang.get('FancyUpload', 'host_path')+'ajax/plogin/help/',
varAJAX:{"pid":1,"item":1},
contentHTML: MooTools.lang.get('FancyUpload', 'host_path')+'ajax/plogin/help/',
onComplete: function(){
var exV = new fValidator("f_send_password", { languageConfig:{l:{}},
msgClass: "rc_div_alert",
msgContainerTag: "div",
submitBt: "send_password_bt",
fValidate_send:function(){
$('f_send_password').set('send', {onComplete: function(data) {
salert('"Has\u0142o zosta\u0142o przes\u0142ana na wskazany adres e-mail!"','null',false,false,'none');
close_window_out($('rc_window3'),1,'null');
}});
$('f_send_password').send();
}
});
}
});
}
function getId(id)
{
return document.getElementById(id)
}
function getTR(str){
return new Element('div', {html: '
'}).getElement('tr');
}
function HtmlToElement(str,tag){
return new Element('div', {html:str}).getElements(tag);
}
onerror = function(info, plik, linia)
{
//alert("plik : " + plik+"\nlinia : " + linia+"\ninfo : " + info);
}
function copy(id)
{
var objs = getId(id)
var text =objs.value
getId(id+"_send").value=text
}
function copy_sel(id,idx)
{
getId(id+"_send").options[idx].selected=true;
}
function counter_words(f, x, y,l) {
if (f.value.length>x-1) {
f.value = f.value.substr(0,x)
}
if(l<2)
{
getId("counter_"+y).value=x-f.value.length
}
else
{
var lc=getId('languages_list_input').value
var lang=getId('main_languages').innerHTML;
var ll=lang.split('~');
if(lc==ll[1])
getId("counter_"+y).value=x-f.value.length
else
getId('lang['+lc+'][counter_'+y+']').value=x-f.value.length
}
}
function select_bg_show(ul)
{
if($(ul+'_span').get('html')==0)
{
$(ul+"_ul").setStyle('display','block');
$(ul+'_span').set('html',1);
}
else
{
$(ul+"_ul").setStyle('display','none');
$(ul+'_span').set('html',0);
}
}
function select_set(idn,id,name)
{
getId(idn).value=id;
getId(idn+"_out").innerHTML=name;
$(idn+"_ul").setStyle('display','none');
$(idn+'_span').set('html',0);
}
function select_bg_show_flags(ul)
{
getId(ul+"_ul").style.display='block';
}
function select_set_flags(idn,id,name)
{
if($(idn+"_input"))
{
getId(idn+"_input").value=id;
getId(idn+"_out").innerHTML=name;
getId(idn+"_ul").style.display='none';
getId(idn+"_outimg").src=MooTools.lang.get('FancyUpload', 'host_path')+'templates/images/flags/'+id+'.gif';
Section=document.getElementById('pfp_edit');
divs=Section.getElementsByTagName('div');
for(var i=0;i input').set('value',0);
search();
}
function send(empty,del)
{
var s=0;
var act=getId('action');
if(act.selectedIndex==0)
alert(empty);
var val=act.value;
if(val=='del')
{
if(confirm(del))
s=true;
else
s=false;
}
if(val=='changes')
{
s=true;
}
if(val=='set_tax')
{
s=true;
}
if(val=='delete_tax')
{
s=true;
}
if(val=='duplicate')
{
s=true;
}
if(s)
getId('pfp').submit();
}
function price_calculate(t,pid,pid1)
{
if(!pid1)
pid1='products_price_brutto';
switch(t)
{
case 1:
var p1=getId(pid).value;
var re = /[^0-9.,]/gi;
p1=p1.replace(re,'');
var re = /,/gi;
p1=p1.replace(re,'.');
getId(pid).value=p1;
var p1=getId(pid).value;
p1=parseFloat(p1);
var tax=getId('tax_id').value.split('-');
var tax1=parseFloat(tax[0]);
var p2=p1*tax1;
if(p2.toString() == "NaN")
{
p2='';
getId(pid1).value=p2;
}
else
{
p2 = p2 + 0.001;
getId(pid1).value=p2.toFixed(2);
}
break;
case 2:
var p1=getId(pid1).value;
var re = /[^0-9.,]/gi;
p1=p1.replace(re,'');
var re = /,/gi;
p1=p1.replace(re,'.');
getId(pid1).value=p1;
var p1=getId(pid1).value;
p1=parseFloat(p1);
var tax=getId('tax_id').value.split('-');
var tax1=parseFloat(tax[0]);
var p2=p1/tax1;
if(p2.toString() == "NaN")
{
p2='';
getId(pid).value=p2;
}
else
{
getId(pid).value=p2.toFixed(2);
}
break;
}
}
function price_buy_calculate(t,pid,bpb)
{
if(!bpb)
bpb='buy_price_brutto';
switch(t)
{
case 1:
var p1=getId(pid).value;
var re = /[^0-9.,]/gi;
p1=p1.replace(re,'');
var re = /,/gi;
p1=p1.replace(re,'.');
getId(pid).value=p1;
var p1=getId(pid).value;
p1=parseFloat(p1);
var tax=getId('tax_id').value.split('-');
var tax1=parseFloat(tax[0]);
var p2=p1*tax1;
if(p2.toString() == "NaN")
{
p2='';
getId(bpb).value=p2;
}
else
{
getId(bpb).value=p2.toFixed(2);
}
break;
case 2:
var p1=getId(bpb).value;
var re = /[^0-9.,]/gi;
p1=p1.replace(re,'');
var re = /,/gi;
p1=p1.replace(re,'.');
getId(bpb).value=p1;
var p1=getId(bpb).value;
p1=parseFloat(p1);
var tax=getId('tax_id').value.split('-');
var tax1=parseFloat(tax[0]);
var p2=p1/tax1;
if(p2.toString() == "NaN")
{
p2='';
getId(pid).value=p2;
}
else
{
getId(pid).value=p2.toFixed(2);
}
break;
}
}
function send_link(alert_del,link)
{
if(confirm(alert_del))
s=true;
else
s=false;
if(s)
window.location.href=link;
}
function ordering(step,pid,ord)
{
loading_start();
if(!ord)
ord='desc';
var getp=getId('get_p').innerHTML;
var req = new Request({
method: 'post',
url: MooTools.lang.get('FancyUpload', 'host_path')+'ajax/'+getp+'/ordering/',
data: {"step":step,"pid":pid},
onComplete: function(data)
{
getId('sort').value="ordering "+ord;
var res = data;
loading_stop();
search();
}
}).send();
}
function filters_ordering(step, pid, module, option) {
var list = document.getElementById('filter_results_productsComplementary');
var currentField, changeOrderField;
if (list) {
for (var i = 0; i < list.children.length; i++) {
if (i === 0) {
continue;
}
if (step === "u") {
if (list.children[i].id === 'div_filter[productsComplementary_' + pid + ']') {
currentField = list.children[i].cloneNode(true);
changeOrderField = list.children[i - 1].cloneNode(true);
currentField.children[1].children[0].value = list.children[i - 1].children[1].children[0].value;
changeOrderField.children[1].children[0].value = list.children[i].children[1].children[0].value;
list.children[i].outerHTML = changeOrderField.innerHTML;
list.children[i].id = changeOrderField.id;
list.children[i].className = 'filtr_body_tr_2';
list.children[i - 1].outerHTML = currentField.innerHTML;
list.children[i - 1].id = currentField.id;
list.children[i - 1].className = 'filtr_body_tr_2';
break;
}
} else {
if (list.children[i].id === 'div_filter[productsComplementary_' + pid + ']') {
currentField = list.children[i].cloneNode(true);
changeOrderField = list.children[i + 1].cloneNode(true);
currentField.children[1].children[0].value = list.children[i + 1].children[1].children[0].value;
changeOrderField.children[1].children[0].value = list.children[i].children[1].children[0].value;
list.children[i].outerHTML = changeOrderField.innerHTML;
list.children[i].id = changeOrderField.id;
list.children[i].className = 'filtr_body_tr_2';
list.children[i + 1].outerHTML = currentField.innerHTML;
list.children[i + 1].id = currentField.id;
list.children[i + 1].className = 'filtr_body_tr_2';
break;
}
}
}
currentField = changeOrderField = null;
}
}
function to_num(t)
{
var p1=t.value;
var re = /[^0-9.,]/gi;
p1=p1.replace(re,'');
var re = /,/gi;
p1=p1.replace(re,'.');
t.value=p1;
}
function no_numbers(t)
{
var p1=t.value;
var re = /[^a-zA-Z]/gi;
p1=p1.replace(re,'');
t.value=p1;
}
function to_num_negative(t)
{
var p1=t.value;
var re = /[^0-9.,-]/gi;
p1=p1.replace(re,'');
var re = /,/gi;
p1=p1.replace(re,'.');
t.value=p1;
}
function to_num_sto(t)
{
var p1=t.value;
var re = /[^0-9.,]/gi;
p1=p1.replace(re,'');
var re = /,/gi;
p1=p1.replace(re,'.');
if (p1>100)
p1=100;
t.value=p1;
}
function to_number(t)
{
var p1=t.value;
var re = /[^0-9]/gi;
p1=p1.replace(re,'');
var re = /,/gi;
p1=p1.replace(re,'.');
t.value=p1;
}
function amazon_dispatch_range(t)
{
var this_max = 30;
var p1=t.value;
var re = /[^0-9]/gi;
p1=p1.replace(re,'');
var re = /',', '.', '-'/gi;
p1=p1.replace(re,'.');
if (p1 > this_max)
p1 = this_max;
t.value = p1;
}
function to_cart_num(t,jm10)
{
var p1=t.value;
if(jm10=="true")
{
var re = /[^0-9.,]/gi;
}
else
{
var re = /[^0-9]/gi;
}
p1=p1.replace(re,'');
var re = /,/gi;
p1=p1.replace(re,'.');
t.value=p1;
}
function to_cart_num_cross(t,jm10, max)
{
var p1=t.value;
if(jm10=="true")
{
var re = /[^0-9.,]/gi;
}
else
{
var re = /[^0-9]/gi;
}
p1=p1.replace(re,'');
var re = /,/gi;
p1=p1.replace(re,'.');
if(p1 != '')
{
p1 = parseInt(p1);
max = parseInt(max);
if(p1>max)
p1=max;
}
else
p1 = 0;
t.value=p1;
}
function email(email)
{
if (!email.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) {
return false;
}
return true;
}
function poprawPNG() {
var divf=getId('flags');
var divs = divf.getElementsByTagName('div');
for(var i=0; i0)
window.location.href='http://cdn10.redcart.pl/_cart/step4/';
}
else
{
salert('null','null',false,false,'none');
}
close_window_out($('rc_window0'),1,'null');
}});
$('f_register').send();
}
});
}
}).send();
}
function box_compare_refresh()
{
var req = new Request({
method: 'post',
url: '/ajax/compare/box_compare/',
data: {},
onComplete: function(data)
{
if(getId('ajax_box_compare'))
getId('ajax_box_compare').set('html',data);
}
}).send();
}
function ajax_box_loyalty_refresh()
{
var req = new Request({
method: 'post',
url: '/ajax/cart/ajax_loyalty_box/',
data: {},
onComplete: function(data)
{
if($('ajax_box_loyalty'))
$('ajax_box_loyalty').set('html',data);
if(data.length==0)
{
if($('ajax_box_loyalty').getParent('.box'))
$('ajax_box_loyalty').getParent('.box').dispose();
}
}
}).send();
}
function ajax_box_loyalty_del(pid)
{
var req = new Request({
method: 'post',
url: MooTools.lang.get('FancyUpload', 'host_path')+'ajax/cart/ajax_loyalty_box/',
data: {"pid":pid},
onComplete: function(data)
{
if($('ajax_box_loyalty'))
{
$('ajax_box_loyalty').set('html',data);
}
}
}).send();
}
function box_compare_action(action, pid, checkbox_value)
{
if(action=='print')
{
var rc_w=new rc_windows({
id:'rc_window5',
container: $(document.body),
useOverlay: true,
width:800,
height:300,
title: 'null',
contentAJAX:'/ajax/pinfo/print_page/'+pid+'/',
onComplete: function()
{}
});
}
if(action=='print_all')
{
var rc_w=new rc_windows({
id:'rc_window5',
container: $(document.body),
useOverlay: true,
width:800,
height:300,
title: 'null',
contentAJAX:'/ajax/compare/print_products/',
onComplete: function()
{}
});
}
if(action=='note')
{
var rc_w=new rc_windows({
id:'rc_window_cnote',
container: $(document.body),
useOverlay: true,
width:400,
height:300,
title: 'null',
contentAJAX:'/ajax/compare/note/'+pid+'/',
onComplete: function()
{}
});
}
if(action=='send_note')
{
var req = new Request({
method: 'post',
url: MooTools.lang.get('FancyUpload', 'host_path')+'ajax/compare/note/',
data: {"note": $('cnote').get('value'),"pid":pid},
onComplete: function(data)
{
box_compare_refresh();
close_window_out($('rc_window_cnote'),1,0);
}
}).send();
}
if(action=='check')
{
if (typeof checkbox_value === "undefined")
{
checkbox_value = $('compare_'+pid).get('checked');
}
else
{
if($('compare_'+pid))
$('compare_'+pid).set('checked',checkbox_value);
}
var req = new Request({
method: 'post',
url: MooTools.lang.get('FancyUpload', 'host_path')+'ajax/compare/check/',
data: {"pid":pid,"check":checkbox_value},
onComplete: function(data)
{
if(data=='1')
{
if($('compare_'+pid))
$('compare_'+pid).set('checked',false);
salert('null');
}
}
}).send();
}
else
{
var req = new Request({
method: 'post',
url: '/ajax/compare/'+action+'/',
data: {"pid": pid},
onComplete: function(data)
{
if(data=='1')
{
salert('null');
}
else
{
if(action=='add')
salert_mini('null','rc_info generic');
if(action=='add' || action=='del') {
if($$('#header_compare .cart-preview').length>0) {
$$('#header_compare .cart-preview').set('html','');
}
ajax_header_shopping_cart();
}
if(action=='del' && $$('#rc_window_compare').length>0) {
var req = new Request({
method: 'post',
url: '/ajax/compare/view/',
onComplete: function(data)
{
$('rc_window_compare_body').set('html',data);
var size=$('rc_window_compare').getSize();
var b_size=window.getSize();
var left=(b_size.x-size.x)/2;
$('rc_window_compare').setStyle('left',left);
}
}).send();
}
box_compare_refresh();
}
}
}).send();
}
}
function compare_window(width)
{
width=width*300;
var rc_w=new rc_windows({
id:'rc_window_compare',
container: $(document.body),
useOverlay: true,
head:true,
move:true,
width:width,
title: 'null',
type:'div',
contentAJAX:MooTools.lang.get('FancyUpload', 'host_path')+'ajax/compare/view/',
onComplete: function(){
var size=$('rc_window_compare').getSize();
var b_size=window.getSize();
var left=(b_size.x-size.x)/2;
$('rc_window_compare').setStyle('left',left);
}
});
}
function addnew(type,name)
{
var periodicalid1=0;
var rc_w=new rc_windows({
id:'rc_window0',
container: $(document.body),
useOverlay: true,
move:true,
width:1200,
height:750,
title: 'Dodaj',
type:'iframe',
scrolling: 'yes',
contentAJAX:MooTools.lang.get('FancyUpload', 'host_path')+'iframe.php?p='+type+'&f=edit&if=1&name='+name,
onComplete: function(){
periodicalid=overlay_corect.periodical(500,{ids:'rc_window0',lp:0});
}
});
}
function rc_modal(p,f,title,id)
{
var periodicalid1=0;
var rc_w=new rc_windows({
id:'rc_window1',
container: $(document.body),
useOverlay: true,
move:true,
width:'1210',
height:'760',
title: title,
type:'iframe',
scrolling: 'yes',
contentAJAX:MooTools.lang.get('FancyUpload', 'host_path')+'iframe.php?p='+p+'&f='+f+'&id='+id,
onComplete: function(){
periodicalid=overlay_corect.periodical(500,{ids:'rc_window0',lp:0});
}
});
}
function plusminus(d,s,t)
{
var num;
if(d=='+')
{
num=t.get('value').toInt()+s;
t.set('value',num);
}
if(d=='-')
{
num=t.get('value').toInt()-s;
if(num<0)
num=0;
t.set('value',num);
}
}
var urlTypeTimer = 1;
function urlTypeKeyUp(el)
{
var url = $(el).get('value');
var re = /[^0-9\-A-Za-z]/gi;
url=url.replace(re,'');
$(el).set('value',url);
var module = $(el).get('data-module');
var key_id = $(el).get('data-id');
clearTimeout(urlTypeTimer);
urlTypeTimer=setTimeout(function validate(){
if(!url)
{
$(el).set('alt','')
}
else {
var req = new Request.JSON({
method: 'post',
url: '/panel/ajax/url/validate/',
data: {"url":url,"module":module,"key_id":key_id},
onComplete: function(data)
{
if(data.valid)
$(el).set('alt','');
else
$(el).set('alt',data.alert)
}
}).send();
}
},500);
}
function urlTypeKeyUpLang(el)
{
var url = $(el).get('value');
var re = /[^0-9\-\/A-Za-z]/gi;
url=url.replace(re,'');
$(el).set('value',url);
var module = $(el).get('data-module');
var key_id = $(el).get('data-id');
var lang = $(el).get('data-lang');
clearTimeout(urlTypeTimer);
urlTypeTimer=setTimeout(function validate(){
if(!url)
{
$(el).set('alt','')
}
else {
var req = new Request.JSON({
method: 'post',
url: '/panel/ajax/url/validate/',
data: {"url":url,"module":module,"key_id":key_id,"lang":lang},
onComplete: function(data)
{
if(data.valid)
$(el).set('alt','');
else
$(el).set('alt',data.alert)
}
}).send();
}
},500);
}
function change_default_lang(title, post) {
var rc_w=new rc_windows({
id:'rc_window5',
container: $(document.body),
useOverlay: true,
width:800,
height:600,
title: title,
varAJAX:{"array":post},
contentAJAX:'/ajax/default_language/index/',
onComplete: function() {}
});
}
function default_lang_set(selectedLang)
{
var myCookie = Cookie.write('rc_lang_alert', selectedLang, {duration: 30});
window.location.href="_change_languages/index/" + selectedLang + "/";
}
function send_form_buy_fast_lite(title, pid) {
var rc_w=new rc_windows({
id:'rc_window5',
container: $(document.body),
useOverlay: true,
width:800,
height:600,
title: title,
varAJAX:{"pid":pid},
contentAJAX:'/ajax/pinfo/buy_fast/',
onComplete: function() {
add_cart_event();
}
});
}
function change_verified(cid) {
var req = new Request({
method: 'post',
url: '/panel/ajax/customers/change_verified/',
data: {"cid":cid},
onComplete: function(data)
{
$('verified_status_'+cid).set('html', data);
}
}).send();
}
function jm_gen(action, value) {
var new_val = $('buy_quantity_input').get('value');
var valp = new_val.toInt()+1;
var valm = new_val.toInt()-1;
if(action == 'p') {
$('buy_quantity_input').set('value', valp);
}
if(action == 'm' && new_val > 0 ) {
$('buy_quantity_input').set('value', valm);
}
}
function ask_negotiation() {
var rc_w=new rc_windows({
id:'rc_window3',
container: $(document.body),
useOverlay: true,
width:600,
height:300,
title: 'NEGOCJUJ CENĘ: ',
contentAJAX:'/ajax/question/index/'+$('products_id').get('value')+'/',
onComplete: function(){
$(rc_w.options.id+'_title').set('html',$(rc_w.options.id+'_title').get('html')+' - '+$('qproduct_title').get('html'));
var exV = new fValidator("q_user", { languageConfig:{l:{required:"To pole jest obowiązkowe! ↑",
alpha:"Pole zawiera nie prawidłowe znaki! ↑",
alphanum:"Pole zawiera nie prawidłowe znaki! ↑",
integer:"Nieprawidłowe dane! ↑",
real:"Nieprawidłowy numer! ↑",
date:"Prawidłowy format daty to (mm/dd/rrrr)! ↑",
dateISO8601:"Prawidłowy format daty to (mm/dd/rrrr)! ↑",
dateEU:"Prawidłowy format daty to (mm/dd/rrrr)!) ↑",
email:"Nieprawidłowy adres e-mail! ↑",
phone:"Nieprawidłowy numer telefonu! ↑",
url:"Nieprawidłowy adres URL! ↑",
zip:"Nieprawidłowy format kodu pocztowego! ↑",
confirm:"Nieprawidłowe hasło! ↑"}},
msgClass: "rc_div_alert",
msgContainerTag: "div",
submitBt: "question_bt",
fValidate_send:function(){
$('q_user').set('send', {onComplete: function(data) {
rc_w.close_window();
salert('Twoje zapytanie zostało wysłane',5000,false,false,'none'); // definicja!
close_window_out($('rc_window3'),1,5000);
}});
$('q_user').send();
}
});
}
});
}
var es_current_modes = {};
function es_value_change(uid) {
var _elem = $('es_container'+uid.replace("es_select",""));
if(_elem !== undefined) {
_elem.getFirst('input').set('value',_elem.getFirst('select').getSelected().get('text'));
}
}
function es_value_add(uid) {
if(es_current_modes[uid] === undefined || es_current_modes[uid] == "back") {
es_current_modes[uid]="add";
}
else {
es_current_modes[uid]="back";
}
var _elem = $('es_container'+uid);
var _url = 'http://photos04.redcart.pl/templatest_/images/';
var _img = {'back':_url+'rc_panel_button/delete_btn.png', 'add':_url+'rc_filter/rc_add.png'};
if(es_current_modes[uid] == "add") {
_elem.getFirst('img').set('src',_img.back);
_elem.getFirst('select').setStyle('display','none');
_elem.getFirst('input').setStyle('display','inline-block');
}
else {
_elem.getFirst('img').set('src',_img.add);
_elem.getFirst('input').setStyle('display','none');
_elem.getFirst('select').setStyle('display','inline-block');
_elem.getFirst('input').set('value',_elem.getFirst('select').getSelected().get('text'));
}
}
function fn_filter_options() {
if($('filter_options'))
{
var state=0;
var data=$('filter_options').get('value');
if (data==1)
{
state=2;
$('filter_options').set('value',state);
} else {
state=1;
$('filter_options').set('value',state);
}
new Request.JSON({
method: 'post',
url: '/panel/ajax/filters_w/state/',
data: {state:state,p:$('get_p').get('html')},
onComplete: function(data)
{
}
}).send();
fn_filter_options_action();
}
}
function fn_filter_options_action() {
if($('filter_options'))
{
var data=$('filter_options').get('value') || true
if (data==1)
{
if ($('filter_set_box'))
$('filter_set_box').setStyle('display','none');
if ($('filter'))
$('filter').setStyle('display','none');
if ($('filter_filters'))
$('filter_filters').setStyle('display','none');
} else {
if ($('filter_set_box'))
$('filter_set_box').setStyle('display','block');
if ($('filter'))
$('filter').setStyle('display','table-row');
if ($('filter_filters'))
$('filter_filters').setStyle('display','table-row');
}
}
var array = Array.from(document.querySelectorAll('.filtr_heading_action'));
array.forEach(function(elm) {
var array = Array.from(elm.querySelectorAll('input'));
if(array.length === 2) {
elm.addClass('filter_inputs');
}
});
}
function clearCache(){
var req = new Request({
method: 'post',
url: 'http://cdn10.redcart.pl/ajax/settings/clear_cache/',
data: {},
onComplete: function(data)
{
loading_stop();
if(data.length>5){
salert('Cache został wyczyszczony. Ilość wpisów usuniętych dla domeny:'+data,null,null,'Komunikat');
}
else{
salert('Brak wpisów w cache.',null,null,'Cache');
}
}
}).send();
}