////////////////////////
// javascript Bar C   //
////////////////////////
// (c) 2004 Winston   //
// www.winston-inc.de //
////////////////////////

// Anzahl der Hintergrundgrafiken
var anzahlGrafiken = 41;

// Farbe Navigation bestimmen
activnav = 0;
hat = 			"hut_dblau.gif";// Default z.B. für Home, Kontakt...
setColorLight = "e6d8bb"; 		// Default z.B. für Home, Kontakt...
setColor = 		"09115d"; 		// Default z.B. für Home, Kontakt...

// Sprache
language = "";

for (a=0; a < ca_folder_path.length; a++){ tmp = ca_folder_path[a];
// Deutsch
if (tmp == 4 || tmp == 20 || tmp == 28) {setColor = "B50615"; setColorLight = "F3D7B3"; hat = "hut_rot.gif"; 	activnav = 1} // Geschichte
if (tmp == 5 || tmp == 21 || tmp == 29) {setColor = "394F04"; setColorLight = "EBDEB2"; hat = "hut_dgruen.gif"; activnav = 2} // Bar C Ranch Resort
if (tmp == 6 || tmp == 22 || tmp == 30) {setColor = "782902"; setColorLight = "F2DBB2"; hat = "hut_braun.gif"; 	activnav = 3} // Bar C Ranch Team
if (tmp == 7 || tmp == 23 || tmp == 31) {setColor = "EEBC25"; setColorLight = "FDEAB5"; hat = "hut_gelb.gif"; 	activnav = 4} // Cattle Ranch
if (tmp == 8 || tmp == 24 || tmp == 32) {setColor = "90AA15"; setColorLight = "F4E8B3"; hat = "hut_hgruen.gif";	activnav = 5} // Anreise
if (tmp == 9 || tmp == 25 || tmp == 33) {setColor = "3E94D1"; setColorLight = "EBE6C8"; hat = "hut_blau.gif"; 	activnav = 6} // Presse

// Englisch
/*if (tmp == 11) {setColor = "B50615"; setColorLight = "F3D7B3"; hat = "hut_rot.gif"; 	activnav = 1} // History
if (tmp == 12) {setColor = "394F04"; setColorLight = "EBDEB2"; hat = "hut_dgruen.gif"; 	activnav = 2} // Bar C Ranch Resort
if (tmp == 13) {setColor = "782902"; setColorLight = "F2DBB2"; hat = "hut_braun.gif"; 	activnav = 3} // Cattle Ranch
if (tmp == 14) {setColor = "EEBC25"; setColorLight = "FDEAB5"; hat = "hut_gelb.gif"; 	activnav = 4} // Guest Comments
if (tmp == 15) {setColor = "90AA15"; setColorLight = "F4E8B3"; hat = "hut_hgruen.gif";	activnav = 5} // How to get there
if (tmp == 16) {setColor = "3E94D1"; setColorLight = "EBE6C8"; hat = "hut_blau.gif"; 	activnav = 6} // Press
*/
}

// Subnavigation  (Linkname , Seiten_ID)
// Hinweis: Die Javascript-Freie Navigation im Template abgleichen !
subnav_de = new Array();
subnav_en = new Array();
subnav_nl = new Array();

// ### Deutsch ###
// Geschichte
subnav_de[1] = [
"1.000 Pferde",			"pferde.html",
"Die Bar C heute",		"barc_heute.html",
"Kontakt",				"kontakt.html"
];
// Bar C Ranch Resort
subnav_de[2] = [
"Cowboy auf Zeit",		"cowboy_auf_zeit.html",
"Aktiv im Westen",		"aktiv_im_westen.html",
/*"Unser Angebot",		"angebot.html",
"Buchung",				"buchung.html",*/
"Begeisterte Gäste",	"gaeste.html",
"Kontakt",				"kontakt.html"
];
// Bar C Ranch Team
subnav_de[3] = [
//"Partner werden",		"partner.html",
//"Schnell entscheiden",	"entscheiden.html",
"MyCanada News",			"team_news.html",
"Kontakt",				"kontakt.html"
];
// Cattle Ranch
subnav_de[4] = [
"Der Ranch-Kalender",	"ranch_kalender.html",
"Kontakt",				"kontakt.html"
];
// Anreise
subnav_de[5] = [
"Kontakt",				"kontakt.html"
];
/*
// ### Englisch ###
// Bar C Ranch Resort 
subnav_en[2] = [
"Accommodations",	22,
"Activities",		23,
"Events",			24,
"Entertainment",	25,
"Packages & Prices",26,
"Specials",			28
];
// Cattle Ranch
subnav_en[3] = [
"The Ranch-Calendar",32
];
*/

