// 19-4-2011	ka	changes

// common variables that need to be used throughout the code
var toggle = 0;

// 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 info pagina
function BottomLine(owner, b2t)
{
	colspan = b2t+1;	
	if (owner == "") owner = "Groove Unlimited";
	var currentTime = new Date();
	var year = currentTime.getFullYear();
	document.write("<table width='800' cellpadding='0' cellspacing='0' border='0'>");
	document.write("<tr><td colspan='" + colspan + "'><hr size='1'></td></tr>");
	document.write("<tr>");
	if (b2t == 1)
	{
		document.write("<td align='left' width='10'>");
		document.write("<a href='#top'><img src='gfx/back2top.gif' border='0'></a>");
		document.write("</td>");
	}
	document.write("<td class='bottomline'>");
	document.write("&copy; ");
	document.write("<a href='http://www.groove.nl' target='_blank'>Groove Unlimited</a>");
	document.write("&nbsp;1995-" + year + ".");
	document.write("&nbsp; &nbsp;Web design: ");
	document.write("<a href='http://www.a-biz.nl' target='_blank'>A-biz Internet Solutions</a>.");
	document.write("&nbsp; &nbsp;This page is property of " + owner + ".");
	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='#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_blokje_end() 
{
	document.write("</td></tr></table><br>");
}


function Info_blokje_start(nr) 
{
	picnaam = 'review' + nr + '.gif';
	oms		= 'review';
	if (nr == "i")
	{
		picnaam = 'info.gif';
		oms		= 'product<br>info';
	}
	document.write("<table style='border: 1px solid #991111;' width='800' cellspacing='0' cellpadding='5' border='0'>");
	document.write("<tr>");
	document.write("<td width='8%' class='leftcol' valign='top' align='center'>");
	document.write("<img src='../../gfx/" + picnaam +"'><br><br>");
	document.write(oms);
	document.write("</td>");
	document.write("<td width='55%' class='info_box txtfont'>");
}

function Info_cover_end() 
{
	document.write("</tr>");
	document.write("</table>");
	document.write("<br>");
}

function Info_cover_start() 
{
	document.write("<br>");
	document.write("<table class='tracklisting' cellpadding='3' cellspacing='3' border='0'>");
	document.write("<tr valign='top'>");
}

function Info_review_form(nr, artist, title) 
{
	document.write("<table class='tracklisting' cellpadding='3' cellspacing='3' border='0'>");
	document.write("<tr>");
	document.write("<td align='center' colspan='3'>");
	document.write("<br>You can submit your own English or Dutch review of <b>'" + title + "'</b> below.");
	document.write("<form name='form' method='post' action='../../reviewmail.php?type=review'>");
	document.write("<input type='hidden' name='subject' value='Review: " + nr + " " + artist + " - " + title + "'>");
	document.write("<textarea name='form[REVIEW]' rows='6' cols='75'></textarea>");
	document.write("<br><font color='#00aa00'><b>&radic;</b></font>");
	document.write("<span class='review_i_agree'>");
	document.write(" I agree that all data regarding this review is used in various Groove publications.");
	document.write("</span>");
	document.write("</td>");
	document.write("</tr>");
	document.write("<tr align='center'>");
	document.write("<td class='review_nce'>");
	document.write("your name");
	document.write("<br><input size='27' value=' ' name='form[NAME]'><br><br>");
	document.write("</td>");
	document.write("<td class='review_nce'>");
	document.write("your country");
	document.write("<br><input size='27' value=' ' name='form[COUNTRY]'><br><br>");
	document.write("</td>");
	document.write("<td class='review_nce'>");
	document.write("your email");
	document.write("<br><input size='27' value=' ' name='form[EMAIL]'><br><br>");
	document.write("</td>");
	document.write("</tr>");
	document.write("<tr>");
	document.write("<td align='center' colspan='3'>");
	document.write("<input type='submit' value='SEND review to Groove'>");
	document.write("</td>");
	document.write("</tr>");
	document.write("</table>");
	document.write("</form>");
}


function Info_top_table (Artikel, catmed, Artist, Title, year, packaging, condition, ltd, remastered, japan, bonus_tracks, genre) 
{
	document.write("<table style='border: 1px solid #991111;' width='800' cellpadding='3' cellspacing='0' border='0'>");
	document.write("<tr>");
	document.write("<td class='info_box artist'>" + Artist + "</td>");
	document.write("<td class='info_box artist'>" + Title + "</td>");
	document.write("<td class='info_box artist'>" + catmed + "</td>");
	document.write("<td class='info_box txtfont'>" + Artikel + "</td>");
	document.write("</tr>");
	document.write("</table>");

	// blok 2
	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("<table width='800' cellspacing='0' cellpadding='3' border='0'>");
	document.write("<tr class='ypcrg_subhead'>");
	document.write("<td>genre</td>");
	document.write("<td>year</td>");
	document.write("<td>packaging</td>");
	document.write("<td>condition</td>");
	document.write("<td>remarks</td>");
	document.write("</tr>");
	document.write("<tr class='info_box ypcrg'>");
	document.write("<td>" + genre + "</td>");
	document.write("<td>" + year + "</td>");
	document.write("<td>" + packaging + "</td>");
	document.write("<td>" + condition + "</td>");
	document.write("<td>" + dat + "</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='800' 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");
	document.write("</td>");
	document.write("<td class=new_ltr>");
	document.write("<b>YOU CAN CLICK ON</b><br>");
	document.write("<span class='dummy_ip'><b>iNFO</b> 12345</span> Shows product information<br>");
	document.write("<img src=gfx/a.gif> &nbsp; &nbsp; &nbsp; &nbsp; Click on cart to add product<br><br>");
	document.write("<b>PRICES</b><br>");
	document.write("<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("<table width='800' 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='800' 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>");
	}
}


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'>what's<br>NEW?</td>");
	document.write(stuk1 + "products.php' target='mainpage'>groove<br>products</td>");
	document.write(stuk1 + "news.php' target='mainpage'>calendar</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 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>");
}

