//<!--
function go(){
	fart = document.forms[0].news;
	fart1= fart.options[fart.selectedIndex].value;
	frames['newsiframe'].location.href = "news.html?" + fart1
}

function entering(){
	MM_preloadImages('images/gelbraen1_r2_c1_f2.jpg','images/gelbraen1_r2_c2_f2.jpg','images/gelbraen1_r2_c3_f2.jpg','images/gelbraen1_r2_c4_f2.jpg','images/gelbraen1_r2_c5_f2.jpg');
	popList();//populate the selectlist
	window.setTimeout('continue_entering()', 200);//wait 200 mills for list to pop and be recognized, then continue_entering (req'ed for IE)	
}
function continue_entering(){
	var RSSfeed = GetCookie('RSSfeed');
	if (RSSfeed == null) {RSSfeed="6"};//PCWORLD is default if no cookie!	
	fart = document.rss.news;
	fart.selectedIndex = RSSfeed;
	fart.value = fart.options[RSSfeed].value;
	go();
}
function exiting(){
	fart = document.rss.news;
	RSSfeed = fart.selectedIndex;
	pathname = location.pathname;
	myDomain = pathname.substring(0,pathname.lastIndexOf('/')) +'/';
	// set expiry date to 1 year from now.
	var largeExpDate = new Date ();
	largeExpDate.setTime(largeExpDate.getTime() + (365 * 24 * 3600 * 1000));
	SetCookie('RSSfeed',RSSfeed,largeExpDate,myDomain);
}








function popList(){
	var iValue = 0;
	var iText = 1;
	var arrList1ValueAndText  = new Array();
	arrList1ValueAndText[iValue]  = new Array();
	arrList1ValueAndText[iText]  = new Array();

	arrList1ValueAndText[iValue][0] = "26";
	arrList1ValueAndText[iText] [0] = "BBC News - Tech";
	arrList1ValueAndText[iValue][1] = "86";
	arrList1ValueAndText[iText] [1] = "Best of Craig's List";
	arrList1ValueAndText[iValue][2] = "115";
	arrList1ValueAndText[iText] [2] = "Computer Support";
	arrList1ValueAndText[iValue][3] = "30";
	arrList1ValueAndText[iText] [3] = "CNET News";
	arrList1ValueAndText[iValue][4] = "@1";
	arrList1ValueAndText[iText] [4] = "Digg";
	arrList1ValueAndText[iValue][5] = "49";
	arrList1ValueAndText[iText] [5] = "Lockernome Tech News";
	arrList1ValueAndText[iValue][6] = "63";
	arrList1ValueAndText[iText] [6] = "PC World";
	arrList1ValueAndText[iValue][7] = "79";
	arrList1ValueAndText[iText] [7] = "Slash Dot";
	arrList1ValueAndText[iValue][8] = "64";
	arrList1ValueAndText[iText] [8] = "Wired News";
	
	// must wait to after select tag before executing "addListOption"
	for(ii=0;ii<arrList1ValueAndText[iValue].length;ii++){
  		var tmpValue = arrList1ValueAndText[iValue][ii];
  		var tmpText  = arrList1ValueAndText[iText][ii];
  		addListOption("news", tmpValue, tmpText);
	}
}
// function add option elements to an empty select object
function addListOption(sListId, sOptionValue, sOptionText){
  oList = document.getElementById(sListId);
  var oOption = document.createElement("option");
  oOption.appendChild(document.createTextNode(sOptionText));
  oOption.setAttribute("value", sOptionValue);
  oList.appendChild(oOption);
  return true;
}	





function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0){break;}
	}
	return null;
}
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1){endstr = document.cookie.length;}
	return unescape(document.cookie.substring(offset, endstr));
}
function SetCookie (name, value) {
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape (value) +
	((expires == null) ? "" : ("; expires=" +
	expires.toGMTString())) +
	((path == null) ? "" : ("; path=" + path)) +
	((domain == null) ? "" : ("; domain=" + domain)) +
	((secure == true) ? "; secure" : "");
}










function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

