function submitForm(message,firstname,lastname,email)
{
	new Ajax.Request('../pages/thankyou_form_process.php',
	  {
		method:'get',
		parameters: {question: message, fname: firstname, lname: lastname, email: email},

		onSuccess: function(transport)
		{
		  var response = transport.responseText;
		  if (response == "FAIL")
		  {
		  	alert(response);
		  }
		  else
		  {
		  	$('thankyou_form').style.display = 'none';
		  	$('thankyou_message').style.display = 'block';
		  }
		},

		onFailure: function()
		{
			alert('Something went wrong...')
		}

	  });


}

function submitFormContact(message,firstname,phone,email)
{
	new Ajax.Request('../pages/contact_form_process.php',
	  {
		method:'get',
		parameters: {question: message, fname: firstname, phone: phone, email: email},

		onSuccess: function(transport)
		{
		  var response = transport.responseText;
		  if (response == "FAIL")
		  {
		  	alert(response);
		  }
		  else
		  {
		  	$('cForm').style.display = 'none';
		  	$('cFormThankYou').style.display = 'block';
		  }
		},

		onFailure: function()
		{
			alert('Something went wrong...')
		}

	  });


}

function createCookie() {
	$('animateMax').value = "1";
}

function readCookie() {
	if ($('animateMax').value == "1")
	{
		$('max_cookie').src="../images/maximize1.gif";
	}
}

function update_name(aName,templateID)
{
	$('specialPNG').style.visibility="hidden";
	
	new Ajax.Request('template_'+templateID+'_ajax.php',
	  {
		method:'get',
		parameters: {_fullname: aName},

		onSuccess: function(transport)
		{
		  var response = transport.responseText;
		  var rand_no = Math.random();
		  if (response == "FAIL")
		  {
		  	alert(response);
		  }
		  else
		  {
		  	//alert(response)
		  	if (templateID == 3)
		  	{
		  		if (IE6)
		  		{		  		
		  			$('specialPNG').style.background = "url('"+ response + "?"+rand_no+"') no-repeat top left";
		  			$('specialPNG').style.visibility="visible";
		  		}
		  		else
		  		{  		
		  			$('photoMask3').style.background = "url('"+ response + "?"+rand_no+"') no-repeat top left";
		  		}
		  	}
		  	else
		  	{
				$('photoMask3').style.background = "url('"+ response + "?"+rand_no+"') no-repeat top left";
			}
			$('_fullname').value = aName;
			$('personalizeClickEditText').style.background='';
			$('personalizeClickEditText').onmouseout=function(){$('personalizeClickEditText').style.border='';$('personalizeClickEditText').style.background='';};			
			$('personalizeClickEditText').onmouseover=function(){$('personalizeClickEditText').style.border='1px solid #cc3333';$('personalizeClickEditText').style.background='url(../images/btn_edit_text.gif) no-repeat 2px 0px';};
		  }
		},

		onFailure: function()
		{
			alert('something went wrong ...')
		}

	  });
}


function update_businesscard(cardNumber,textboxNumber,text,side)
{
	$('specialPNG').style.visibility="hidden";
	
	new Ajax.Request('template_8_ajax.php',
	  {
		method:'get',
		parameters: {cardNumber:cardNumber,textboxNumber:textboxNumber,text:text,side:side},

		onSuccess: function(transport)
		{
		  var response = transport.responseText;
		  var rand_no = Math.random();
		  if (response == "FAIL")
		  {
		  	alert(response);
		  }
		  else
		  {
		  	//alert(response)
			
			$('theshade').style.background = "url('/customtemp/"+ response + "?"+rand_no+"') no-repeat top left";

		  	if (templateID == 3)
		  	{
		  		if (IE6)
		  		{		  		
		  			$('specialPNG').style.background = "url('"+ response + "?"+rand_no+"') no-repeat top left";
		  			$('specialPNG').style.visibility="visible";
		  		}
		  		else
		  		{  		
		  			$('photoMask3').style.background = "url('"+ response + "?"+rand_no+"') no-repeat top left";
		  		}
		  	}
		  	else
		  	{
				$('photoMask3').style.background = "url('"+ response + "?"+rand_no+"') no-repeat top left";
			}
			$('_fullname').value = aName;
			$('personalizeClickEditText').style.background='';
			$('personalizeClickEditText').onmouseout=function(){$('personalizeClickEditText').style.border='';$('personalizeClickEditText').style.background='';};			
			$('personalizeClickEditText').onmouseover=function(){$('personalizeClickEditText').style.border='1px solid #cc3333';$('personalizeClickEditText').style.background='url(../images/btn_edit_text.gif) no-repeat 2px 0px';};
		  }
		},

		onFailure: function()
		{
			alert('something went wrong ...')
		}

	  });
}





