/********************************************************************************
free scripts - http://www.d6data.com
********************************************************************************/
// Original by Michael van Ouwerkerk - www.dhtmlcentral.com

function lib_bwcheck() { //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()

// Variables to set:

messages= new Array()
//	Write your descriptions in here.
//	Standard Product Category

messages[0] ="<b>Gold Bar</b><br>25 gr, 50 gr, 100 gr, 1000 gr"
messages[1] ="<b>Granule</b><br>5 kg"
messages[2] ="<b>Standard Medals</b><br>1,2, 2.5 , 5, 10 gr"
messages[3] ="<b>Granule</b><br>999.9, 995 and 925"
messages[4] ="<b>Crystal</b><br>999.5"
messages[5] ="<b>Special Design of Platinum Crucible </b><br>"


messages[6] ="<b>Customized Medals and Coins</b><br>"
messages[7] ="<b>Gold & Silver Rings</b><br>"
messages[8] ="<b>Gold & Silver Emblem & Tie Pins</b><br>"
messages[9] ="<b>Gold & Silver Tie Clips</b><br>" 
messages[10] ="<b>Pincers Platinum Plated</b><br>" 
messages[11] ="<b>Stamp 100 years Bung Hatta anniversary</b><br>" 
messages[12] ="<b>Customized Product 1</b><br>"
messages[13] ="<b>Customized Product 2</b><br>"
messages[14] ="<b>Customized Product 3</b><br>"
messages[15] ="<b>Customized Product 4</b><br>"
messages[16] ="<b>Customized Product 5</b><br>"
messages[17] ="<b>Dinar Coin  </b><br>"
messages[18] ="<b>Medals 1</b><br>"
messages[19] ="<b>Medals 2</b><br>"
messages[20] ="<b>Medals 3</b><br>"
messages[21] ="<b>Medals 4</b><br>"
messages[22] ="<b>Medals 5</b><br>"
messages[23] ="<b>ONH Coin  </b><br>"
messages[24] ="<b>Rings </b><br>"

messages[25]="<b>Gold & Silver Plate</b><br>-"
messages[26]="<b>Gold & Silver Wire</b><br>-"
messages[27]="<b>Silver Nitrate Solution and Crystal</b><br>-"
messages[28]="<b>GPC Crystal</b><br>-"

messages[29] ="<b>GOLD DRAGON</b><br><br>.... the biggest astrological sign on Chinese traditional calendar show up on the 3rd millennium. They believe that Liong (Dragon) will bring a lot of luck, success and the balance of yin and yang.<br><br>Now available on 5 gram of weight, 20 mm diameter and 99.99% fineness."
messages[30] ="<b>GOLDEN SNAKE</b><br>....Symbolize wisdom, symphatic, attractive and confidence. Some of the world famous golden snake's astrological sign are Edgar Allen Poe, Abraham Lincoln and Mao Tze Tung.<br><br>Now available on 5 gram of weight, 20 mm diameter and 99.99% fineness."
messages[31] ="<b>HORSE</b><br>....Tough fighter, owner of strength and incredible tenacity who serve with full of loyality. Symbolize a bright and clear of business future with domination of optimism and impulsive act.<br><br>Now available on 5 gram of weight, 20 mm diameter and 99.99% fineness."
messages[32] ="<b>RHINOCEROS SINGLE HORN</b><br>(Rhinoceros Sondaicus)<br><br>....This scarce animal existence si now not more than 50 all over the world. Their female can only reproduce once in their life time. Until now these animal are still being protected in their natural habitat in Ujung Kulon, Banten.<br><br>Now available on 5 gram of weight, 20 mm diameter and 99.99% fineness. And also on 5 gram of weight, 20 mm diameter and 99.99% fineness."
messages[33]="<b>Toraja Coin</b><br>Traditional house of Torajanese called Tongkonan Toraya, it is the house of nobleman which was settled by the king or in Torajanese called Puang. The craft made in small shape and being the mainstay of various crafts from Toraja. "
messages[34]="<b>ORANG UTAN</b><br>(Pongo Pygmaeus)<br><br>....there are now only 5000 of this species remaining, they live in tropical forest of Kalimantan and some of the are beIng conservated on Tanjung Puting National Park.<br><br>Now available on 5 gram of weight, 20 mm diameter and 99.99% fineness."
messages[35]="<b>ASMAUL HUSNA</b><br>....Allah the Almighty power of God.<br><br>Now available on 10 gram of weight, 26 mm diameter and 99.99% fineness."
messages[36]="<b>Zodiac Oval Pendant</b><br>2, 2.1, 2.5, 3, 4, 5 gr"
messages[37]="<b>Z. Triangle Pendant</b><br>3 gr"
messages[38]="<b>Geomet Pendant</b><br>2 gr"
messages[39]="<b>ONH Gold Coin</b><br>1, 2, 2,5 3, 4, 5, gr"

// Custom Product Category

//messages[17]="<b>Customized<br>Medals and Coins</b><br>-"
//messages[18]="<b>Gold & Silver<br>Rings</b><br>-"
//messages[19]="<b>Gold & Silver<br>Emblem and Tie Pins</b><br>-"
//messages[20]="<b>Gold & Silver<br>Tie Clips</b><br>-"
//messages[21]="<b>Gold Placards</b><br>1. dan 5 kg"
//messages[22]="<b>Special Design of Platinum Crucible </b><br>1. dan 5 kg"
//messages[23]="<b>Pincers Platinum Plated</b><br>1, 2, 2,5 3, 4, 5, gr"

// Industrial Product Category

//messages[24]="<b>Gold & Silver Plate</b><br>-"
//messages[25]="<b>Gold & Silver Wire</b><br>-"
//messages[26]="<b>Silver Nitrate Solution and Crystal</b><br>-"
//messages[27]="<b>GPC Crystal</b><br>-"

// To have more descriptions just add to the array.

fromX= -1           // How much from the actual mouse X should the description box appear?
fromY= 21            // How much from the actual mouse Y should the description box appear?
ns4center= 1        // Centering the text in ns4 doesn't work with css, use this variable instead... the value is 1 or 0
useFading= 1        // 1 for a fading effect in windows explorer 5+ and all platforms ns6, 0 for no fading effect.
animation= 0        // 1 if you want animation, 0 for no animation.
detectiontype= 0    // 1 for 'smooth' window size detection, 0 for 'flip' window size detection.
delay= 300          // The time before showing the popup, in milliseconds.


/*** There should be no need to change anything beyond this. ***/ 

if(document.layers) { //NS4 resize fix.
    scrX= innerWidth; scrY= innerHeight;
    onresize= function() {if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} };
}

