// Various functions
// baked, borrowed or pilfered for http://www.icsep.org.il
// by http://www.engaging.net

// the following function stops forms being sent incorrectly

function checkrequired(which) 
{
	var pass=true;
	if (document.images) 
	{
		for (i=0;i<which.length;i++) 
		{
			var tempobj=which.elements[i];
			if ((tempobj.name.substring(0,8)=="required") || (tempobj.name=="email"))
			{
				if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==0)) 
				{
					pass=false;
					break;
				}
			}
		}
	}
	if (!pass) 
	{
		if (tempobj.name=="email")
		{
			shortFieldName="EMAIL";
		}
		else
		{
			shortFieldName=tempobj.name.substring(8,30).toUpperCase();
		}
		alert("Please complete the "+shortFieldName+" field.");
		return false;
	}
	else
	return true;
}

function orderform(title,subtitle,price)
{
	text="scrollbars=no,status=no,menubar=no,width=190,titlebar=no,height=450,screenX=200,screenY=200,top=200,left=200";
	myFloater=window.open('http://www.icsep.org.il/order.html?' + title + '|' + subtitle + '|' + price,'myWindow',text); 
}


randomQuoteNumber = Math.round(Math.random() * 36);

if (randomQuoteNumber < "1")
{
	randomQuoteNumber = 1;
}

randomQuote = "not work<BR>";

if (randomQuoteNumber == "1")
{
	randomQuote = "<I>&quot;ICSEP has introduced innovative ideas into public life, has started people<BR>thinking about economic realities, and is generally doing an excellent job.&quot;</I><BR>Amnon Rubinstein, former Minister of Energy<BR>";
}

if (randomQuoteNumber == "2")
{
	randomQuote = "<I>&quot;Thank you for including me in the dinner with Israeli Supreme Court<BR>Justices... I learned a lot... Your Center is surely doing good work.&quot;</I><BR>Prof. James Buchanan, Nobel Laureate in Economics<BR>";
}

if (randomQuoteNumber == "3")
{
	randomQuote = "<I>&quot;ICSEP's approach... is of great interest to a Knesset member<BR>like myself who has to face daily concrete policy issues...&quot;</I><BR>Yehoshua Matza, former Minister of Health<BR>";
}

if (randomQuoteNumber == "4")
{
	randomQuote = "<i>&quot;Your conference was an occasion for seminal thinking<BR>and the exchange of ideas on the highest level.&quot;</I><BR>Dr. S. Levin, Justice of the Supreme Court<BR>";
}

if (randomQuoteNumber == "5")
{
	randomQuote = "<I>&quot;Thanks to ICSEP's help, I have just completed my first trip to Israel...<BR>I am astounded by the number and quality of meetings that were put together... &quot;</I><BR>Jeb Hensarling, former Executive Director, National Republican Senatorial Committee<BR>";
}

if (randomQuoteNumber == "6")
{
	randomQuote = "<i>&quot;I am convinced that such a wealth of professional experiences as I had<BR>on your study mission shall not come my way for a long time, if ever...&quot;</I><BR>Gadi Sukenik, senior political correspondent, Israel TV<BR>";
}

if (randomQuoteNumber == "7")
{
	randomQuote = "<I>&quot;The presentations in your excellent conference on </I>New Economics,<BR>New Politics<I> in Jerusalem last November were very thoughtful.&quot;</I><BR>Henry L. Clarke, former Counselor for Economic Affairs, US Embassy in Israel<BR>";
}

if (randomQuoteNumber == "8")
{
	randomQuote = "<I>&quot;The audience at your law and economics conference was perhaps the most<BR>influential and outstanding group of jurists ever assembled in Israel.&quot;</I><BR>Professor Uriel Reichman, former Dean, Tel Aviv University Faculty of Law<BR>";
}

if (randomQuoteNumber == "9")
{
	randomQuote = "<I>&quot;You are indeed waging a difficult struggle<BR>but it is imperative that you continue to do so.&quot;</I><BR>Stuart Eizenstat, Under Secretary of the US Treasury<BR>";
}

if (randomQuoteNumber == "10")
{
	randomQuote = "<I>&quot;[ICSEP] is the main fighter in Israel for free enterprise.<BR>Its very lucid statements are day by day making us a freer society.&quot;</I><BR>Danny Gillerman, Israeli Ambassador to the United Nations<BR>";
}

