  function inArray(val,arr) {
	  var e=arr.length;
	  var ret = false;
	  for(var i=0;i<e;i++) {
	      if( arr[i] == val) {
		      ret = true;
			  break;
			  }
	      }
	  return ret;
	  
      }
	  
var view = "world";
	  
  function contentloader(land) {
  
	var europa = new Array();
	europa[0] = "dk_n_s";
	europa[1] = "finland";
	europa[2] = "france";
	europa[3] = "poland";
	europa[4] = "italy";
	europa[5] = "cz_sk";
	europa[6] = "b_nl";
	europa[7] = "spain_portugal";
	europa[7] = "d_a_ch";
  
    $("#infoCountry").html('');
	$('#infoCountry').addClass('load');
	
	$.get("/version2/misc/inc_contact_international/int_"+land+".txt",function(data) {
	    $('#infoCountry').html(data);
	    $('#infoCountry').removeClass('load');
		
		$('#infoCountry').show();
		if( self.pageYOffset<240 )
			self.scrollTo(0, 240);
		}
		);
	if( inArray(land,europa) && view!="europe" )
	    changeView("europe");
	else if( ! inArray(land,europa) && view!="world")
	    changeView("world");
	
  };
  
function changeView(v) {
    switch(v) {
	    case "europe":
			if(view=="europe") break;
			view = "europe";
			$("#wmap").animate({ width:"2519px",
								 height:"1300px",
								 marginLeft:"-930px",
								 marginTop:"-90px"}, 1000 );
			$("#wmap").fadeOut(400,function() { $("#wmapsmall_link").fadeIn(500); } );
			break;
		case "world":
			if(view=="world") break;
			view = "world"
			$("#wmapsmall_link").fadeOut(600);
			$("#wmap").fadeIn(400, function(){
				$("#wmap").animate({ width:"620px",
									 height:"320px",
									 marginLeft:"0px",
									 marginTop:"0px"}, 1000 );
				} );
			break;
		case "switch":
			if(view=="europe")
			    changeView("world");
			  else
			    changeView("europe");
			break;
		default:
			changeView("world");
			break;
			
	    }
    }

$(document).ready(function(){
$.get("/version2/misc/international_map.txt",function(data) {
	$("#container_wmap").html(data);
	$("#wmapsmall_link").hide();
	
$("#mapklickeuropa").click(function(){changeView("europe");});
$("#wmapsmall_link").click(function(){changeView("world");});

$("#nojshint").prepend("<span style=\"color:#f00\">JavaScript detected.</span> ");
$("#nojshint").hide();
$("#infoCountry").hide();

});

});
