$('document').ready(function(){

    $('table.table tr').find("td:eq(0)").addClass('first');	
	
    $('.choose li.active a').click(function() {
        $('.choose li').addClass("clicked");
    });	
	
    $('.clicked a').live('click', function() {
        $('.choose li').removeClass("active");	
        $(this).parents('li').addClass("active");		
    });		

    $('a[rel~="external"]').click(function(){
        $(this).attr({
            "target":"_blank"
        });
    });	
	
});

//----------------------------------------------------------------------------------------------------------------------------------	

/* google maps - starts */

function showMap() {

    var myOptions = {
        zoom: 14,
        center: new google.maps.LatLng(55.6573385, 21.1834651),
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        scrollwheel: false
    }
    var map = new google.maps.Map(document.getElementById("map"), myOptions);

    setMarkers(map, offices);

}


var offices = [
['BTR', 55.6573385, 21.1834651, 1]
]

function setMarkers(map, locations) {
    var image = new google.maps.MarkerImage('images/icon.png',
        // This marker is 20 pixels wide by 32 pixels tall.
        new google.maps.Size(87, 107),
        // The origin for this image is 0,0.
        new google.maps.Point(0,0),
        // The anchor for this image is the base of the flagpole at 0,32.
        new google.maps.Point(0, 107));

    for (var i = 0; i < locations.length; i++) {
        var office = locations[i];
        var myLatLng = new google.maps.LatLng(office[1], office[2]);
        var marker = new google.maps.Marker({
            position: myLatLng,
            map: map,
            icon: image,
            title: office[0],
            zIndex: office[3]
        });
    }
}



/* google maps - ends */

$(function(){
	if($('#map').length > 0){
		showMap();
	}
	
	/* fix news imagers */
	var imgCorner = $('div.oneNew .imgCorner');
	if(imgCorner.length > 0){
		imgCorner.click(function(){
			window.location = $(this).parents('div.oneNew').find('h3 a').attr('href');
		});
	}
});


















