function checkIeVersion(){
	var version = 999; // we assume a sane browser
    if (navigator.appVersion.indexOf("MSIE") != -1){
      // bah, IE again, lets downgrade version number
      version = parseFloat(navigator.appVersion.split("MSIE")[1]);
	}
    if (version<7){	
		var info = "Browser version: "+ version + "\n";
		info += "Da biste ispravno pregledali sajt potreban je internet explorer 7 ! \n";
		info += "Da li zelite da preuzmete Internet Explorer 7 ?";
		conf = confirm(info);
		if (conf){
		  location.href = "http://www.microsoft.com/windows/downloads/ie/getitnow.mspx";  
		}else
		{
		  history.go(-1);
		}		  
	}	
}

function callPage(serverName, page){	
	switch(page)
	{
		case "Link1":
			location.href = serverName+"index.php/main_cg/index/o_hotelu";
			break;    
		case "Link2":
			location.href = serverName+"index.php/main_cg/index/rooms";
			break;
		case "Link3":
			location.href = serverName+"index.php/main_cg/index/restaurants_bars";
			break;
		case "Link4":
			location.href = serverName+"index.php/main_cg/index/conferences_banquets";
			break;
		case "Link5":
			location.href = serverName+"index.php/main_cg/index/podgorica_informacije";
			break;
		case "Link6":
			location.href = serverName+"index.php/main_cg/index/galerija";
			break;
		case "Link7":
			location.href = serverName+"index.php/main_cg/index/ostale_usluge";
			break;       
		default:
			location.href = serverName+"index.php/main_cg/index/home";
	}			
}
function callPage_eng(serverName, page){	
	switch(page)
	{
		case "Link1":
			location.href = serverName+"index.php/main_eng/index/o_hotelu";
			break;    
		case "Link2":
			location.href = serverName+"index.php/main_eng/index/rooms";
			break;
		case "Link3":
			location.href = serverName+"index.php/main_eng/index/restaurants_bars";
			break;
		case "Link4":
			location.href = serverName+"index.php/main_eng/index/conferences_banquets";
			break;
		case "Link5":
			location.href = serverName+"index.php/main_eng/index/podgorica_informacije";
			break;
		case "Link6":
			location.href = serverName+"index.php/main_eng/index/galerija";
			break;
		case "Link7":
			location.href = serverName+"index.php/main_eng/index/ostale_usluge";
			break;       
		default:
			location.href = serverName+"index.php/main_eng/index/home";
	}			
}

// fucntion called from flash and XHTML
function popup(name)
{
    var fullName = '#popup'+name;
	
    //centering with css  
    centerPopup(fullName);  
    //load popup  
    loadPopup(fullName);      
}
function popitup(url,name,width,height) {
	
	newwindow=window.open(url,name,'width='+width+','+'height='+height);
        
        //Center new window
        var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
        var popupWidth = width;
        var popupHeight = height;
        
        var top = windowHeight/2-popupHeight/2;
	var left = windowWidth/2-popupWidth/2;
        
        //document.documentElement.scrollLeft/Top.
        newwindow.moveTo(left, top);
        
	if (window.focus) {newwindow.focus()}
	return false;
}
function Flashpopitup(url,name,width,height) {
	
		width = 415;
		height = 497;
	
	newwindow=window.open(url,name,'width='+width+','+'height='+height);
        
        //Center new window
        var windowWidth = document.documentElement.clientWidth;
	var windowHeight = document.documentElement.clientHeight;
        var popupWidth = width;
        var popupHeight = height;
        
        var top = windowHeight/2-popupHeight/2;
	var left = windowWidth/2-popupWidth/2;
        
        //document.documentElement.scrollLeft/Top.
        newwindow.moveTo(left, top);
        
	if (window.focus) {newwindow.focus()}
	return false;
}
function PlayVideo() {
               
    thisMovie("video").actioncriptPlayVideo();                        
                       
}  

function StopVideo() {
               
    thisMovie("video").actioncriptStopVideo();                        
                       
}          
        
function thisMovie(movieName) {
      if (navigator.appName.indexOf("Microsoft") != -1) {
          return window[movieName];
      }
      else {
          return document[movieName];
      }
}
function roll(img_name, img_src){
	document[img_name].src = img_src;
}
function initialize() {
      
	  if (GBrowserIsCompatible()) {
	  	
		//get div tag to place map inside
        var map = new GMap2(document.getElementById("lokacija_map"));
		
		//set map ceter
        map.setCenter(new GLatLng(42.438629,19.256415), 13);
						
		//create new point and add Marker
		var point = new GLatLng(42.438629,19.256415);
		map.addOverlay(new GMarker(point));
		
		//set Zoom
		map.setZoom(22); 
		
		//get default UI
		var customUI = map.getDefaultUI();
		        
		// Remove MapType and Controls propety
        customUI.maptypes.normal = false;
		customUI.maptypes.hybrid = false;
		customUI.maptypes.physical = false;		
		customUI.controls.scalecontrol  = false;
		 
		//set UI
        map.setUI(customUI);
        
      }
}
checkIeVersion();