//***********************************************************************
//* APPLICATION	: WTO Web Site
//* COMPONENT	: 
//* PAGE		: 
//* CREATION	: 03/11/2005
//* AUTHOR		: Jane M Pickett
//* CONTENT		: Data and functions for watch this space - French
//*		
//***********************************************************************
//* UPDATES		:
//*
//***********************************************************************
var wts_array = new Array();  // array for items to appear in watch this space

	wts_array[wts_array.length] =  [
					 "Rester informé des nouvelles de l’OMC",  // display text
					 "http://icd.wto.org/member/register.aspx?l=f",  // link relative to root
					 0, // language text array index
					 "",  // ??&nbsp;pages; ??KB; for document
					 "",  // link to an image relative to root
					"email",  // item type eg email, feature, new
					 ""  // caption for photo 
					];  // end of array


		
	wts_array[wts_array.length] =  [
					 "Rapport annuel 2009 de l'OMC",  // display text
					 "",  // link relative to root
					 0, // language text array index
					 "",  // ??&nbsp;pages; ??KB; for document
					 "/images/img_bkshop/anrep_09.gif",  // link to an image relative to root
					"feature",  // item type eg email, feature, new
					 ""  // caption for photo
					];  // end of array

//	wts_array[wts_array.length] =  [
//					 "Nouvelle",  // display text
//					 "",  // link relative to root
//					 0, // language text array index
//					 "",  // ??&nbsp;pages; ??KB; for document
//					 "",  // link to an image relative to root
//					"feature",  // item type eg email, feature, new
//					 ""  // caption for photo
//					];  // end of array

	wts_array[wts_array.length] =  [
					 "Détails de la publication",  // display text
					 "/french/res_f/publications_f/anrep09_f.htm",  // link relative to root
					 0, // language text array index
					 "",  // ??&nbsp;pages; ??KB; for document
					 "",  // link to an image relative to root
					"feature",  // item type eg email, feature, new
					 ""  // caption for photo
					];  // end of array
			
	wts_array[wts_array.length] =  [
					 "Enquête auprès des lecteurs",  // display text
					 "http://forms.wto.org/anrep09_survey_f.htm",  // link relative to root
					 0, // language text array index
					 "",  // ??&nbsp;pages; ??KB; for document
					 "",  // link to an image relative to root
					"feature",  // item type eg email, feature, new
					 ""  // caption for photo
					];  // end of array

	wts_array[wts_array.length] =  [
					 "Commander un exemplaire imprimé",  // display text
					 "http://onlinebookshop.wto.org/shop/article_details.asp?Id_Article=767&lang=FRA",  // link relative to root
					 0, // language text array index
					 "",  // ??&nbsp;pages; ??KB; for document
					 "",  // link to an image relative to root
					"feature",  // item type eg email, feature, new
					 ""  // caption for photo
					];  // end of array



			
	//wts_array[wts_array.length] =  [
					// "Fichier audio (lancement du livre)",  // display text
					 //"",  // link relative to root
					 //2, // language text array index
					 //"??&nbsp;pages; ??KB",  // ??&nbsp;pages; ??KB; for document
					 //"",  // link to an image relative to root
					//"feature",  // item type eg email, feature, new
					// ""  // caption for photo
					//];  // end of array

	
//	wts_array[wts_array.length] =  [
//					 "Nouvelles pages:",  // display text
//					 "",  // link relative to root
//					 0, // language text array index
//					 "",  // ??&nbsp;pages; ??Ko; for document
//					 "",  // link to an image relative to root
//					"new",  // item type eg email, feature, new
					// ""  // caption for photo
//					];  // end of array

wts_array[wts_array.length] =  [
					 "Groupes dans les négociations",  // display text
					 "/french/tratop_f/dda_f/negotiating_groups_f.htm",  // link relative to root
					 0, // language text array index
					 "",  // ??&nbsp;pages; ??KB; for document
					 "",  // link to an image relative to root
					"new",  // item type eg email, feature, new
					 ""  // caption for photo
					];  // end of array
wts_array[wts_array.length] =  [
					 "Nouveau document de travail: The WTO: Theory and Practice",  // display text
					 "/french/res_f/reser_f/ersd200911_f.htm",  // link relative to root
					 0, // language text array index
					 "",  // ??&nbsp;pages; ??KB; for document
					 "",  // link to an image relative to root
					"new",  // item type eg email, feature, new
					 ""  // caption for photo
					];  // end of array

