var activeSub=0;
var SubNum=0;

function reDo(){ window.location.reload() }
    window.onresize = reDo;
	var browser = null;
      var NN3 = false;
      image1 = new Image();
      image1.src = "link2.gif";
      image1on = new Image();
      image1on.src = "link2A.gif";
      function on3(name) {
       document[name].src = eval(name + "on.src");
      }
       function clearing() {
        document.image1.src = image1.src;
       }
        NN3 = true;
       function on(name) {
       if (NN3) on3(name);
      }

    var timerID = null; var timerOn = false; var timecount = 500; var what = null;  var newbrowser = true; var check = false;  var name = "";

    	function init(){
    	//  alert ("Running Init");
          if (document.layers) {
                    //  alert ("Running Netscape 4");
                        layerRef="document.layers";  styleSwitch="";  visibleVar="show"; screenSize = window.innerWidth;  what ="ns4";
          }else if(document.all){
                      //  alert ("Running IE");  layerRef="document.all";  styleSwitch=".style";  visibleVar="visible"; screenSize = document.body.clientWidth + 18; what ="ie";
           }else if(document.getElementById){
                      //  alert ("Running Netscape 6"); 
                      layerRef="document.getElementByID"; styleSwitch=".style";  visibleVar="visible"; what="moz";
           }else{ 
                      //alert("Older than 4.0 browser.");
	        what="none";	newbrowser = false;  }
	window.status='status bar text to go here'; check = true; 	}

/*
       function showLayer(layerName){
        if (document.layers) {browser = "ns4";}
        else if (document.all){browser = "ie";}
          else {browser = "moz"; }
       if (browser == "none"){return;}
	//  else if (browser == "moz"){document.getElementById(layerName).style.visibility="visible";}
        else if (browser == "ie") {document.all(layerName).style.visibility="visible";}
       else {document.all(layerName).visibility="visible";}
       }

*/


       function hideLayer(layerName){
       document.getElementById(layerName).style.visibility='hidden';
       }


        function showLayer(layerName){
        document.getElementById(layerName).style.visibility='visible';
       }


/*
        function hideLayer(layerName){
        	if (browser == "none"){return;}
	      	else if (browser == "moz"){	document.getElementById(layerName).style.visibility="hidden";}
        else if (browser == "ie") {document.all(layerName).style.visibility="hidden";}
        else {document.all(layerName).visibility="hidden";}
       }
*/
       function hideLayer(layerName){
       document.getElementById(layerName).style.visibility='hidden';
       }


