/************************
    Created by : Babak Serajeh  May on 06, 2004  
    Change History:
        May 8, 2004 : Arash Jalali - The locate function was slightly modified
        Nov 3, 2006 :  Arash Jalali - Added the organisation subtitle and the EHRC 
*************************/

LinkCats = ["General", "Political", "Cultural", "Scientific", "Technical", "Fun", "END"];

CatsAbb = ["GEN", "POL", "CUL", "SCI", "TEX", "FUN"];

Links =
[
  ["title", "General"],
        ["subtitle", "Organisations"], 
                ["http://www.ehrcweb.org", "European Human Rights Centre"],
	["subtitle", "Sources"],
		["http://www.google.com", "Google"],
		["http://blogdex.media.mit.edu/", "Blogdex"],
		["http://www.memeufacture.com/", "Memeufacture"],
	["subtitle", "News"],
		["http://news.bbc.co.uk/", "BBC UK"],
		["http://www.foxnews.com/index.html", "Fox News"],
		["http://cnn.com", "CNN"],
		["http://www.haaretzdaily.com/", "Ha'aretz"],
		["http://www.irna.ir/?LANG=EN&amp;PART=_HOME&amp;TYPE=HP", "IRNA"],
	["subtitle", "Reference"],
		["http://www.refdesk.com", "RefDesk"],
		["http://www.wikipedia.org", "Wikipedia"],
		["http://babelfish.altavista.com/translate.dyn", "Babel Fish Translator"],
		["http://www.faqs.org/faqs/index.html", "Internet FAQ Archives"],
  ["title", "Political"],
	["subtitle", "Left"],
	  ["subsubtitle", "journals"],
		["http://www.prospect.org/", "American Prospect"],
		["http://www.guardian.co.uk", "Guardian"],
		["http://www.thenation.com/", "Nation"],
		["http://www.harpers.org", "Harper's"],
		["http://www.archipelago.org/contents.htm", "Archipelago"],
		["http://www.cjr.org/", "Columbia Journalism Review"],
		["http://www.motherjones.com/", "Mother Jones"],
		["http://zmag.org/ZMagSite/curTOC.htm", "Z-Magazine"],
		["http://mondediplo.com/", "Le Monde Diplomatique"],
		["http://www.digitalnpq.org/", "New Prospectives"],
		["http://www.walrusmagazine.ca/index.pl?section=magazine", "Walrus"],
	  ["subsubtitle", "websites/weblogs"],
		["http://www.tompaine.com/", "Tom Paine"],
		["http://msnbc.msn.com/id/3449870/", "Alterman's Commentary"],
		["http://www.dailyhowler.com/", "Daily Howler"],
		["http://www.dailykos.com/", "Daily KOS"],
		["http://www.spinsanity.org", "Spinsanity"],
		["http://atrios.blogspot.com", "Eschaton"],
		["http://www.talkleft.com/", "TalkLeft"],
		["http://www.aclu.org/", "American Civil Liberties Union"],
		["http://www.lessig.org/blog/", "Larry Lessig"],
		["http://www.infoshop.org/Welcome.html", "InfoShop"],
		["http://edstrong.blog-city.com/index.cfm", "Edstrong"],
		["http://www.hyperorg.com/blogger/", "Joho the Blog"],
	["subtitle", "Right"],
	  ["subsubtitle", "journals"],
		["http://www.theamericanenterprise.org/", "American Enterprise"],
		["http://www.amconmag.com/", "American Conservative"],
		["http://economist.com/", "The Economist"],
		["http://www.foreignaffairs.org/current/", "Foreign Affairs"],
		["http://www.nationalreview.com/", "National Review"],
		["http://www.forward.com/", "Forward"],
		["http://frontpagemag.com/", "Frontpage"],
		["http://www.commentarymagazine.com/", "Commentary"],
		["http://www.weeklystandard.com/", "Weekly Standard"],
		["http://www.opeds.com/", "OpEds"],
	  ["subsubtitle", "websites/weblogs"],
		["http://www.command-post.org/", "Command Post"],
		["http://www.truthlaidbear.com/", "NZ Bear"],
		["http://volokh.com/", "Volokh Conspiracy"],
		["http://nicedoggie.net/", "Anti-Idiotarian Rottweiler"],
		["http://settingtheworldtorights.com", "Setting the World to Rights"],
		["http://www.rightwingnews.com/", "Right Wing News"],
		["http://www.littlegreenfootballs.com/weblog/weblog.php", "Little Green Footballs"],
		["http://windsofchange.net/", "Winds of Change"],
		["http://www.instapundit.com/", "InstaPundit"],
		["http://www.pejmanesque.com/", "PejmanPundit"],
		["http://www.buzzmachine.com/", "BuzzMachine"],
		["http://www.allahpundit.com/", "Allah is in the House"],
		["http://www.danielpipes.org/", "Daniel Pipes"],
	["subtitle", "Center/Other"],
		["http://www.hoder.com/weblog/", "Editor: Myself"],
		["http://riverbendblog.blogspot.com/", "Baghdad Burning"],
		["http://www.opendemocracy.com/home/index.jsp", "Open Democracy"],
		["http://www.amnesty.org/", "Amnesty International"],
		["http://www.angrybear.blogspot.com/", "Angry Bear"],
		["http://iranfilter.com", "IranFilter"],
  ["title", "Cultural"],
	["http://www.aldaily.com", "Arts and Letters Daily"],
	["http://www.centerforbookculture.org/context/", "Context"],
	["http://www.deviantart.com/", "Deviant Art"],
	["http://akma.disseminary.org/", "AKMA's Random Thoughts"],
	["http://weblog.burningbird.net/", "Burning Bird"],
	["http://weblog.delacour.net/", "Heart of Things"],
	["http://adbusters.org/home/", "Adbusters"],
	["http://plagiarist.com/", "Plagiarist Poetry Archive"],
	["http://www.gutenberg.net/find.shtml", "Project Gutenberg E-Books"],
	["http://scitechdaily.com/", "Science and Technology Daily"],
	["http://www.granta.com/latest-issue", "Granta"],
	["http://wvs.topleftpixel.com/", "Daily Dose of Imagery"],
	["http://www.tehranavenue.com/", "Tehran Avenue"],
	["http://www.iranian.com/today.html", "Iranian dot com"],
  ["title", "Scientific"],
		["http://www.ipm.ac.ir/IPM/publications/publications.jsp","AKHBAR: IPM Quarterly Newsletter"],
		["http://radio.weblogs.com/0110772/", "Seb's Open Research"],
		["http://www.crookedtimber.org/", "Crooked Timber"],
	["subtitle", "Humanities"],
		["http://www.politicaltheory.info/", "Political Theory Daily"],
		["http://www.amritas.com/", "Amravati"],
	["subtitle", "Exact"],
		["http://www.nature.com/", "Nature"],
		["http://www.sciencemag.org/", "Science"],
		["http://www.edge.org/", "The Edge"],
		["http://www.butterfliesandwheels.com/", "Butterflies & Wheels"],
		["http://www.chriscmooney.com/blog.asp", "Chris C Mooney"],
		["http://golem.ph.utexas.edu/~distler/blog/", "Musings"],
		["http://bottomquark.com/", "Bottom Quark"],
 ["title", "Technical"], /* includes web design, computers, nerdity} */
	["subtitle", "News"],
		["http://slashdot.org/", "SlashDot"],
		["http://www.wired.com/news/", "Wired"],
	["subtitle", "References"],
		["http://blogger.com", "Blogger"],
		["http://movabletype.org", "Movable Type"],
	["subtitle", "Weblogs"],
		["http://www.scripting.com/", "Dave Winer"],
		["http://www.kuro5hin.org/", "Kuro5hin"],
		["http://google.blogspace.com/", "Google Weblog"],
		["http://www.kottke.org/", "Kottke"],
  ["title", "Fun"],
	["http://www.theonion.com/", "The Onion"],
  ["title", "END"]
];

