$(document).ready(function () {
$('a[rel]').lightBox();
$('.easy_slideshow').each(function(){
speed = parseInt($(this).attr('speed'))*1000;
$(this).find('a').fadeOut(0);
$(this).find('.index_0').fadeIn(1000);
$(this).everyTime(parseInt($(this).attr('speed'))*1000, function(i){ index=i%$(this).find('a').length; $(this).find('a').fadeOut(1000); $(this).find('.index_'+index).fadeIn(1000); });
});
$('body').append('');
//SWFAddress.addEventListener(SWFAddressEvent.CHANGE, loadPage);
//initLinks();
chakalaka();
});
$(document).resize(function () {
chakalaka();
});
function chakalaka(){
$('#bgr').css('height', $(document).height()-72+'px');
//$('#copyrights').css('top', $(document).height()-30+'px');
}
stop_scroll = false;
/*
function slider(container, content, direction){
if(!stop_scroll){
leftPos_int = parseInt($('#'+container).css('left'))-(direction)*parseInt($('#'+content).width());
if(direction==-1){
if(leftPos_int>0){
stop_scroll=false;
return;
}
}else{
if(leftPos_int*(-1)>$('#'+container+' .product_thumb').length*136){
stop_scroll=false;
return;
}
}
leftPos = leftPos_int+'px';
if($('#'+container).width()<=((parseInt(leftPos))*(-1))){
$('#'+container).animate( { left:'0px' }, 1000, '', function(){ stop_scroll=false; } );
}else{
$('#'+container).animate( { left:leftPos }, 1000, '', function(){ stop_scroll=false; } );
}
}
}
*/
function submitSearchForm(url, form){
location = url + document.forms['search'].elements['q'].value;
}
function getMouseXY(e) {
if (document.all) { // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft
tempY = event.clientY + document.body.scrollTop
} else { // grab the x-y pos.s if browser is NS
tempX = e.pageX
tempY = e.pageY
}
// catch possible negative values in NS4
if (tempX < 0){tempX = 0}
if (tempY < 0){tempY = 0}
// show the position values in the form named Show
// in the text fields named MouseX and MouseY
return { x:tempX, y:tempY }
}
function ajax(a_url, a_obj, top_pos){
$.ajax({
async: true,
url: a_url,
cache: false,
beforeSend: function(){
//$("#"+a_obj).slideUp(1000, function(){ });
},
success: function(html){
$("#"+a_obj).html(html);
if(top_pos) $("#"+a_obj).animate({height:"150px", top:top_pos}, 1000);
},
//timeout: 20,
complete: function(html){
}
});
}
function post(a_url, a_obj, form){
$.ajax({
type: "POST",
async: true,
url: a_url,
cache: false,
data: formData2QueryString(form),
beforeSend: function(){
$("#"+a_obj).fadeOut(500, function(){ });
},
success: function(html){
$("#"+a_obj).html(html);
$("#"+a_obj).fadeIn(1000);
},
//timeout: 20,
complete: function(html){
}
});
}
function setSelected(obj, val){
for(i=0; i1){
if((arr[1]).length<2)
str = str + "0";
if((arr[1]).length>2)
str = Math.round(str*100)/100;
}else{
str = str + ".00";
}
return str;
}
function checkInt(x){
var filter = /^[0-9]*$/;
if (filter.test(x)) return true;
else return false;
}
function valid_email(){
if(checkMail(document.forms['news'].elements['email'].value))
document.forms['news'].submit();
else
alert('Neteisingai įvestas el. paštas.');
}
function checkMail(x)
{
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(x)) return true;
else return false;
}
function valid_number(x)
{
var filter = /^([0-9])*$/;
if (filter.test(x)) return true;
else return false;
}
function inputFocus(field){
if(document.getElementById(field.name + '_').value != 1)
field.value='';
}
function inputBlur(field, text){
if(document.getElementById(field.name + '_').value != 1 && field.value != '')
document.getElementById(field.name + '_').value = 1;
if(document.getElementById(field.name + '_').value != 1)
field.value = text;
}
function show_hide(id){
var obj = document.getElementById(id);
if(obj.style.display=='none'){
//obj.style.visibility='visible';
//obj.style.position='static';
obj.style.display = 'block';
}else{
//obj.style.visibility='hidden';
//obj.style.position='absolute';
obj.style.display = 'none';
}
}