//Specify rate of display (1/freq)
var freq=1

var random_num=Math.floor(Math.random()*freq)
if (random_num==0)
window.onload=initbox
var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"

var bouncelimit=32 //(must be divisible by 8)
var direction="up"

function initbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin").style : ie?
document.all.dropin : document.dropin
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-250+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}

function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<0+scroll_top)
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}

function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}

function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}

function truebody(){
return (document.compatMode &&
document.compatMode!="BackCompat")? document.documentElement : document.body
}


function download_tb() { 
		var TranslatorFile= "http://www.babylon.com/systems/toolbar.php";
		document.location.href = TranslatorFile;

}
function closeit() 
{ 
    if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
    
} 

function sendgoogle() {
	var p="http://search.babylon.com/?babsrc=dictionarybc&sa=Search&q=" + document.getElementById("q").value;
	document.location.href=p;
}
function sendgoogles() {
	var p="http://search.babylon.com/?babsrc=dictionarybc&sa=Search&q=" + document.getElementById("qt").value;
	document.location.href=p;
}
function sendgoogler() {
	var p="http://search.babylon.com/?babsrc=dictionarybc&sa=Search&q=" + document.getElementById("qr").value;
	document.location.href=p;
}
function google_ad_request_done(google_ads) {
		var s = '';
		var i;
		if (google_ads.length == 0)
		return;

		if (google_ads[0].type == "image") {
		s += '<a href="' + google_ads[0].url +
		'" target="_top" title="go to ' + google_ads[0].visible_url +
		'"><img border="0" src="' + google_ads[0].image_url +
		'"width="' + google_ads[0].image_width +
		'"height="' + google_ads[0].image_height + '"></a>';
		}
		else if (google_ads[0].type == "flash") {
		s += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
		' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"' +
		' WIDTH="' + google_ad.image_width +
		'" HEIGHT="' + google_ad.image_height + '">' +
		'<PARAM NAME="movie" VALUE="' + google_ad.image_url +
		'">' +
		'<PARAM NAME="quality" VALUE="high">' +
		'<PARAM NAME="AllowScriptAccess" VALUE="never">' +
		'<EMBED src="' + google_ad.image_url +
		'" WIDTH="' + google_ad.image_width +
		'" HEIGHT="' + google_ad.image_height +
		'" TYPE="application/x-shockwave-flash"' +
		' AllowScriptAccess="never" ' +
		' PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
		}
		else if (google_ads[0].type == "html") {
		s += google_ads[0].snippet;
		}
		else if (google_ads[0].type == "text") {
		
		if (google_ads.length == 1) {

		s += '<a href="' + google_ads[0].url + '" ' +
		'onmouseout="window.status=\'\'" ' +
		'onmouseover="window.status=\'go to ' +
		google_ads[0].visible_url + '\';return true;" ' +
		'class="google">' +
		'<span style="">' +
		'<b>' + google_ads[0].line1 + '</b><br></span>' +
		'<span style="">' +
		google_ads[0].line2 + ' ' +
		google_ads[0].line3 + '<br></span>' +
		'<span  style="color:4A9A00;">' +
		google_ads[0].visible_url + '</span></a><br>';
		}
		else if (google_ads.length > 1) {
		
		for(i=0; i < google_ads.length; ++i) {
		s += '<br><a href="' + google_ads[i].url + '" ' +
		'onmouseout="window.status=\'\'" ' +
		'onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\';return true;" ' +
		'style="color:#0000CE;font-size: 12px;text-decoration:none;">' +
		'<span style="line-height: 1.5em;">' +
		'<b>' + google_ads[i].line1 + '</b><br></span></a>' + '<a href="' + google_ads[i].url + '" ' +
		'onmouseout="window.status=\'\'" ' +
		'onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\';return true;" ' +
		'style="color:#5A5A5A;font-size: 12px;text-decoration:none;">' +
		'<span style="line-height: 1.0em;">' +
		google_ads[i].line2 + ' ' +
		google_ads[i].line3 + '<br></span></a>' +
		 '<a href="' + google_ads[i].url + '" ' +
		'onmouseout="window.status=\'\'" ' +
		'onmouseover="window.status=\'go to ' +
		google_ads[i].visible_url + '\';return true;" ' +
		'style="color:#4A9A00;font-size: 12px;text-decoration:none;">' +
		'<span style="line-height: 1.5em;">' +
		google_ads[i].visible_url + '</a><br>';
		}

		}
s += '<span style="text-align:right;font-weight:bold;font-size:10px;color:#999999;">Ads by Google</span>';
		}
		document.write(s);
		return;
}