function selectAllCheckBoxes(num, chkSetId, chkController)
{
	var chk = true;
	
	if(chkController.checked)
	{
		chk = true;
	} else {
		chk = false;
	}
	
	for(var i=0; i<num; i++)
	{
		document.getElementById(chkSetId+"["+i+"]").checked = chk;
	}
}


function popUp(title, fullImagePath)
{
	var width = 800;
    var height = 800;
	var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
	//alert(title+fullImagePath);
	var url="/viewImage.php?imageFullPath="+fullImagePath+"&title="+title;
	
	var attributes = "width=250, height=250, left="+left+",top="+top+", scrollbars=no, menubar=no, resizable=no, location=no, toolbar=no, status=no";
	
	window.open(url, "", attributes);
}

function isValidInt(myNumStr) {
		var myStr = '0123456789';
		var myChar;
		for (i=0; i< myNumStr.length; i++) {
			myChar = myNumStr.substring(i,i+1);
			if (myStr.indexOf(myChar) == -1) {
				return false;
			}
		}
		return true;
	} // end fn



function chkProd(){
	
	if(document.form1.quantity.value==""){
	alert("Please Give Quantity.");
	document.form1.quantity.focus();
	return false;		
	}else
	if(!isValidInt(document.form1.quantity.value)){
	alert("Please enter valid Quantity.");
	document.form1.quantity.value="";
	document.form1.quantity.focus();
	return false;		
	}else
	return true;	
}


function verfyCheckout(){
	
	if(document.checkoutForm.firstName.value==""){
	alert("Please Enter First Name.");
	document.checkoutForm.firstName.focus();
	return false;		
	}else
	if(document.checkoutForm.lastName.value==""){
	alert("Please Enter Last Name.");
	document.checkoutForm.lastName.focus();
	return false;		
	}
	else
	if(document.checkoutForm.phone.value==""){
	alert("Please Enter Phone No.");
	document.checkoutForm.phone.focus();
	return false;		
	}
	else
	if(document.checkoutForm.email.value==""){
	alert("Please Enter Email Address.");
	document.checkoutForm.email.focus();
	return false;		
	}
	else
	if(document.checkoutForm.street.value==""){
	alert("Please Enter Street No.");
	document.checkoutForm.street.focus();
	return false;		
	}
	else
	if(document.checkoutForm.city.value==""){
	alert("Please Enter City.");
	document.checkoutForm.city.focus();
	return false;		
	}
	else
	if(document.checkoutForm.zip.value==""){
	alert("Please Enter Zip Code.");
	document.checkoutForm.zip.focus();
	return false;		
	}else
	if(document.checkoutForm.country.value==""){
	alert("Please Enter Country.");
	document.checkoutForm.country.focus();
	return false;		
	}else
	if(document.checkoutForm.street2.value==""){
	alert("Please Enter Shipping Street No.");
	document.checkoutForm.street2.focus();
	return false;		
	}
	else
	if(document.checkoutForm.city2.value==""){
	alert("Please Enter Shipping City.");
	document.checkoutForm.city2.focus();
	return false;		
	}
	else
	if(document.checkoutForm.zip2.value==""){
	alert("Please Enter Shipping Zip Code.");
	document.checkoutForm.zip2.focus();
	return false;		
	}else
	if(document.checkoutForm.country2.value==""){
	alert("Please Enter Shipping Country.");
	document.checkoutForm.country2.focus();
	return false;		
	}
	else
	return true;	
}


function confirmDelete(){//start function
		
		//numLength=document.frmCart.hdnTotal.value;
		bolFlag=true;
		
		if(bolFlag==true){
			bolCheck=confirm("Are you sure you want to delete the product?");
			if(bolCheck==false){
				return false;
			}
		}
		
		
		return true;
		
	}//end of function


function confirmCheckout(){//start function
		
		//numLength=document.frmCart.hdnTotal.value;
		bolFlag=true;
		
		if(bolFlag==true){
			bolCheck=confirm("Are you sure you want to checkout?");
			if(bolCheck==false){
				return false;
			}
		}
		
		
		return true;
		
	}//end of function


function copyBilling2Shipping()
{
		f = document.checkoutForm;
		
		if(f.chkSame.checked)
		{
			f.street2.value = f.street.value;
			f.city2.value = f.city.value;
			f.zip2.value = f.zip.value;
			f.state2.value = f.state.value;
			f.country2.value = f.country.value;
		}
}

