function findPosY(obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return curtop;
}
function video_change(t)
{
getId('v1').innerHTML='';
}
function change_div(did,act) {
if(act==1) {
$(did).getChildren('.tm1').set('class', 'tm1h fl');
$(did).getChildren('.tm2').set('class', 'tm2h fl');
$(did).getChildren('.tm3').set('class', 'tm3h fl');
} else {
$(did).getChildren('.tm1h').set('class', 'tm1 fl');
$(did).getChildren('.tm2h').set('class', 'tm2 fl');
$(did).getChildren('.tm3h').set('class', 'tm3 fl');
}
}
function clock(cid) {
ndate=$('boxclock-'+cid).get('html');
var d1=ndate.split(' ');
var d=d1[0].split('-');
var t=d1[1].split(':');
var now = new Date().getTime()/1000;
var dayend = new Date(d[0],d[1]-1,d[2],t[0],t[1],t[2]).getTime()/1000;
var sec = Math.abs(now-dayend);
var min = Math.floor(sec/60);
var hours = Math.floor(min/60);
var days = Math.floor(hours/24);
var years = Math.floor(days/365);
sec = Math.floor(sec-min*60);
min = Math.floor(min-hours*60);
hours = Math.floor(hours-days*24);
days = Math.floor(days-years*365);
var r="";
if(days>0)
r=r+"dni: "+days;
if(days==0)
{
if(hours>0)
r=r+hours;
if(min>0)
r=r+":"+((min<10)?"0":"")+min;
if(sec>=0)
r=r+":"+((sec<10)?"0":"")+sec;
}
$('boxclock_show-'+cid).innerHTML =r;
if (now↑",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) {
salert('Twoje konto zostało utworzone, a na Twój adres e-mail zostało wysłane hasło do konta.','10000',false,false,'none');
close_window_out($('rc_window0'),1,'10000');
}});
$('f_register').send();
}
});
}
});
});
}
if ($('login_user_text')){
$('login_user_text').addEvent('click', function(e){
var rc_w=new rc_windows({
id:'rc_window1',
container: $(document.body),
useOverlay: true,
width:600,
height:300,
title:'Zaloguj się',
contentAJAX:'http://www.primakomp.pl//ajax/login/index/',
varAJAX:{"pid":1,"item":1},
contentHTML: 'http://www.primakomp.pl//ajax/login/index/',
onComplete: function(){
var exV = new fValidator("f_login", { 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: "login_bt",
fValidate_send:function(){
$('f_login').set('send', {onComplete: function(data) {
rc_w.close_window();
window.location.href='http://www.primakomp.pl/_account/index/';
}});
$('f_login').send();
}
});
$('login').addEvent('keydown', function(event){if(event.key=='enter' && $('pass').get('value')!='') exV._onSubmit(event)});
$('pass').addEvent('keydown', function(event){if(event.key=='enter' && $('login').get('value')!='') exV._onSubmit(event)});
}
});
});
}
if ($('login_user_text2')){
$('login_user_text2').addEvent('click', function(e){
var rc_w=new rc_windows({
id:'rc_window1',
container: $(document.body),
useOverlay: true,
width:600,
height:300,
title:'Zaloguj się',
contentAJAX:'http://www.primakomp.pl//ajax/login/index/',
varAJAX:{"pid":0,"item":1},
contentHTML: 'http://www.primakomp.pl//ajax/login/index/',
onComplete: function(){
var exV = new fValidator("f_login", { 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: "login_bt",
fValidate_send:function(){
$('f_login').set('send', {onComplete: function(data) {
rc_w.close_window();
window.location.href='http://www.primakomp.pl/_account/index/';
}});
$('f_login').send();
}
});
$('login').addEvent('keydown', function(event){if(event.key=='enter' && $('pass').get('value')!='') exV._onSubmit(event)});
$('pass').addEvent('keydown', function(event){if(event.key=='enter' && $('login').get('value')!='') exV._onSubmit(event)});
}
});
});
}
//rc-Carousel
$$('.box_Carousel').each(function(el,i){
var box=el.id.split('-');
var box_config={};
if($('config-'+box[2]))
{
var as = $('config-'+box[2]).getElements('span');
as.each(function(el1,i){
box_config[el1.get('id')]=parseInt(el1.get('html'));
});
}
new RCCarousel(el.id, {width:box_config['config-opt-width'], height:box_config['config-opt-height'],duration:box_config['config-opt-duration'],delay:box_config['config-opt-delay'],box:box_config['config-opt-box']});
});
});
function pass_help(){
close_window_out($('rc_window1'),0);
var rc_w=new rc_windows({
id:'rc_window2',
container: $(document.body),
useOverlay: false,
width:600,
height:300,
title: 'Przypomnij hasło',
contentAJAX:'http://www.primakomp.pl//ajax/login/help/',
varAJAX:{"pid":1,"item":1},
contentHTML: 'http://www.primakomp.pl//ajax/login/help/',
onComplete: function(){
var exV = new fValidator("f_help", { 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: "login_help_bt",
fValidate_send:function(){
$('f_help').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_window2'),1,'10000');
}});
$('f_help').send();
}
});
$('login_email').addEvent('keydown', function(event){if(event.key=='enter' && $('token').get('value')!='') exV._onSubmit(event)});
$('token').addEvent('keydown', function(event){if(event.key=='enter' && $('login_email').get('value')!='') exV._onSubmit(event)});
}
});
}
/*
new iMask({
onValid: function(event, obj) {obj.removeClass('rc_valid_no'); obj.addClass('rc_valid_ok')},
onInvalid: function(event, obj) {obj.removeClass('rc_valid_ok'); obj.addClass('rc_valid_no')}
});
*/