function getDescription(part,desc)
{
	arrD = desc.split('\|');
	
	
	if (arrD[part]==undefined)
	{
	
		return "";
	}
	else
	{

		return arrD[part];
	}

}

function verifyDuplicateUsername(username)
{
	new Ajax.Request('verify_email_exists.php',
	  {
		method:'get',
		parameters: {email: username},

		onSuccess: function(transport)
		{

			var response = transport.responseText;

		  if (response == "DUPLICATE")
		  {
		  document.getElementById("checkoutinfoRegisterDuplicate").style.display = "block";
			document.getElementById("create_email").style.backgroundColor = "#cc3333";
			 document.getElementById("registerButton").style.visibility = "hidden";
		  }
		  else
		  {
		  	document.getElementById("checkoutinfoRegisterDuplicate").style.display = "none";
			document.getElementById("create_email").style.backgroundColor = "#fff";
			document.getElementById("registerButton").style.visibility = "visible";
		  }
		},

		onFailure: function()
		{
			alert('Something went wrong...')
		}

	  });

	return false;
}


function show_larger_description(desc,comp_number)
{

	//alert(desc +'==='+comp_number)
	new Ajax.Request('template_back_description_'+comp_number+'_pop_up_ajax.php',
	{
	method:'get',
	parameters: {_description: desc},

	onSuccess: function(transport)
	{
	  var response = transport.responseText;
	  var rand_no = Math.random();
	  if (response == "FAIL")
	  {
		alert(response);
	  }
	  else
	  {
	  	//alert(response)
	  	//new Effect.Appear($('pop_up_description'), {duration:.2, from:0, to:1});
		$('pop_up_description').style.background = "url('"+ response + "?"+rand_no+"') no-repeat top left";
		$('pop_up_description').style.visibility = "visible";
		
	  }
	},

	onFailure: function()
	{
		alert('something went wrong ...')
	}

	});
}

function constrainByCropper(xDragger, yDragger, widthDragger ,heightDragger, xCropper, yCropper, widthCropper, heightCropper , xBleed, yBleed)
{
	//alert(xDragger + " " + xCropper  + " " +  widthCropper  + " " +  widthDragger  + " " +  xBleed  + " " + yDragger  + " " +  yCropper  + " " +  heightCropper  + " " +  heightDragger  + " " +  yBleed);
	//return vars
	returnY = yDragger;
	returnX = xDragger;

	//Y
	if (yDragger > yCropper)
	{
		returnY = yCropper;
		//$('notice').innerHTML = returnY + " if: ";
	}
	else if ((yDragger + heightDragger) < (yCropper + heightCropper))
	{
		returnY = yCropper - (heightDragger - heightCropper);		
		//$('notice').innerHTML = returnY + " else if :" + yCropper +"-(" +heightDragger+" - "+heightCropper +")";	
	}
	else
	{
		returnY = yDragger;
		//$('notice').innerHTML = returnY + " else";
	}

	//X
	if (xDragger > xCropper - xBleed)
	{
		returnX = xCropper;
		//$('notice').innerHTML = returnX + " if: " + xCropper;
	}
	else if ((xDragger + widthDragger) < (xCropper + widthCropper + (xBleed * 2)))
	{
		returnX = xCropper - (widthDragger - widthCropper)
		//$('notice').innerHTML = returnX + " else if :" + xCropper +"-(" +widthDragger+" - "+widthCropper +")";
	}
	else
	{
		returnX = xDragger;
		//$('notice').innerHTML = returnX + " else";
	}

	return [returnX, returnY];
}

