function postCSV(csvString){
	post_to_url('http://ir.nasdaqomxnordic.com/OpenInEXcel', csvString);
	return "success";
}

function post_to_url(path, csvString) {
	method = "post"; // Set method to post by default, if not specified.
	var form = document.createElement("form");
	form.setAttribute("method", method);
	form.setAttribute("action", path);
	var hiddenField = document.createElement("input");
	hiddenField.setAttribute("type", "hidden");
	hiddenField.setAttribute("name", "csvString");
	hiddenField.setAttribute("value", csvString);
	form.appendChild(hiddenField);
	document.body.appendChild(form); // Not entirely sure if this is necessary
	form.submit();
}

document.write("<script type='text/javascript'>var head = document.getElementsByTagName('head')[0];script = document.createElement('script');script.src = 'http://www.omxnordicexchange.com/static/ir/JavaScriptFunctions/flashCheck.js';script.type = 'text/javascript';head.appendChild(script);</script>");
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' id='NasdaqOmxFlash' width='700' height='250' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'>");
document.write("  <param name='flashVars' value='companyId=UNR&width=700&height=250&AppbgColor=0xFFFFFF&TitlebgColor=#0066CC&borderStyle=solid&borderThickness=0&borderColor=0xFFFFFF&titleTxt=Number dispersion&shareholdersTxt=Owners&sharesTxt=Amount&numSharesTxt=Shares&updatedLabel=Updated&totalLabel=Total&updateInfoTxt=Distribution of shareholding is updated monthly.&TitleFontColor=0xFFFFFF&FontColor=0x000000&instrumentId=HEX24385&instrumentIdB=&aShares=A-Shares&bShares=B-Shares&combined=true&fontFamily=Verdana&fontSize=10&fontColor=0x000000&widthCorrection=&shareholdersBTxt=Number of shareholders&numSharesBTxt=Number of shares&boxBGColor1=0xFFFFFF&boxBGColor2=0xF3F3F3&nonAPKRegisteredShares=Not in book-entry register&nonAPKRegisteredShareData=0|0|854|0&showExcel=${configuration.getParameter('showExcel')}&excelText=${configuration.getParameter('excelText')}'/>");
document.write("  <param name='movie' value='http://www.omxnordicexchange.com/static/ir/Apk-Numberdispersion/Numberdispersion.swf' />");
document.write("  <param name='quality' value='high' />");
document.write("  <param name='bgcolor' value='#ffffff' />");
document.write("  <param name='AllowScriptAccess' value='always' />");
document.write("  <param name='wmode' value='transparent' />");
document.write("  <embed src='http://www.omxnordicexchange.com/static/ir/Apk-Numberdispersion/Numberdispersion.swf' quality='high' bgcolor='#ffffff'");
document.write("    width='700' height='250' name='historicalSearch' align='middle'");
document.write("    play='true'");
document.write("    loop='false'");
document.write("    AllowScriptAccess='always'");
document.write("    wmode='transparent'");
document.write("    type='application/x-shockwave-flash'");
document.write("    flashVars='companyId=UNR&width=700&height=250&AppbgColor=0xFFFFFF&TitlebgColor=#0066CC&borderStyle=solid&borderThickness=0&borderColor=0xFFFFFF&titleTxt=Number dispersion&shareholdersTxt=Owners&sharesTxt=Amount&numSharesTxt=Shares&updatedLabel=Updated&totalLabel=Total&updateInfoTxt=Distribution of shareholding is updated monthly.&TitleFontColor=0xFFFFFF&FontColor=0x000000&instrumentId=HEX24385&instrumentIdB=&aShares=A-Shares&bShares=B-Shares&combined=true&fontFamily=Verdana&fontSize=10&fontColor=0x000000&widthCorrection=&shareholdersBTxt=Number of shareholders&numSharesBTxt=Number of shares&boxBGColor1=0xFFFFFF&boxBGColor2=0xF3F3F3&nonAPKRegisteredShares=Not in book-entry register&nonAPKRegisteredShareData=0|0|854|0&showExcel=${configuration.getParameter('showExcel')}&excelText=${configuration.getParameter('excelText')}'");
document.write(" </embed>");
document.write("</object>");
