document.write('
');document.write('');document.write('');document.write('');document.write('');document.write(''); document.write(''); document.write(''); document.write('
');document.write('
');document.write('

');document.write('
');document.write('');document.write(' ');document.write('');document.write('

');document.write('

');document.write('
');document.write('');document.write('');document.write('

');document.write('
Jetzt den Wert Ihres Goldes errechnen
');document.write('
');document.write('
'); var boxHeight = 64; function pruefeZahl(wert){ check=wert.toString(); check=check.replace(",", "."); wert=parseFloat(check); if(isNaN(wert)){ return false; } return wert; } function rechne() { var eingabe = document.getElementById('gfgr_eingabe').value; var einheit = document.getElementById('gfgr_einheit').value; var karat = document.getElementById('gfgr_carat').value; eingabe=pruefeZahl(eingabe); if (eingabe==false){ return false; } xhr = http(); xhr.open("POST", "http://www.goldfixing.de/export/goldrechner2/rechner.php", false); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send('karat='+karat+'&einheit='+einheit+'&eingabe='+eingabe); //alert(document.getElementById('gfgr_calculator_label').style.color); document.getElementById('gfgr_calculator_label').style.color = 'grey'; document.getElementById('gfgr_calculator_rate').style.color = 'grey'; if (xhr.readyState == 4) { setTimeout( function () { if (document.getElementById('gfgr_ergebnis').style.display == "none") { slideDown(document.getElementById('gfgr_ergebnis'),0,boxHeight,Math.ceil(boxHeight/300)); } datenAusgeben(xhr); }, 500 ) } } function datenAusgeben() { var rueckgabe = xhr.responseText; var ergebnisse = eval(rueckgabe); var euroKurs = ergebnisse[0]; var dollarKurs = ergebnisse[1]; document.getElementById('gfgr_ergebnis_dollar').innerHTML = dollarKurs; document.getElementById('gfgr_ergebnis_euro').innerHTML = euroKurs; var selectEinheit = document.getElementById('gfgr_einheit'); var einheit = selectEinheit.options[selectEinheit.selectedIndex].innerHTML; var selectKarat = document.getElementById('gfgr_carat'); var karat = selectKarat.options[selectKarat.selectedIndex].innerHTML; var eingabe = document.getElementById('gfgr_eingabe').value; var singularPlural = 'hat'; if (eingabe > 1) { var singularPlural = 'haben'; } document.getElementById('gfgr_ergebnis_karat').innerHTML = karat; document.getElementById('gfgr_ergebnis_einheit').innerHTML = singularPlural+' '+eingabe+' '+einheit; removeGrey(); } function http() { var http; if (window.XMLHttpRequest) { http = new XMLHttpRequest(); } else if (window.ActiveXObject) { http = new ActiveXObject("Microsoft.XMLHTTP"); } return http; } function removeGrey() { if (document.getElementById('gfgr_calculator_label').style.removeProperty) { document.getElementById('gfgr_calculator_label').style.removeProperty('color'); document.getElementById('gfgr_calculator_rate').style.removeProperty('color'); } else { document.getElementById('gfgr_calculator_label').style.removeAttribute('color'); document.getElementById('gfgr_calculator_rate').style.removeAttribute('color'); } } function slideDown(obj,offset,full,px){ if(offset < full){ obj.style.visibility = "hidden"; obj.style.display = "block"; obj.style.height="0px"; obj.style.visibility = "visible"; obj.style.height = offset+"px"; offset=offset+px; setTimeout((function(){slideDown(obj,offset,full,px);}),1); } else { obj.style.height = full+"px"; document.getElementById('gfgr_calculator_label').style.display = 'block'; document.getElementById('gfgr_calculator_rate').style.display = 'block'; removeGrey(); } } var stylesheet = document.createElement('link'); stylesheet.href = 'http://www.goldfixing.de/export/goldrechner2/gf_goldrechner.css'; stylesheet.rel = 'stylesheet'; stylesheet.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(stylesheet);