var ns4 = 0;
var ie4 = 0;
var lefthandReady = 0;
var righthandReady = 0;
var handsReady = 0;
var handcount = 0;
var linkimgcount = 0;

if (document.all) {
	ie4  = 1;
	doc  = "document.all['";
	sty  = "'].style";
	docR = "'].document" ;
	doc0 = "']." ;
} else if (document.getElementById) {
	ns4  = 1;
	doc  = "document.getElementById('";
	sty  = "').style";
	docR = "').document" ;
	doc0 = "')" ;
} else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4) {
	ns4  = 1;
	doc  = "document['";
	sty  = "']";
	docR = "'].document" ;
	doc0 = "']";
}

//#################################### MAIN FRAME ###################################


function initPostit() {
	if(ie4 || ns4) {
		handObj = eval(doc + "handLayer" + sty);
		handObj.left = windowWidth;
		handObj.top = 0;
		handObj.visibility = "visible";

		bugHide = eval(doc + "nsbugHide" + sty);
		bugHide.left = windowWidth-250;
		bugHide.top = 0;
		bugHide.visibility = "hidden";

		setTimeout("slideinPostit()", 2000);
	}
}

function initHands() {
	if((ie4 || ns4) && (parent.topframe)) {
		leftHandhand = new Image();
		leftHandhand.src = "images/hand_l_h.gif";
		leftHandhand.onLoad = handCheck();

		leftHandthumb = new Image();
		leftHandthumb.src = "images/hand_l_t.gif";
		leftHandthumb.onLoad = handCheck();

		rightHandhand = new Image();
		rightHandhand.src = "images/hand_r_h.gif";
		rightHandhand.onLoad = handCheck();

		rightHandthumb = new Image();
		rightHandthumb.src = "images/hand_r_t.gif";
		rightHandthumb.onLoad = handCheck();

		leftHandhand = eval(doc + "lefthandhandLayer" + sty);
		leftHandhand.left = windowWidth;
		leftHandhand.top = 120;
		leftHandhand.visibility = "visible";

		leftHandthumb = eval(doc + "lefthandthumbLayer" + sty);
		leftHandthumb.left = windowWidth+72;
		leftHandthumb.top = 176;
		leftHandthumb.visibility = "visible";

		rightHandhand = eval(doc + "righthandhandLayer" + sty);
		rightHandhand.left = -160;
		rightHandhand.top = -136;
		rightHandhand.visibility = "visible";

		rightHandthumb = eval(doc + "righthandthumbLayer" + sty);
		rightHandthumb.left = -154;
		rightHandthumb.top = -80;
		rightHandthumb.visibility = "visible";

		logoObj = eval(doc + "logoLayer" + sty);
		logoObj.left = (windowWidth/2)-150;
		logoObj.top = 85;
		logoObj.visibility = "hidden";
	}
}

function handCheck() {
   if(ie4 || ns4) {
	handcount++;
	if(handcount == 4) {
		setTimeout("slideinRight()", 1500);
		setTimeout("slideinLeft()", 3000);
	}
   }
}

//########################## LEFT FRAME ##########################

function initLinks() {
	if(ie4 || ns4) {
/*		mainleftimg = new Image();
		mainleftimg.src = "images/int-le.gif";
		mainleftimg.onLoad = linkimgCheck();

		mainleftshadowimg = new Image();
		mainleftshadowimg.src = "images/int-lesh.gif";
		mainleftshadowimg.onLoad = linkimgCheck();

		mainbottomimg = new Image();
		mainbottomimg.src = "images/int-bott.gif";
		mainbottomimg.onLoad = linkimgCheck();

		linkplateimg = new Image();
		linkplateimg.src = "images/int-link.gif";
		linkplateimg.onLoad = linkimgCheck();
*/
		mainLeft = eval(doc + "mainleftLayer" + sty);
		mainLeft.left = 0;
		mainLeft.top = 0;
		mainLeft.visibility = "visible";

		mainLeftshadow = eval(doc + "mainleftshadowLayer" + sty);
		mainLeftshadow.left = 7;
		mainLeftshadow.top = 0;
		mainLeftshadow.visibility = "visible";

		mainBottom = eval(doc + "mainbottomLayer" + sty);
		mainBottom.left = 0;
		mainBottom.top = 247;
		mainBottom.visibility = "visible";

		linkPlate = eval(doc + "linkplateLayer" + sty);
		linkPlate.left = -155;
		linkPlate.top = -1;
		linkPlate.visibility = "hidden";

		linkText = eval(doc + "linktextLayer" + sty);
		linkText.left = -155;
		linkText.top = 20;
		linkText.zIndex = 3;
		linkText.visibility = "hidden";

		setTimeout("linkplateIn()", 1000);
	}
}

