﻿
// Positie van de hoofdrubrieken
var Rbr_Left = 20;		// Linkerposite van de menu's
var Rbr_TopStart = 245;		// Top-positie 1e menu
var Rbr_TopToename = 27;	// Toename top-positie volgende menu
var PosTop = 0;

// Positie submenu ( RELATIVE TO hoofdrubriek )
var xSubOffset = 180;	//3;
var ySubOffset = 5;

// Tesamen met delay: submenu blijft zichtbaar, wanneer je hoofdmenu verlaat en naar submenu gaat
var SubVisible = false;
var delay = 1000;



// Bovenbalk: 848x197. Positie binnen moederomhulsel: (20, 23)
function Pr_Bovenbalk()
{
  document.write( "<div style=\"position:absolute; left:20px; top:23px; width:848px; height:197px;\">\n"
	+ "<img src=\"/styles/bovenbalk_kader.png\" width=\"848\" height=\"197\" border=\"0\" alt=\"\">\n"
	+ '<a href="/">'
	+ "<img src=\"/styles/logo_fc.jpg\" width=\"240\" height=\"153\" border=\"0\" alt=\"Logo Fanclub\""
	+ "style=\"position:absolute; left:10px; top:24px; width:240px; height:153px;\"></a>\n"
	+ "</div>\n" );

  // Magazine-banner in de bovenbalk: postitie tov moeder (269, 37). Rechts van logo
  document.write( "<div id=\"magazine_banner\" style=\"position:absolute; left:269px; top:37px; "
	+ "width:585px; height:167px;\">\n"
	+ "<script type=\"text/javascript\">\n"
	+ "<!--\n"
	+ "var hasReqestedVersion = DetectFlashVer(8, 0, 0);\n"
	+ "if (	hasReqestedVersion	)\n"
	+ "{\n"
    	+ "	AC_FL_RunContent(\n"
	+ "		'src', '/magazine_banner', 'play', 'true', 'loop', 'false',\n"
	+ "		'width', '585', 'height', '167', 'salign', 'C',\n"
	+ "		'scale', 'ShowAll', 'id', 'vid_1', 'quality', 'Best',\n"
	+ "		'wmode', 'transparent', 'name', 'vid_1',\n"
	+ "		'type', 'application/x-shockwave-flash',\n"
	+ "		'codebase', 'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab',\n"
	+ "		'pluginspage', 'http://www.macromedia.com/go/getflashplayer' );\n"
	+ "}\n"
	+ "else\n"
	+ "{\n"
	+ "	var msg2user = 'An old version of the Flash plugin was detected. <strong>' + "
	+ "'<a href=\"http://www.macromedia.com/go/getflash/\">Please upgrade your Flash plugin.' + "
 	+ "'<\/a><\/strong>';\n"
	+ "document.write( msg2user );\n"
	+ "}\n"
	+ "-->\n"
	+ "</script>\n"
	+ "</div>\n" );
}

// Copyright blok, positie tov moeder (29, 805)
function Pr_Copyright()
{
  PosTop = PosTop + Rbr_TopToename;

  // document.write( "<div id=\"copyright\" style=\"position:absolute; left:29px; top:805px; width:175px; \n"
  document.write( "<div id=\"copyright\" style=\"position:absolute; left:29px; top:" + PosTop + "px; width:175px; \n"
	+ "font-weight: 400; font-family: Verdana; font-size: 11px; font-style: italic; \n"
	+ "height:137px; -moz-box-sizing:border-box; box-sizing:border-box; overflow: hidden;\">\n"
	+ "<p>All contents on this site © 1985-2010 The Official International ABBA Fan Club, formerly "
	+ "the Agnetha Benny Björn Frida Fan Club. Please ask permission in writing before using "
	+ "anything published on this website.</p>\n</div>\n" );
// alert('hoi 2: ' + PosTop);
}