function lpolygon(no,div,type,rd,gr,bl,lft,tp,rt,bt,thick,ang) {
if (type == "tri" | type == "pent") {bt *= 0.92;}
var js = new Array();
js[no] = new jsGraphics(div);
var rad;  Pi = 3.141592; var col; var cnt; 
var ptx = new Array(); var pty = new Array();
rt = lft + rt;
bt = tp + bt;
var orix = (lft + rt)/2; var oriy = (tp + bt)/2; var oldx; var oldy;
rad = ((rt-lft-2)/2)*1/Math.cos(3.141592/5);

if (type == "pent") {
ptx[0] = (rt-lft-2)/2 + lft + 1;
pty[0] = tp + 1;
ptx[1] = rt-1;
pty[1] = tp + rad * Math.sin(Pi/5);
ptx[2] = rt - 1 - rad * Math.sin(Pi/10);
pty[2] = bt-1;
ptx[3] = lft + 1 + rad * Math.sin(Pi/10);
pty[3] = bt-1;
ptx[4] = lft+1;
pty[4] = tp + rad * Math.sin(Pi/5); 
cnt = 5;
}

if (type == "quad") {
ptx[0] = lft ;
pty[0] = tp ;
ptx[1] = rt;
pty[1] = tp;
ptx[2] = rt;
pty[2] = bt;
ptx[3] = lft;
pty[3] = bt;
cnt = 4;
}

if  (type == "tri") {
ptx[0] = lft + (rt-lft)/2 + 1;
pty[0] = tp + 1;
ptx[1] = rt -1;
pty[1] = bt -1;
ptx[2] = lft + 1;
pty[2] = bt-1;
cnt = 3;
}

if (type == "hex") {
rt *= 0.92;
rad = ((rt-lft-2)/2)* 1/Math.cos(Pi/6)
ptx[0] = (rt-lft-2)/2 + lft + 1
pty[0] = tp + 1
ptx[1] = rt-1
pty[1] = tp + rad * Math.sin(Pi/6)
ptx[2] = rt-1
pty[2] = bt - rad * Math.sin(Pi/6)
ptx[3] = (rt-lft-2)/2 + lft + 1
pty[3] = bt - 1
ptx[4] = lft+1
pty[4] = bt - rad * Math.sin(Pi/6)
ptx[5] = lft+1
pty[5] = tp + rad * Math.sin(Pi/6)
cnt = 6;
}

if (type == "oct") {
cnt = 8;
ptx[0] = (rt-lft)/4 + lft + 1;
pty[0] =tp+1;
ptx[1] = rt - (rt-lft)/4 -1;
pty[1] = tp+1;
ptx[2] = rt-1;
pty[2] = (bt-tp)/4 + tp + 1;
ptx[3] = rt-1;
pty[3] = bt - (bt-tp)/4 -1;
ptx[4] = rt - (rt-lft)/4 -1;
pty[4] =bt-1;
ptx[5] = (rt-lft)/4 + lft + 1;
pty[5] = bt-1;
ptx[6] = lft + 1;
pty[6] = bt - (bt-tp)/4 -1;
ptx[7] = lft + 1;
pty[7] = (bt-tp)/4 + tp + 1;
}

if (type == "star") {
cnt = 10;
var wrad = rt-lft-2.0;
var hrad = bt-tp-2.0;
ptx[0] = lft + 97*wrad/193
pty[0] = tp + 1
ptx[1] = lft + 120*wrad/193
pty[1] = tp + 65*hrad/171
ptx[2] = lft + 193*wrad/193
pty[2] = tp + 65*hrad/171
ptx[3] = lft + 134*wrad/193
pty[3] = tp + 106*hrad/171
ptx[4] = lft + 156*wrad/193
pty[4] = tp + 171*hrad/171
ptx[5] = lft + 97*wrad/193
pty[5] = tp + 131*hrad/171
ptx[6] = lft + 37*wrad/193
pty[6] = tp + 171*hrad/171
ptx[7] = lft + 59*wrad/193
pty[7] = tp + 106*hrad/171
ptx[8] =lft+1
pty[8] = tp + 65*hrad/171
ptx[9] = lft + 74*wrad/193
pty[9] = tp + 65*hrad/171
}


if (ang > 0) {
ang = ang * (Pi/180);
for (var i = 0;i < cnt;i++) {
oldx = ptx[i] + 0.0;
oldy = pty[i] + 0.0;
ptx[i] =  (oldx - orix)*Math.cos(ang) - (oldy-oriy)*Math.sin(ang) + orix;
pty[i] =  (oldx - orix)*Math.sin(ang) + (oldy-oriy)*Math.cos(ang) + oriy;
}
} 

col = RGB2HEX(rd,gr,bl)
js[no].setColor(col);
js[no].setStroke(thick);
js[no].drawPolygon(ptx,pty);
js[no].paint();

}