wts_array[wts_array.length] =  [
					 "Statistiques du commerce international 2009",  // display text
					 "/french/res_f/statis_f/its2009_f/its09_toc_f.htm",  // link relative to root
					 0, // language text array index
					 "",  // ??&nbsp;pages; ??KB; for document
					 "",  // link to an image relative to root
					"new",  // item type eg email, feature, new
					 ""  // caption for photo
					];  // end of array

wts_array[wts_array.length] =  [
					 "Atelier OMC-OIT sur le commerce mondial et l’emploi",  // display text
					 "/french/res_f/reser_f/wkshop_aug09_f/wkshop_aug09_f.htm",  // link relative to root
					 0, // language text array index
					 "",  // ??&nbsp;pages; ??KB; for document
					 "",  // link to an image relative to root
					"new",  // item type eg email, feature, new
					 ""  // caption for photo
					];  // end of array

wts_array[wts_array.length] =  [
					 "Nouvelle publication: Forum public de l'OMC 2008",  // display text
					 "/french/res_f/publications_f/public_forum08_f.htm",  // link relative to root
					 0, // language text array index
					 "",  // ??&nbsp;pages; ??KB; for document
					 "",  // link to an image relative to root
					"new",  // item type eg email, feature, new
					 ""  // caption for photo
					];  // end of array


var item_type_array = new Array(); // array for different watch this space sections
	item_type_array[0] = ["email", "&nbsp;FLASHS&nbsp;PAR&nbsp;COURRIEL&nbsp;", "", ""];
	item_type_array[1] = ["feature", "&nbsp;DOSSIER&nbsp;", "More publications", "french/res_f/res_f.htm#publications"];
//	item_type_array[2] = ["event", "&nbsp;ÉVÉNEMENT&nbsp;", "", ""];
	item_type_array[2] = ["new", "&nbsp;NOUVEAU&nbsp;SUR&nbsp;LE&nbsp;SITE&nbsp;", "", ""];
	

var language_text_array = new Array(); // array for text to indicate that item is in a different language
	language_text_array[0] = "";
	language_text_array[1] = "temporairement en anglais";
	language_text_array[2] = "uniquement en anglais";
	language_text_array[3] = "déclaration bilingue &mdash; les traductions suivront";
	language_text_array[4] = "temporairement en français";
	language_text_array[5] = "uniquement en français";
	language_text_array[6] = "temporairement en espagnol";
	language_text_array[7] = "uniquement en espagnol";

var document_type_array = new Array();  // array for flyout text to be used depending on the document type
	document_type_array[0] = ["doc", "Format MS word;"];
	document_type_array[1] = ["pdf", "Format pdf;"];
	document_type_array[2] = ["wpf", "Format Wordperfect;"];
	document_type_array[3] = ["xls", "Format MS excel;"];
	document_type_array[4] = ["ppt", "Format MS powerpoint;"];
	