// ### Englisch ###
// Geschichte
subnav_en[1] = [
"1.000 Pferde",			"index.php?site_id=72",
"Die Bar C heute",		"index.php?site_id=73"
];
// Bar C Ranch Resort
subnav_en[2] = [
"Cowboy auf Zeit",		"index.php?site_id=75",
"Aktiv im Westen",		"index.php?site_id=76",
/*"Unser Angebot",		"index.php?site_id=77",
"Buchung",				"index.php?site_id=78",*/
"Begeisterte Gäste",	"index.php?site_id=79"
];
// Bar C Ranch Team
subnav_en[3] = [
"MyCanada News",			"index.php?site_id=87",
"Team Rules",			"index.php?site_id=89"
];
// Cattle Ranch
subnav_en[4] = [
"Der Ranch-Kalender",	"index.php?site_id=101"
];

// ### Hollaedisch ###
// Geschichte
subnav_nl[1] = [
"1.000 Paarden",		"index.php?site_id=114",
"De Bar C Ranch nu",	"index.php?site_id=115"
];
// Bar C Ranch Resort
subnav_nl[2] = [
"Samen met cowboys",	"index.php?site_id=117",
"Volop activiteiten",	"index.php?site_id=118",
"Wat Bar C biedt",		"index.php?site_id=119",
"Boeking",				"index.php?site_id=120",
"Gastenboek",			"index.php?site_id=121"
];
// Bar C Ranch Team
subnav_nl[3] = [
"MyCanada News",			"index.php?site_id=129"
// "Snel beslissen",	        "index.php?site_id=172"
//"Team Rules",			"index.php?site_id=131"
];
// Cattle Ranch
subnav_nl[4] = [
"De Ranch-Kalender",	"index.php?site_id=143"
];

// Browserweiche
var agt=navigator.userAgent.toLowerCase();
ie = ((document.all) && (window.offscreenBuffering)) ? true : false;
nn = ((document.captureEvents) && (!document.getElementById)) ? true : false;
mz = ((document.getElementById) && (!document.all) && (document.documentElement)) ? true : false;
op = ((document.getElementById) && (navigator.userAgent.indexOf('Opera') != -1)) ? true :false;
is_mac = (agt.indexOf("mac")!=-1);

if (nn) document.write('<link REL="stylesheet" TYPE="text/css" HREF="public/css/style.css">');
else    document.write('<link REL="stylesheet" TYPE="text/css" HREF="public/css/style.css">');

// Zufaellige Hintergrund-Grafiken 
colorImgRan = Math.floor(Math.random()*anzahlGrafiken+1);
document.write('<style type="text/css">');
document.write('body {background-image: url(public/images/bg/bgimgv_'+colorImgRan+'.jpg); background-repeat: no-repeat}');
document.write('.subnavback {  background-color: #'+setColor+'}');
document.write('.containerback {  background-color: #'+setColorLight+'}');
document.write('</style>');

////////////////
// Funktionen //
////////////////

function writeSubNavigation(lang){
subnav = "";

language = lang;

if (lang == "de") subnav = subnav_de;
if (lang == "en") subnav = subnav_en;
if (lang == "nl") subnav = subnav_nl;

if (subnav[activnav]){

document.write('<table width="170" border="0" cellspacing="0" cellpadding="0"><tr>');
document.write('<td><img src="public/images/leer.gif" width="15" height="25"></td>');
document.write('<td height="25"><img src="public/images/leer.gif" width="1" height="25"></td>');
document.write('<td><img src="public/images/leer.gif" width="15" height="25"></td></tr>');
 for(i=0;i<subnav[activnav].length; i=i+2){
  document.write('<tr><td>&nbsp;</td><td height="25">');
  document.write('<a href="'+subnav[activnav][i+1]+'" class="navi"><img src="public/images/pfeil.gif" width="9" height="7" border="0">&nbsp;'+subnav[activnav][i]+'</a>');
  document.write('</td><td>&nbsp;</td></tr>');
 }
document.write('</table>');
}
}


function showHat(){
document.write('<img src="public/images/'+hat+'" width="40" height="42">');
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
	if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	obj.visibility=v; }
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function icon(datei)
{
	var abschnitt = datei.lastIndexOf (".");
	var endung = datei.substring (abschnitt+1,abschnitt+4);
	window.document.writeln("<img src='public/images/icons/",endung,".gif' border='0' width='16' height='16' align='absmiddle'>");
}

function setImages() {
	MM_swapImage(  'cimgage','','public/images/bg/bgimgh_'+colorImgRan+'.jpg',1);
}