// Landenvlaggetjes, vanaf 757 top tov moeder nope: Postop FcLogo + toename + hoogte logo (160)
// PosTop (top tov moeder) en Rbr_TopToename uit menu.js --> Overhevelen naar menu.js !!!

function Pr_Flags()
{
  PosTop = PosTop + Rbr_TopToename + 160;

  document.write( '<div style="position:absolute; left:77px; top:' + PosTop + 'px; width:25px; height:17px;">\n'
	+ '<a href="/languages/japanese">'
	+ '<img src="/images/navigation/japanese.png" border="0" alt="Japanese language"></a>\n</div>\n'
	+ '<div style="position:absolute; left:105px; top:' + PosTop + 'px; width:25px; height:17px;">\n'
	+ '<a href="/">'
	+ '<img src="/images/navigation/english.png" border="0" alt="English language"></a>\n</div>\n'
	+ '<div style="position:absolute; left:133px; top:' + PosTop + 'px; width:25px; height:17px;">\n'
	+ '<a href="/languages/spanish">'
	+ '<img src="/images/navigation/spanish.png" border="0" alt="Spanisch language"></a>\n</div>\n' );

  PosTop = PosTop + 23;
  document.write( '<div style="position:absolute; left:77px; top:' + PosTop + 'px; width:25px; height:17px;">\n'
	+ '<a href="/languages/swedish">'
	+ '<img src="/images/navigation/swedish.png" width="25" border="0" alt="Swedisch language"></a>\n</div>\n'
	+ '<div style="position:absolute; left:105px; top:' + PosTop + 'px; width:25px; height:17px;">\n'
	+ '<a href="/languages/german">'
	+ '<img src="/images/navigation/german.png" border="0" alt="German language"></a>\n</div>\n'
	+ '<div style="position:absolute; left:133px; top:' + PosTop + 'px; width:25px; height:17px;">\n'
	+  '<a href="/languages/french">'
	+ '<img src="/images/navigation/french.png" border="0" alt="French language"></a>\n</div>\n' );

  PosTop = PosTop + 23;
  document.write( '<div style="position:absolute; left:77px; top:' + PosTop + 'px; width:25px; height:17px;">\n'
	+ '<a href="/languages/portuguese">'
	+ '<img src="/images/navigation/portuguese.png" width="25" border="0" alt="Portuguese language"></a>\n</div>\n'
	+ '<div style="position:absolute; left:105px; top:' + PosTop + 'px; width:25px; height:17px;">\n'
	+ '<a href="/languages/dutch">'
	+ '<img src="/images/navigation/dutch.png" border="0" alt="Dutch language"></a>\n</div>\n'
	+ '<div style="position:absolute; left:133px; top:' + PosTop + 'px; width:25px; height:17px;">\n'
	+ '<a href="/languages/russian">'
	+ '<img src="/images/navigation/russian.png" border="0" alt="Russian language"></a>\n</div>\n' );
}

