// JavaScript Document
onload = function()
{
	var h = 0;
	var l = 0;
	var ht = 0;
   var main = document.getElementById( 'main' );

   if( main.style.offsetHeight )
		h = main.style.offsetHeight;
	else if( main.style.pixelHeight )
		h = main.style.pixelHeight;
   else
		h = main.clientHeight;

   var left = document.getElementById( 'main-left' );

   if( left.style.offsetHeight )
		l = left.style.offsetHeight;
	else if( left.style.pixelHeight )
		l = left.style.pixelHeight;
   else
		l = left.clientHeight;

   var right = document.getElementById( 'main-right' );

   if( right.style.offsetHeight )
		r = right.style.offsetHeight;
	else if( right.style.pixelHeight )
		r = right.style.pixelHeight;
   else
		r = right.clientHeight;
		
	ht = Math.max(l, r, h );
	
	document.getElementById( 'main-left' ).style.height =  ht;
	document.getElementById( 'main-right' ).style.height =  ht;
	document.getElementById( 'main' ).style.height =  ht;

}

function validate()
{
	 var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
    var email_valid = false;
	 var doc = true;
	 var success = "You have requested a subscription to our Newsletter. Please click OK to confirm your subscription.";

	 if (document.subscribe.nl_email.value=="")
    {
	     document.getElementById( "msg" ).innerHTML = "Please Enter An Email Address";
		  document.getElementById( "button" ).innerHTML = "<input type='button' value='Ok' onClick=\"change();\">";
		  return false;		
	 }   
	 
	 if ( document.subscribe.nl_email.value.match(emailExp) )
    {
		  email_valid = true;
		  document.getElementById( "msg" ).innerHTML = success;
		  document.getElementById( "button" ).innerHTML = "<input type='button' value='Ok' onClick=\"subscribeTo();\">";
	 }

	 if ( email_valid == false )
	 {
	     document.getElementById( "msg" ).innerHTML = "Please Enter A Valid Email Address";
		  document.getElementById( "button" ).innerHTML = "<input type='button' value='Ok' onClick=\"change();\">";
		  return false;		
	 }
	 
}


function chkcontrol()
{
	var total=0;
	
	if( document.started.prod0.checked == true )
	{
		total = total + 1;
	}


	if( document.started.prod1.checked == true )
	{
		total = total + 1;
	}

	if( document.started.prod2.checked == true )
	{
		total = total + 1;
	}

	if( document.started.prod3.checked == true )
	{
		total = total + 1;
	}

	if( document.started.prod4.checked == true )
	{
		total = total + 1;
	}

	if( document.started.prod5.checked == true )
	{
		total = total + 1;
	}

	if( document.started.prod6.checked == true )
	{
		total = total + 1;
	}

	if( document.started.prod7.checked == true )
	{
		total = total + 1;
	}

	if( document.started.prod8.checked == true )
	{
		total = total + 1;
	}

	if( document.started.prod9.checked == true )
	{
		total = total + 1;
	}
	
	
	if(total > 4)
	{
		alert("Please Select only four products")
		document.started;
		return false;
	}

	document.getElementById("ckb").value = total;
}