function zoom(point)
{

	hsbImage = $('uploaded_pic_'+$('_currentSelection_').value);
	hsbCropper = $('divCropper_'+$('_currentSelection_').value);

	xBleed = 17;
	yBleed = 3;

	// update the hidden field point
	$('point_'+$('_currentSelection_').value).value = point;

	//current image width & height
	cWidth = parseInt(hsbImage.width);
	cHeight = parseInt(hsbImage.height);

	//Work out the new scale
	point = 1 + point;

	hsbDimensions = $('imgDimensions_'+$('_currentSelection_').value).value.split('_');
	//alert($('imgDimensions_'+$('_currentSelection_').value).value);

	//set new size
	hsbImage.height  = parseInt(hsbDimensions[1]) * point;
	hsbImage.width  = parseInt(hsbDimensions[0]) * point;

	//update the hidden field with width and height
	$('imgWidth_'+$('_currentSelection_').value).value 	= hsbImage.width;
	$('imgHeight_'+$('_currentSelection_').value).value 	= hsbImage.height;

	if (point == 1)
	{
		hsbImage.style.top = "0";
		hsbImage.style.left = "0";
	}
	else if (point < 2)
	{
	  	if (cWidth < hsbImage.width) 
	  	{  		
		  	hsbImage.style.top = (parseInt(hsbImage.style.top) -  (hsbImage.height - cHeight)/5)  + 'px';
		  	hsbImage.style.left = (parseInt(hsbImage.style.left) -  (hsbImage.width - cWidth)/5)  + 'px';
		  	
		  	//$('notice').innerHTML =  "cWidth:"+cWidth+"<br><br>"+$('notice').innerHTML;
	  		//$('notice').innerHTML = "hsbImage.width:"+hsbImage.width + "<br>"+$('notice').innerHTML;
		  	//$('notice').innerHTML = "hsbImage.style.left:"+hsbImage.style.left + "<br>"+$('notice').innerHTML;
		  	//$('notice').innerHTML = "hsbImage.style.top:"+hsbImage.style.top + "<br>"+$('notice').innerHTML;
		  	//$('notice').innerHTML = "point:"+point+ "<br>"+$('notice').innerHTML;
	   	}
	   	
	   	if (cWidth >= hsbImage.width) 
	   	{
	   		pLeft = hsbImage.style.left;
	   		pLeft = pLeft.replace("px","");
	   		if ( pLeft < 0 )
	   		{		  		
		  		leftCoor = (parseInt(hsbImage.style.left) +  (cWidth - hsbImage.width)/5);
		  		if ( leftCoor > 0 )
		  		{
		  			hsbImage.style.left = 0;
		  		}
		  		else
		  		{			  			
		  			hsbImage.style.left = (parseInt(hsbImage.style.left) +  (cWidth - hsbImage.width)/5)   + 'px';
		  		}
		  	}
		  	
		  	pTop = hsbImage.style.top;
			pTop = pTop.replace("px","");
	   		if ( pTop < 0 )
			{
				topCoor = (parseInt(hsbImage.style.top) +  (cHeight - hsbImage.height)/5);
				if ( topCoor > 0 )
				{
					hsbImage.style.top = 0;
				}
				else
				{					
					hsbImage.style.top = (parseInt(hsbImage.style.top) +  (cHeight - hsbImage.height)/5)  + 'px';	
				}
		  	}
		  	
		  	
		  	//$('notice').innerHTML =  "cWidth:"+cWidth+"<br><br>"+$('notice').innerHTML;
			//$('notice').innerHTML = "hsbImage.width:"+hsbImage.width + "<br>"+$('notice').innerHTML;
		  	//$('notice').innerHTML = "hsbImage.style.left:"+hsbImage.style.left + "<br>"+$('notice').innerHTML;
		  	//$('notice').innerHTML = "hsbImage.style.top:"+hsbImage.style.top + "<br>"+$('notice').innerHTML;
		  	
	   	}
	}

	//Make sure we are within the box
	iLeft = parseInt(hsbCropper.style.left) - parseInt(hsbImage.style.left);
	//alert(iLeft)
	iTop = parseInt(hsbCropper.style.top) - parseInt(hsbImage.style.top);
	iCropperWidth = parseInt(hsbCropper.style.width);
	iCropperHeight = parseInt(hsbCropper.style.height);





	if (parseInt(hsbImage.style.left) < (parseInt(hsbCropper.style.left) - parseInt(hsbImage.width) + parseInt(hsbCropper.style.width))){
		//There is a crop discrepancy on the right hand side of the image
		//try to slide the image back to an acceptable position
		//left position calculated as cropperleft - imagewidth + cropperwidth
		hsbImage.style.left = (parseInt(hsbCropper.style.left) - parseInt(hsbImage.width) + parseInt(hsbCropper.style.width)) + 'px';
	}

	if (parseInt(hsbImage.style.top) < (parseInt(hsbCropper.style.top) - parseInt(hsbImage.height) + parseInt(hsbCropper.style.height))){
		//there is a crop discrepancy to the base of the image
		//try to move the image down slightly
		//top position calculated as croppertop - imageheight + cropperheight
		hsbImage.style.top = (parseInt(hsbCropper.style.top) - parseInt(hsbImage.height) + parseInt(hsbCropper.style.height)) + 'px';
	}	

   	//make sure the dragger is in place
	hsbDragger = $('divDragger_'+$('_currentSelection_').value);

	hsbDragger.style.width = hsbImage.width + 'px';
	hsbDragger.style.height = hsbImage.height + 'px';
	hsbDragger.style.top = hsbImage.style.top;
	hsbDragger.style.left = hsbImage.style.left;

	// update the hidden field of the x and y coordinate of the image
	$('x_'+$('_currentSelection_').value).value = hsbImage.style.left;
	$('y_'+$('_currentSelection_').value).value = hsbImage.style.top;


}

