//CSS-Selector selecting the right CSS file

if (navigator.platform.indexOf('Mac') == -1) {
	if (navigator.userAgent.indexOf('MSIE') != -1) {
		document.write('<link rel="stylesheet" type="text/css" href="/include/gkg.css" title="IE (nicht Mac)">');
	} else {
		document.write('<link rel="stylesheet" type="text/css" href="/include/gkg.css" title="andere (nicht Mac)">');
	}
} else {
	if (navigator.userAgent.indexOf('MSIE') != -1) {
		document.write('<link rel="stylesheet" type="text/css" href="/include/gkg_mac.css" title="IE auf Mac">');
	} else {
		document.write('<link rel="stylesheet" type="text/css" href="/include/gkg_mac.css" title="Andere auf Mac">');
	}
}

//Functions opening popup windows

function impressum(lang) {
	if(lang) {
		window.open("/"+lang+"/impressum.html","Impressum","width=670,height=600,left=30,top=30");
	} else {
		window.open("/de/impressum.html","Impressum","width=670,height=600,left=30,top=30");
	}
}

function login(sid,lang) {
	window.open("/"+lang+"/login_confirm.html?SID="+sid,"Login","width=470,height=400,directories=no,hotkeys=yes,location=no,resizeable=no,scrollbars=yes,status=yes,titlebar=yes,toolbar=no")
}

function logout(sid,lang) {
  window.open("/"+lang+"/logout_confirm.html?SID="+sid,"Logout","width=470,height=400,directories=no,hotkeys=yes,location=no,resizeable=no,scrollbars=yes,status=yes,titlebar=yes,toolbar=no")
}

function kontakt(sid,kid,lang) {
  if(lang == "de") {
  	window.open("/de/dyn_output.html?SID="+sid+"&content.void=428&content.extdata[kid]="+kid,"_blank","width=530,height=400,directories=no,hotkeys=yes,location=no,resizeable=yes,scrollbars=no,status=yes,titlebar=yes,toolbar=no");
  } else {
  	window.open("/fr/dyn_output.html?SID="+sid+"&content.void=595&content.extdata[kid]="+kid,"_blank","width=530,height=400,directories=no,hotkeys=yes,location=no,resizeable=yes,scrollbars=no,status=yes,titlebar=yes,toolbar=no");
  }	
}

//Functions used for the events...

function goback(currForm, previd) {
	currForm.elements['content.extdata[startat]'].value = previd;
	currForm.submit();
}

function goforward(currForm, nextid) {
	currForm.elements['content.extdata[startat]'].value = nextid;
	currForm.submit();
}

//Function used to print contact

function printContact(lang) {
	if (window.print) {
		setTimeout('window.print();',200);
	}
	else if (agt.indexOf("mac") != -1) {
	  if(lang == "de") {
		alert("'Cmd+p' drücken um diesen Artikel zu drucken.");
	  } else {
	    alert("Appuyer sur 'Cmd+p' pour imprimer sette page.");
	  }
	}
	else {
	  if(lang == "de") {
		alert("'Ctrl+p' drücken um diesen Artikel zu drucken.");
	  } else {
	  	alert("Appuyer sur 'Ctrl+p' pour imprimer sette page.");
	  }
	}
}