// 23-3-2010	ka	<dd>

// common variables that need to be used throughout the code
var toggle = 0;
var VAKKEES = 0;	// 1 = ja
// for search
netscape = "";
ver = navigator.appVersion; 
len = ver.length;
for(iln = 0; iln < len; iln++) if (ver.charAt(iln) == "(") break;
netscape = (ver.charAt(iln+1).toUpperCase() != "C");


// ******* ALL FUNCTIONS ARE SORTED ALPHABETICAL *********** //


//	display bottom line, standaard op elke pagina
function BottomLine(owner)
{
	if (owner == "") owner = "Groove Unlimited";
	var currentTime = new Date();
	var year = currentTime.getFullYear();
	document.write("<table width='100%'>");
	document.write("<tr><td colspan='3'><hr></td></tr><tr>");
	document.write("<td align='left'>");
	document.write("<input type='button' value='top of page' onclick=\"location.href='#top'\">");
	document.write("</td>");
	document.write("<td colspan='2' class='bottomline' align='center'>");
	document.write("&copy; 1995-" + year + ". This webpage is property of " + owner + ".");
	document.write("&nbsp; &nbsp; &nbsp; Design and maintenance: ");
	document.write("<a href='http://www.a-biz.nl' target='_blank'>A-biz Internet Solutions</a>");
	document.write("</td>");
	document.write("</tr></table>");
}


// search
function checkKey(DnEvents)
{
	k = (netscape) ? DnEvents.which : window.event.keyCode;
	if (k == 13) proc();
}


function faq_back ()
{
	document.write("<br><br>");
	document.write("<form action=\"button\">");
	document.write("<input type=\"button\" value=\"back to top\" onclick=\"location.href='#top'\">");
	document.write("</form>");
}


// information anchors incl. <tr> (staat hier omdat linkbot anders fouten geeft)
function faq_tr_anchors () 
{
	document.write("<tr><td class='faq_subhead'>");
	document.write("FREQUENTLY ASKED QUESTIONS");
	document.write("</td</tr>");
	document.write("<tr valign='top'>");
	document.write("<td class='faq_mainhead'>");
	document.write("<ul>");
	document.write("<li><a href='#company_profile'>Company profile</a>");
	document.write("<li><a href='#why_groove'>Why should you buy from Groove?</a>");
	document.write("<br><br>");
	document.write("<li><a href='#stock'>Is everything in stock?</a>");
	document.write("<li><a href='#ordering_online'>Ordering Online</a>");
	document.write("<li><a href='#ordering_offline'>Ordering Offline</a>");
	document.write("<li><a href='#goq'>General order questions</a>");
	document.write("<li><a href='#shipping_cost'>Shipping cost</a>");
	document.write("<br><br>");
	document.write("<li><a href='#sound_clips'>Sound clips</a>");
	document.write("<li><a href='#contact_info'>Contact information</a>");
	document.write("<li><a href='#reviews'>Covers, tracklistings, reviews, soundclips</a>");
	document.write("<br><br>");
	document.write("<li><a href='#trade'>Do you want to trade/sell CD's?</a>");
	document.write("<br><br>");
	document.write("<li><a href='#demos'>Sending demo cd's</a>");
	document.write("</ul>");
	document.write("</td>");
	document.write("</tr>");
}


// information page subheading incl. <tr>
function faq_tr_subhead (anchor, txt) 
{
	l = txt.toLowerCase();
	u = txt.toUpperCase();
	document.write("<tr>");
	document.write("<td class='faq_subhead'>");
	document.write("<a name='" + anchor + "'></a>");
	document.write(txt.toUpperCase());
	document.write("</td></tr>");
}


function Info_part_of() 
{
	document.write("<center><span class=part_of>This webpage is part of the Groove Unlimited website. Click <a href=http://www.groove.nl target=_blank>HERE</a> if you do NOT see the <b>CATALOG</b> and <b>ORDERING</b> buttons in top.</span></center>");
}