function linkimgCheck() {
   if(ie4 || ns4) {
	linkimgcount++;
	if(linkimgcount == 4) {
		//setTimeout("linkplateIn()", 1000);
	}
   }
}

function linkplateIn() {
   if(ie4 || ns4) {
	linkPlate.visibility = "visible";
	linkText.visibility = "visible";
	var x1_pos = parseInt(linkPlate.left);
	var x2_pos = parseInt(linkText.left);
	if(x1_pos < 0) {
		linkPlate.left = x1_pos+3;
		linkText.left = x2_pos+3;
		setTimeout("linkplateIn()", 10);
	} else {
		linkPlate.left = 0;
		linkText.left = 0;
		linkText.zIndex = 5;
	}		
   }
}

function writeToLayer(oFrame, obj, txt) {
	var el ;
	oFrame = (oFrame.length > 0) ? oFrame + "." : "" ;
	if (document.getElementById) {
		el = eval(oFrame + "document.getElementById(\"" + obj + "\")") ;
		el.innerHTML = txt ;
	} else if (document.all) {
		el = eval(oFrame + "document.all.postitLayer") ;
		el.innerHTML = txt ;
	} else if (document.layers) {
		el = eval(oFrame + "document.postitLayer.document") ;
		el.open();
		el.write(txt);
		el.close();
	}
}

//################################ POSTIT ################################

function slideinPostit() {
   if(ie4 || ns4) {
	handObj.visibility = "visible";
	var x_pos = parseInt(handObj.left);
	if(windowWidth <= 425) {
	   bugHide = eval('parent.topframe.' + doc + 'nsbugHide' + sty);
	   bugHide.left = windowWidth-182;
	   bugHide.top = 0;
	   bugHide.visibility = "visible";
	   postitinfoObj = eval('parent.topframe.' + doc + 'postitLayer' + sty);
	   postitinfoObj.left = 70;
	   postitinfoObj.zIndex = 3;
	   if(x_pos > windowWidth-180) {
		handObj.left = x_pos-5;
		setTimeout("slideinPostit()", 10);
	   } else {
		handObj.left = windowWidth-180;
		postitinfoObj = eval('parent.topframe.' + doc + 'postitLayer' + sty);
		postitinfoObj.visibility = "visible";
		postitinfoObj.zIndex = 3;
		postitInfo('','');
		setTimeout("hideInfo()", 10);
	   }		
	} else { 
	   bugHide = eval('parent.topframe.' + doc + 'nsbugHide' + sty);
	   bugHide.left = windowWidth-250;
	   bugHide.top = 0;
	   bugHide.visibility = "visible";
	   if(x_pos > windowWidth-250) {
		handObj.left = x_pos-5;
		setTimeout("slideinPostit()", 10);
	   } else {
		handObj.left = windowWidth-250;
		postitinfoObj = eval('parent.topframe.' + doc + 'postitLayer' + sty);
		postitinfoObj.visibility = "visible";
		postitinfoObj.zIndex = 3;
		postitInfo('','');
		setTimeout("hideInfo()", 10);
	   }
	}
   }
}