// object constructor...
function makeTooltip(obj) {								
   	this.elm= document.getElementById? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
   	this.css= bw.ns4?this.elm:this.elm.style;
   	this.wref= bw.ns4?this.elm.document:this.elm;
	this.obj= obj+'makeTooltip'; eval(this.obj+'=this');
	this.w= bw.ns4? this.elm.clip.width: this.elm.offsetWidth;
	this.h= bw.ns4? this.elm.clip.height: this.elm.offsetHeight;
};
makeTooltip.prototype.measureIt= function() {
	this.w= bw.ns4? this.elm.clip.width: this.elm.offsetWidth;
	this.h= bw.ns4? this.elm.clip.height: this.elm.offsetHeight;
};
makeTooltip.prototype.writeIt= function(text) {
	if (bw.ns4) {this.wref.write(text); this.wref.close()}
	else this.wref.innerHTML= text;
};

// Mousemove detection
var mouseX=0,mouseY=0,setX=0,setY=0;
function getMousemove(e){
	mouseX= (bw.ns4||bw.ns6)? e.pageX: bw.ie4&&bw.win? event.x: bw.ie&&bw.win&&!bw.ie4? (event.x-2)+document.body.scrollLeft : event.x+document.body.scrollLeft;
	mouseY= (bw.ns4||bw.ns6)? e.pageY: bw.ie4&&bw.win? event.y: bw.ie&&bw.win&&!bw.ie4? (event.y-2)+document.body.scrollTop : event.y+document.body.scrollTop;
	if (isLoaded && hovering && animation) placeIt();
};
function placeIt() {
	if (detectiontype==1) setX= mouseX+fromX+tooltip.w > screenWscrolled ? screenWscrolled-tooltip.w: mouseX+fromX;
	if (detectiontype==1) setY= mouseY+fromY+tooltip.h > screenHscrolled ? screenHscrolled-tooltip.h: mouseY+fromY;
	if (detectiontype==0) setX= mouseX+fromX+tooltip.w > screenWscrolled ? mouseX-fromX-tooltip.w: mouseX+fromX;
	if (detectiontype==0) setY= mouseY+fromY+tooltip.h > screenHscrolled ? mouseY-fromY-tooltip.h: mouseY+fromY;
	if (setX<0) setX= 0;
	if (setY<0) setY= 0;
	tooltip.css.left= setX;
	tooltip.css.top= setY;
};