function dragged (oValue) {

	hsbDragger 	= $('divDragger_'+$('_currentSelection_').value);
	hsbImage 	= $('uploaded_pic_'+$('_currentSelection_').value);
	hsbX 		= $('x_'+$('_currentSelection_').value);
	hsbY		= $('y_'+$('_currentSelection_').value);

	hsbX.value			= hsbDragger.style.left;
	hsbY.value			= hsbDragger.style.top;
	hsbImage.style.top 	=  hsbDragger.style.top;
	hsbImage.style.left =  hsbDragger.style.left;
}
	
function update_fullname(x)
{
	// insert name
	var letter=document.getElementById(x).value;
	$("insert_name").innerHTML = letter;

	// update the font type
	var f=document.getElementById('selected_font');
	$("insert_name").style.fontFamily = f.options[f.selectedIndex].text;
}

function update_font(x)
{
	var f=document.getElementById(x);
	$("insert_name").style.fontFamily = f.options[f.selectedIndex].text;
}

function getInfo()
{
	var x;
	var y;
	var imgW;
	var imgH;
	var infoDisplay;

	x = $('x_'+$('_currentSelection_').value).value;
	y = $('y_'+$('_currentSelection_').value).value;

	imgW = $('imgWidth_'+$('_currentSelection_').value).value;
	imgH = $('imgHeight_'+$('_currentSelection_').value).value;

	divDX = $('divDragger').style.left;
	divDY = $('divDragger').style.top;
	
	divW = $('divDragger').style.width;
	divH = $('divDragger').style.height;

	dimensions = $('imgDimensions_'+$('_currentSelection_').value).value;
	
	photo = $('_photoFileName').value;

	pointer = $('point_'+$('_currentSelection_').value).value;
	
	gs = $('_grayscale').value;

	ratio = $('_ratio').value;

	infoDisplay = "&nbsp;imgWidth: " + imgW + "<br>&nbsp;imgHeight:" + imgH;
	
	infoDisplay += "<br>&nbsp;imgDimensions: " + dimensions;
	
	infoDisplay += "<br>&nbsp;Coordinate X: " + x + "<br>&nbsp;Coordinate Y:" + y;
	
	infoDisplay += "<br>&nbsp;Dragger Left: " + divDX + "<br>&nbsp;Dragger Top:" + divDY;
	
	infoDisplay += "<br>&nbsp;Dragger Width: " + divW + "<br>&nbsp;Dragger Height:" + divH;
	
	infoDisplay += "<br>&nbsp;Point: " + pointer;
	
	infoDisplay += "<br>&nbsp;Ratio: " + ratio;
	
	infoDisplay += "<br>&nbsp;Grayscale: " + gs;
	
	infoDisplay += "<br>&nbsp;photo: " + photo;
	
	$('notice').innerHTML = infoDisplay;
	$('notice').style.visibility = "visible";
}

function submit_form_lb(target, w)
{
	lbWin=window.open('add_photo_lightbox.php','LightBox','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=450,height=200');
	lbWin.close();
	
	//w.close();

	// send to the default url for processing
	if (target == 0)
	{
  		document.hsb.submit();
  	}
  	else if (target != 0) // send to the default specified url for processing
  	{
  		document.hsb.action = target + ".php";
  		document.hsb.submit();
  	}
}




function submit_form(target)
{
	// send to the default url for processing
	if (target == 0)
	{
  		document.hsb.submit();
  	}
  	else if (target != 0) // send to the default specified url for processing
  	{
  		document.hsb.action = target + ".php";
  		document.hsb.submit();
  	}
}

