flashRed = 255;
flashGreen = 255;
flashBlue = 255;

flashRedEnd = 62;
flashGreenEnd = 84;
flashBlueEnd = 104;
function FlashLoginMenu()
{
	document.getElementById("tdLoginMenu").style.backgroundColor="rgb("+flashRed+","+flashGreen+","+flashBlue+")";
	if (flashRed == flashRedEnd && flashGreen == flashGreenEnd && flashBlue == flashBlueEnd)
	{			
	}
	else
	{
		if (flashRed != flashRedEnd)
			flashRed--;
		if (flashRed != flashRedEnd)
			flashRed--;
		if (flashRed != flashRedEnd)
			flashRed--;

		if (flashGreen != flashGreenEnd)
			flashGreen--;
		if (flashGreen != flashGreenEnd)
			flashGreen--;
		if (flashGreen != flashGreenEnd)
			flashGreen--;	

		if (flashBlue != flashBlueEnd)
			flashBlue--;
		if (flashBlue != flashBlueEnd)
			flashBlue--;
		if (flashBlue != flashBlueEnd)
			flashBlue--;
		setTimeout(FlashLoginMenu,1)			
	}			
}

function GalleryFisk(tSecID, tFiID)
{
	VisPopupFisk("/galleri.php?gap_id="+tFiID+"&g_sec_id="+tSecID, 700, 650);		
}

function tipenvenPopup()
{
	titel = document.title;
	newurl = document.location;
	VisPopupFisk('/tipenven.php?newurl=' + newurl + '&titel=' + titel, 362, 325);

}
function newsletterPopup()
{
	VisPopupFisk("/newsletter.php", 362, 250);
}
function loginPopup()
{
	VisPopupFiskNotTransparent("/login.php", 362, 325);		
}
function opretPopup()
{
	VisPopupFisk("/opretbruger.php", 362, 325);			
}
function glemtPopup()
{
	VisPopupFisk("/glemtlogin.php", 362, 325);				
}
function popFoto(tImg, tWidth,tHeight)
{
	PopupFiskFoto(tImg, tWidth,tHeight+22);
	/*
	popWidth=tWidth;
	popHeight=tHeight;
	//hvis tWidth>clientwidth saa skal winduet vaere mindre og det samme med hojden			
	useScrollbars="yes";
	if (popWidth<screen.availWidth && popWidth<screen.availHeight)
	{			
		useScrollbars="yes";
	}
	else
	{
		popWidth=screen.availWidth;
		popWidth=screen.availHeight;
		useScrollbars="yes";
	}
	
	surl = '/u/show_img.php?img=../'+tImg+'&imgWidth='+tWidth+'&imgHeight='+tHeight;
	WindowXOffset = screen.width/2 - popWidth/2;
	WindowYOffset = screen.height/2 - popHeight/2 - 40;
	if(WindowYOffset < 0){
		WindowYOffset = 0;
	}
	

	window.open(surl,"Foto", "left=" + WindowXOffset + ",top=" + WindowYOffset + ",WIDTH="+popWidth+",HEIGHT="+popHeight+",menubar=no,location=no,toolbar=no,status=yes,scrollbars="+useScrollbars+",resizable=yes");
*/
}

function PopupFiskFoto(tImg, tWidth, tHeight){		
	wndWidth = parseInt(tWidth)+12
	wndHeight = parseInt(tHeight)+12
	
	//alert("/vis-foto-fisk.php?img="+tImg+"&img-w="+tWidth+"&img-h="+tHeight);
	VisPopupFiskNotTransparent("/vis-foto.php?img="+tImg+"&img-w="+tWidth+"&img-h="+tHeight, wndWidth, wndHeight);		
}

function PopupSetLinks(){
	var alist = document.getElementsByTagName("a");
	for(var i=0; i<alist.length; i++){
		if(alist[i].target == "imgLink"){
			alist[i].onclick = function(){
				PopupFiskFoto(this.href, 10, 10);
				return false;
			}
		}
	}
}
	
if (window.addEventListener){
  window.addEventListener('load', PopupSetLinks, false); 
}else if (window.attachEvent){
  window.attachEvent('onload', PopupSetLinks);
}

	
	//PopupFiskFoto('/fangst-fotos/139/139-140-437-1252874629.jpg', 445, 334);
