var flashCount;
var myHeight = 0;
var myWidth = 0;


function ValidateQuantity(itemID)
{
 if (parseInt(document.getElementById(itemID).value, 10) > parseInt(document.getElementById('max' + itemID).value, 10))
  document.getElementById(itemID).value = (document.getElementById('max' + itemID).value > 0 ? document.getElementById('max' + itemID).value : 1);
}

function alertSize()
{
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
//  window.alert( 'Width = ' + myWidth );
//  window.alert( 'Height = ' + myHeight );
}

function CheckPassword()
{
 flashCount = 0;
 if (document.getElementById('Password').value != document.getElementById('ConfirmPassword').value)
 {
  document.getElementById('passwordMatch').innerHTML = 'Passwords do not match';
	FlashConfirmPassword();
 }
 else
  document.getElementById('passwordMatch').innerHTML = '';
}

function FlashConfirmPassword()
{
 if (flashCount % 2 == 0)
  document.getElementById('passwordMatch').style.color = '#CCCCCC';
 else
  document.getElementById('passwordMatch').style.color = '#990000';
	
 flashCount++;

 if (flashCount <= 7)
  window.setTimeout('FlashConfirmPassword()', 150);
}
