/* VECTORMAP MAIN Java<script> */

var debugSwitch = false;

loadClockImg = new Image(); loadClockImg.src="../_elements/vm_logoClock_red1.png"; 

function writemail(mb,dm,tld) { 
document.write("<a class='mailto' href='mai"+"lto:"+mb+"@"+dm+"."+tld+"'>"+mb+"@"+dm+"."+tld+"<\/a>");
}

function DBG(bug,add) {
if (debugSwitch == true) {
document.debugForm.debugMsg.value = (add==true) ? document.debugForm.debugMsg.value+"\n"+bug : "\n"+bug;
document.debugForm.style.display="block"; 
						} 
}

function execLine() {
document.debugForm.debugMsg.value += eval(document.debugForm.commandLine.value)+"\n";
}

function cls() {
document.debugForm.debugMsg.value="";
return self;
}

function quit() {
document.debugForm.style.display="none";
debugSwitch = false;
return self;
}

function hide() {
document.debugForm.style.display="none";
return self;
}




function postload_init() {
currentimgobj = getObjectById("blend_div_"+gk_current_img_nr);
gk_setZtop(currentimgobj);
window.setTimeout("gk_slideshow('start')",3000);
}

function gk_slideshow(startstop) {
if (startstop == "start") { autofade = window.setInterval("gk_next_img()",10000); }
if (startstop == "stop") { autofade = window.clearInterval(autofade); }
}

var loadRotate = 0;
var loadRotations = 1;
var aRo = "";

function loadingClock() {
var loadRotate = 0;
var loadRotations = 1;
document.getElementById("vmAnimClip").style.height="64px";
document.getElementById("vmAnimClip").style.display="block";
aRo = document.getElementById("vmAnim");
arrowtation = window.setInterval("arrowtate()",166);
}

function arrowtate() {
loadRotate = (loadRotate > -1855) ? loadRotate-64 : 0;
loadRotations = (loadRotate == 0) ? loadRotations-1 : loadRotations;
aRo.style.left = loadRotate + "px";
// if (loadRotations == 0) { window.clearInterval(arrowtation); fcf = window.setInterval("wipeClock()",10); }
} 

function stopClock() {
window.clearInterval(arrowtation); 
document.getElementById("vmAnimClip").style.display="none";
// fcf = window.setInterval("wipeClock()",16);
}

function wipeClock() {
document.getElementById("vmAnimClip").style.height = (parseInt(document.getElementById("vmAnimClip").style.height) - 2) + "px";
if (parseInt(document.getElementById("vmAnimClip").style.height) < 1) { document.getElementById("vmAnimClip").style.display="none"; window.clearInterval(fcf); }
}

String.prototype.splitCSV = function(sep) {
  for (var csvSplit = this.split(sep = sep || ","), x = csvSplit.length - 1, tl; x >= 0; x--) {
    if (csvSplit[x].replace(/"\s+$/, '"').charAt(csvSplit[x].length - 1) == '"') {
      if ((tl = csvSplit[x].replace(/^\s+"/, '"')).length > 1 && tl.charAt(0) == '"') {
        csvSplit[x] = csvSplit[x].replace(/^\s*"|"\s*$/g, '').replace(/""/g, '"');
      } else if (x) {
        csvSplit.splice(x - 1, 2, [csvSplit[x - 1], csvSplit[x]].join(sep));
      } else csvSplit = csvSplit.shift().split(sep).concat(csvSplit);
    } else csvSplit[x].replace(/""/g, '"');
  } return csvSplit;
}; // nice one from www.greywyvern.com, thanks!


Number.prototype.formatMoney = function(c, d, t){
var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
   return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
 };

 function warnDataLoss() {
 // if (document.lsForm) {
    // if  (document.lsForm.writeToCookieLic.checked == false || document.lsForm.writeToCookieLic.checked == false) {
	//	leavePage = confirm("Achtung: Ihre Ebenen- oder Lizenzauswahl ist nicht gespeichert! \n Wenn Sie die Seite verlassen, geht Ihre Auswahl verloren. \n\n Wollen Sie die Auswahl jetzt als Cookies speichern?");
	//	if (leavePage == false) { return; } else { writeCookie("layerSelection"); writeCookie("licenseSelection"); }
	//																											 }							
	//				 }		 
 }
 
 
blinker = new Array();

function blinkColor(ObjName,interVal) { 
window.setTimeout("blinker['"+ObjName+"1'] = window.setInterval('document.getElementById(\""+ObjName+"\").style.color=\"#c10000\"',"+(interVal*2)+")",1);
window.setTimeout("blinker['"+ObjName+"2'] = window.setInterval('document.getElementById(\""+ObjName+"\").style.color=\"#ff6d0d\"',"+(interVal*2)+")",interVal);
}

function blinkBackGround(ObjName,interVal) { 
window.setTimeout("blinker['"+ObjName+"3'] = window.setInterval('document.getElementById(\""+ObjName+"\").style.backgroundColor=\"#c10000\"',"+(interVal*2)+")",1);
window.setTimeout("blinker['"+ObjName+"4'] = window.setInterval('document.getElementById(\""+ObjName+"\").style.backgroundColor=\"#ff6d0d\"',"+(interVal*2)+")",interVal);
}
