function labPage(edgurl,inframe)
{
if(inframe)
 {
 if(window.opener.location.href != edgurl)window.opener.location.href = edgurl;
 }
 else
 {
 if(window.opener.top.location.href != edgurl)window.opener.top.location.href = edgurl;
 }
}

function popRemote(newURL)
{
    var hDom = 'www';
    if(document.location.href.indexOf('www.')==-1)
     {
     if(document.location.href.indexOf('stage.')!=-1)hDom='stage';
     if(document.location.href.indexOf('web03.')!=-1)hDom='web03';
     }

    var pWidth=370,pHeight=1200,hHeight=616,pLeft=0,mWidth=1280;
    
	if(screen.availWidth)pLeft = screen.availWidth-pWidth-10;
    pHeight = (screen.availHeight>pHeight) ? pHeight:screen.availHeight-80;
	hHeight = (screen.availHeight>hHeight) ? hHeight:screen.availHeight-80;
	mWidth = (screen.availWidth>mWidth) ? mWidth-pWidth:screen.availWidth-(pWidth+10);
    var wFeatures = 'height='+hHeight+',width='+pWidth+',top=0,left='+pLeft+',status=no,toolbar=no,menubar=no,resizable=yes,location=no,scrollbars=yes,titlebar=no';
    var lthelpwindow = window.open('http://'+hDom+'.labtricity.com/bin/elab.dll?page?p='+newURL,'lthelpwin',wFeatures);

    window.top.moveTo(0,0);
    window.top.resizeTo(mWidth,pHeight);
}

function labAcct()
{
    var hDom = 'www';
    if(document.location.href.indexOf('www.')==-1)
     {
     if(document.location.href.indexOf('stage.')!=-1)hDom='stage';
     if(document.location.href.indexOf('web03.')!=-1)hDom='web03';
     }
 document.location.href='https://'+hDom+'.labtricity.com/bin/elab.dll?page?p=managelab';
}

function phoAcct()
{
    var hDom = 'www';
    if(document.location.href.indexOf('www.')==-1)
     {
     if(document.location.href.indexOf('stage.')!=-1)hDom='stage';
     if(document.location.href.indexOf('web03.')!=-1)hDom='web03';
     }
 document.location.href='https://'+hDom+'.labtricity.com/bin/elab.dll?page?p=managepho';
}

function checkLength(field,len)
{
if (field.value.length>len)
 {
 alert('Please limit your entry to '+new String(len)+' characters.');
 field.value = field.value.substr(0,len);
 field.focus();
 }
}

function setDefault(thefield,thedefault)
{
if (thefield.value=="")thefield.value=thedefault;
}

function clearThis(vDateName)
{
var enteredstring = new String(vDateName.value);
if(!(enteredstring.indexOf('mm')!=-1&&enteredstring.indexOf('all events')!=-1))
 {
 vDateName.value = "";
 }
}

function clickSubmit(theform)
{
theform.submit();
}

function popup(newURL)
{
    var ltpopupwindow = window.open(newURL,"ltpopupwindow","width=580,top=110,left=250,status=yes,toolbar=no,menubar=no,resizable=yes,location=no,scrollbars=yes,titlebar=yes");
	ltpopupwindow.focus();
}

function ExpressPhoto(newURL)
{
    newURL = "http://www.labtricity.com/bin/elab.dll?page?p=Express"+newURL;
    var ltpopupwindow = window.open(newURL,"ltpopupwindow","width=780,top=110,left=250,status=yes,toolbar=no,menubar=yes,resizable=yes,location=no,scrollbars=yes,titlebar=yes");
	ltpopupwindow.focus();
}

function coming(message)
{
alert('Coming soon: '+message);
}

function pagePreload()
{

}


function popHelp(helpPage)
{
    var helpString="window.open(\'/common/"+helpPage+".htm\',\'HelpWindow\',\'status,scrollbars,resizable,width=400,height=400\')";
    eval(helpString);
}

function popUp(newURL,style)
{
    var popupwindow;
	if (!style)popupwindow = window.open(newURL,null,'height=300,width=800,top=50,left=50,status=yes,toolbar=yes,menubar=yes,resizable=yes,location=yes,scrollbars=yes,titlebar=yes');
	if (style==1)popupwindow = window.open(newURL,null,'height=498,width=600,top=50,left=50,status=no,toolbar=no,menubar=no,resizable=yes,location=no,scrollbars=no,titlebar=no');
	if (style==2)popupwindow = window.open(newURL,null,'height=600,width=800,top=50,left=50,status=no,toolbar=no,menubar=no,resizable=yes,location=no,scrollbars=yes,titlebar=no,personalbar=no');
	if (style==3)popupwindow = window.open(newURL,null,'height=600,width=307,top=50,left=50,status=no,toolbar=no,menubar=no,resizable=yes,location=no,scrollbars=yes,titlebar=no,personalbar=no');
	if (style==4)popupwindow = window.open(newURL,null,'height=400,width=350,top=50,left=50,status=no,toolbar=no,menubar=no,resizable=yes,location=no,scrollbars=yes,titlebar=no,personalbar=no');
	popupwindow.focus();
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i>a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  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=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function tmt_findObj(n){
	var x,t; if((n.indexOf("?"))>0&&parent.frames.length){t=n.split("?");
	x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
	}else{x=document.getElementById(n)}return x;
}

function MM_showHideLayers() { //v3.0A Modified by Al Sparber and Massimo Foti for NN6 Compatibility

  var i,p,v,obj,args=MM_showHideLayers.arguments;if(document.getElementById){
   for (i=0; i<(args.length-2); i+=3){ obj=tmt_findObj(args[i]);v=args[i+2];
   v=(v=='show')?'visible':(v='hide')?'hidden':v;
   if(obj)obj.style.visibility=v;}} else{
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }}
}




