function popup() {
	window.open("faq.html","namn","width=400,height=600,scrollbars=yes,status=no,toolbar=no,resizable=no,location=no,menubar=no,directories=no")
}


function displayPrefsChoice() {
	var htmlString;
	htmlString = ' \
	<form> \
	<input type="button" onclick="displayCollectionPrefs()" value="Choose Collection"> \
	<input type="button" onclick="displayTemperaturePrefs()" value="Calibrate Apparent Temperature"> \
	<input type="button" onclick="closePrefs()" value="aldrig"> <br /> \
	</form> \
	';
	document.getElementById("mainView").innerHTML = htmlString;
}


function displayTemperaturePrefs() {
	var htmlString;
	htmlString = ' \
	<form> \
	<select name="temperatureAdjustement"> \
	<option value="neutral">No it\'s fine thanks</option> \
	<option value="warm">I am a warm person</option> \
	<option value="cold">I am a cold person</option> \
	</select> \
	<input type="button" onclick="setTemperaturePrefs()" value="Set Adjustement"> \
	<input type="button" onclick="closePrefs()" value="aldrig"> <br /> \
	</form> \
	';
	document.getElementById("mainView").innerHTML = htmlString;			
}


function setTemperaturePrefs() {
	var warmOrCold;
	var theIndex;
	theIndex = document.forms[0].temperatureAdjustement.selectedIndex;
	warmOrCold = document.forms[0].temperatureAdjustement.options[theIndex].value;
	window.location = "?warmOrCold="+warmOrCold;
	document.getElementById("mainView").innerHTML = $forecastHTML;
}


function displayCollectionPrefs(collection) {
	var prefsHTML;
	var mika = 'img/mika.png';
	var kim = 'img/kim.png';
	if (collection == 'mika') {
		mika = 'img/mika.png';
	} else {
		kim = 'img/kim.png';
	}
	
	prefsHTML = '<table cellpadding="0" cellspacing="0" border="0" width="302"> \
	<tr> \
	<td align="center"> \
	<table cellpadding="0" cellspacing="0" border="0" width="230"> \
	<tr> \
	<td align="left" height="30"> \
	<h3>Klicka på den kollektion du tycker passar dig, för att välja!</h3> \
	</td> \
	</tr> \
	<tr> \
	<td align="center" height="130"> \
	<a href="?collection=mika"><img src="' + mika  + '" border="0"></a> \
	</td> \
	</tr> \
	<tr> \
	<td align="center" height="130"> \
	<a href="?collection=kim"><img src="'+ kim +'" border="0"></a> \
	</td> \
	</tr> \
	<tr> \
	<td align="left"> \
	</td> \
	</tr> \
	</table> \
	</td> \
	</tr> \
	</table> ';
	document.getElementById("mainView").innerHTML = prefsHTML;
}				

function closePrefs() {
	document.getElementById("mainView").innerHTML = $forecastHTML;
}

function setPrefs() {
	var txt;
	var prefs;
	prefs=document.forms[0].prefs;
	txt = '?collection=';
	if (prefs[0].checked) {
	    txt = txt + prefs[0].value;
	} else {
		 txt = txt + prefs[1].value;
	}
	window.location = txt;
	document.getElementById("mainView").innerHTML = $forecastHTML;    				
}