// Main popUp function.
var hovering=false, screenWscrolled=0, screenHscrolled=0;
makeTooltip.prototype.showTimer= null;
function popUp(num){
	if(isLoaded){
		clearTimeout(tooltip.popTimer);
		dopopOut();
		if (bw.ns4){
			var text= '<span class="netscape4Style">' + (ns4center?'<center>':"") + messages[num] + (ns4center?'</center>':"") + '</span>';
			tooltip.writeIt(text);
		}
		if (!bw.ns4) tooltip.writeIt(messages[num]);
		screenWscrolled= screenW + (bw.ie?document.body.scrollLeft:pageXOffset);
		screenHscrolled= screenH + (bw.ie?document.body.scrollTop:pageYOffset);
		hovering= true;
		
		/* I'm using a timeout for ie4 here, because it doesn't store the measurements quickly enough. Does anybody know why this happens? */
		if (bw.ie4) setTimeout('tooltip.measureIt(); placeIt();', delay/2);
		else { tooltip.measureIt(); placeIt(); }
		if (useFading) tooltip.showTimer= setTimeout('tooltip.blendIn()', delay);
		if (!useFading) tooltip.showTimer= setTimeout('tooltip.css.visibility="visible"', delay);
    }
};

// Hiding routines
makeTooltip.prototype.popTimer= null;
function popOut() {
	if (isLoaded) tooltip.popTimer= setTimeout('dopopOut()', 30)
};
function dopopOut() {
	hovering= false;
	clearTimeout(tooltip.showTimer);
	tooltip.css.visibility= 'hidden';
	clearTimeout(tooltip.fadeTimer);
	tooltip.i= 0;
};

// Measure screensize.
var scrollbarWidth= bw.ns6&&bw.win?14:bw.ns6&&!bw.win?16:bw.ns4?16:0;
function measureScreen() {
	tooltip.css.top= 0;
	tooltip.css.left= 0;
	screenW= (bw.ie?document.body.clientWidth:innerWidth) - scrollbarWidth;
	screenH= (bw.ie?document.body.clientHeight:innerHeight);
};

// Opacity methods.
makeTooltip.prototype.blendIn= function() {
	if (bw.ie && bw.win && !bw.ie4) {
		this.css.filter= 'blendTrans(duration=0.5)';
		this.elm.filters.blendTrans.apply();
		this.css.visibility= 'visible';
		this.elm.filters.blendTrans.play();
	}
	else {
		this.css.visibility= 'visible';
		if (!bw.ns4) this.fadeIt();
	}
};
makeTooltip.prototype.step= 8;
makeTooltip.prototype.i= 0;
makeTooltip.prototype.fadeTimer= null;
makeTooltip.prototype.fadeIt= function() {
	this.i+= this.step;
	//this.css.filter= 'alpha(opacity='+this.i+')';
	this.css.MozOpacity= this.i/100;
	if (this.i<100) this.fadeTimer= setTimeout(this.obj+'.fadeIt()', 40);
	else this.i= 0;
};

// Init function...
var isLoaded= false;
function popupInit() {
	//Fixing the browsercheck for opera... this can be removed if the browsercheck has been updated!!
	bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false
	if (bw.opera5) bw.ns6 = 0
	
	//Extending the browsercheck to add windows platform detection.
	bw.win= (navigator.userAgent.indexOf('Windows')>-1)

	tooltip= new makeTooltip('divTooltip');
	tooltip.elm.onmouseover= function(){ clearTimeout(tooltip.popTimer); if(bw.ns4){setTimeout('clearTimeout(tooltip.popTimer)',20)}; };
	tooltip.elm.onmouseout= dopopOut;
	if (bw.ns4) document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove= getMousemove;
	measureScreen();
	if (!bw.ns4) onresize= measureScreen;
	if (!bw.ns4) tooltip.elm.className= 'normalStyle';
	if (bw.ie && bw.win && !bw.ie4) tooltip.css.filter= 'alpha(opacity=100)'; //Preloads the windows filters.
	isLoaded= true;
};

// Initiates page on pageload if the browser is ok.
if(bw.bw && !isLoaded) onload= popupInit;
