function validation(fld)
{
  var d=document.form;
  
  if(d.printingtype.value =="")
 {
  alert("Please Select Printing Type");
  d.printingtype.focus();
  return false;
 }
 

 if(d.pname.value =="")
 {
  alert("Please Enter Product Name");
  d.pname.focus();
  return false;
 }
 


 
var a=document.form['prsize[]'];
var p=0;
	for(i=0;i<a.length;i++){
		if(a[i].checked){
			p=1;
		}
	}
	if (p==0){
		alert('please select at least one check box');
		return false;
	}
	
	//first
	
if(document.getElementById('check1').checked==true){
		
	


if(document.getElementById("bong1").value=="")
{
alert("Please Enter At Least One Quantity");
document.getElementById("bong1").focus();
return false;

}
if(document.getElementById("ping1").value=="")
{
alert("Please Enter At Least One Price");
document.getElementById("ping1").focus();
return false;

}
/*if(document.getElementById('hidden1').value>0){
for(a=0;a<document.getElementById('hidden1').value;a++)
{

hehe='qty1'+a;
hoho='price1'+a;


if(document.getElementById(hehe).value==""){
alert("Please Enter Quantity");
document.getElementById(hehe).focus();
return false;
}
if(document.getElementById(hoho).value==""){
alert("Please Enter Price");
document.getElementById(hoho).focus();
return false;
}
}
}*/
}


//second
if(document.getElementById('check2').checked==true){


if(document.getElementById("bong2").value=="")
{
alert("Please Enter At Least One Quantity");
document.getElementById("bong2").focus();
return false;

}
if(document.getElementById("ping2").value=="")
{
alert("Please Enter At Least One Price");
document.getElementById("ping2").focus();
return false;

}

/*if(document.getElementById('hidden2').value>0){

for(a=0;a<document.getElementById('hidden2').value;a++)
{
	
	
	hehe='qty2'+a;
	hoho='price2'+a;
	
	
	

if(document.getElementById(hehe).value=="")
{
alert("Please Enter Quantity");
document.getElementById(hehe).focus();
return false;

}
if(document.getElementById(hoho).value=="")
{
alert("Please Enter Price");
document.getElementById(hoho).focus();
return false;

}
	
	
}
	
}*/
	
	}

	//third
	
	if(document.getElementById('check3').checked==true){
		
	

if(document.getElementById("bong3").value=="")
{
alert("Please Enter At Least One Quantity");
document.getElementById("bong3").focus();
return false;

}
if(document.getElementById("ping3").value=="")
{
alert("Please Enter At Least One Price");
document.getElementById("ping3").focus();
return false;

}
/*if(document.getElementById('hidden3').value>0){

for(a=0;a<document.getElementById('hidden3').value;a++)
{
	
	
	hehe='qty3'+a;
	hoho='price3'+a;
	
	
	

if(document.getElementById(hehe).value=="")
{
alert("Please Enter Quantity");
document.getElementById(hehe).focus();
return false;

}
if(document.getElementById(hoho).value=="")
{
alert("Please Enter Price");
document.getElementById(hoho).focus();
return false;

}
	
}
	
}*/

	}
	
//fourth


if(document.getElementById('check4').checked==true){
		
	


if(document.getElementById("bong4").value=="")
{
alert("Please Enter At Least One Quantity");
document.getElementById("bong4").focus();
return false;

}
if(document.getElementById("ping4").value=="")
{
alert("Please Enter At Least One Price");
document.getElementById("ping4").focus();
return false;

}
/*if(document.getElementById('hidden4').value>0){

for(a=0;a<document.getElementById('hidden4').value;a++)
{
	
	
	hehe='qty4'+a;
	hoho='price4'+a;
	
	
	
if(document.getElementById(hehe).value=="")
{
alert("Please Enter Quantity");
document.getElementById(hehe).focus();
return false;

}
if(document.getElementById(hoho).value=="")
{
alert("Please Enter Price");
document.getElementById(hoho).focus();
return false;

}
	
}
	
}*/

	}

//fifth



if(document.getElementById('check5').checked==true){
		
	


if(document.getElementById("bong5").value=="")
{
alert("Please Enter At Least One Quantity");
document.getElementById("bong5").focus();
return false;

}

if(document.getElementById("ping5").value=="")
{
alert("Please Enter At Least One Price");
document.getElementById("ping5").focus();
return false;

}

/*if(document.getElementById('hidden5').value>0){

for(a=0;a<document.getElementById('hidden5').value;a++)
{
	
	
	hehe='qty5'+a;
	hoho='price5'+a;
	
	
	

if(document.getElementById(hehe).value=="")
{
alert("Please Enter Quantity");
document.getElementById(hehe).focus();
return false;

}
if(document.getElementById(hoho).value=="")
{
alert("Please Enter Price");
document.getElementById(hoho).focus();
return false;

}
	
}
	
}
*/
	}

//sixth


if(document.getElementById('check6').checked==true){

if(document.getElementById("bong6").value=="")
{
alert("Please Enter At Least One Quantity");
document.getElementById("bong6").focus();
return false;

}
if(document.getElementById("ping6").value=="")
{
alert("Please Enter At Least One Price");
document.getElementById("ping6").focus();
return false;

}
	}
	
if(document.getElementById('check7').checked==true){


if(document.getElementById("bong7").value=="")
{
alert("Please Enter At Least One Quantity");
document.getElementById("bong7").focus();
return false;

}
if(document.getElementById("ping7").value=="")
{
alert("Please Enter At Least One Price");
document.getElementById("ping7").focus();
return false;

}
}

if(document.getElementById('check8').checked==true){


if(document.getElementById("bong8").value=="")
{
alert("Please Enter At Least One Quantity");
document.getElementById("bong8").focus();
return false;

}
if(document.getElementById("ping8").value=="")
{
alert("Please Enter At Least One Price");
document.getElementById("ping8").focus();
return false;

}
}
if(document.getElementById('check9').checked==true){


if(document.getElementById("bong9").value=="")
{
alert("Please Enter At Least One Quantity");
document.getElementById("bong9").focus();
return false;

}
if(document.getElementById("ping9").value=="")
{
alert("Please Enter At Least One Price");
document.getElementById("ping9").focus();
return false;

}
}
if(document.getElementById('check10').checked==true){


if(document.getElementById("bong10").value=="")
{
alert("Please Enter At Least One Quantity");
document.getElementById("bong10").focus();
return false;

}
if(document.getElementById("ping10").value=="")
{
alert("Please Enter At Least One Price");
document.getElementById("ping10").focus();
return false;

}
}

if(document.getElementById('check11').checked==true){


if(document.getElementById("bong11").value=="")
{
alert("Please Enter At Least One Quantity");
document.getElementById("bong11").focus();
return false;

}
if(document.getElementById("ping11").value=="")
{
alert("Please Enter At Least One Price");
document.getElementById("ping11").focus();
return false;

}
}



	
	if((fld.value!="")) {
               
     
	   	   var maxWidth=100;
// height to resize large images to
var maxHeight=100;
// valid file types
var fileTypes=["gif","png","jpg","jpeg"];
// the id of the preview image tag
var outImage="previewField";
// what to display when the image is not valid
var defaultPic="spacer.gif";

/***** DO NOT EDIT BELOW *****/


var source=fld.value;
var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;
globalPic=new Image();
if (i<fileTypes.length) globalPic.src=source;
else {
globalPic.src=defaultPic;
alert("THAT IS NOT A VALID IMAGE\nPlease load an image with an extention of one of the following:\n\n"+fileTypes.join(", "));
return false;
}
  }	
	
}

function validatephone(xxxxx) {
	 var maintainplus = '';
 	var numval = xxxxx.value
 	if ( numval.charAt(0)=='+' ){ var maintainplus = '+';}
 	curphonevar = numval.replace(/[\\A-Za-z!"£$%^&*+_={};:'@#~,.¦\/<>?|`¬\]\[]/g,'');
 	xxxxx.value = maintainplus + curphonevar;
 	var maintainplus = '';
 	xxxxx.focus;
}