//Avoiding MooTools.lang dependency
(function() {
host_ppath='/';
if (window.location.href.match(/panel/))
host_path='/panel/';
else
host_path='/';
var phrases = {
'fileName': '{name}',
'cancel': 'Anuluj',
'retry': 'Powtórz',
'add': 'Dodano',
'add_file': 'Dodaj pliki:',
'choice_file': 'Wybierz pliki:',
'cancelTitle': 'Kliknij aby usunąć.',
'validationErrors': {
'duplicate': 'Plik {name} został już dodany.',
'sizeLimitMin': 'Plik {name} ({size}) jest zbyt mały, minimalna wielkość to {fileSizeMin}.',
'sizeLimitMax': 'Plik {name} ({size}) jest zbyt duży, maksymalna wielkość to {fileSizeMax}.',
'fileListMax': 'Plik {name} nie może zostac dodany, ilość {fileListMax} plików przekroczona.',
'fileListSizeMax': 'Plik {name} ({size}) jest zbyt duży, całkowita wielkość plików {fileListSizeMax} przekroczona.'
},
'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: 'Aktywuj sklep',
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:{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: "activate_bt",
fValidate_send:function(){
$('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: 'Aktywuj sklep',
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 injectnew(params)
{
var j=JSON.decode(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ło',
contentAJAX:MooTools.lang.get('FancyUpload', 'host_path')+'ajax/login/help/',
varAJAX:{"pid":1,"item":1},
contentHTML: MooTools.lang.get('FancyUpload', 'host_path')+'ajax/login/help/',
onComplete: function(){
var exV = new fValidator("f_send_password", { 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: "send_password_bt",
fValidate_send:function(){
$('f_send_password').set('send', {onComplete: function(data) {
salert('Hasło zostało przesłana na wskazany adres e-mail!','10000',false,false,'none');
close_window_out($('rc_window3'),1,'10000');
}});
$('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;i100)
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 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 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; i↑",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: "register_bt",
fValidate_send:function(){
var email=$('customers_email').get('value');
$('f_register').set('send', {onComplete: function(data) {
if($('sumall'))
{
var sumall_t=$('sumall').value;
sumall_t=(parseFloat(sumall_t)+parseFloat(shh))
if(sumall_t>0)
window.location.href='http://www.modasexygirl.pl/_cart/step4/';
}
else
{
salert('Dziękujemy! Twoje konto zostało utworzone.','10000',false,false,'none');
}
close_window_out($('rc_window0'),1,'10000');
}});
$('f_register').send();
}
});
}
}).send();
}
function box_compare_refresh()
{
var req = new Request({
method: 'post',
url: MooTools.lang.get('FancyUpload', 'host_path')+'ajax/compare/box_compare/',
data: {},
onComplete: function(data)
{
$('ajax_box_compare').set('html',data);
}
}).send();
}
function ajax_box_loyalty_refresh()
{
var req = new Request({
method: 'post',
url: MooTools.lang.get('FancyUpload', 'host_path')+'ajax/cart/ajax_loyalty_box/',
data: {},
onComplete: function(data)
{
if($('ajax_box_loyalty'))
$('ajax_box_loyalty').set('html',data);
}
}).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)
{
if(action=='print')
{
var rc_w=new rc_windows({
id:'rc_window5',
container: $(document.body),
useOverlay: true,
width:800,
height:300,
title: 'Wydrukuj stronę',
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: 'Wydrukuj stronę',
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: 'Notatka',
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')
{
var req = new Request({
method: 'post',
url: MooTools.lang.get('FancyUpload', 'host_path')+'ajax/compare/check/',
data: {"pid":pid,"check":$('compare_'+pid).get('checked')},
onComplete: function(data)
{
if(data=='1')
{
$('compare_'+pid).set('checked',false);
salert('Osiągnąłeś już maksymalną liczbę produktów w porównywarce!');
}
}
}).send();
}
else
{
var req = new Request({
method: 'post',
url: MooTools.lang.get('FancyUpload', 'host_path')+'ajax/compare/'+action+'/',
data: {"pid": pid},
onComplete: function(data)
{
if(data=='1')
salert('Osiągnąłeś już maksymalną liczbę produktów w porównywarce!');
else
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: '',
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:1000,
height:600,
title: '',
type:'iframe',
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 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);
}
}