var bestBuy = new Array(); bestBuy[0] = '
'+ 'L-Carnitin Instant'+ '
'+ '
L-Carnitin Instant
'+ '
'+ '
'+ '   '+ '
'+ '
'; bestBuy[1] = '
'+ 'Instant Energy Drink'+ '
'+ '
Instant Energy Drink
'+ '
'+ '
'+ '   '+ '
'+ '
'; bestBuy[2] = '
'+ 'Isotonic R'+ '
'+ '
Isotonic R
'+ '
'+ '
'+ '   '+ '
'+ '
'; var nrBestBuy = 3; var currentItem = 0; function slideBestBuy(){ if(currentItem>=nrBestBuy-1){ $('slideBestBuy').innerHTML = bestBuy[currentItem]; currentItem = 0; } else{ $('slideBestBuy').innerHTML = bestBuy[currentItem]; currentItem++; } //slideBestBuy setTimeout("slideBestBuy()", 4000); } setTimeout("slideBestBuy()", 4000); function getPage(page, div, id){ //page = fisier prelucrare, div= element care se actualizeaza var param = "id="+id; res = ajaxUpdate( div, page, { params:param, meth:"post", async:true, startfunc:"onById('loading')", endfunc:"offById('loading'); onById('"+div+"');", errorfunc:"ajaxError()" } ); var scrollpos = getScrollingPosition(); document.getElementById('loading').style.top = scrollpos[1]+100; return false; } function emptyCart(){ return getPage('http://www.supplementenergy.co.uk/shopping.cart.empty.php', 'shoppingCartSummary', ''); } function refreshSC(){ getPage('http://www.supplementenergy.co.uk/shopping.cart.refresh.mini.php', 'shoppingCartSummary', ''); setTimeout("getPage('http://www.supplementenergy.co.uk/shopping.cart.refresh.mini.php', 'shoppingCartSummary', '')",2000); } var url_server = 1; function addToCart(idProdus){ for(i=1;i<=4;i++){ if($('prod_'+idProdus+'_'+i).type=='radio' &&$('prod_'+idProdus+'_'+i).checked==true){ getPage('http://www.supplementenergy.co.uk/shopping.cart.add.do.php', 'shoppingCartInfo', 'total!=!'+i+'!|!prod!=!'+idProdus); refreshSC(); } } } function onById(id){ document.getElementById(id).style.display = "block"; var scrollpos = getScrollingPosition(); document.getElementById(id).style.top = scrollpos[1]+100; // + 300; } function offById(id){ document.getElementById(id).style.display = "none"; } function ajaxError(){ alert( "There was an error encountered while performing the request. Please try again later." ); } function $(id){ return document.getElementById(id); } function getScrollingPosition() { var position = [0, 0]; if (typeof window.pageYOffset != 'undefined') { position = [ window.pageXOffset, window.pageYOffset ]; } else if (typeof document.documentElement.scrollTop != 'undefined' && document.documentElement.scrollTop > 0) { position = [ document.documentElement.scrollLeft, document.documentElement.scrollTop ]; } else if (typeof document.body.scrollTop != 'undefined') { position = [ document.body.scrollLeft, document.body.scrollTop ]; } return position; } function MsgBox(url,msg) { if(confirm(msg)) window.location = url; } function $(id){ try{ return document.getElementById(id); } catch(err){ return false; } }