function showitem(item1, item2){
	var getdis = document.getElementById(item1);
	if(getdis.style.display == 'none'){
		getdis.style.display = 'block';
		if(item2){document.getElementById(item2).style.display = 'none';}
	}else{
		getdis.style.display = 'none';
	}

}

function veiwpic(folder, type, passedvalue) {
  if (passedvalue != "") {
	  if (type == "pdf") {
		window.open(folder , "win1", "menubar=no, status=no, location=yes, toolbar=no, scrollbars=no, resizable=no");
	  }else{
		window.open("pic.php?folder="+encodeURIComponent(folder)+"&type="+encodeURIComponent(type)+"&name="+encodeURIComponent(passedvalue) , "win1", "width=400, height=400, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=no");
	  }
  }
}


function PrintPage(){
	str = window.location.href;
	str = str.replace("&",",");
	window.open("print.php?url="+str , "print", "width=670, height=650, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=no");
}

function SendPage(){
var str = parent.document.URL;
	str = str.replace("&",",");
	window.open("friend.php?url="+str , "win1", "width=350, height=400, menubar=no, status=no, location=no, toolbar=no, scrollbars=no, resizable=no");
}


//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=80//(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)<170+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
}