function submit_form_secure(target)
{
	// send to the default url for processing
	if (target == 0)
	{
  		document.hsb.submit();
  	}
  	else if (target != 0) // send to the default specified url for processing
  	{
  		document.hsb.action = "https://www.headshotbox.com/pages/" + target + ".php";
		//document.hsb.action = "http://localhost/pages/" + target + ".php";
  		//document.hsb.action = target + ".php";
  		document.hsb.submit();
  	}
}

function change_template(target,templateID)
{

	
	$('_templateID').value 		= templateID;
	document.hsb.action 		= target + ".php";
	document.hsb.submit();

}

function hsb_trim(s) 
   {
   	// Remove leading spaces and carriage returns
   	while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))
   	 { s = s.substring(1,s.length); }
     
   	// Remove trailing spaces and carriage returns
 while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || (s.substring(s.length-1,s.length) == '\r'))
   	 { s = s.substring(0,s.length-1); }
     
   	return s;
   }



function change_content(target,my_data)
{

	
	
	if ($('my_content').value == 'DESCRIPTION')
	{
		$('_description').value 	= hsb_trim(my_data);
	}
	else
	{
		$('_fullname').value 		= my_data;
	}
	
	document.hsb.action 		= target + ".php";
	document.hsb.submit();

}

function change_name(target,fullname,photo)
{
	$('_fullname').value 		= "" + fullname;

	
	document.hsb.action 		= target + ".php";
	document.hsb.submit();

}

function change_grayscale(target)
{
	document.hsb.action 		= target + ".php";
	document.hsb.submit();
}

function change_rotation(target)
{
	//$('_photoFileName').value 	= photo;
	//$('_rotation').value		= degree;
	//$('_grayscale').value		= gs;
	
	document.hsb.action 		= target + ".php";
	document.hsb.submit();

}

function checkRegisterRequired()
{
	var status = true;
	
	if ($('firstname').value == "")
	{
		$('firstname').style.backgroundColor = "#cc3333";
		status = false;
	}
	
	if ($('lastname').value == "")
	{
		$('lastname').style.backgroundColor = "#cc3333";
		status = false;
	}
	
	if ($('create_email').value == "")
	{
		$('create_email').style.backgroundColor = "#cc3333";
		status = false;
	}

	if ($('create_password').value == "")
	{
		$('create_password').style.backgroundColor = "#cc3333";
		status = false;
	}

	if ($('create_password2').value == "")
	{
		$('create_password2').style.backgroundColor = "#cc3333";
		status = false;
	}
	
	return status;
}

function checkLoginRequired(extra)
{
	if (extra == "populate")
	{
		var status = true;

		if ($('login_email').value == "")
		{
			$('login_email').style.backgroundColor = "#cc3333";
			status = false;
		}

		if ($('login_password').value == "")
		{
			$('login_password').style.backgroundColor = "#cc3333";
			status = false;
		}
		
		if (status == true)
		{
			document.hsb.action 		= "login_process.php";
			//document.hsb.submit();
		}
	}
	else
	{
		var status = true;

		if ($('login_email').value == "")
		{
			$('login_email').style.backgroundColor = "#cc3333";
			status = false;
		}

		if ($('login_password').value == "")
		{
			$('login_password').style.backgroundColor = "#cc3333";
			status = false;
		}		
	}

	
	return status;
}

function populateBilling(status)
{
	if (status == 'yes')
	{
		$('billing_firstname').value = $('shipping_firstname').value
		$('billing_lastname').value = $('shipping_lastname').value
		$('billing_address1').value = $('shipping_address1').value
		$('billing_address2').value = $('shipping_address2').value
		$('billing_city').value = $('shipping_city').value
		$('billing_state').value = $('shipping_state').value
		$('billing_zipcode').value = $('shipping_zipcode').value
		$('billing_phone').value = $('shipping_phone').value
		
		$('same_as_shipping').value = 'no';
		$('same_as_shipping').checked = true;	
	}
	else
	{
		$('billing_firstname').value = ""
		$('billing_lastname').value = ""
		$('billing_address1').value = ""
		$('billing_address2').value = ""
		$('billing_city').value = ""
		$('billing_state').value = ""
		$('billing_zipcode').value = ""
		$('billing_phone').value = ""
		
		$('same_as_shipping').value = 'yes';
		$('same_as_shipping').checked = false;
	
	}

	//return false;
}

