var direction;
var cpuaddon;
var vcore;
var vcoredef;
var vcorepossible;
var fsbsel;
var logo;

function APPCHKDIR() {
if (navigator.appName=="Netscape")
{direction=NetDir;
VIDCHG()}
else
{direction=meingabe.direction.value;
VIDCHG()} }

function APPCHKV() {
if (navigator.appName=="Netscape")
{vcore=NetV
VIDCHG()}
else
{vcore=meingabe.Volt.value
VIDCHG()} }

function APPCHKVdef() {
if (navigator.appName=="Netscape")
{vcoredef=NetVdef
VIDCHG()}
else
{vcoredef=meingabe.Voltdef.value
VIDCHG()} }


function APPCHKFSB() {
if (navigator.appName=="Netscape")
{fsbsel=NetFSB;
VIDCHG()}
else
{fsbsel=meingabe.fsbselect.value;
VIDCHG()} }



function VIDCHG() {
// alert (vcoredef+" "+vcore+" "+vcorepossible);
if (!vcore) {return; }

cpuaddon = "";
vcorepossible = "yes";
if (!vcore)    {vcore = "nonV"}
if (!vcoredef) {vcoredef = "11111"}
if (!fsbsel)   {fsbsel = "0"}

if (vcoredef.substr(0,1) == "0" && vcore.substr(0,1) == "1") { vcorepossible = "no"; }
if (vcoredef.substr(1,1) == "0" && vcore.substr(1,1) == "1") { vcorepossible = "no"; }
if (vcoredef.substr(2,1) == "0" && vcore.substr(2,1) == "1") { vcorepossible = "no"; }
if (vcoredef.substr(3,1) == "0" && vcore.substr(3,1) == "1") { vcorepossible = "no"; }
if (vcoredef.substr(4,1) == "0" && vcore.substr(4,1) == "1") { vcorepossible = "no"; }
if (vcoredef == vcore) { vcorepossible = "no"; }

// alert (vcoredef+" "+vcore+" "+vcorepossible);
VIDANZ()
}


function VIDANZ() {
if (!direction) {direction="cpu"}

if (vcore == "nonV") {
self.document.VID4.src = "cpu/vidblank.gif";
self.document.VID3.src = "cpu/vidblank.gif";
self.document.VID2.src = "cpu/vidblank.gif";
self.document.VID1.src = "cpu/vidblank.gif";
self.document.VID0.src = "cpu/vidblank.gif";
}



if (vcore != "nonV" && vcorepossible != "no") {

if ((vcore.substr(2,1) == "1") && (vcore.substr(3,1) == "0" && vcoredef.substr(3,1) == "1")) { vcorepossible = "no"; }
if ((vcore.substr(2,1) == "1" || vcore.substr(3,1) == "1") && (vcore.substr(4,1) == "0" && vcoredef.substr(4,1) == "1")) { vcorepossible = "no"; }
if ((vcore.substr(2,1) == "1" || vcore.substr(3,1) == "1" || vcore.substr(4,1) == "1") && (vcore.substr(0,1) == "0" && vcoredef.substr(0,1) == "1")) { vcorepossible = "no"; }
if ((vcore.substr(2,1) == "1" || vcore.substr(3,1) == "1" || vcore.substr(4,1) == "1" || vcore.substr(0,1) == "1") && (vcore.substr(1,1) == "0" && vcoredef.substr(1,1) == "1")) { vcorepossible = "no"; }


if (direction=="cpu" && vcorepossible != "no") {
self.document.CPUPICTURE.src = "am2pin.gif";

if (vcoredef.substr(0,1) == "1" && vcore.substr(0,1) == "0") { self.document.VID4.src = "cpu/vid4_0.gif"; }
else                                                         { self.document.VID4.src = "cpu/vidblank.gif"; }

if (vcoredef.substr(1,1) == "1" && vcore.substr(1,1) == "0") { self.document.VID3.src = "cpu/vid3_0.gif"; }
else                                                         { self.document.VID3.src = "cpu/vidblank.gif"; }

if (vcoredef.substr(2,1) == "1" && vcore.substr(2,1) == "0") { self.document.VID2.src = "cpu/vid2_0.gif"; }
else                                                         { self.document.VID2.src = "cpu/vidblank.gif"; }

if (vcoredef.substr(3,1) == "1" && vcore.substr(3,1) == "0") { self.document.VID1.src = "cpu/vid1_0.gif"; }
else                                                         { self.document.VID1.src = "cpu/vidblank.gif"; }

if (vcoredef.substr(4,1) == "1" && vcore.substr(4,1) == "0") { self.document.VID0.src = "cpu/vid0_0.gif"; }
else                                                         { self.document.VID0.src = "cpu/vidblank.gif"; }

// alert (self.document.VID4.src + "\n" + self.document.VID3.src + "\n" +self.document.VID2.src + "\n" +self.document.VID1.src + "\n" +self.document.VID0.src);

self.document.VID0SOCKET.src = "socket/vidblank.gif";
self.document.VID1SOCKET.src = "socket/vidblank.gif";
self.document.VID2SOCKET.src = "socket/vidblank.gif";
self.document.VID3SOCKET.src = "socket/vidblank.gif";
self.document.VID4SOCKET.src = "socket/vidblank.gif";
}

}

if (vcorepossible == "no") {
self.document.VID4.src = "cpu/reserved.gif";
self.document.VID3.src = "cpu/reserved.gif";
self.document.VID2.src = "cpu/reserved.gif";
self.document.VID1.src = "cpu/reserved.gif";
self.document.VID0.src = "cpu/reserved.gif";
}

if (vcore == "nonV" || vcore == vcoredef) {
self.document.VID4.src = "cpu/vidblank.gif";
self.document.VID3.src = "cpu/vidblank.gif";
self.document.VID2.src = "cpu/vidblank.gif";
self.document.VID1.src = "cpu/vidblank.gif";
self.document.VID0.src = "cpu/vidblank.gif";
}

document.meingabe.Volt.focus();

}


function header() {
logo = -100;
self.document.getElementById('toplogo').innerHTML = "<b>Sockel AM2 CPU Pins</b>";
self.document.getElementById('bottomlogo').innerHTML = "<b>www.ocinside.de</b>";
showlogo();
}

function showlogo () {
if (logo <= 185) {
self.document.getElementById('toplogo').style.left = logo+6 + "px";
self.document.getElementById('bottomlogo').style.left = logo+28 + "px";
self.document.getElementById('bottomlogo').style.top = logo+300 + "px";
logo = logo + 10;
}

window.setTimeout("showlogo()", 10);
}