function fpolygon(no,div,type,rd,gr,bl,lft,tp,rt,bt,ang) {
if (type == "tri" | type == "pent") {bt *= 0.92;}
var js = new Array();
js[no] = new jsGraphics(div);
var rad;  Pi = 3.141592; var col; var cnt; 
var ptx = new Array(); var pty = new Array();
rt = lft + rt;
bt = tp + bt;
var orix = (lft + rt)/2; var oriy = (tp + bt)/2; var oldx; var oldy;
rad = ((rt-lft-2)/2)*1/Math.cos(3.141592/5);

if (type == "pent") {
ptx[0] = (rt-lft-2)/2 + lft + 1;
pty[0] = tp + 1;
ptx[1] = rt-1;
pty[1] = tp + rad * Math.sin(Pi/5);
ptx[2] = rt - 1 - rad * Math.sin(Pi/10);
pty[2] = bt-1;
ptx[3] = lft + 1 + rad * Math.sin(Pi/10);
pty[3] = bt-1;
ptx[4] = lft+1;
pty[4] = tp + rad * Math.sin(Pi/5); 
cnt = 5;
}

if (type == "quad") {
ptx[0] = lft ;
pty[0] = tp ;
ptx[1] = rt;
pty[1] = tp;
ptx[2] = rt;
pty[2] = bt;
ptx[3] = lft;
pty[3] = bt;
cnt = 4;
}

if  (type == "tri") {
ptx[0] = lft + (rt-lft)/2 + 1;
pty[0] = tp + 1;
ptx[1] = rt -1;
pty[1] = bt -1;
ptx[2] = lft + 1;
pty[2] = bt-1;
cnt = 3;
}

if (type == "hex") {
rt *= 0.92;
rad = ((rt-lft-2)/2)* 1/Math.cos(Pi/6)
ptx[0] = (rt-lft-2)/2 + lft + 1
pty[0] = tp + 1
ptx[1] = rt-1
pty[1] = tp + rad * Math.sin(Pi/6)
ptx[2] = rt-1
pty[2] = bt - rad * Math.sin(Pi/6)
ptx[3] = (rt-lft-2)/2 + lft + 1
pty[3] = bt - 1
ptx[4] = lft+1
pty[4] = bt - rad * Math.sin(Pi/6)
ptx[5] = lft+1
pty[5] = tp + rad * Math.sin(Pi/6)
cnt = 6;
}

if (type == "oct") {
cnt = 8;
ptx[0] = (rt-lft)/4 + lft + 1;
pty[0] =tp+1;
ptx[1] = rt - (rt-lft)/4 -1;
pty[1] = tp+1;
ptx[2] = rt-1;
pty[2] = (bt-tp)/4 + tp + 1;
ptx[3] = rt-1;
pty[3] = bt - (bt-tp)/4 -1;
ptx[4] = rt - (rt-lft)/4 -1;
pty[4] =bt-1;
ptx[5] = (rt-lft)/4 + lft + 1;
pty[5] = bt-1;
ptx[6] = lft + 1;
pty[6] = bt - (bt-tp)/4 -1;
ptx[7] = lft + 1;
pty[7] = (bt-tp)/4 + tp + 1;
}

if (type == "star") {
cnt = 10;
var wrad = rt-lft-2.0;
var hrad = bt-tp-2.0;
ptx[0] = lft + 97*wrad/193
pty[0] = tp + 1
ptx[1] = lft + 120*wrad/193
pty[1] = tp + 65*hrad/171
ptx[2] = lft + 193*wrad/193
pty[2] = tp + 65*hrad/171
ptx[3] = lft + 134*wrad/193
pty[3] = tp + 106*hrad/171
ptx[4] = lft + 156*wrad/193
pty[4] = tp + 171*hrad/171
ptx[5] = lft + 97*wrad/193
pty[5] = tp + 131*hrad/171
ptx[6] = lft + 37*wrad/193
pty[6] = tp + 171*hrad/171
ptx[7] = lft + 59*wrad/193
pty[7] = tp + 106*hrad/171
ptx[8] =lft+1
pty[8] = tp + 65*hrad/171
ptx[9] = lft + 74*wrad/193
pty[9] = tp + 65*hrad/171
}

if (ang > 0) {
ang = ang * (Pi/180);
for (var i = 0;i < cnt;i++) {
oldx = ptx[i] + 0.0;
oldy = pty[i] + 0.0;
ptx[i] =  (oldx - orix)*Math.cos(ang) - (oldy-oriy)*Math.sin(ang) + orix;
pty[i] =  (oldx - orix)*Math.sin(ang) + (oldy-oriy)*Math.cos(ang) + oriy;
}
} 

col = RGB2HEX(rd,gr,bl)
js[no].setColor(col);
js[no].fillPolygon(ptx,pty);
js[no].paint();

}

