var browserType=1;
var haveClock=1;  // boolean - declared 1 if ssi/clock.shtml = loaded
var clockVisible=1; // boolean - set to false on rollover while showing alt text

var dontFocus=false;

var chatActive=1; // 1=business hours, 0=closed hours

function popUpAward(){
	pucw('index/homePageBlockTextImages/award/index.html','liquaFiber','600','600','no','no','no','no','-20');
}

function executeClick(){
	featLaunch('features/3.html','features','780','630','no','yes','yes','no','-20');
}

if(navigator.appName!="Microsoft Internet Explorer"){
	browserType=0;
}

function showIpAddr(){
	if(document.getElementById){
		var ipFlag="external";
			if(ipAdd.indexOf("192.168")!=-1){
				ipFlag="local";
	}
	if(ipFlag=="local"){
	var splitIP=ipAdd.split(".");
	var ip1=splitIP[2];
	var ip2=splitIP[3];
	if(ip1=="0"){ip1="zero";}
	if(ip1=="1"){ip1="one";}
	if(ip1=="2"){ip1="two";}
	if(ip1=="3"){ip1="three";}
	if(ip1=="4"){ip1="four";}
	if(ip1=="5"){ip1="five";}
	if(ip1=="6"){ip1="six";}
	document.getElementById("ipShow").innerHTML=ip1+"&nbsp;dot&nbsp;"+ip2;
}else{
	document.getElementById("ipShow").innerText=ipAdd;
}}}

function getWiseEye(which){
	if(which==1){
		document.location="wiseeye6.shtml";
	}else if(which==2){
		document.location="wiseeye5.shtml";
	}else if(which==3){
		document.location="wiseeye.shtml";
	}else if(which==4){
		document.location="wiseeye7.shtml";
	}else if(which==5){
		document.location="wiseeye8.shtml";
	}else if(which==6){
		document.location="wiseeye6.shtml";
	}else if(which==15){
		document.location="wiseeye15.shtml";
	}else if(which==16){
		document.location="wiseeye16.shtml";
}}

function showVid(which){
	if(which==1){
		pucw('wiseeye/pages/tenaStretch/video.shtml','Video','788','596','no','no','no','no','0');
	}else if(which==2){
		pucw('wiseeye/pages/grahamField/video.shtml','Video2','454','342','no','no','no','no','0');
	}
}

function loginActive(elemEyeD,elemColor,txtColor){
	if(document.getElementById){
		document.getElementById(elemEyeD).style.background=elemColor;
		document.getElementById(elemEyeD).style.color=txtColor;
	}
}
function loginKey(){
if(navigator.appName=="Microsoft Internet Explorer"){
    if (window.event.keyCode == 13){
		ttsLogin();
		}
	}
}
function ttsLogin(){
	adjustLoader();
	document.login.submit();
}

