function addit()
{
var articleamt;
var total;
var bonus;
var arcount=document.homeForm1.articlescount.value;
////alert("Articles Count:"+document.homeForm1.articlescount.value)
////alert("Rating:"+document.homeForm1.rating.value)
//alert("Grade:"+document.homeForm1.grade.value)




if(document.homeForm1.grade.value=='A+')
{
	
	if(arcount<=10)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("Article Type: Short");
			articleamt=100;
			bonus=0;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("Article Type: Long");
			articleamt=200;
			bonus=0;
		}
	}
	else
	{

	
	if(document.homeForm1.rating.value==3)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			////alert("A+:3:Short");
			articleamt=110;
		}
		if(document.homeForm1.articletype.value=='L')
		{
//			//alert("A+:3:Long");
			articleamt=220;
		}
	}
	if(document.homeForm1.rating.value==4)
	{
		if(document.homeForm1.articletype.value=='S')
		{
//			//alert("A+:4:Short");
			articleamt=120;
		}
		if(document.homeForm1.articletype.value=='L')
		{
//			//alert("A+:4:Long");
			articleamt=240;
		}
	}
	if(document.homeForm1.rating.value==5)
	{
		if(document.homeForm1.articletype.value=='S')
		{
//			////alert("A+:5:Short");
			articleamt=130;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			////alert("A+:5:Long");
			articleamt=260;
		}
	}
	if(arcount<50 )
	{
		bonus=0;
		////alert("Bonus:0");
	}
	if(arcount>50 && arcount<=100)
	{
		bonus=5;
		//alert("Bonus:5");
	}
	if(arcount>100 && arcount<=150)
	{
		bonus=10;
		//alert("Bonus:10");
	}
	if(arcount>150)
	{
		bonus=15;
		//alert("Bonus:15");
	}
	}

}


if(document.homeForm1.grade.value=='B+')
{
	
	if(arcount<=10)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("Article Type: Short");
			articleamt=80;
			bonus=0;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("Article Type: Long");
			articleamt=160;
			bonus=0;
		}
	}
	else
	{

	
	if(document.homeForm1.rating.value==3)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("B+:3:Short");
			articleamt=90;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("B+:3:Long");
			articleamt=180;
		}
	}
	if(document.homeForm1.rating.value==4)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("B+:4:Short");
			articleamt=100;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("A+:4:Long");
			articleamt=200;
		}
	}
	if(document.homeForm1.rating.value==5)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("A+:5:Short");
			articleamt=110;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("A+:5:Long");
			articleamt=220;
		}
	}
	if(arcount<50 )
	{
		bonus=0;
		//alert("Bonus:0");
	}
	if(arcount>50 && arcount<=100)
	{
		bonus=5;
		//alert("Bonus:5");
	}
	if(arcount>100 && arcount<=150)
	{
		bonus=10;
		//alert("Bonus:10");
	}
	if(arcount>150)
	{
		bonus=15;
		//alert("Bonus:15");
	}
	}

}








	if(document.homeForm1.grade.value=='B')
{
	
	if(arcount<=10)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("Article Type: Short");
			articleamt=70;
			bonus=0;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("Article Type: Long");
			articleamt=140;
			bonus=0;
		}
	}
	else
	{

	
	if(document.homeForm1.rating.value==3)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("A+:3:Short");
			articleamt=80;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("A+:3:Long");
			articleamt=160;
		}
	}
	if(document.homeForm1.rating.value==4)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("A+:4:Short");
			articleamt=90;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("A+:4:Long");
			articleamt=180;
		}
	}
	if(document.homeForm1.rating.value==5)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("A+:5:Short");
			articleamt=100;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("A+:5:Long");
			articleamt=200;
		}
	}
	if(arcount<50 )
	{
		bonus=0;
		//alert("Bonus:0");
	}
	if(arcount>50 && arcount<=100)
	{
		bonus=5;
		//alert("Bonus:5");
	}
	if(arcount>100 && arcount<=150)
	{
		bonus=10;
		//alert("Bonus:10");
	}
	if(arcount>150)
	{
		bonus=15;
		//alert("Bonus:15");
	}
	}

}