function Info_review_form(nr, artist, title) 
{
	document.write("<center>");
	document.write("<hr align=center size=1>");
	document.write("<table>");
	document.write("<tr>");
	document.write("<td align=center>");
	document.write("<br><font size=-2>You can submit your own English or Dutch review of <b>'" + title + "'</b> below. As short or as long as you want...</font>");
	document.write("<form name='form' method=post action='../../reviewmail.php?type=review'>"); // v1.42
	document.write("<input type=hidden name=subject value='Review: " + nr + " " + artist + " - " + title + "'>");
	document.write("<textarea name='form[REVIEW]' rows=6 cols=75></textarea>");	// v1.41
	document.write("<br><input type=checkbox name='form[I_AGREE]' checked><span class=small_gray>I agree that all data regarding this review is used in various Groove publications.</span>"); // v1.41
	document.write("</td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("<table>");
	document.write("<tr>");
	document.write("<th class=small_black>your name</th>");
	document.write("<th class=small_black>your country</th>");
	document.write("<th class=small_black>your@email</th>");
	document.write("</tr>");
	document.write("<tr>");
	document.write("<td><input size=27 value=' ' name='form[NAME]'></td>");		// v1.41
	document.write("<td><input size=27 value=' ' name='form[COUNTRY]'></td>");	// v1.41
	document.write("<td><input size=27 value=' ' name='form[EMAIL]'></td>");	// v1.41
	document.write("</tr>");
	document.write("</table>");
	document.write("<input type=submit value=SEND review to Groove>");
	document.write("</form>");
	document.write("</center>");
}


// YouTube filmpje(s)
function Info_youtube (n1, n2) 
{
	w	= 320;
	h	= 260;
	url = "http://www.youtube.com/v/";

	// zijn er filmpjes?
	if ( n1+n2 != "" ) 
	{
		// maak template
		stuk1  = "<object width='" + w + "' height='" + h + "'><param name='movie' value='" + url;
		stuk2  = "&hl=nl_NL&fs=1&rel=0'></param><param name='allowFullScreen' value='true'></param><embed src='" + url;
		stuk3  = "&hl=nl_NL&fs=1&rel=0' type='application/x-shockwave-flash'";
		stuk3 += " allowscriptaccess='always' allowfullscreen='true'";
		stuk3 += " width='" + w + "' height='" + h + "'></embed></object>";

		// start write
		document.write("<tr align='center'>");
		document.write("<tr align='center'><th colspan='5'>youtube</th></th></tr>");
		document.write("<td colspan='5' class='youtube'>");
		document.write("<div align='center'>");

		if ( n1 != "")	document.write( stuk1+n1+stuk2+n1+stuk3 );
		if ( n2 != "")	document.write( "&nbsp; &nbsp;" + stuk1+n2+stuk2+n2+stuk3 );

		// eind write
		document.write("</div>");
		document.write("</td></tr>");
	}
}


// review form
function Info_ypcrg (year, packaging, condition, ltd, remastered, japan, bonus_tracks, genre) 
{
	br = "";
	dat = "";
	if (ltd != "") 
	{
		dat = dat + br + ltd + ".";
		br = "<br>";
	}
	if (remastered != "") 
	{
		dat = dat + br + remastered + ".";
		br = "<br>";
	}
	if (japan != "")
	{
		dat = dat + br + japan + ".";
		br = "<br>";
	}
	if (bonus_tracks != "")
	{
		dat = dat + br + bonus_tracks + ".";
		br = "<br>";
	}
	if (year == "") year = "&nbsp;";
	if (packaging == "") packaging = "&nbsp;";
	if (condition == "") condition = "&nbsp;";
	if (dat == "") dat = "&nbsp;";
	if (genre == "") genre = "&nbsp;";
	document.write("<tr align='left'><th>year</th><th>packaging</th><th>condition</th><th>remarks</th><th>genre</th></tr>");
	document.write("<tr valign='top' align='left'>");
	document.write("<td class='year'>" + year + "</td>");
	document.write("<td class='packaging'>" + packaging + "</td>");
	document.write("<td class='condition'>" + condition + "</td>");
	document.write("<td class='remarks'>" + dat + "</td>");
	document.write("<td class='genre'>" + genre + "</td>");
}


function Info_top_table (Artikel, MediumGFX, Artist, Title ) 
{
	document.write("<table width='100%' border='0'>");
	document.write("<tr>");
	document.write("<td rowspan='2'>");
	document.write("<img src='../../gfx/gr3co_tr.gif' width='85' height='65' border='0'><br>");
	document.write("<span class='small_gray'>This INFO webpage is part of<br>the <a href='http://www.groove.nl'><b>Groove Unlimited</b></a> website.</span>");
	document.write("</td>");
	document.write("<td>");
	document.write("<table border='5' cellpadding='10' cellspacing='5'>");
	document.write("<tr align='center'>");
	//	document.write("<td class='buy'><a href='http://www.groove.nl/jump2.php?artiest=" + Artist.toLowerCase() + "'><img src='../../gfx/buy.gif' width='97' height='66' border='0'></a></td>");
	document.write("<td valign='middle' class='medium'>" + MediumGFX + "<br>" + Artikel + "</td>");
	document.write("<td class='artist'>" + Artist + "</td>");
	document.write("<td class='title'>" + Title + "</td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</td>");
	document.write("</tr>");
	document.write("</table>");
}


function Last_Update_EN ()
{
	var maand = new Array(13);
	maand[1] = "January";
	maand[2] = "February";
	maand[3] = "March";
	maand[4] = "April";
	maand[5] = "May";
	maand[6] = "June";
	maand[7] = "July";
	maand[8] = "August";
	maand[9] = "September";
	maand[10] = "October";
	maand[11] = "November";
	maand[12] = "December";
	var dateObj = new Date(document.lastModified);
	var lmonth = maand[dateObj.getMonth() + 1];
	var date = dateObj.getDate();
	var fyear = dateObj.getFullYear();
	document.write(lmonth + " " + date + " " + fyear );
}

function mc(a)	{	a.className = 'butt_text butt_mc';	}
function mc2(a)	{	a.className = 'butt_text2 butt_mc';	}
function mc3(a)	{	a.className = 'butt_text3 butt_mc';	}
function mc4(a)	{	a.className = 'butt_text4 butt_mc';	}

function mg(a)	{	a.className = 'butt_text butt_mg';	}
function mg2(a)	{	a.className = 'butt_text2 butt_mg';	}
function mg3(a)	{	a.className = 'butt_text3 butt_mg';	}
function mg4(a)	{	a.className = 'butt_text4 butt_mg';	}

function mo(a)	{	a.className = 'butt_text butt_mo';	}
function mo2(a)	{	a.className = 'butt_text2 butt_mo';	}
function mo3(a)	{	a.className = 'butt_text3 butt_mo';	}
function mo4(a)	{	a.className = 'butt_text4 butt_mo';	}


function New_letter(ltr)
{
	document.write("<table width=100% border=1 cellpadding=3><tr class=new_ltr>");
	document.write("<td align=center class=new_ltr_big>" + ltr + " </td>");
	document.write("<td align=left class=new_ltr>");
	document.write("&nbsp;&nbsp;&nbsp;<b>STOCK INFORMATION</b><br>");
	document.write("&nbsp;&nbsp;&nbsp;What does <img src=gfx/g.gif><img src=gfx/y.gif><img src=gfx/r.gif><img src=gfx/w.gif> mean?<br>");
	document.write("<img src=gfx/g.gif> in stock<br>");
	document.write("<img src=gfx/y.gif> expected soon<br>");
	document.write("<img src=gfx/r.gif> unreleased<br>");
	document.write("<img src=gfx/w.gif> not in stock but available for ordering");
	if (VAKKEES == 1) document.write("<br><img src=gfx/b.gif> NO stock information due to holidays<br>");
	document.write("</td>");
	document.write("<td class=new_ltr>");
	document.write("&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<b>YOU CAN CLICK ON</b><br>");
	document.write("<span class='dummy_ip'><b>iNFO</b> 12345</span> Shows track information, cover, reviews, soundclips<br>");
	document.write("<img src=gfx/a.gif> &nbsp; &nbsp; &nbsp; &nbsp; Click on cart to add product to shopping cart<br><br>");
	document.write("&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<b>PRICES</b><br>");
	document.write("&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<b>$</b> (US dollar), <b>&pound;</b> (UK pound), <b>&euro;</b> (Euro)");
	document.write("</td>");
	document.write("<td align=center class=new_ltr_big> " + ltr + "</td>");
	document.write("</tr></table>");
}


function print_order_flag(country, description)	// de, nl etc.
{
	var stuk1 = "href='https://secure.groove.nl/orderform_";
	var stuk2 = ".html' target='_blank'>";
	document.write("<tr>");
	document.write("<td class='flag flag_" + country + "'>");
	document.write("<a class='country' " + stuk1 + country + stuk2);
	document.write("");
	document.write("</a>");
	document.write("</td>");
	document.write("<td class='box1'>");
	document.write("<a class='country2' " + stuk1 + country + stuk2);
	document.write(description);
	document.write("</a>");
	document.write("</td>");
	document.write("</tr>");
}

function print_alfabet(progname, but4)
{
	var b=97;
	var e=(b+26);
	document.write("<center>");
	document.write("<table width='100%' border='0'><tr>");
	for ( var i=b ; i<e; i++ )
	{
		var ltr = String.fromCharCode(i);
		document.write("<td class='butt_text butt_mg' onMouseover='mo(this);' onMouseout='mg(this);' onmousedown='mc(this);' onClick='ref_to(this);' href='" + progname + ".php?letter=" + ltr + "'>" + ltr.toUpperCase() + "</td>");
	}
	document.write("</tr></table>");
	if (but4 > 0)	// 0= geen extra knoppen
	{
		var stuk1 = "<td class='butt_text2 butt_mg' onMouseover='mo2(this);' onMouseout='mg2(this);' onmousedown='mc2(this);' onClick='ref_to(this);' href='";
		document.write("<table width='100%' border='0'>");
		document.write("<tr>");
		document.write(stuk1 + "td.php'>tangerine dream</td>");
		document.write(stuk1 + "ks.php'>klaus schulze</td>");
		document.write(stuk1 + "offers.php'>offers</td>");
		document.write(stuk1 + "downloads.php'>downloads</td>");
		document.write(stuk1 + "soundtracks.php'>soundtracks</td>");
		document.write(stuk1 + "dvd_video.php'>dvd</td>");
		document.write("</tr>");
		document.write("</table>");
	}
	document.write("</center>");
}


function print_topbuttons()
{
	var stuk1 = "<td class='butt_text3 butt_mg' onMouseover='mo3(this);' onMouseout='mg3(this);' onmousedown='mc3(this);' onClick='ref_to(this);' href='";

	document.write("<table cellspacing='0' cellpadding='0' border='0'>");
	document.write("<tr>");
	document.write(stuk1 + "catalog.php?letter=a' target='mainpage'>catalog</td>");
	document.write(stuk1 + "order.html' target='mainpage'>ordering</td>");
	document.write(stuk1 + "sound.php' target='mainpage'>soundclips</td>");
	document.write(stuk1 + "latest.php' target='mainpage'>catalog<br>changes</td>");
	document.write(stuk1 + "products.php' target='mainpage'>groove<br>products</td>");
	document.write(stuk1 + "news.php' target='mainpage'>fairs<br>concerts</td>");
	document.write(stuk1 + "mailing.html' target='mainpage'>news<br>letter</td>");
	document.write(stuk1 + "jukebox.html' target='mainpage'>jukebox</td>");
	document.write(stuk1 + "links.html' target='mainpage'>links<br>homepages</td>");
	document.write(stuk1 + "faq.html' target='mainpage'>FAQ</td>");
	document.write("</tr>");
	document.write("</table>");
}

// search
function proc()
{
	var a = document.topsearch.pattern.value;
	var b = document.topsearch.wat.options[document.topsearch.wat.selectedIndex].text;
	a = a.replace(/^\s*/, "").replace(/\s*$/, "");
	document.topsearch.pattern.value=a;
	if (a.length < 2)
	{
		alert("Please type at least 2 characters");
	}
	else
	{
		parent.mainpage.location.href = "searchmain.php?actie=search&waarde=" + escape(a) + "&extra=" + escape(b);
		return false;
	}
}


// jump to page
function ref_to(a)
{
	var nul		= null;	// nodig om NULL te testen
	var page	= a.getAttribute('href'); 
	var target	= a.getAttribute('target');
//	confirm("href: " + page + " - target: " + target);
	if (target == "_blank" )	
		window.open(page);			// open new window with page
	else
	{
		if (target == nul )			
			window.location = page;		// show new page on same page
		else
			window.open(page,target);	// show new page in target
	}
}


function sa(naam)
{
	parent.mainpage.location.href = 'searchmain.php?actie=search&waarde=' + escape(naam) + '&extra=artist&source=sa';
}


function showinfo()
{	// if toggle is 1, turn the info space frame off by setting it to 0 pixels. 
	// It will still update, just won't show
	if (toggle) 
	{
		toggle = 0;
		document.getElementById('fs2').cols = '0px,*';
	}
	else
	{
		toggle = 1;
		document.getElementById('fs2').cols = '240px,*';
	}
}


function Special_Box(naam)
{
	if (naam == '*autographed*')
	{
		txt = 'If you want anything autographed from this artist<br>then mention this with your order.<br>There\'s NO extra charge!';
		document.write("<dd>");
		document.write("<table width='40%' border='0' cellpadding='3' cellspacing='0'>");
		document.write("<tr><td class='special_box'>");
		document.write(txt);
		document.write("</td></tr></table></dd>");
	}

	if (naam == '*wehavemore*')
	{
		document.write("<dd><span class=wcsm> &nbsp; <img src=gfx/more.gif width=9 height=7 border=0> We can supply more titles from this artist. Email us if you\'re looking for a title that\'s not listed.</span></dd>");
	}
}


// display backbutton en header voor tearsheet 
function Tearsheet_head() 
{
	document.write("<tr align=left>");
	document.write("<th width=5%>cover</th>");
	document.write("<th>medium</th>");
	document.write("<th>article</th>");
	document.write("<th>artist</th>");
	document.write("<th>title</th>");
	document.write("</tr>");
}


// display links entry 
function tr_links (Website, Local, Name, Desc) 
{
	if (Website == "heading") 
	{
		document.write("<tr><td>&nbsp;</td></tr>");
		document.write("<tr><td align='center' colspan='3' class='links_subhead'>" + Desc + "</td></tr>");
		document.write("<tr><td>&nbsp;</td></tr>");
	}
	else
	{
		target = Website;
		if (Local == "n") target = "http://" + Website + " target='_blank'";	// j/n op groove website
		document.write("<tr><td>&nbsp;</td>");
		document.write("<td class='links_bg" + bg + "' align='right' width='200'>");
		document.write("<a href=" + target + ">" + Name + "</a></td>");
		document.write("<td class='links_bg" + bg + "' align='left'>" + Desc + "</td></tr>");
	    bg++;
		if (bg > 2) bg=1;	// alleen kleur 1 en 2
	}
}


// display tearsheet entry 
function tr_tearsheet (Artikel, Artist, Title, MediumGFX, Extensie) 
{
	u = Artikel.toUpperCase();
	l = Artikel.toLowerCase();
	Subdir = l.substr(0,1);
	if (MediumGFX == '') MediumGFX = 'cd.gif';
	if (Extensie == '') Extensie = 'jpg';
	document.write("<tr>");
	document.write("<td><a href=tear/"+ l + ".pdf>");
	document.write("<img src=cd/" + Subdir + "/gfx/" + l +"s." + Extensie + " width=64 height=64 border=0></a></td>");
	document.write("<td align=center><img src=gfx/" + MediumGFX + "></td>");
	document.write("<td>" + u + "</td>");
	document.write("<td>" + Artist + "</td>");
	document.write("<td>" + Title + "</td>");
	document.write("</tr>");
}
