// JavaScript Document





//Copyright Peter Finch 2008

// used to attach POST data to a URL

//  URL: http://mentaljetsam.wordpress.com/2008/06/02/using-javascript-to-post-data-between-pages/

function postwith (to,p) {

  var myForm = document.createElement("form");

  myForm.method="post" ;

  myForm.action = to ;

  for (var k in p) {

    var myInput = document.createElement("input") ;

    myInput.setAttribute("name", k) ;

    myInput.setAttribute("value", p[k]);

    myForm.appendChild(myInput) ;

  }

  document.body.appendChild(myForm) ;

  myForm.submit() ;

  document.body.removeChild(myForm) ;

}



//wrapper function for postwith()

function FilterInventory(Language, Lenght, Isole, Promo)

{

	

	if (Language == "French")

	{

		var InventoryURL = "/Default.aspx?CCID=16369&FID=94145&ExcludeBoolFalse=True&PageID=9705660&ID=/fr/conteneurs/resultats.html";

		var PostData = {};

		//Container Length

		PostData.CAT_Custom_291156 = "";

		//Container Type

		PostData.CAT_Custom_274235 = "";

		//Promotion

		PostData.CAT_Custom_291088 = "";

	

		if (Lenght > 0)

		{

			PostData.CAT_Custom_291156 = Lenght + "";

		}

		if (Isole == true) { PostData.CAT_Custom_274235 = "Isolé"; }

		if (Promo == true) { PostData.CAT_Custom_291088 = "1"; }

		postwith(InventoryURL, PostData);

	}

	else if (Language == "English")

	{

		var InventoryURL = "/Default.aspx?CCID=17771&FID=99229&ExcludeBoolFalse=True&PageID=9944564&ID=/en/containers/results.html";

		var PostData = {};

		//Container Length

		PostData.CAT_Custom_291906 = "";

		//Container Type

		PostData.CAT_Custom_291905 = "";

		//Promotion

		PostData.CAT_Custom_291915 = "";

	

		if (Lenght > 0)

		{

			PostData.CAT_Custom_291906 = Lenght + "";

		}

		if (Isole == true) { PostData.CAT_Custom_291905 = "Insulated"; }

		if (Promo == true) { PostData.CAT_Custom_291915 = "1"; }

		postwith(InventoryURL, PostData);		

	}



}






