function gradient(id, level)
{
	var box = document.getElementById(id);
	box.style.opacity = level;
	box.style.MozOpacity = level;
	box.style.KhtmlOpacity = level;
	box.style.filter = "alpha(opacity=" + level * 100 + ")";
	box.style.display="block";
	return;
}


function fadein(id) 
{
	var level = 0;
	while(level <= 1)
	{
		setTimeout( "gradient('" + id + "'," + level + ")", (level* 1000) + 10);
		level += 0.01;
	}
}


// Open the lightbox


/*function openbox(formtitle, fadin)
{
  var box = document.getElementById('box'); 
  document.getElementById('filter').style.display='block';

  var btitle = document.getElementById('boxtitle');
  btitle.innerHTML = formtitle;
  
  if(fadin)
  {
	 gradient("box", 0);
	 fadein("box");
  }
  else
  { 	
    box.style.display='block';
  }  	
}
*/

function openbox(formtitle, fadin,boxname,boxtitle,filter)
{
	
  var box = document.getElementById(boxname); 
  
  document.getElementById(filter).style.display='block';

  var btitle = document.getElementById(boxtitle);	
  //btitle.innerHTML = formtitle;
  

  if(fadin)
  {
	 gradient("box", 0);
	 fadein("box");
  }
  else
  { 	
    box.style.display='block';
  }  	
}




function openboxS(formtitleS, fadin,boxname,boxtitleS,filterS)
{
  var box = document.getElementById(boxname); 
  document.getElementById(filterS).style.display='block';

  var btitle = document.getElementById(boxtitleS);	
  //btitle.innerHTML = formtitle;
  

  if(fadin)
  {
	 gradient("boxS", 0);
	 fadein("boxS");
  }
  else
  { 	
    box.style.display='block';
  }  	
}




function print_bro(formtitle, fadin, box_bro, boxtitle_bro, print_bro)
{
	
  var box_bro = document.getElementById(box_bro); 
  document.getElementById(print_bro).style.display='block';

  var btitle_bro = document.getElementById(boxtitle_bro);	
  //btitle.innerHTML = formtitle;
  

  if(fadin)
  {
	 gradient("box_bro", 0);
	 fadein("box_bro");
  }
  else
  { 	
    box_bro.style.display='block';
  }  	
}






/*function openbox(formtitle, fadin,element)
{
	alert(element);
	
  var box = document.getElementById('element'); 
  alert(box);
  document.getElementById('filter').style.display='block';

  var btitle = document.getElementById('boxtitle');
  btitle.innerHTML = formtitle;
  
  if(fadin)
  {
	 gradient("box", 0);
	 fadein("box");
  }
  else
  { 	
    box.style.display='block';
  }  	
}
*/

// Close the lightbox

function closebox()
{
   document.getElementById('box').style.display='none';
   document.getElementById('filter').style.display='none';
		
	 document.sendFriendEmail.friendName.value='';
	 document.sendFriendEmail.friendEmail.value='';
     document.sendFriendEmail.yourName.value='';
	 document.sendFriendEmail.yourEmail.value='';
     document.sendFriendEmail.comments.value='';
	 document.sendFriendEmail.adName.value='';
	 
   
}
function closeboxS()
{
   document.getElementById('boxS').style.display='none';
   document.getElementById('filterS').style.display='none';
   
   	document.sendFriendEmailS.yourName.value ='';
	document.sendFriendEmailS.yourEmail.value ='';
    document.sendFriendEmailS.comments.value ='';
	document.sendFriendEmailS.adName.value ='';
	document.sendFriendEmailS.sellerEmail.value ='';
	document.sendFriendEmailS.cName.value ='';
	document.sendFriendEmailS.adUrl.value ='';

}
function closebox_bro()

{
   document.getElementById('box_bro').style.display='none';
   document.getElementById('print_bro').style.display='none';

}




function refresh()
{
document.getElementById('box').style.display='none';
document.getElementById('filter').style.display='none';
window.location.reload(false);
}
function refreshS()
{
document.getElementById('boxS').style.display='none';
document.getElementById('filterS').style.display='none';
window.location.reload(false);
}

function refresh_bro()
{
document.getElementById('box_bro').style.display='none';
document.getElementById('print_bro').style.display='none';
window.location.reload(false);
}