function postitInfo(doknr,info) {
   if((ie4 || ns4) && (parent.topframe)) {
	postitinfoObj = eval('parent.topframe.' + doc + 'postitLayer' + sty);
	postitinfoObj.top = 20;
	if(ns4) {
		var msg = '<table width=236 height=55 border=0 cellspacing=0 cellpadding=0 align=right><tr><td width=150 height=55 align=center valign=middle><font style="font: bold 11pt/12pt Arial,Helvetica,Geneva,sans-serif; color: #000033">' + doknr + '<br></font><font style="font: bold 10pt/11pt Arial,Geneva,sans-serif; color: #333333">' + info + '</font></td><td width=86>&nbsp\;</td></tr></table>';
		//infoMsg = eval('parent.topframe.' + doc + 'postitLayer' + docR);
		writeToLayer("parent.topframe", "postitLayer", msg) ;
		//infoMsg.open();
		//infoMsg.write(msg);
		//infoMsg.close();
	} else if(ie4) {
		var msg = '<table width=236 height=55 border=0 cellspacing=0 cellpadding=0 align=right><tr><td width=150 height=55 align=center valign=middle><font style="font: bold 11pt/12pt Arial,Helvetica,Geneva,sans-serif; color: #000033">' + doknr + '<br></font><font style="font: bold italic 10pt/11pt Arial,Geneva,sans-serif; color: #333333">' + info + '</font></td><td width=86>&nbsp\;</td></tr></table>';
		//infoMsg = eval('parent.topframe.' + doc + 'postitLayer' + doc0);
		//infoMsg.innerHTML = msg;
		writeToLayer("parent.topframe", "postitLayer", msg) ;
	}
   }
}

function hideInfo() {
	if((ie4 || ns4) && (parent.topframe)) {
		postitinfoObj = eval('parent.topframe.' + doc + 'postitLayer' + sty);
		postitinfoObj.top = -100;
	}
}

function showActive(active,info) {
   if(ie4 || ns4) {
	postitinfoObj = eval('parent.topframe.' + doc + 'postitLayer' + sty);
	postitinfoObj.top = 20;
	if(ns4) {
		var msg = '<table width=214 height=55 border=0 cellspacing=0 cellpadding=0 align=right><tr><td width=150 height=55 align=center valign=middle><font style="font: bold 11pt/11pt Palatino,Times New Roman,Times Roman,serif; color: #000033">' + active + '</font><font style="font: bold 10pt/10pt Arial,Geneva,sans-serif; color: #333333">' + info + '</font></td><td width=64>&nbsp\;</td></tr></table>';
		//infoMsg = eval('parent.topframe.' + doc + 'postitLayer' + docR);
		//infoMsg.open();
		//infoMsg.write(msg);
		//infoMsg.close();
		writeToLayer("parent.topframe", "postitLayer", msg) ;
	} else if(ie4) {
		var msg = '<table width=240 height=55 border=0 cellspacing=0 cellpadding=0 align=right><tr><td width=150 height=55 align=center valign=middle><font style="font: bold italic 11pt/11pt Palatino,Times New Roman,Times Roman,serif; color: #000033">' + active + '</font><font style="font: bold italic 10pt/10pt Arial,Geneva,sans-serif; color: #333333">' + info + '</font></td><td width=90>&nbsp\;</td></tr></table>';
		//infoMsg = eval('parent.topframe.' + doc + 'postitLayer' + doc0);
		//infoMsg.innerHTML = msg;
		writeToLayer("parent.topframe", "postitLayer", msg) ;
	}
   }
}

//################################ HANDS ################################

function slideinLeft() {
   if(ie4 || ns4){
	leftHandhand.visibility = "visible";
	leftHandthumb.visibility = "visible";
	var x1_pos = parseInt(leftHandhand.left);
	var x2_pos = parseInt(leftHandthumb.left);
	if(windowWidth <= 430) {
	   if(x1_pos > (windowWidth/2)-210) {
		leftHandhand.left = x1_pos-5;
		leftHandthumb.left = x2_pos-5;
		setTimeout("slideinLeft()", 8);
	   } else {
		leftHandhand.left = (windowWidth/2)-210;
		leftHandthumb.left = (windowWidth/2)-138;
		leftHandhand.zIndex = 2;
		leftHandthumb.zIndex = 4;
		lefthandReady = 1;
		handsReady = 1;
		showLogo();
	   }		
	} else { 
	   if(x1_pos > (windowWidth/2)-210) {
		leftHandhand.left = x1_pos-8;
		leftHandthumb.left = x2_pos-8;
		setTimeout("slideinLeft()", 10);
	   } else {
		leftHandhand.left = (windowWidth/2)-210;
		leftHandthumb.left = (windowWidth/2)-138;
		leftHandhand.zIndex = 2;
		leftHandthumb.zIndex = 4;
		lefthandReady = 1;
		handsReady = 1;
		showLogo();
	   }
	}
   }
}

