var language
function getLanguage() {
language = (navigator.language || navigator.systemLanguage || navigator.userLanguage || 'en').substr(0, 2).toLowerCase();
return language;
}

function setItem(id, value) {
	var obj = document.getElementById(id)
	
	if(obj.value == "false") {
		obj.value = "";
	} else {
		obj.value = value;
	}
}

function getWidget(id, width, height, z, mt, d, p) {

	setItem('mapID', id);
	setItem('mapWidth', width);
	setItem('mapHeight', height);
	
	setItem('mapZoom', z);
	setItem('mapType', mt);
	setItem('mapDrag', d);
	setItem('mapPosition', p);
	
	wow_scribble_maps_GetWidgetBtn.open();
}

function getURL() {
return window.location.toString();
}

function clearMapID(ID) {
window.location.href="#";
}

function showMapID(ID) {
window.location.href="#id="+ID;
}

function preventClose() {
if(halted == "true") {
    return "You have not saved the map you are working on.";
}
}
window.onbeforeunload = preventClose;

function halt(value) {
	halted = value;
}

var halted

var rsize = 160;
 
function resize()
    {
        var container = document.getElementById('container');
          var myWidth = 0, myHeight = 0;
          if( typeof( window.innerWidth ) == 'number' ) {
            //Non-IE
            myWidth = window.innerWidth;
            myHeight = window.innerHeight;
          } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
            myHeight = document.documentElement.clientHeight;
          } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
            //IE 4 compatible
            myWidth = document.body.clientWidth;
            myHeight = document.body.clientHeight;
          }
          
          container.style.height = myWidth - rsize;
    }

resize();