function verifyInitial(initial)
{
	if (initial.length < 2)
	{
		$('initialError').style.display="block";
		return false;
	}
	else
	{
		return true;
	}
}

function verifyInitial2(initial)
{
	if (initial.length < 2)
	{
		$('initialError').style.visibility="visible";
		return false;
	}
	else
	{
		return true;
	}
}

function verfyCheckoutInfo()
{
	var proceed = true;
	
	// this is the NEW REGISTRANT section
	if ($('existing_customer').value == "false")
	{
		// require to register if they are not returning customer
		if ($('create_email').value == "")
		{
			$('create_email').style.backgroundColor="#cc3333";
			proceed = false;
		}

		// require to register if they are not returning customer
		if ($('create_password').value == "")
		{
			$('create_password').style.backgroundColor="#cc3333";
			proceed = false;
		}
		
		// require to register if they are not returning customer
		if ($('create_password2').value == "")
		{
			$('create_password2').style.backgroundColor="#cc3333";
			proceed = false;
		}
	}	
	
	// this is the SHIPPING section
	if ($('shipping_firstname').value == "")
	{
		$('shipping_firstname').style.backgroundColor="#cc3333";
		proceed = false;
	}
	
	if ($('shipping_lastname').value == "")
	{
		$('shipping_lastname').style.backgroundColor="#cc3333";
		proceed = false;
	}	

	if ($('shipping_address1').value == "")
	{
		$('shipping_address1').style.backgroundColor="#cc3333";
		proceed = false;
	}
	
	if ($('shipping_city').value == "")
	{
		$('shipping_city').style.backgroundColor="#cc3333";
		proceed = false;
	}

	if ($('shipping_state').value == "")
	{
		$('shipping_state').style.backgroundColor="#cc3333";
		proceed = false;
	}
	
	if ($('shipping_zipcode').value == "")
	{
		$('shipping_zipcode').style.backgroundColor="#cc3333";
		proceed = false;
	}
	
	// this is the BILLING section
	if ($('billing_firstname').value == "")
	{
		$('billing_firstname').style.backgroundColor="#cc3333";
		proceed = false;
	}
	
	if ($('billing_lastname').value == "")
	{
		$('billing_lastname').style.backgroundColor="#cc3333";
		proceed = false;
	}	

	if ($('billing_address1').value == "")
	{
		$('billing_address1').style.backgroundColor="#cc3333";
		proceed = false;
	}
	
	if ($('billing_city').value == "")
	{
		$('billing_city').style.backgroundColor="#cc3333";
		proceed = false;
	}

	if ($('billing_state').value == "")
	{
		$('billing_state').style.backgroundColor="#cc3333";
		proceed = false;
	}
	
	if ($('billing_zipcode').value == "")
	{
		$('billing_zipcode').style.backgroundColor="#cc3333";
		proceed = false;
	}

	// this is the CREDIT CARD section
	if ($('cc_fullname').value == "")
	{
		$('cc_fullname').style.backgroundColor="#cc3333";
		proceed = false;
	}
	
	if ($('cc_cardtype').value == "")
	{
		$('cc_cardtype').style.backgroundColor="#cc3333";
		proceed = false;
	}	

	if ($('cc_cardnumber').value == "")
	{
		$('cc_cardnumber').style.backgroundColor="#cc3333";
		proceed = false;
	}
	
	if ($('cc_exp_mm').value == "")
	{
		$('cc_exp_mm').style.backgroundColor="#cc3333";
		proceed = false;
	}

	if ($('cc_exp_yy').value == "")
	{
		$('cc_exp_yy').style.backgroundColor="#cc3333";
		proceed = false;
	}
	
	if (proceed == false)
	{
		$('checkoutinfoError').style.display="block";
	}
	
	return proceed;
}



 
function popup(url,name,windowWidth,windowHeight){
	myleft=(screen.width)?(screen.width-windowWidth)/2:100;
	mytop=(screen.height)?(screen.height-windowHeight)/2:100;
	properties = "width="+windowWidth+",height="+windowHeight+",scrollbars=yes, top="+mytop+",left="+myleft;
	window.open(url,name,properties)
}

function getInfo()
{
	curSelection = $('_currentSelection_').value;

	infoDisplay = "&nbsp;curSelection: " + curSelection;
	

	

	
	$('notice').innerHTML = infoDisplay;
	$('notice').style.visibility = "visible";
}