function gradpoly(no,div,type,rd,gr,bl,rd2,gr2,bl2,l,t,w,h,ang) {
var js = new Array();
js[no] = new jsGraphics(div);
var rad;  Pi = 3.141592; var col; var comp; var comp2; var r; var g; var b; var r2; var b2; var g2;
var ptx = new Array(); var pty = new Array();
var orix = (2*l + w)/2; var oriy = (2*t + h)/2; var oldx; var oldy; var cnt;
if (type == "tri" | type == "pent") {h *= 0.92;}
if (type == "hex") { w *= 0.92;}
var hi = h; var wi = w; 
if (ang > 0) {ang = ang * (Pi/180);}

if (hi < wi) {comp = hi; comp2 = hi;}
else
{comp = wi; comp2 = wi;}

while (comp > comp2/10) {
l ++;
t ++;
w -= 2;
h -= 2;
comp -= 2;

rad = ((w-2)/2)*1/Math.cos(Pi/5);

r = rd * (h/hi) + rd2 * (1 - h/hi);
g = gr* (h/hi) + gr2 * (1 - h/hi);
b = bl * (h/hi) + bl2 * (1 - h/hi);
col = "#" + RGB2HEX(r,g,b);

js[no].setColor(col);

if (type == "pent") {
ptx[0] = (w-2)/2 + l + 1;
pty[0] = t + 1;
ptx[1] = w + l-1;
pty[1] = t + rad * Math.sin(Pi/5);
ptx[2] =w + l - 1 - rad * Math.sin(Pi/10);
pty[2] = h + t-1;
ptx[3] = l + 1 + rad * Math.sin(Pi/10);
pty[3] = h + t-1;
ptx[4] = l+1;
pty[4] = t + rad * Math.sin(Pi/5); 
cnt = 5;
}

if (type == "quad") {
ptx[0] = l ;
pty[0] = t ;
ptx[1] = l+w;
pty[1] = t;
ptx[2] = l+w;
pty[2] = h+t;
ptx[3] = l;
pty[3] = h+t;
cnt = 4;
}


if  (type == "tri") {
ptx[0] = l + w/2 + 1
pty[0] = t + 1
ptx[1] = w + l -1
pty[1] = h + t -1
ptx[2] = l + 1
pty[2] = h + t-1
cnt = 3;
}

if (type == "hex") {
rad = ((w-2)/2)* 1/Math.cos(Pi/6)
ptx[0] = (w-2)/2 + l + 1
pty[0] =  t + 1
ptx[1] = w + l -1
pty[1] = t + rad * Math.sin(Pi/6)
ptx[2] = w + l -1
pty[2] = (h + t) - rad * Math.sin(Pi/6)
ptx[3] = (w-2)/2 + l + 1
pty[3] = h + t - 1
ptx[4] = l+1
pty[4] = (h + t) - rad * Math.sin(Pi/6)
ptx[5] = l+1
pty[5] = t + rad * Math.sin(Pi/6)
cnt = 6;
}

if (type == "oct") {
cnt = 8;
ptx[0] = w/4 + l + 1;
pty[0] =t+1;
ptx[1] = w+l - w/4 -1;
pty[1] = t+1;
ptx[2] = w+l-1;
pty[2] = (h)/4 + t + 1;
ptx[3] = w+l-1;
pty[3] = h+t - h/4 -1;
ptx[4] = w+l - w/4 -1;
pty[4] =h+t-1;
ptx[5] = w/4 + l + 1;
pty[5] = h+t-1;
ptx[6] = l + 1;
pty[6] = h+t - h/4 -1;
ptx[7] = l + 1;
pty[7] = h/4 + t + 1;
}

if (type == "star") {
cnt = 10;
var wrad = w-2.0;
var hrad = h-2.0;
ptx[0] = l + 97*wrad/193;
pty[0] = t + 1;
ptx[1] = l + 120*wrad/193;
pty[1] = t + 65*hrad/171;
ptx[2] = l + 193*wrad/193;
pty[2] = t + 65*hrad/171;
ptx[3] = l + 134*wrad/193;
pty[3] = t + 106*hrad/171;
ptx[4] = l + 156*wrad/193;
pty[4] = t + 171*hrad/171;
ptx[5] = l + 97*wrad/193;
pty[5] = t + 131*hrad/171;
ptx[6] = l + 37*wrad/193;
pty[6] = t + 171*hrad/171;
ptx[7] = l + 59*wrad/193;
pty[7] = t + 106*hrad/171;
ptx[8] = l+1;
pty[8] = t + 65*hrad/171;
ptx[9] = l + 74*wrad/193;
pty[9] = t + 65*hrad/171;
}

for (var i = 0;i < cnt;i++) {
oldx = ptx[i] + 0.0;
oldy = pty[i] + 0.0;
ptx[i] =  (oldx - orix)*Math.cos(ang) - (oldy-oriy)*Math.sin(ang) + orix;
pty[i] =  (oldx - orix)*Math.sin(ang) + (oldy-oriy)*Math.cos(ang) + oriy;
}

js[no].fillPolygon(ptx,pty);
js[no].paint();
}
}

