function isScroll() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  var totalHeight = document.body.offsetHeight;
  return totalHeight > myHeight
}

function chooseProd(s) {
	if(s.selectedIndex > 0) {
		goTo (s.options[s.selectedIndex].value);
	}
}

function goTo (l) {
	location.href=l;
}

function changeBg (el) {
	el.style.backgroundColor = '#ffecec';
}
function changeBgTr (el) {
	el.style.backgroundColor = 'white';
}

function movieWindow(urlImg, title, width, height) {   
	var width = parseInt(width);
	var height = parseInt(height);
	var width = (isNaN(width) ? 420 : width+20);
	var height = (isNaN(height) ? 420 : height+20);
 
	var Win = window.open('',"",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no, menubar=no, left=350, top=100' );
	Win.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>'+title+'</title></head><body style="background-color:navy" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">');
	
	Win.document.write('<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align=center><table bgcolor="white" style="padding:4px;border:silver 1px solid"><tr><td><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" SRC="'+urlImg+'" name="wmp" SHOWCONTROLS="1" SHOWDISPLAY="0" AutoStart="true"></embed></td></tr></table></td></tr></table>');
	Win.document.write('</body></html>');
	
};


function imageWindow(urlImg, title, width, height) {   
	var width = parseInt(width);
	var height = parseInt(height);
	var width = (isNaN(width) ? 420 : width+20);
	var height = (isNaN(height) ? 420 : height+20);
 
	var Win = window.open('',"",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no, menubar=no, left=350, top=100' );
	Win.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>'+title+'</title></head><body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">');
	
	Win.document.write('<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td align=center><table style="padding:4px;border:silver 1px solid"><tr><td><a href="javascript:self.close();"><img src="'+urlImg+'" alt="" border="0"></a></td></tr></table></td></tr></table>');
	Win.document.write('</body></html>');
	
};

function win(url, title, width, height) {   
	var width = parseInt(width);
	var height = parseInt(height);
	var width = (isNaN(width) ? 420 : width+20);
	var height = (isNaN(height) ? 420 : height+20);
 
	var Win = window.open(url,"",'width=' + width + ',height=' + height + ',resizable=0,scrollbars=no, menubar=no, left=350, top=100' );
	
};

function checkEmailAddress(field) {
	var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,4}))$)\b/gi);
	
	if (goodEmail){
	  return true
	} else {
    field.focus()
    field.select()
    return false
  }
}