function swapImgRestore() { //v3.0
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function swapImage() { //v3.0
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

var origWidth, origHeight;
if (document.layers) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}

function initScrollerObjs() {
	scroller1 = new scrollerObj(0,0,95,190,"center","holder1");
	scroller1.setTiming(5000,1,1);	
	scroller1.setFont('arial,helvetica,verdana,sans-serif','10px','#395494');
	scroller1.addItem('<b>Druzak Medical expands</b> with a new facility in <b>Florida.<br><br>Druzak<br>Pompano Beach</b><br>5001 NW 13th Ave, Ste D,E,F<br>Deerfield Beach, FL 33064');
	scroller1.addItem('Druzak Medical now offers Free Live Help.<br><br>Just click on the Live Help Link on our Home Page to Chat Live with a Druzak Customer Service Representative.');
	scroller1.addItem('Druzak Medical is a distributor of medical products that are most commonly utilized within long term care facilities, pharmacies, and physician offices.');
	scroller1.addItem('Who said money doesn\'t grow on trees? If you haven\'t discovered our Treetop Shopper Reports yet, then What are you waiting for? Call us now at 800-837-9560.');

	if(browserType==1){
		scroller1.create(); 
	}
	if(navigator.userAgent.indexOf("Gecko")>-1){
		positionGecko();
		setMouseEvents(); 
}}

window.onload = initScrollerObjs;
if (navigator.userAgent.indexOf("Gecko")>-1) window.onresize=rePosGecko;

window.status="Druzak Medical, Inc.";

function statusTip(tip){
	window.status=tip;
}
function statusRestore(){
	window.status="Druzak Medical, Inc.";
}
function dynTextTop(dynText){
	clockVisible=0;
	if(document.getElementById){
	switch(dynText){
		case 1: 
		  	dynMessage="Druzak Medical, Inc. HomePage";
	 break;
		case 2: 
  			dynMessage="Information about Druzak Medical, Inc";
	 break;
		case 3: 
  			dynMessage="Top Selling Products & Manufacturers";
     break;
		case 4: 
  			dynMessage="Ordering & Management Information";
     break;
		case 5: 
  			dynMessage="Contact Information and Email Directory";
     break;
        case 6: 
  			dynMessage="Ordering at Druzak Medical, Inc.";
     break;
}
	//document.getElementById("menuDesc").innerText=dynMessage;
	}
}
function dynTextRestore(){
	clockVisible=1;
}

function featLaunch(loc,name,width,height,status,resize,scrollbars,menubar,lift) {
    var iMyWidth;
    var iMyHeight;
    iMyWidth = 15; 
    iMyHeight = (window.screen.height/2) - ( (height/2) + 50);
	if(screen.availHeight>=600){
		iMyHeight-=lift;
	}
    var win2 = window.open(loc,name,"status=" + status + ",height=" + height + ",width=" + width + ",resizable=" + resize + ",scrollbars="  + scrollbars + ",menubar=" +menubar+ ",left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight);
    win2.focus();
    return win2;
}

function pucw(loc,name,width,height,status,resize,scrollbars,menubar,lift) {
    var iMyWidth;
    var iMyHeight;
    iMyWidth = (window.screen.width/2) - ( (width/2) + 10); 
    iMyHeight = (window.screen.height/2) - ( (height/2) + 50);
	if(screen.availHeight>=600){
		iMyHeight-=lift;
	}
    var win2 = window.open(loc,name,"status=" + status + ",height=" + height + ",width=" + width + ",resizable=" + resize + ",scrollbars="  + scrollbars + ",menubar=" +menubar+ ",left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight);
    win2.focus();
    return win2;
}

function puvw(loc,name,width,height,status,resize,scrollbars,menubar,lift) {
    var iMyWidth;
    var iMyHeight;
	var totalWidth=screen.availWidth-12;
	var totalHeight=screen.availHeight-40;
    iMyWidth = (window.screen.totalWidth/2) - ( (totalWidth/2) + 10); 
    iMyHeight = (window.screen.totalHeight/2) - ( (totalHeight/2) + 50);
	if(screen.availHeight>=600){
		iMyHeight-=lift;
	}
    var win2 = window.open(loc,name,"status=" + status + ",height=" + totalHeight + ",width=" + totalWidth + ",resizable=" + resize + ",scrollbars="  + scrollbars + ",menubar=" +menubar+ ",left='0',top='0'");
    win2.focus();
    return win2;
}

function pubw(loc,name,width,height,status,resize,scrollbars,menubar) {
    var iMyWidth;
    var iMyHeight;
    iMyWidth = 8; 
    iMyHeight = 8;
    var win2 = window.open(loc,name,"status=" + status + ",height=" + height + ",width=" + width + ",resizable=" + resize + ",scrollbars="  + scrollbars + ",menubar=" +menubar+ ",left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight);
    win2.focus();
    return win2;
}

function puOffScreen(loc,name,width,height,status,resize,scrollbars,menubar) {
    var iMyWidth;
    var iMyHeight;
    iMyWidth = 8; 
    iMyHeight = 8;
    var win2 = window.open(loc,name,"status=" + status + ",height=" + height + ",width=" + width + ",resizable=" + resize + ",scrollbars="  + scrollbars + ",menubar=" +menubar+ ",left=5000,top=5000,screenX=5000,screenY=5000");
    win2.focus();
    return win2;
}

function pufullw(loc,name,status,resize,scrollbars,menubar) {
    var iMyWidth;
    var iMyHeight;
	var height=window.screen.availHeight-225;
	var width=window.screen.availWidth-125;
    iMyWidth = (window.screen.width/2) - ( (width/2) + 10); 
    iMyHeight = (window.screen.height/2) - ( (height/2) + 75);
	
    var win2 = window.open(loc,name,"status=" + status + ",height=" + height + ",width=" + width + ",resizable=" + resize + ",scrollbars="  + scrollbars + ",menubar=" +menubar+ ",left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight);
    win2.focus();
    return win2;
}

function getTransitMap(){
	if (document.form1.maps_1.options[document.form1.maps_1.selectedIndex].value=="zero") {
		return;
	}else{
		document.form1.maps_1.blur();
		mapWin=pucw('ordering/maps/'+document.form1.maps_1.options[document.form1.maps_1.selectedIndex].value+'.html','tts_map','400','241','no','no','no','no','21');
	}
}

function emailUs(){
	if (document.form1.email_1.options[document.form1.email_1.selectedIndex].value=="zero") {
		return;
	}else{
		var msg=document.form1.email_1.options[document.form1.email_1.selectedIndex].value;
		var e1=msg.split("?");
		var e2="@druz";
		var e3="ak.com";
		document.form1.email_1.blur();
		window.location="mai"+"lto:"+e1[0]+e2+e3+"?"+e1[1];
		return true;
	}
}


var what_Url=document.location.href;

var centerplaceUrl="https://www.centerplace.biz/";

var leftPicture;

var imageRotate=Math.floor(Math.random()*9); // change number of possible images in here

leftPicture="<IMG SRC='index/mainBlock/pic"+imageRotate+".jpg' WIDTH=101 HEIGHT=420>";

function adjustLoader(){
	if(haveFlash==true){
		if(screen.availWidth>800){
			document.getElementById("loadingFlash").style.left=421+"px";
		}else{
			document.getElementById("loadingFlash").style.left=309+"px";
		}
	var movie=document.getElementById("loading555");
	movie.play();
}}

var dMailAtSym="@dru";
var dMailDom="zak.com";
var dMailTo1="mai";
var dMailTo2="lto";
var dMailTo3="lto:";
var dMailDisabledMessage="This E-mail Account is in the process of being created\n\nPlease check back soon or call:\n 1-800-837-9560 for further assistance.";

function giveDisabledMessage(){
	alert(dMailDisabledMessage);	
}

function mailLink(usr){
	document.write("<a onclick='this.blur();' class='email' href='"+dMailTo1+dMailTo2+":"+usr+dMailAtSym+dMailDom+"'>");
}

function mailJavaForm(usr){
	pucw("contactUs/mailForm.jsp?addrName="+usr+"","liquaFiber","600","600","no","no","no","no","-20");
}

function mailLinkDisabled(usr){
	document.write("<a onclick='this.blur(); giveDisabledMessage(); return false;' class='email' href='#'>");
}

function mailLinkOrange(usr){
	document.write("<a onclick='this.blur();' href='"+dMailTo1+dMailTo2+":"+usr+dMailAtSym+dMailDom+"'>");
}

function mailStatic(usr){
	document.write(usr+dMailAtSym+dMailDom);
}

function checkCapsLock(e){
	var x=0;
	var y=false;
	var z='Caps Lock is On.\n\nTo prevent entering your password incorrectly,\nyou should press Caps Lock to turn it off.';
	if(document.all){
		x=e.keyCode;
		y=e.shiftKey;
	}else if(document.layers){
		x=e.which;
		y=(x==16)?true:false;
	}else if(document.getElementById){
		x=e.which;
		y=(x==16)?true:false;
	}
	if ((x>=65&&x<=90)&&!y){
		document.images.capsAnime.src="commonImages/loginText/login_09_caps.gif";
	}else if((x>=97&&x<=122)&&y){
		document.images.capsAnime.src="commonImages/loginText/login_09_caps.gif";
		}else{
		document.images.capsAnime.src="commonImages/loginText/login_09.gif";
}}

function hideCaps(){
	//setTimeout("document.images.capsAnime.src='commonImages/loginText/login_09.gif';",1500);
}