var winw, posdoc=document.getElementById("idpos"), browse, preloadFlag = false, opicd, opfirstind=true, opcount, opval=1, opvartime,
opfunfrom, optim, tjpopwindow, mappopwindow;

window.onunload = closepopup;

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function preloadImagesg() 
{
	if (document.images) 
	{
		hyp_salon_over = newImage("images/hyp_salon-over.gif");
		hyp_srvc_over = newImage("images/hyp_srvc-over.gif");
		hyp_coll_over = newImage("images/hyp_coll-over.gif");
		hyp_prod_over = newImage("images/hyp_prod-over.gif");
		hyp_about_over = newImage("images/hyp_about-over.gif");
		hyp_contact_over = newImage("images/hyp_contact-over.gif");
		hyp_home_over = newImage("images/hyp_home-over.gif");
		preloadFlag = true;
	}
}

function opvars(funfrom, picd, ind)
{
     opicd = picd;
     opfunfrom = funfrom;
     opcount = 1;
     (ind == 1) ?  opvar() : opvar2();
}

function opvar()
{
    if (opcount < 21)
    {
       opval = opval - .04;
       opicd.style.opacity= opval;
       opcount =  opcount +1;
       opvartime = setTimeout ("opvar()", 0);
    }
    else
    {
       opfirstind = false;
       clearTimeout(opvartime);
       optim = setTimeout (opfunfrom, 0);
    }
}

function opvar2()
{
    if (opcount < 21)
    {
       opval = opval + .04;
       opicd.style.opacity= opval;
       opcount =  opcount +1;
       opvartime = setTimeout ("opvar2()", 0);
    }
    else
    {
       opfirstind = true;
       opval = 1;
       opicd.style.opacity= 1;
       clearTimeout(opvartime);
       optim = setTimeout (opfunfrom, 5000);
    }
}

function tjpopup(popurl)
{
   if (tjpopwindow != null) tjpopwindow.close();
   tjpopwindow= window.open(popurl, "", "top=5, left=5, width=795, height=570, scrollbars, resizable");
}
function closepopup()
{
  if(tjpopwindow != null) tjpopwindow.close();
  if (mappopwindow != null) mappopwindow.close();
}