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='590' height='240' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0'>");
document.write("  <param name='flashVars' value='companyId=SCI&width=590&height=240&AppbgColor=0xFFFFFF&TitlebgColor=0xFFFFFF&borderStyle=none&borderThickness=&borderColor=&titleTxt=Number dispersion&shareholdersTxt=Shareholders&sharesTxt=Amount&numSharesTxt=Shares&updatedLabel=Updated&totalLabel=Total&updateInfoTxt=Distribution of shareholding is updated monthly.&TitleFontColor=0x868686&FontColor=0x868686&instrumentId=HEX24348&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=&nonAPKRegisteredShareData=&showExcel=false&excelText=Download excel'/>");
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='590' height='240' 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=SCI&width=590&height=240&AppbgColor=0xFFFFFF&TitlebgColor=0xFFFFFF&borderStyle=none&borderThickness=&borderColor=&titleTxt=Number dispersion&shareholdersTxt=Shareholders&sharesTxt=Amount&numSharesTxt=Shares&updatedLabel=Updated&totalLabel=Total&updateInfoTxt=Distribution of shareholding is updated monthly.&TitleFontColor=0x868686&FontColor=0x868686&instrumentId=HEX24348&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=&nonAPKRegisteredShareData=&showExcel=false&excelText=Download excel'");
document.write(" </embed>");
document.write("</object>");
