// JavaScript Document
$(document).ready(function() {
	
	$("a.sedi").fancybox({
		'width'				: 700,
		'height'			: 650,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'overlayOpacity'	: 0.7,
		'overlayColor'		: '#000'
	});

});

function createMarker(map,point,title,html,icon,icon_shadow,sidebar_id,openers){
	var marker_options={
		position:point,
		map:map,
		title:title
	};
	if(icon!=''){
		marker_options.icon=icon;
	}
	if(icon_shadow!=''){
		marker_options.icon_shadow=icon_shadow;
	}
	var new_marker=new google.maps.Marker(marker_options);
	if(html!=''){
		var infowindow=new google.maps.InfoWindow({content:html});
		google.maps.event.addListener(new_marker,'click',function(){
			$("<a href='"+$(html).text()+"'>"+title+"</a>").fancybox({
				'width'				: 700,
				'height'			: 650,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe',
				'overlayShow'		: true,
				'overlayOpacity'	: 0.7,
				'overlayColor'		: '#000'
			}).click();
		});
		if(sidebar_id!=''){
			var sidebar=document.getElementById(sidebar_id);
			if(sidebar!=null&&sidebar!=undefined){
				var newlink=document.createElement('a');
				newlink.onclick=function(){
					infowindow.open(map,new_marker);
					return false
				};
				newlink.innerHTML=title;
				sidebar.appendChild(newlink);
			}
		}
		if(openers!=''&&!isEmpty(openers)){
			for(var i in openers){
				var opener=document.getElementById(openers[i]);
				opener.onclick=function(){
					infowindow.open(map,new_marker);
					return false
				};
			}
		}
	}
	return new_marker;
}