function gradLine(no,div,rd,gr,bl,rd2,gr2,bl2,l,t,rt,bt,thick) {
var js = new Array();
js[no] = new jsGraphics(div);
var r; var g; var b; var col; var diff = thick /2; var hor;
thick = thick/2;
if (Math.abs(r-l) > Math.abs(b-t)) {
hor = false; }
else {
hor = true;}
while (diff > 0) {
if (hor) {
l ++;
rt ++;}
else {
t++;
bt ++;}
diff --;
r = rd * (diff/thick) + rd2 * (1 - (diff/thick));
g = gr * (diff/thick) + gr2 * (1 - (diff/thick));
b = bl * (diff/thick) + bl2 * (1 - (diff/thick));
col = "#" + RGB2HEX(r,g,b);
js[no].setColor(col);
js[no].drawLine(l,t,rt,bt);
}
while (diff <= thick) {
if (hor) {
l ++;
rt ++;}
else {
t++;
bt ++;}
diff ++;
r = rd * (diff/thick) + rd2 * (1 - (diff/thick));
g = gr * (diff/thick) + gr2 * (1 - (diff/thick));
b = bl * (diff/thick) + bl2 * (1 - (diff/thick));
col = "#" + RGB2HEX(r,g,b);
js[no].setColor(col);
js[no].drawLine(l,t,rt,bt);
js[no].paint();
}
}

function gradient(no,div,type, ri, gi, bi, rd2, gr2, bl2, l, t, w, h,start,stop) {
var js = new Array();
js[no] = new jsGraphics(div);
var col; var r; var g; var b; var hi =h; var wi = w; var comp; var comp2;
if (hi < wi) {comp = hi; comp2 = hi;}
else
{comp = wi; comp2 = wi;}

while (comp > comp2/10) {
l ++;
t ++;
w -= 2;
h -= 2;
comp -= 2;
r = ri * (h/hi) + rd2 * (1 - h/hi);
g = gi * (h/hi) + gr2 * (1 - h/hi);
b = bi * (h/hi) + bl2 * (1 - h/hi);
col = "#" + RGB2HEX(r,g,b);
js[no].setColor(col);
if (type == "ellipse") {js[no].fillEllipse(l,t,w,h);}
if (type == "rect") {js[no].fillRect(l,t,w,h);}
if (type == "arc") {js[no].fillArc(l,t,w,h,start,stop);}
}
js[no].paint();
}

function RGB2HEX(R,G,B) {return getHex(R)+getHex(G)+getHex(B)}
function getHex(num) {
 //num=parseInt(num);
 if (num==0) return "00";
 //num=Math.max(0,num);
 //num=Math.min(num,255);
 //num=Math.round(num);
 return "0123456789ABCDEF".charAt((num-num%16)/16) + "0123456789ABCDEF".charAt(num%16);
}

	function startTime() {
	        if (timerOn == false) {  timerID=setTimeout( "doAction()" , timecount);  timerOn = true; }}

	function stopTime() {
	        if (timerOn) { clearTimeout(timerID); timerID = null; timerOn = false;  }}

	function onLoad() { init(); }