function Ind (RefStr, NameStr) {

/* Returns the index at which a certain NameStr appears in Links;
    RefStr determines the type of the entry: "title", "subtitle", "subsubtitle", or "http". */ 

	var i = 0;
	var flag = 0;

	document.write("Ind ");

	while (flag==0) {
	  if (RefStr.substr(0, 4)!="http")
	    if ( (Links[i][0]==RefStr)&&(Links[i][1]==NameStr) ) {flag=1;}
	  if (RefStr.substr(0, 4)=="http") 
	    if (Links[i][1]==NameStr) {flag=1;}
	  if ( (Links[i][0]=="title")&&(Links[i][1]=="END") ) {flag=-1;}
	  i++;
	}
	if (flag == 1) return (i-1);
 	if (flag == -1) return (-1);
}

function Tostring(n)
{
/* Turns the number n into a string */

	var i, Rstr, m;
	
	Rstr =""; m=n;
	for (i=1; i<=Math.ceil(Math.log(n+1)/Math.LN10); i++)
	{
		Rstr = String.fromCharCode(48+m%10) + Rstr;
		m = (m - m%10)/10;
	}
	return Rstr;
}

function locate(ind) {
/* redirection to the desired URL */
  if( (!isNaN(ind)) && (ind != "") ) {
	location=Links[ind][0];
  }

}