// Current magazine: rechterkolom. Tov moeder: 708, 237
function Pr_OutNow()
{
  //document.write( '<div id="Auction" style="position:absolute; left:708px; top:237px; width:157px; height:150px;">\n'
  //	+ '<a href="/cgi-bin/auction/overview.pl" style="text-decoration: none;">'
  //	+ '<img src="/images/navigation/auction25jaar.jpg" alt="Auction button" border=0></a>\n'
  //	+ '</div>\n' );

  // document.write( '<div id="OutNow" style="position:absolute; left:708px; top:237px; width:157px; height:150px;">\n'
	// + '<a href="/fanclub/magazine.html" style="text-decoration: none;">'
	// // + '<h2>Out now!<br>Magazine #104</h2>\n'
	// // + '<p><img src="/images/mags/104coversmall.jpg" alt="Cover magazine #104" border=0></p></a>\n'
	// + '<img src="/images/navigation/outnow_105.jpg" alt="Magazine button" border=0></a>\n'
	// + '</div>\n' );

	// return;

  document.write( '<div id="OutNow" style="position:absolute; left:708px; top:237px; width:152px; height:304px;">\n'
	+ '<script type="text/javascript">\n'
	+ '<!--\n'
	+ 'var hasReqestedVersion = DetectFlashVer(8, 0, 0);\n'
	+ 'if (	hasReqestedVersion	)\n'
	+ '{\n'
	+ '	AC_FL_RunContent( "src", "/109", "play", "true", "loop", "true",\n'
	+ '		"width", "152", "height", "304", "salign", "C", "scale", "ShowAll",\n'
	+ '		"id", "vid_3", "quality", "High", "name", "vid_3",\n'
	+ '		"type", "application/x-shockwave-flash",\n'
	+ '		"codebase", "http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab",\n'
	+ '		"pluginspage", "http://www.macromedia.com/go/getflashplayer" );\n'
	+ '}\n'
	+ 'else\n'
	+ '{\n'
	+ "		var msg2user = 'An old version of the Flash plugin was detected. <strong> <a' + "
	+ "		' href=\"http://www.macromedia.com/go/getflash/\">Please upgrade your Flash plugin.<\/a><\/strong>';\n"
	+ "    document.write( msg2user );\n"
	+ '}\n'
	+ '-->\n'
	+ '</script>\n'
	+ '</div>\n' );

  document.write( '<div id="Gift 105" style="position:absolute; left:708px; top:551px; width:150px; height:150px;">\n'
	+ '<a href="/fanclub/magazine/105_giftsingle.html" style="text-decoration: none;">'
	// + '<h2>Out now!<br>Magazine #104</h2>\n'
	// + '<p><img src="/images/mags/104coversmall.jpg" alt="Cover magazine #104" border=0></p></a>\n'
	+ '<img src="/images/navigation/105giftsingle.jpg" alt="Gift single button" border=0></a>\n'
	+ '</div>\n' );

	return;

  document.write( '<div id="Auction" style="position:absolute; left:708px; top:551px; width:152px; height:357px;">\n'
	+ '<script type="text/javascript">\n'
	+ '<!--\n'
	+ 'var hasReqestedVersion = DetectFlashVer(8, 0, 0);\n'
	+ 'if (	hasReqestedVersion	)\n'
	+ '{\n'
	+ '	AC_FL_RunContent( "src", "/auction_over", "play", "true", "loop", "true",\n'
	+ '		"width", "152", "height", "357", "salign", "C", "scale", "ShowAll",\n'
	+ '		"id", "vid_3", "quality", "High", "name", "vid_3",\n'
	+ '		"type", "application/x-shockwave-flash",\n'
	+ '		"codebase", "http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab",\n'
	+ '		"pluginspage", "http://www.macromedia.com/go/getflashplayer" );\n'
	+ '}\n'
	+ 'else\n'
	+ '{\n'
	+ "		var msg2user = 'An old version of the Flash plugin was detected. <strong> <a' + "
	+ "		' href=\"http://www.macromedia.com/go/getflash/\">Please upgrade your Flash plugin.<\/a><\/strong>';\n"
	+ "    document.write( msg2user );\n"
	+ '}\n'
	+ '-->\n'
	+ '</script>\n'
	+ '</div>\n' );

}

// Rechterkolom: nieuwskoppen. Voorlopig (708, 505) tov moeder
function __Pr_Headlines()
{
  document.write( '<div id="Headlines" style="position:absolute; left:708px; top:505px; width:158px; ' 
	+ 'height:308px;-moz-box-sizing:border-box;box-sizing:border-box; overflow:hidden;">\n'
	+ '<p style="margin-top:0px"><span class="h2">NEWS HEADLINES</span></p>\n'
	+ '<p>Here some news??? Like Kristina Tickets. <br>Now that we have received bookings from members who'
	+ ' just read&nbsp;the news in the magazine, we still have some tickets for the first three rows of the'
    + ' Carnegie Hall available (both nights, but more for the 2nd).<p>Bla nla bla....\n'
	+ '<p><a href="javascript:alert(\'To do\');" class="link">Read More...</a></p>\n' 
	+ '</div>\n' );
}

