function addBookmark(title,url) {
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}


function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}


function CheckForm()
{


	var i, numproducts,problem
	i=1
	numproducts = document.form1.ProductCount.value
	problem = "N"
	
	while (i <= numproducts)
	{
		checkvalue = document.getElementById('Qty'+i).value;
		if (IsNumeric(checkvalue)==false)
		{
			problem="Y"
		}
	i=i+1;
	}
	
	if (problem=="Y")
	{
		alert('Please ensure the Quantity fields contain only numbers.');
	}
	else
	{
		document.form1.submit();
	}

}


function LoadPhoto(picture,caption,PicNumber) {

	document.theimg.src = "http://www.eclipseawards.com/awards/highres/" + picture;
	//document.getElementById("Caption").innerHTML =  caption + "&nbsp;";
	
	pic = document.getElementById('PhotoOne')
	pic.className="pictureoff"
	
	pic = document.getElementById('PhotoTwo')
	if (pic != null)
	{
	pic.className="pictureoff"
	}
	
	
	pic = document.getElementById('PhotoThree')
	if (pic != null)
	{
	pic.className="pictureoff"
	}
	
	
	pic = document.getElementById('PhotoFour')
	if (pic != null)
	{
	pic.className="pictureoff"
	}
	
	
	pic = document.getElementById('PhotoFive')
	if (pic != null)
	{
	pic.className="pictureoff"
	}

	
	
	pic = document.getElementById(PicNumber)
	pic.className="pictureon"

}

function MoveLayer()
{

	imgobj = new Image();
	imgobj.src = document.theimg.src;
	var imgh = 585+imgobj.height;

	
	//document.getElementById("Layer1").style.top = imgh;
	//document.getElementById("Layer1").style.visibility = "visible";

}

function ShowLargePhoto(){
xloc = Math.floor((screen.width/2) - (480/2));
yloc = Math.floor((screen.height/2) - (640/2));
mywin = window.open('product_highres.asp?file='+document.theimg.src,'viewpic','width=480,height=640,top='+yloc+',left='+xloc+', resize=no,scrollbars=no');
mywin.focus();
} 
 
function AddToCart(){

	var numproducts,totalqty
	numproducts = document.productform.ProductCount.value;
	
	var x, validate
	x=1
	validate=true;
	totalqty = 0;
	
	while (x<=numproducts)
	{
		ProductQty =  eval("document.productform.Qty" + x + ".value");
		
		if (!IsNumeric(ProductQty))
		{
			alert('One or more Quantity fields do not contain a number.  Please enter a value of 0 or greater.');
			validate=false;
		}else
		{
			totalqty = totalqty + ProductQty;
		}
		
		x=x+1
	}
	
	if (totalqty <= 0)
	{
		alert('Please enter a quantity greater than zero for a product option above.');
	}
	
	if ((validate==true) && (totalqty > 0))
	{
		document.productform.submit();	
	}
} 
	
	
function IsNumeric(sText)
{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
}


