$(document).ready(function() {
	//if(site_error) show_feedback(site_error_msg);
	
	$('#feedback_link').click(function(event){
		event.preventDefault();
		$("#wrapper2").hide();
		$("#feedback").hide();
		$("#wrapper").fadeTo("", 1.0);
	});
	
	$("a").focus(function(){
		this.blur();
	});
	
	$("a[rel='external']").click(function(event){
		event.preventDefault();
		window.open(this);
	});
	
	$("#country").change(function(event){
		var cc_lc = this.value;
		var temp = cc_lc.split('_');
		var url = '?cc=' + temp[0] + '&lc=' + temp[1];
		if(page.length>0) url += '&pg=' + page;
		if(section.length>0) url += '&section=' + section;

		window.location = url;
	});
	
	$("#link_copy").click(function(event) {
		var temp = '/'+cc+'/'+lc+'/H8.22/'+page+'/outgoing/';
		if(section.length>1) temp += section+'/';
		temp += 'Copyright';
		pageTracker._trackPageview(temp);
	});
	
	$("#link_products").click(function(event) {
		var temp = '/'+cc+'/'+lc+'/H8.23/'+page+'/outgoing/';
		if(section.length>1) temp += section+'/';
		temp += 'Products/';
		pageTracker._trackPageview(temp);
	});
});

function show_feedback(data) {
	$('#wrapper2').show();
	$("#feedback_response").html(data);
	positionBox();
	$(window).scroll(positionBox);
	$(window).resize(positionBox);
	
	$("#feedback").show(500);
	$('#ok_anchor').focus();
}

function positionBox () {
	$('#wrapper2').height( $(document).height() );
	$('#wrapper2').width( $(document).width() );
	var newTop = $(window).scrollTop() + ( $(window).height() / 2 ) - ($('#feedback').height() / 2) - 100;
	$('#feedback').css("top", newTop )
}