if (randomQuoteNumber == "11")
{
	randomQuote = "<I>&quot;Since as head of ICSEP you find it useful to disseminate [your recent publication], I am confident that I will both enjoy reading it and also learn from it.&quot;</I><BR>Prof. Ya'acov Frenkel, former Governor of the Bank of Israel<BR>";
}

if (randomQuoteNumber == "12")
{
	randomQuote = "<I>&quot;There is no doubt that your action plan deserves<BR>deep analysis and that it raises important points.&quot;</I><BR>Benjamin Ben-Eliezer, former Minister of Defence<BR>";
}

if (randomQuoteNumber == "13")
{
	randomQuote = "<I>&quot;Your formulations of the problems is the best I<BR>have seen. Every word is worth its weight in gold.&quot;</I><BR>MK Meir Sheetrit, Minister without Portfolio in the Finance Ministry<BR>";
}

if (randomQuoteNumber == "14")
{
	randomQuote = "<I>&quot;Your </I>What You Wanted to Know<I> [book] is most interesting and an<BR>important contribution to decision-makers in the economic sphere.&quot;</I><BR>Prof. Avi Lubotsky<BR>";
}

if (randomQuoteNumber == "15")
{
	randomQuote = "<I>&quot;I learn a lot from your publications and<BR>they serve me daily in my Knesset work.&quot;</I><BR>Nissim Dahan, former Minister of Health<BR>";
}

if (randomQuoteNumber == "16")
{
	randomQuote = "<I>&quot;I hope decision-makers and policy formulators shall be assisted<BR>by your good work when they formulate public policy.&quot;</I><BR>Prof. Ya'acov Ne'eman, former Minister of Finance<BR>"; 
}

if (randomQuoteNumber == "17")
{
	randomQuote = "<I>&quot;In my view, [ICSEP's] conference contributed substantially<BR>to the advancement of free market ideas in Israel.&quot;</I><BR>Prof. Uriel Reichman, former Dean, Tel Aviv University Faculty of Law<BR>";
}

if (randomQuoteNumber == "18")
{
	randomQuote = "<I>&quot;... your sharp focus and the in-depth and clear analysis of the topics you treat are revealing new sides to issues that are often presented to us in a one-sided way...&quot;</I><BR>Nissim Dahan, former Minister of Health<BR>";
}

if (randomQuoteNumber == "19")
{
	randomQuote = "<I>&quot;Slowly things are moving in the right direction and you<BR>rightly claim a substantial amount of credit for ICSEP.&quot;</I><BR>Stuart Eizenstat, Under Secretary of the US Treasury<BR>";
}

if (randomQuoteNumber == "20")
{
	randomQuote = "<i>&quot;The view of all the justices with whom I spoke was that [your conference]<BR>was most successful, both in its contents and in its organization.&quot;</I><BR>Dr. S. Levin, Justice of the Supreme Court<BR>";
}

if (randomQuoteNumber == "21")
{
	randomQuote = "<i>&quot;We need a change towards freer markets. What ICSEP does is to<BR>fulfill that role as a catalyst for change. I think it is irreplaceable.&quot;</I><BR>Benjamin Netanyahu, Finance Minister<BR>";
}

if (randomQuoteNumber == "22")
{
	randomQuote = "<i>&quot;Your materials are riveting, to the point, and analyse correctly what has taken place... We shall continue to work together for the attainment of these goals.&quot;</I><BR>Shimon Peres, Leader of the Opposition<BR>";
}

if (randomQuoteNumber == "23")
{
	randomQuote = "<i>&quot;The ICSEP is like a breath of fresh air... It deserves the support of all of us<BR>who are deeply committed to the survival of a strong and healthy Israel.&quot;</I><BR>Prof. Milton Friedman, Nobel Laureate in Economics<BR>";
}

if (randomQuoteNumber == "24")
{
	randomQuote = "<i>&quot;It is important that ICSEP's voice continue to ring out.<BR>Please keep up your efforts on behalf of the Jewish people.&quot;</I><BR>Kenneth Bialkin, Chairman of the Board, American-Israel Friendship League<BR>";
}

if (randomQuoteNumber == "25")
{
	randomQuote = "<i>&quot;I benefited greatly from hearing many of the first rate speakers and the chance to meet many of the outstanding people you brought together for this conference.&quot;</I><BR>Dr. Ron Kronish, The American Jewish Committee<BR>";
}

if (randomQuoteNumber == "26")
{
	randomQuote = "<i>&quot;...Thanks for the frankness and generosity you have shown me in all our contacts. Your spirit of cooperation has brought resolution to certain bilateral problems.&quot;</I><BR>Tain P. Tompkins, Economic Counselor, Embassy of the United States of America<BR>";
}