function showvideo(name) {
if (screen.width == 1024) {
myWindow = window.open("","myWindow","width=370,height=260,top=114,left=327");
} else if (screen.width > 1024) {
myWindow = window.open("","myWindow","width=240,height=200,top=312,left=520");
} else if (screen.width == 800) {
myWindow = window.open("","myWindow","width=240,height=200,top=100,left=280");
} else if (screen.width == 640) {
myWindow = window.open("","myWindow","width=240,height=200,top=40,left=200");
}
myWindow.document.write('<html>')
myWindow.document.write('<body  bgcolor="#000000">') 
// myWindow.document.write('<embed src='+name+' autostart=true loop=true width=220 height=180><noembed>')
myWindow.document.write('<embed src='+name+' autostart=true loop=true><noembed>')
myWindow.document.write('</body>')
myWindow.document.write('</html>')
}
function showimage(name) {
if (screen.width == 1024) {
newWindow = window.open("","newWindow","width=240,height=200,screenY=384,screenX=272,top=384,left=272");
} else if (screen.width >1024) {
newWindow = window.open("","newWindow","width=240,height=200,top=512,left=520");
} else if (screen.width == 800) {
newWindow = window.open("","newWindow","width=240,height=200,top=300,left=272");
} else if (screen.width == 640) {
newWindow = window.open("","newWindow","width=240,height=200,top=340,left=200");
}
newWindow.document.write('<html>');
newWindow.document.write('<body>'); 
newWindow.document.write('<img SRC='+name+' width=220 height=180>');
newWindow.document.write('</body>');
newWindow.document.write('</html>');
}

function showimage2(name) {
if (screen.width == 1024) {
newWindow2 = window.open("","newWindow2","width=240,height=200,screenY=384,screenX=512,top=384,left=512");
} else if (screen.width >1024) {
newWindow2 = window.open("","newWindow2","width=240,height=200,top=512,left=520");
} else if (screen.width == 800) {
newWindow2 = window.open("","newWindow2","width=240,height=200,top=300,left=512");
} else if (screen.width == 640) {
newWindow2 = window.open("","newWindow2","width=240,height=200,top=340,left=200");
}
newWindow2.document.write('<html>');
newWindow2.document.write('<body>'); 
newWindow2.document.write('<img SRC='+name+' width=220 height=180>');
newWindow2.document.write('</body>');
newWindow2.document.write('</html>');
}

 function surfto(form) {
        var myindex=form.dest.selectedIndex
        location=form.dest.options[myindex].value;
}


function playaudio(name) {
newWindow.document.write('<html>');
newWindow.document.write('<body>');
newWindow.document.write('<embed src='+name+' loop=true hidden="true">');
newWindow.document.write('</body>');
newWindow.document.write('</html>');
} 

function playaudio2(name) {
document.write('<embed src='+name+' loop=true hidden="true">');
}
 
function closeimagewindow() {
 newWindow.window.close();
}

function closeimagewindow2() {
 newWindow2.window.close();
}  

function closevideowindow() {
 myWindow.window.close();
}

function openwindow() {
if (screen.width == 1024) {
newWindow = window.open("","myWindow","width=370,height=260,top=114,left=327");
} else if (screen.width > 1024) {
newWindow = window.open("","myWindow","width=240,height=200,top=312,left=520");
} else if (screen.width == 800) {
newWindow = window.open("","myWindow","width=240,height=200,top=100,left=280");
} else if (screen.width == 640) {
newWindow = window.open("","myWindow","width=240,height=200,top=40,left=200");
}
}

redirTime = "5";
redirURL = "/web/B2.html";
function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); }

var first_opac = 1; var sec_opac =100; var opac = first_opac;  var speed = 1.5; var si;

function fadeinout(what,doshow) {
if (document.all )  { (doshow) ? opac+=speed : opac-=speed;   eval(what+".filters.alpha.opacity="+opac);
if (opac >= sec_opac) {clearInterval(si);  si=setInterval('fadeinout(\'layer1\',false)',10);}
if (opac< first_opac) {clearInterval(si); si=setInterval('fadein2(\'layer2\',true)',10); }}}

function fadein2(what,doshow) {if (document.all) {  opac += speed;  eval(what+".filters.alpha.opacity="+opac);}
if (document.layers) clearInterval(si);}