var start_url = "";  // variable for start of url
var end_url = "";  // variable for end of url
var new_window = false; // boolean to indicate if a new window is needed
var new_window_text = "ouvre une nouvelle fenêtre"; // variable for text to display if document should open in a new window
var document_type = "";  // variable for text to display if document is not html
var flyout_text = ""; // variable for flyout text
var new_box = true;
var index_page = false;
var border_colour = "#18497B";
// This function displays just the feature box
function displayFeature()
{
	if ((this_page.indexOf("/english/") == -1) && (this_page.indexOf("/french/") == -1) && (this_page.indexOf("/spanish/") == -1))
	{
		index_page = true;
	}
	if (this_page.indexOf("/docs_") != -1)
	{
		border_colour = "#FF0000";
	}
	else if (this_page.indexOf("/forums_") != -1)
	{
		border_colour = "#000080";
	}
	else if (this_page.indexOf("/info_") != -1)
	{
		border_colour = "#0080C0";
	}
	else if (this_page.indexOf("/news_") != -1)
	{
		border_colour = "#0080FF";
	}
	else if (this_page.indexOf("/res_") != -1)
	{
		border_colour = "#008080";
	}
	else if (this_page.indexOf("/thewto_") != -1)
	{
		border_colour = "#0080C0";
	}
	else if (this_page.indexOf("/tratop_") != -1)
	{
		border_colour = "#800000";
	}
	if (index_page == true)
	{
		document.writeln("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"30%\" class=\"cellheadingcolourtext\">" + item_type_array[1][1] + "</td><td class=\"cellheadingwhitetext\">&nbsp;</td></tr></table>");
	}
	else
	{
		document.writeln("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"30%\" class=\"cellheadingwhitetext\">" + item_type_array[1][1] + "</td><td class=\"cellheadingblacktext\">&nbsp;</td></tr></table>");
	}
	document.writeln("<table style=\"border-style:solid; border-color:" + border_colour + "; border-width:1px; border-collapse:collapse\" border=\"1\" cellSpacing=\"0\" cellPadding=\"4\" width=\"100%\" bgcolor=\"#FFFFFF\"><tr><td width=\"100%\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\"><tr><td valign=\"top\" class=\"paranormaltext\">");
// loops through each item of the array of watch this space items
	for (i = 0; i < wts_array.length; i++)
	{
		if (wts_array[i][5] == "feature")
		{
			if (wts_array[i][1] != "")
			{
				new_window = false;
				flyout_text = "";
				end_url = wts_array[i][1].substr(wts_array[i][1].length - 3, 3).toLowerCase();
// loop through array of different document types			
				for (j = 0; j < document_type_array.length; j++)
				{
// extension of link is in list of selected docment types - set indicator for a new window 
// and build flyout text
					if (document_type_array[j][0] == end_url)
					{
						new_window = true;
						flyout_text = document_type_array[j][1] + " " + wts_array[i][3] + " " + new_window_text;
						break;
					}
				}
				start_url = wts_array[i][1].substr(0, 7);
// link is to an external website - set indicator for a new window and build flyout text	
				if ((new_window == false) && (start_url == "http://"))
				{
					new_window = true;
					flyout_text = new_window_text;
				}
				if (wts_array[i][2] != 0)
				{
					if (flyout_text != "")
					{
						flyout_text = flyout_text + "; ";
					}
					flyout_text = flyout_text + language_text_array[wts_array[i][2]];
				}
			}
// array item contains no link - display as a heading
			if (wts_array[i][1] == "")
			{
				document.write("<p align=\"left\" class=\"subnormalboldcolourtext\">" + wts_array[i][0]);
				if (wts_array[i][4] != "")
				{
					document.write("<br><img border=\"0\" src=\"" + wts_array[i][4]);
					if (wts_array[i][6] != "")
					{
						document.write("\"  onmouseover=\"writetxt(\'" + wts_array[i][6] + "\')\" onmouseout=\"writetxt(0)");
					}
					document.write("\">");
				}
				document.writeln("</p>");
			}
			else if ((wts_array[i][1] != "") && (wts_array[i][4] != ""))
			{
				document.write("<p align=\"left\" class=\"subnormalboldcolourtext\">" + wts_array[i][0] + "<br>");
				document.write("<a class=\"parasmallcolourtext\" href=\"" + wts_array[i][1] + "\"");
				if (new_window == true)
				{
					document.write(" target=\"_blank\""); 
				}
				if (wts_array[i][6] != "")
				{
					flyout_text = wts_array[i][6] + flyout_text;
				}
				if (flyout_text != "")
				{
					document.write(" onmouseover=\"writetxt(\'" + flyout_text + "\')\" onmouseout=\"writetxt(0)\"");
				}
				document.writeln("><img border=\"0\" src=\"" + wts_array[i][4] + "\" ></a></p>");			
			}
			else
// array item contains a link - display as a link		
			{
// write link
				document.write("<p align=\"left\" class=\"smallgreaterlistitem\">");
				if (wts_array[i][0] == "Diaporama")
				{
					slideshow_array = wts_array[i][1].split(", ");
					insertOccasionSlideshow(slideshow_array[0], slideshow_array[1],  parseInt(slideshow_array[2]), parseInt(slideshow_array[3]));
				}
				else
				{
					if (wts_array[i][4] != "")
					{
						document.write("<a class=\"parasmallcolourtext\" href=\"" + wts_array[i][1] + "\"");
						if (new_window == true)
						{
							document.write(" target=\"_blank\""); 
						}
						if (flyout_text != "")
						{
							document.write(" onmouseover=\"writetxt(\'" + flyout_text + "\')\" onmouseout=\"writetxt(0)\"");
						}
						document.write("><img border=\"0\" src=\"" + wts_array[i][4] + "\" align=\"right\" width=\"50\"></a>");			
					}
					document.write("&gt;&nbsp;<a class=\"parasmallcolourtext\" href=\"" + wts_array[i][1] + "\"");
					if (new_window == true)
					{
						document.write(" target=\"_blank\""); 
					}
					if (flyout_text != "")
					{
						document.write(" onmouseover=\"writetxt(\'" + flyout_text + "\')\" onmouseout=\"writetxt(0)\"");
					}
					document.write(">" + wts_array[i][0] + "</a>");
					document.writeln("</p>");
				}
			}
		}
	}
// write end of table tags	
    document.writeln("</td></tr></table></td></tr></table>");
	return false;
	
}