if (randomQuoteNumber == "27")
{
	randomQuote = "<i>&quot;...I fully agree with the thrust of your argument of the close positive<BR>link between economic development, civil society and peace.&quot;</I><BR>Saad Eddin Ibrahim, Chairman of the Board, Ibn Khaldoun Center for Development<BR>";
}

if (randomQuoteNumber == "28")
{
	randomQuote = "<i>&quot;All of us here at The Heritage Foundation applaud you for your<BR>extraordinary work in advancing the ideas of the free society, which we share.&quot;</I><BR>Edwin J. Feulner, Jr., President, The Heritage Foundation<BR>";
}

if (randomQuoteNumber == "29")
{
	randomQuote = "<i>&quot;I could not agree with you more on the importance of the economic foundations of the peace process... Thank you again for all of the assistance you have provided...&quot;</I><BR>Edward S. Walker, Jr., former US Ambassador to Israel<BR>";
}

if (randomQuoteNumber == "30")
{
	randomQuote = "<i>&quot;Your insights into the many political and bureaucratic problems that face<BR>Israel are both provocative and enlightening. I appreciate your efforts...&quot;</I><BR>Stephen Goldsmith, former Mayor, City of Indianapolis<BR>";
}

if (randomQuoteNumber == "31")
{
	randomQuote = "<i>&quot;Thank you again for putting together such an excellent program...<BR>I obtained a well-rounded perspective that served me well...&quot;</I><BR>Phil Gramm, United State Senator<BR>";
}

if (randomQuoteNumber == "32")
{
	randomQuote = "<i>&quot;Thank you for your letter and the really terrific articles enclosed with it...<BR>I hope your articles are getting a large audience in Israel. They certainly ought to.&quot;</I><BR>Richard A. Posner, Chief Judge, United States Court of Appeals<BR>";
}

if (randomQuoteNumber == "33")
{
	randomQuote = "<i>&quot;I am very grateful for your flawless hostmanship in arranging... our meetings...<BR>my perceptions concerning that part of the world will never be the same.&quot;</I><BR>Justice Antonin Scalia, US Supreme Court<BR>";
}

if (randomQuoteNumber == "34")
{
	randomQuote = "<i>&quot;In the past decade [ICSEP Director] Daniel Doron has consistently been perhaps<BR>the most effective proponent of a strictly free-market approach in Israel...&quot;</I><BR>Milton Friedman, Nobel Laureate in Economics<BR>";
}

if (randomQuoteNumber == "35")
{
	randomQuote = "<i>&quot;[I] salute the extraordinary work, which Daniel Doron<BR>and his institute have undertaken over the past decade...&quot;</I><BR>The Honorable Stuart E. Eizenstat, Under Secretary of the US Treasury<BR>";
}

if (randomQuoteNumber == "36")
{
	randomQuote = "<i>&quot;...the U.S. government salutes your achievements, your institute's achievements...&quot;</I><BR>The Honorable Stuart E. Eizenstat, Under Secretary of the US Treasury<BR>";
}

function order(title,cost) 
{
	var filename = 'http://64.39.3.66/order.html' + '?' + title + '|' + cost;
	text="scrollbars=no,status=no,menubar=no,WIDTH=200,titlebar=no,height=375,screenX=400,screenY=400,top=400,left=400";
	myFloater=window.open(filename,'myWindow',text); 
}


function enterPopup(el)
{
	el.style.cursor = "hand";
}

function popup(item, width, height, action) 
{ 
	itemName = item;
	completeFilename = itemName;
	if (action == "resize")
	{
		window.location = completeFilename;
		window.resizeTo(width, height);
	}
	if (action == "open")
	{
		window.open(completeFilename, "popup", "toolbar=no,scrollbars=no,status=no,menubar=no,resizable=0,copyhistory=no,width=" + width + ",height=" + height + ",top=0,left=0");
	}
}

function erase(box) 
{
   if (box.defaultValue == "Mailing list")
   box.value = "";
   if (box.defaultValue == "Search")
   box.value = "";
   if (box.defaultValue == "Amount in $US")
   box.value = "";
}

function topicsDisplay(toptopic)
{
	obj = document.getElementById(toptopic);
	obj.style.display = "block";
}

function topicsHide(toptopic)
{
	obj = document.getElementById(toptopic);
	obj.style.display = "none";
}