function slideinRight() {
   if(ie4 || ns4) {
	rightHandhand.visibility = "visible";
	rightHandthumb.visibility = "visible";
	var x3_pos = parseInt(rightHandhand.left);
	var y3_pos = parseInt(rightHandhand.top);
	var x4_pos = parseInt(rightHandthumb.left);
	var y4_pos = parseInt(rightHandthumb.top);
	if(windowWidth <= 430) { //############# Screen Resolution 640x480 #############
	   if(x3_pos < (windowWidth/2)+98 || y3_pos < 135) {
		rightHandhand.left = x3_pos+5;
		rightHandthumb.left = x4_pos+5;
		rightHandhand.top = y3_pos+3;
		rightHandthumb.top = y4_pos+3;
		setTimeout("slideinRight()", 10);
	   } else {
		rightHandhand.left = (windowWidth/2)+98;
		rightHandhand.top = 135;
		rightHandthumb.left = (windowWidth/2)+104;
		rightHandthumb.top = 191;
		rightHandhand.zIndex = 2;
		rightHandthumb.zIndex = 4;
		righthandReady = 1;
		showLogo();
	   }		
	} else if(windowWidth <= 585) { //############# Screen Resolution 800x600 #############
	   if(x3_pos < (windowWidth/2)+98 || y3_pos < 130) {
		rightHandhand.left = x3_pos+10;
		rightHandthumb.left = x4_pos+10;
		rightHandhand.top = y3_pos+5;
		rightHandthumb.top = y4_pos+5;
		setTimeout("slideinRight()", 20);
	   } else {
		rightHandhand.left = (windowWidth/2)+98;
		rightHandhand.top = 130;
		rightHandthumb.left = (windowWidth/2)+104;
		rightHandthumb.top = 186;
		rightHandhand.zIndex = 2;
		rightHandthumb.zIndex = 4;
		righthandReady = 1;
		showLogo();
	   }		
	} else { //############# Screen Resolution >1024x768 #############
	   if(x3_pos < (windowWidth/2)+98 || y3_pos < 123) {
		rightHandhand.left = x3_pos+10;
		rightHandthumb.left = x4_pos+10;
		rightHandhand.top = y3_pos+4;
		rightHandthumb.top = y4_pos+4;
		setTimeout("slideinRight()", 20);
	   } else {
		rightHandhand.left = (windowWidth/2)+98;
		rightHandhand.top = 123;
		rightHandthumb.left = (windowWidth/2)+104;
		rightHandthumb.top = 179;
		rightHandhand.zIndex = 2;
		rightHandthumb.zIndex = 4;
		righthandReady = 1;
		showLogo();
	   }
	}
   }
}

function showLogo() {
   if((ie4 || ns4) && lefthandReady && righthandReady) {
	setTimeout("logoObj.visibility = 'visible'", 700);
   }
}

function slideLeftleft() {
   if(ie4 || ns4) {
	handsReady = 0;
	var x1_pos = parseInt(leftHandhand.left);
	var x2_pos = parseInt(leftHandthumb.left);
	if(x1_pos > (windowWidth/2)-250) {
		leftHandhand.left = x1_pos-7;
		leftHandthumb.left = x2_pos-7;
		setTimeout("slideLeftleft()", 10);
	} else {
		leftHandhand.left = (windowWidth/2)-250;
		leftHandthumb.left = (windowWidth/2)-178;
		setTimeout("leftHandhand.zIndex = 1", 100)
		setTimeout("leftHandthumb.zIndex = 2", 100)
		setTimeout("slideLeftright()", 200);
	}		
   }
}

function slideLeftright() {
   if(ie4 || ns4) {
	var x1_pos = parseInt(leftHandhand.left);
	var x2_pos = parseInt(leftHandthumb.left);
	if(x1_pos < (windowWidth/2)+118) {
		leftHandhand.left = x1_pos+7;
		leftHandthumb.left = x2_pos+7;
		setTimeout("slideLeftright()", 10);
	} else {
		leftHandhand.left = (windowWidth/2)+118;
		leftHandthumb.left = (windowWidth/2)+190;
		leftHandhand.zIndex = 4;
		leftHandthumb.zIndex = 5;
		setTimeout("slideLeftback()", 100);
	}		
   }
}

