var shadowboxLang = '';
switch(coreLang) {
	case "EN": shadowboxLang = 'en';
	break;
	case "RU": shadowboxLang = 'ru';
	break;
	case "FR": shadowboxLang = 'fr';
	break;
}
Shadowbox.loadSkin('classic', '/css/skin');
Shadowbox.loadLanguage(shadowboxLang, '/js/lang');
Shadowbox.loadPlayer(['flv', 'html', 'iframe', 'img', 'qt', 'swf', 'wmp'], '/js/player');


function openSB($content, $player, $title, $width, $height){
	
	Shadowbox.open({
		player:     $player,
		title:      $title,
		content:    $content,
		height:     $height,
		width:      $width
	});
	
}

function printSBMap() {
//	var theWork =  window.open('/googlemaps/googlemaps.html');
//	theWork.onload = function () {var frame = theWork.frames[0]; theWork.print(); theWork.close();}
//	return false;
	var frameWindow = document.all ? document.all.shadowbox_content : document.getElementById('shadowbox_content');
	frameWindow.focus();
	frameWindow = frameWindow.contentWindow;
	var googleFrame = frameWindow.document.all ? frameWindow.document.all.google_frame : frameWindow.document.getElementById('google_frame');
//	var theWork =  window.open(googleFrame.src + '&pw=2');
	var theWork =  window.open('/googlemaps/googlemaps_print.html');
//	theWork.document.onreadystatechange = function () {
//		alert(document.readyState);
//		if (document.readyState=="complete") {
//			alert('test');
//		}
  
//	}
//	theWork.onload = function () {theWork.frames[0].onload = function () {theWork.print(); theWork.close();}}
//	googleFrame.style.overflow = "hidden";
//	frameWindow.print();
}

function onSbFinish() {
	var newDiv = $('<a id="shadowbox_nav_print" href="#" onclick="printSBMap();" title="Print"></a>');
	if ($('a#shadowbox_nav_print') != null){
		$('a#shadowbox_nav_print').remove();
	}
	newDiv.insertAfter($('a#shadowbox_nav_close'));
//	}
}