// This function displays the Watch this space table on a web page
function displayWatchThisSpace()
{
	if ((this_page.indexOf("/english/") == -1) && (this_page.indexOf("/french/") == -1) && (this_page.indexOf("/spanish/") == -1))
	{
		index_page = true;
	}
	if (this_page.indexOf("/docs_") != -1)
	{
		border_colour = "#FF0000";
	}
	else if (this_page.indexOf("/forums_") != -1)
	{
		border_colour = "#000080";
	}
	else if (this_page.indexOf("/info_") != -1)
	{
		border_colour = "#0080C0";
	}
	else if (this_page.indexOf("/news_") != -1)
	{
		border_colour = "#0080FF";
	}
	else if (this_page.indexOf("/res_") != -1)
	{
		border_colour = "#008080";
	}
	else if (this_page.indexOf("/thewto_") != -1)
	{
		border_colour = "#0080C0";
	}
	else if (this_page.indexOf("/tratop_") != -1)
	{
		border_colour = "#800000";
	}
// loops through array of different watch this space sections
	for (h = 0; h < item_type_array.length; h++)
	{
		new_box = true;
// loops through each item of the array of watch this space items
		for (i = 0; i < wts_array.length; i++)
		{
			if (wts_array[i][5] == item_type_array[h][0])
			{
				if (new_box == true)
				{
					if (h != 0)
					{
    					document.writeln("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>&nbsp;</td></tr></table>");
					}
					if (index_page == true)
					{
						document.writeln("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"30%\" class=\"cellheadingcolourtext\">" + item_type_array[h][1] + "</td><td class=\"cellheadingwhitetext\">&nbsp;</td></tr></table>");
					}
					else
					{
						document.writeln("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"30%\" class=\"cellheadingwhitetext\">" + item_type_array[h][1] + "</td><td class=\"cellheadingblacktext\">&nbsp;</td></tr></table>");
					}
	    			document.writeln("<table style=\"border-style:solid; border-color:" + border_colour + "; border-width:1px; border-collapse:collapse\" border=\"1\" cellSpacing=\"0\" cellPadding=\"4\" width=\"100%\" bgcolor=\"#FFFFFF\"><tr><td width=\"100%\"><table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\"><tr><td valign=\"top\" class=\"paranormaltext\">");
					new_box = false;
				}
				if (wts_array[i][1] != "")
				{
					new_window = false;
					flyout_text = "";
					end_url = wts_array[i][1].substr(wts_array[i][1].length - 3, 3).toLowerCase();
// loop through array of different document types			
					for (j = 0; j < document_type_array.length; j++)
					{
// extension of link is in list of selected docment types - set indicator for a new window 
// and build flyout text
						if (document_type_array[j][0] == end_url)
						{
							new_window = true;
							flyout_text = document_type_array[j][1] + " " + wts_array[i][3] + " " + new_window_text;
							break;
						}
					}
					start_url = wts_array[i][1].substr(0, 7);
// link is to an external website - set indicator for a new window and build flyout text	
					if ((new_window == false) && (start_url == "http://"))
					{
						new_window = true;
						flyout_text = new_window_text;
					}
					if (wts_array[i][2] != 0)
					{
						if (flyout_text != "")
						{
							flyout_text = flyout_text + "; ";
						}
						flyout_text = flyout_text + language_text_array[wts_array[i][2]];
					}
				}
				
// array item contains no link - display as a heading
				if (wts_array[i][1] == "")
				{
					document.write("<p align=\"left\" class=\"subnormalboldcolourtext\">" + wts_array[i][0]);
					if (wts_array[i][4] != "")
					{
						document.write("<br><img border=\"0\" src=\"" + wts_array[i][4]);
						if (wts_array[i][6] != "")
						{
							document.write("\"  onmouseover=\"writetxt(\'" + wts_array[i][6] + "\')\" onmouseout=\"writetxt(0)");
						}
						document.write("\">");
					}
					document.writeln("</p>");
				}
				else if ((wts_array[i][1] != "") && (wts_array[i][4] != ""))
				{
					document.write("<p align=\"left\" class=\"subnormalboldcolourtext\">" + wts_array[i][0] + "<br>");
					document.write("<a class=\"parasmallcolourtext\" href=\"" + wts_array[i][1] + "\"");
					if (new_window == true)
					{
						document.write(" target=\"_blank\""); 
					}
						if (wts_array[i][6] != "")
					{
						flyout_text = wts_array[i][6] + flyout_text;
					}
				if (flyout_text != "")
					{
						document.write(" onmouseover=\"writetxt(\'" + flyout_text + "\')\" onmouseout=\"writetxt(0)\"");
					}
					document.writeln("><img border=\"0\" src=\"" + wts_array[i][4] + "\" ></a></p>");			
				}
				else
// array item contains a link - display as a link		
				{
					new_window = false;
					flyout_text = "";
					end_url = wts_array[i][1].substr(wts_array[i][1].length - 3, 3).toLowerCase();
// loop through array of different document types			
					for (j = 0; j < document_type_array.length; j++)
					{
// extension of link is in list of selected docment types - set indicator for a new window 
// and build flyout text
						if (document_type_array[j][0] == end_url)
						{
							new_window = true;
							flyout_text = document_type_array[j][1] + " " + wts_array[i][3] + " " + new_window_text;
							break;
						}
					}
					start_url = wts_array[i][1].substr(0, 7);
// link is to an external website - set indicator for a new window and build flyout text	
					if ((new_window == false) && (start_url == "http://"))
					{
						new_window = true;
						flyout_text = new_window_text;
					}
					if (wts_array[i][2] != 0)
					{
						if (flyout_text != "")
						{
							flyout_text = flyout_text + "; ";
						}
						flyout_text = flyout_text + language_text_array[wts_array[i][2]];
					}
// write link
					document.write("<p align=\"left\" class=\"smallgreaterlistitem\">");
					if (wts_array[i][0] == "Diaporama")
					{
						slideshow_array = wts_array[i][1].split(", ");
						insertOccasionSlideshow(slideshow_array[0], slideshow_array[1],  parseInt(slideshow_array[2]), parseInt(slideshow_array[3]));
					}
					else
					{
					if (wts_array[i][4] != "")
					{
						document.write("<a class=\"parasmallcolourtext\" href=\"" + wts_array[i][1] + "\"");
						if (new_window == true)
						{
							document.write(" target=\"_blank\""); 
						}
						if (flyout_text != "")
						{
							document.write(" onmouseover=\"writetxt(\'" + flyout_text + "\')\" onmouseout=\"writetxt(0)\"");
						}
						document.write("><img border=\"0\" src=\"" + wts_array[i][4] + "\" align=\"right\" width=\"50\"></a>");			
					}
					document.write("&gt;&nbsp;<a class=\"parasmallcolourtext\" href=\"" + wts_array[i][1] + "\"");
					if (new_window == true)
					{
						document.write(" target=\"_blank\""); 
					}
					if (flyout_text != "")
					{
						document.write(" onmouseover=\"writetxt(\'" + flyout_text + "\')\" onmouseout=\"writetxt(0)\"");
					}
					document.write(">" + wts_array[i][0] + "</a>");
					document.writeln("</p>");
					}
				}
			}
		}
// write end of table tags	
    	document.writeln("</td></tr></table></td></tr></table>");
	}
	return false;
}
//-->

