
function load_page(url, effect, current)
{
	if(effect=='fade')
	{
		$.get(url, function(data){
			$("#jqueryFade").fadeOut(1500, function(){
				$("#jqueryFade").fadeIn(1500).html(data);
			});
		});
		
		$.get('/get_sidebar.php?current='+current, function(data){
			$("#jqueryFade2").fadeOut(1500, function(){
				$("#jqueryFade2").fadeIn(1500).html(data);
			});
		});
	}
	else
	{
		$.get(url, function(data){
			$("#jqueryFade").slideUp("normal", function () {
				$("#jqueryFade").html(data).slideDown("normal");
			});
		});
		
		$.get('/get_sidebar.php?current='+current, function(data){
			$("#jqueryFade2").slideUp("normal", function () {
				$("#jqueryFade2").html(data).slideDown("normal");
			});
		});
	}
}

function popup(url, width, height, mode)
{
	if(!width)
	{
		width = 800;
	}
	
	if(!height)
	{
		height = 600;
	}
	
	var left = (screen.width-width)/2;
	var top = (screen.height-height)/2;
	var settings ='height='+height+',';
	settings +='width='+width+',';
	settings +='top='+top+',';
	settings +='left='+left+',';
	settings +='scrollbars=yes,';
	settings +='resizable=yes';
		
	if(mode == 'full')
	{
		// full screen mode
		settings +=',location=yes,toolbar=yes';
	}
	
	win = window.open(url, '', settings);
	
	if(parseInt(navigator.appVersion) >= 4)
	{
		win.window.focus();
	}
	
}


function get_selected_index (object)
{
	if(object.options)
	{
		return object.options[object.selectedIndex].value;
	}
	return '';
}

function check_postage_country ()
{
	if(get_selected_index(document.getElementById('country')) == '')
	{
		alert('Please select your shipping location');
		return false;
	}
	return true;
}