function $(id) {
	return document.getElementById(id);
}

function addto_pr(id)
{
	//var count = $('count_'+id).value;
	var count = 1;
	addto(id,count);
}

function addto(id,count)
{
	y=screen.height/2-125;
	x=screen.width/2-135;                
	win=window.open("/add/index/"+id+"/"+count,"erwvyeirbywveiburi35r34ui5vt3o4ivb531","toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0, width=270,height=150,top="+y+",left="+x+"");
}

function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results )
    return ( unescape ( results[2] ) );
  else
    return null;
}

function set_cookie ( name, value, exp_y, exp_m, exp_d, path, domain , secure )
{
	//path ='/';

  var cookie_string = name + "=" + escape ( value );

  if ( exp_y )
  {
    var expires = new Date ( exp_y, exp_m, exp_d );
    cookie_string += "; expires=" + expires.toGMTString();
  }

  if ( path )
        cookie_string += "; path=" + escape ( path );

  if ( domain )
        cookie_string += "; domain=" + escape ( domain );
  
  if ( secure )
        cookie_string += "; secure";
  
  document.cookie = cookie_string;
}

function show_submenu(id)
{
	for (i = 1; i <= submenus_count; i++)
	{
		$('submenu_'+submenus[i]).style.display = 'none';
	}

	$('submenu_'+id).style.display = 'block';
}

