// JavaScript Document
var popupWin = '';              
function changeWindow(url) {
          if (popupWin != null && !popupWin.closed && popupWin.location) {
                popupWin.close();
          }
          popupWin = window.open(url,'remote','width=900,height=660,toolbar=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,location=yes,screenX=10,screenY=10,top=10,left=10,alwaysRaised=yes,z-lock=yes');
      //popupWin.focus();
}

function changeLargeWindow(url) {
          if (popupWin != null && !popupWin.closed && popupWin.location) {
                popupWin.close();
          }
          popupWin = window.open(url,'remote','width=650,height=350,toolbar=yes,menubar=yes,resizable=yes,scrollbars=yes,status=yes,location=yes,screenX=10,screenY=10,top=10,left=10,alwaysRaised=yes,z-lock=yes');
      //popupWin.focus();
}


function DisableSecondColor() {
	document.search.getsecondcolor.selectedIndex=0;
	document.search.getsecondcolor.disabled = true;	
}

function AbleSecondColor() {
	var color1 = document.search.getfirstcolor.value;
	if (color1 !== "") {
		document.search.getsecondcolor.disabled = false;
	} else {
		document.search.getsecondcolor.selectedIndex=0;
		document.search.getsecondcolor.disabled = true;
	}
}

function CheckFirstColor() {
	var color1 = document.search.getfirstcolor.value;
	if (color1 == "") {
	 	alert("Please select the Main color first.");
	}
}

function CheckNoImprint() {
	if (document.search.getnoimprint.checked==true) {
		document.search.getimprint.value="";
	}
}


function ShowDisclaimer() {
	alert("Pillbox is currently under development and is not intended for clinical use.  It is presented for evaluation as a research and development effort.\n\nImages contained within this resource are not part of the Structured Product Label and have not been verified by the sponsor/manufacturer.\n\nIf you suspect a poisoning emergency, call the national Poison Help hotline at 1-800-222-1222.\n\nComments and suggestions are welcome at pillbox@nlm.nih.gov.");
}

function reLoad(form)
{
	var j;
	var val=form.display.options[form.display.options.selectedIndex].value; 
	var link = window.location.href;
	var tmp=link.split('&');
	var link2="";
	var addDisplay=false;
	for (j=0; j<tmp.length; j++) 
	{	
		var tmp2=tmp[j].split("=");
		if(tmp2[0]=="s")
		{
			link2+="s="+0+"&";
		}
		else if(tmp2[0]=="display")
		{
			link2+="display="+val;
			addDisplay=true;
		}
		else if(tmp2[0]!="searchbox_checked")
			link2+=tmp[j]+"&";
	}
	if(!addDisplay)
		link2+="display="+val;
	self.location=link2 ;	
}
 