// Rechterkolom: Logo 160x135. Voorlopig (708, 465) tov moeder
function __Pr_FcLogo()
{
  document.write( "<a style=\"position:absolute; left: 708px; top: 465px;\" "
	+ "href=\"http://www.abbafanclubshop.nl\" id=\"FCS\" target=\"_blank\">"
	+ "<img border=0 src=\"/images/navigation/fcs_logo_160.jpg\" alt=\"Logo shop\"></a>\n" );

}

function Pr_Buttons()
{
  // var top = 465;
  // var top = 557;
  var top = 711;

  //document.write( '<div style="position:absolute; left:740px; top:465px; width:100px; height:28px;">\n'
  document.write( '<div style="position:absolute; left:740px; top:' + top + 'px; width:100px; height:28px;">\n'
	+ '<a href="/fanclub/join.html">'
	+ '<img src="/images/navigation/join.jpg" border="0" alt="Button join"></a></div>\n' );
  top += 38;
  //document.write( '<div style="position:absolute; left:740px; top:503px; width:100px; height:28px;">\n'
  document.write( '<div style="position:absolute; left:740px; top:' + top + 'px; width:100px; height:28px;">\n'
	+ '<a href="/fanclub/renew.html">'
	+ '<img src="/images/navigation/renew.jpg" border="0" alt="Button renew"></a></div>\n' );

  top += 38;
  //document.write( '<div style="position:absolute; left:740px; top:541px; width:100px; height:28px;">\n'
  document.write( '<div style="position:absolute; left:740px; top:' + top + 'px; width:100px; height:28px;">\n'
	+ '<a href="/fanclub/donate.html">'
	+ '<img src="/images/navigation/donate.jpg" border="0" alt="Donate button"></a></div>\n' );

  top += 38;
  //document.write( '<div style="position:absolute; left:740px; top:579px; width:28px; height:28px;">\n'
  document.write( '<div style="position:absolute; left:740px; top:' + top + 'px; width:28px; height:28px;">\n'
	+ '<a href="http://www.facebook.com/pages/The-Official-International-ABBA-Fan-Club/287106442779" target="_new">'
	+ '<img src="/images/navigation/icon_facebook.jpg" border="0" alt="Icon Facebook"></a></div>\n' );
  //document.write( '<div style="position:absolute; left:775px; top:579px; width:23px; height:28px;">\n'
  document.write( '<div style="position:absolute; left:775px; top:' + top + 'px; width:23px; height:28px;">\n'
	+ '<a href="http://twitter.com/officialabbafan" target="_new">'
	+ '<img src="/images/navigation/icon_twitter.jpg" border="0" alt="Icon Twitter"></a></div>\n' );
}

function Pr_Linkerkolom() { Pr_Menu(); Pr_Flags(); Pr_Copyright(); }

// function Pr_Rechterkolom() { Pr_OutNow(); Pr_FcLogo(); Pr_Buttons(); }
function Pr_Rechterkolom() { Pr_OutNow(); Pr_Buttons(); }

