function updatebasket(){
				$.ajax({
				type:'GET',
				url:'/electroshop/b_info2.php',
				dataType:'html',
				cache:false,
				success:function(html){$('#topbasket').html(html)},
				error: function(xhr, type, exception) { alert("Error: " + type);} 
				});
	}

function buy(id){	
				$.ajax({
				type:'GET',
				url:'/electroshop/b_info2.php?add='+id,
				dataType:'html',
				cache:false,
				success:function(html){$('#topbasket').html(html)},
				error: function(xhr, type, exception) { alert("Error: " + type);} 
				});
	}
	
function st(id){
				$.ajax({
				type:'GET',
				url:'/electroshop/b_info2.php?st='+id,
				dataType:'html',
				cache:false,
				success:function(html){$('#topbasket').html(html)},
				error: function(xhr, type, exception) { alert("Error: " + type);} 
				});
	            window.location.reload();
	}
	
function xreload(){
                window.location.reload();
	}
	

	
	
function sbw(event,id){
	
         oCanvas = document.getElementsByTagName('HTML')[0];
        document.getElementById('movingbox').style.left =  event.clientX + oCanvas.scrollLeft +60+'px';
        document.getElementById('movingbox').style.top =  event.clientY + oCanvas.scrollTop - 50+'px';	
		document.getElementById('id').style.visibility = 'visible';

	
	}
	
	
function hbw(event,id){
	
		document.getElementById('id').style.visibility = 'hidden';

	
	}
	
	

	
function set_cookie(cookie_name, value, expire)
{
    var expire_date = new Date();
    
    expire_date.setDate(expire_date.getDate() + expire);
    document.cookie = (cookie_name + "=" + escape(value) + ((expire == null) ? "" : ";expires=" + expire_date.toGMTString()));

    return true;
}

function get_cookie(cookie_name)
{
    if (document.cookie.length > 0) {
        cookie_start = document.cookie.indexOf(cookie_name + "=");
        
        if (cookie_start != -1) { 
            cookie_start = ((cookie_start + cookie_name.length) + 1); 
            cookie_end   = document.cookie.indexOf(";", cookie_start);
            
            if ( cookie_end == -1) {
                cookie_end = document.cookie.length;
            }
            
            return unescape(document.cookie.substring(cookie_start, cookie_end));
        } 
    }
    
    return false;
}

function set_def(){

  set_cookie('s_width',screen.width,14);

}

