/*
 * Place the following to page's head: 
 * <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
 * 
 */


/** From http://www.javaworld.com/javaforums/showthreaded.php?Cat=&Board=Enterprisejava&Number=18880&page=&view=&sb=5&o=&vc=1 */
function getParameter ( queryString, parameterName ) {
	// Add "=" to the parameter name (i.e. parameterName=value)
	var parameterName = parameterName + "=";
	if ( queryString.length > 0 ) {
		// Find the beginning of the string
		begin = queryString.indexOf ( parameterName );
		// If the parameter name is not found, skip it, otherwise return the value
		if ( begin != -1 ) {
			// Add the length (integer) to the beginning
			begin += parameterName.length;
			// Multiple parameters are separated by the "&" sign
			end = queryString.indexOf ( "&" , begin );
			if ( end == -1 ) {
				end = queryString.length
			}
			// Return the string
			return unescape ( queryString.substring ( begin, end ) );
		}
		// Return "null" if no parameter has been found
		return "null";
	}
} 
			
$(document).ready(function() {
	var newsPara = getParameter(window.top.location.search.substring(1), "uutinen");
	if (newsPara == "null") {
		newsPara = "news-1"
	}
	var selector = "#" + newsPara;
	$(selector).contents().appendTo("#shownNews");
});