if(document.homeForm1.grade.value=='C')
{
	
	if(arcount<=10)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("Article Type: Short");
			articleamt=60;
			bonus=0;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("Article Type: Long");
			articleamt=120;
			bonus=0;
		}
	}
	else
	{

	
	if(document.homeForm1.rating.value==3)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("C:3:Short");
			articleamt=70;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("C:3:Long");
			articleamt=140;
		}
	}
	if(document.homeForm1.rating.value==4)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("C:4:Short");
			articleamt=80;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("C:4:Long");
			articleamt=160;
		}
	}
	if(document.homeForm1.rating.value==5)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("C:5:Short");
			articleamt=100;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("C:5:Long");
			articleamt=200;
		}
	}
	if(arcount<50 )
	{
		bonus=0;
		//alert("Bonus:0");
	}
	if(arcount>50 && arcount<=100)
	{
		bonus=5;
		//alert("Bonus:5");
	}
	if(arcount>100 && arcount<=150)
	{
		bonus=10;
		//alert("Bonus:10");
	}
	if(arcount>150)
	{
		bonus=15;
		//alert("Bonus:15");
	}
	}

}







if(document.homeForm1.grade.value=='A')
{
	
	if(arcount<=10)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("Article Type: Short");
			articleamt=90;
			bonus=0;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("Article Type: Long");
			articleamt=180;
			bonus=0;
		}
	}
	else
	{

	
	if(document.homeForm1.rating.value==3)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("A :3:Short");
			articleamt=100;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("A:3:Long");
			articleamt=200;
		}
	}
	if(document.homeForm1.rating.value==4)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("A:4:Short");
			articleamt=110;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("A:4:Long");
			articleamt=220;
		}
	}
	if(document.homeForm1.rating.value==5)
	{
		if(document.homeForm1.articletype.value=='S')
		{
			//alert("A:5:Short");
			articleamt=120;
		}
		if(document.homeForm1.articletype.value=='L')
		{
			//alert("A:5:Long");
			articleamt=240;
		}
	}
	if(arcount<50 )
	{
		bonus=0;
		//alert("Bonus:0");
	}
	if(arcount>50 && arcount<=100)
	{
		bonus=5;
		//alert("Bonus:5");
	}
	if(arcount>100 && arcount<=150)
	{
		bonus=10;
		//alert("Bonus:10");
	}
	if(arcount>150)
	{
		bonus=15;
		//alert("Bonus:15");
	}
	}

}

total=articleamt*arcount;
var finalbonus=total*(bonus/100);
document.homeForm1.bonus.value=bonus+"%";
document.homeForm1.total.value=total+finalbonus;
//alert("Amount:"+total);

////alert("Bonus:"+document.homeForm1.bonus.value)
////alert(document.homeForm1.total.value)
//= parseInt(document.homeForm1.a.value) + parseInt(document.homeForm1.b.value)
}
function clearform()
{
document.homeForm1.articlescount.value= " ";
//document.homeForm1.rating.value= " ";
//document.homeForm1.grade.value= " ";
document.homeForm1.bonus.value= " ";
document.homeForm1.total.value= " ";
}
function MM_jumpMenu(){
var slcd= document.getElementById("menu1").value;
 if(slcd=="B"){
 window.location="./Grade-B.php"; 
 }
 if(slcd=="B+"){
 window.location="./Grade-B+.php"; 
 }
 if(slcd=="A"){
 window.location="./Grade-A.php"; 
 }
 if(slcd=="A+"){
 window.location="./Grade-A+.php"; 
 }
 if(slcd=="C"){
 window.location="./Grade-C.php"; 
 }


}

function submitform()
	{
	
		document.homeForm1.action="./loginvalidate.php";
		document.homeForm1.submit();
	}
	function reFresh() {

 document.f1.submit();
 }
	function submitform()
	{
		
		document.homeForm1.submit();
	}
	function search1()
	{
		
		document.search1.submit();
	}
	
	
	
	function reFresh() {

 document.f1.submit();
 }

var win_popup = null;

function openWindow( url, name, params, w, h )
{
      var ah = window.availHeight;
      var aw = window.availWidth;

      var l = (aw - w) / 2;
      var t = (ah - h) / 2;

      params += params == "" ? "" : ",";
      params += "left=0,top=0,height="+ah+",width="+aw;

      //close previous opened popup
      if (win_popup && win_popup.open && !win_popup.closed)
      {
         win_popup.close();
      }
      //---
      win_popup = window.open( "", name, params );
      win_popup.location.href = url;

}
function submitform()
	{
				document.homeForm1.submit();
	}
	
function price(e)
	{
 var pay= document.form2.checkpay;
 var total=document.getElementById("total").value;
 
  var j=0;
 for(var i=0;i<pay.length;i++){
 if(pay[i].checked){
 j++;
 }
 }
 
 document.getElementById("total").innerHTML=5400*parseInt(j);
 document.getElementById("discount").innerHTML=2700*parseInt(j);
 	}
	