function Pr_ColRightAday()
{
  document.write( '<div id="events" style="position:absolute; left:708px; top:237px; width:157px; background-color: #FFFFFF;">\n'
	+ "<h2>Earlier events</h2>\n"
	+ "<ul>\n"
	+ '<li><a class="link" href="/abbaday/2011_report.html">2011: the 25<sup>th</sup> aniversary</a></li>\n'
	+ '<li><a class="link" href="/abbaday/2010_report.html">10th of April 2010</a></li>\n'
	+ '<li><a class="link" href="/abbaday/2009_report.html">18th of April 2009</a></li>\n'
	+ '<li><a class="link" href="/abbaday/2008_report.html">19th of April 2008</a></li>\n'
	+ '<li><a class="link" href="/abbaday/2007_report.html">April 2007</a></li>\n'
	+ '<li><a class="link" href="/abbaday/2006_report.html">22th of April 2006<br>20 years</a></li>\n'
	+ '<li><a class="link" href="/abbaday/2005_report.html">16th of April 2005</a></li>\n'
	+ '<li><a class="link" href="/abbaday/2004_report.html">17th of April 2004</a></li>\n'
	+ '<li><a class="link" href="/abbaday/2003_report.html">12th of April 2003</a></li>\n'
	+ '<li><a class="link" href="/abbaday/2002_report.html">6th of April 2002</a></li>\n'
	+ '<li><a class="link" href="/abbaday/2001_report.html">2001: the 15<sup>th</sup> aniversary</a></li>\n'
	+ '<li><a class="link" href="/abbaday/2000_report.html">15th of April 2000</a></li>\n'
	+ '<li><a class="link" href="/abbaday/1999_report.html">27th of March 1999</a></li>\n'
	+ '<li><a class="link" href="/abbaday/1998_report.html">4th of April 1998</a></li>\n'
	+ '<li><a class="link" href="/abbaday/1997_report.html">Report 1997</a></li>\n'
	+ '</ul>\n</div>\n' );
}


// Menu functies

// Generate menu (RvG)
function Pr_Menu()
{
  // var pos_top; 

  N_Rbr = Rubriek.length;

  document.write( "<div>\n" );
  for ( i=0; i<N_Rbr; i++)
  {
	// pos_top = Rbr_TopStart + i*Rbr_TopToename;
	PosTop = Rbr_TopStart + i*Rbr_TopToename;
  
  // document.write( "<a style=\"position:absolute; left: " + Rbr_Left + "px; top: " + pos_top + "px;\" "
  document.write( "<a style=\"position:absolute; left: " + Rbr_Left + "px; top: " + PosTop + "px;\" "
	+ "href=\"" + Rubriek[i][1] + "\" class=\"rubriek_off\" id=\"Rbr" + i + "\" "
	+ "target=\"" + Rubriek[i][2] + "\" "
	+ "onMouseOver=\"this.className='rubriek_on'; SubVisible=true; Show_Submenu(" + i + ");\" "
	+ "onMouseOut=\"this.className='rubriek_off'; SubVisible=false; "
	+ "setTimeout('Hide_Submenu(" + i + ")',delay);\">"
	+ Rubriek[i][0] + "</a>\n" );
  }

  // Logo fanclubshop
  PosTop = PosTop + Rbr_TopToename;
  document.write( "<a style=\"position:absolute; left: " + Rbr_Left + "px; top: " + PosTop + "px;\" "
	+ "href=\"http://www.abbafanclubshop.nl\" id=\"FCS\" target=\"_blank\">"
	+ "<img border=0 src=\"/images/navigation/fcs_logo.jpg\" alt=\"Logo shop\"></a>\n" );

  document.write( "</div>\n" );

  Pr_Submenu()
}

// GENERATE SUB MENUS
function Pr_Submenu()
{
  for ( i=0; i<N_Rbr; i++)
  {
	if ( subInfo[i].length < 1 )
	{ 
		// Set empty div for buttons without submenu
		document.write( '<div id="submenu' + i + '">' );
	}
	else
	{
		// Set div for buttons with submenu
		document.write( '<div id="submenu' + i + '" class="dropmenu" '
			+ 'onMouseOver="SubVisible=true; Rbr_On(' + i + ');" '
			+ 'onMouseOut="SubVisible=false; '
			+ 'setTimeout(\'Hide_Submenu(' + i + ')\',delay); '
			+ 'Rbr_Off(' + i + ');">' );

		document.write('<ul>');
		for ( k=0; k<subInfo[i].length; k++ )
		{
			document.write('<li>');
			document.write('<a href="' + subInfo[i][k][1] + '" ');
			document.write('target="' + subInfo[i][k][2] + '">');
			document.write( subInfo[i][k][0] + '</a>');
			document.write('</li>');
		}
		document.write('</ul>');
	}
	document.write('</div>');
  }
}