function slideLeftback() {
   if(ie4 || ns4) {
	var x1_pos = parseInt(leftHandhand.left);
	var x2_pos = parseInt(leftHandthumb.left);
	if(x1_pos > (windowWidth/2)-250) {
		leftHandhand.left = x1_pos-7;
		leftHandthumb.left = x2_pos-7;
		setTimeout("slideLeftback()", 10);
	} else {
		leftHandhand.left = (windowWidth/2)-250;
		leftHandthumb.left = (windowWidth/2)-178;
		leftHandhand.zIndex = 1;
		leftHandthumb.zIndex = 4;
		setTimeout("slideLeftsign()", 100);
	}		
   }
}

function slideLeftsign() {
   if(ie4 || ns4) {
	var x1_pos = parseInt(leftHandhand.left);
	var x2_pos = parseInt(leftHandthumb.left);
	if(x1_pos < (windowWidth/2)-210) {
		leftHandhand.left = x1_pos+7;
		leftHandthumb.left = x2_pos+7;
		setTimeout("slideLeftsign()", 10);
	} else {
		leftHandhand.left = (windowWidth/2)-210;
		leftHandthumb.left = (windowWidth/2)-138;
		setTimeout("handsReady = 1", 500);
	}		
   }
}


function slideRightright() {
   if(ie4 || ns4) {
	var x3_pos = parseInt(rightHandhand.left);
	var x4_pos = parseInt(rightHandthumb.left);
	if(x3_pos < (windowWidth/2)+138) {
		rightHandhand.left = x3_pos+7;
		rightHandthumb.left = x4_pos+7;
		setTimeout("slideRightright()", 10);
	} else {
		rightHandhand.left = (windowWidth/2)+138;
		rightHandthumb.left = (windowWidth/2)+144;
		setTimeout("rightHandhand.zIndex = 4", 100);
		setTimeout("rightHandthumb.zIndex = 5", 100);
		setTimeout("slideRightleft()", 200);
	}		
   }
}

function slideRightleft() {
   if(ie4 || ns4) {
	var x3_pos = parseInt(rightHandhand.left);
	var x4_pos = parseInt(rightHandthumb.left);
	if(x3_pos > (windowWidth/2)-230) {
		rightHandhand.left = x3_pos-7;
		rightHandthumb.left = x4_pos-7;
		setTimeout("slideRightleft()", 10);
	} else {
		rightHandhand.left = (windowWidth/2)-230;
		rightHandthumb.left = (windowWidth/2)-224;
		rightHandhand.zIndex = 1;
		rightHandthumb.zIndex = 2;
		setTimeout("slideRightback()", 100);
	}		
   }
}

function slideRightback() {
   if(ie4 || ns4) {
	var x3_pos = parseInt(rightHandhand.left);
	var x4_pos = parseInt(rightHandthumb.left);
	if(x3_pos < (windowWidth/2)+138) {
		rightHandhand.left = x3_pos+7;
		rightHandthumb.left = x4_pos+7;
		setTimeout("slideRightback()", 10);
	} else {
		rightHandhand.left = (windowWidth/2)+138;
		rightHandthumb.left = (windowWidth/2)+144;
		rightHandhand.zIndex = 1;
		rightHandthumb.zIndex = 4;
		setTimeout("slideRightsign()", 100);
	}		
   }
}

function slideRightsign() {
   if(ie4 || ns4) {
	var x3_pos = parseInt(rightHandhand.left);
	var x4_pos = parseInt(rightHandthumb.left);
	if(x3_pos > (windowWidth/2)+98) {
		rightHandhand.left = x3_pos-7;
		rightHandthumb.left = x4_pos-7;
		setTimeout("slideRightsign()", 10);
	} else {
		rightHandhand.left = (windowWidth/2)+98;
		rightHandthumb.left = (windowWidth/2)+104;
	}		
   }
}