//*** MAIN BUTTONS FUNCTIONS ***//

// SET MOUSEOVER BUTTON
function Rbr_On( VolgNr ) { GetObject('Rbr' + VolgNr).className = "rubriek_on"; }

// SET MOUSEOUT BUTTON
function Rbr_Off( VolgNr ) { GetObject('Rbr' + VolgNr).className = "rubriek_off"; }

//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function GetObject( Id )
{
	return document.getElementById ? document.getElementById(Id) : document.all ? document.all(Id) : null; 
}

// GET X COORDINATE
function getRealLeft( Id)
{ 
	var el = GetObject( Id );

	if (	el	)
	{ 
		xPos = el.offsetLeft;
		tempEl = el.offsetParent;
		while (	tempEl != null	)
		{
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		} 
		return xPos;
	} 
} 

// GET Y COORDINATE
function getRealTop( Id )
{
	var el = GetObject( Id );

	if (	el	)
	{ 
		yPos = el.offsetTop;
		tempEl = el.offsetParent;
		while (	tempEl != null	)
		{
			yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
		}
		return yPos;
	}
}

// MOVE OBJECT TO COORDINATE
function moveObjectTo( ObjId, CoX, CoY)
{
	var el = GetObject( ObjId );

	// Bij gebruik van url in doctype: px nodig !!!!
	//el.style.left = CoX;
	//el.style.top = CoY;
	el.style.left = CoX + "px";
	el.style.top = CoY + "px";
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
// Wordt nu binnen dezelfde moederdiv gegenereerd als het menu,
// dus geen 'real x', maar de posiie is gemeten vanaf hetzelfde beginpunt
function Show_Submenu( Idx )
{
	var submenu_id = "submenu" + Idx;
	var rubriek_id = "Rbr" + Idx;
	var rbr = GetObject(rubriek_id);

//alert('Gaat ie - 1' );
	hideAllSubMenus();
//alert('Gaat ie - 2' );
	//butX = getRealLeft( rubriek_id );
	//butY = getRealTop( rubriek_id );
	//rbr_x = rbr.style.left;  ?? fout tijdens parsen van 'left'
	//rbr_y = rbr.style.top;
	rbr_x = rbr.offsetLeft;
	rbr_y = rbr.offsetTop;
//alert('Gaat ie - 3' );

//var tmp_x = butX+xSubOffset; var tmp_y = butY+ySubOffset;
//alert("Show_Submenu: (" + butX + ", " + butY + ") naar (" + tmp_x + ", " + tmp_y + ")" );

	moveObjectTo( submenu_id, rbr_x + xSubOffset, rbr_y + ySubOffset );
//alert('Gaat ie - 4' );
//alert( "'Real' x van submenu: " + getRealLeft(submenu_id) );
}

function XX_Show_Submenu( Idx )
{
	var submenu_id = "submenu" + Idx;
	var rubriek_id = "Rbr" + Idx;

	hideAllSubMenus();
	butX = getRealLeft( rubriek_id );
	butY = getRealTop( rubriek_id );

	moveObjectTo( submenu_id, butX+xSubOffset, butY+ySubOffset );
}

// HIDE ALL SUB MENUS
function hideAllSubMenus()
{
	for ( i=0; i<N_Rbr; i++)
	{
		moveObjectTo("submenu" + i + "", -500, -500 );
	}
}

function Hide_Submenu( Idx )
{
	var submenu_id = "submenu" + Idx;

	if (	SubVisible == false			)
	{	moveObjectTo(submenu_id, -500, -500);	}
}

