// SecureSiteSolutions (SSS) JavaScript file
// -------------------------------------------
//
// This javascript file should be included in any page that either requests or
// invokes any SecureSiteSolution action.  
// 
// This file is split into two parts: a user configurable section into which
// site specific details must be entered, and actual coding.  It is strongly
// recommended that no modifications are made to the latter.
//
// Additional help, technical documentation may be found on the support 
// website: http://www.securesitesolutions.com/support
//
// SecureSiteSolutions Copyright 2001 Applied Consultancy Solutions Limited
// http://www.appliedconsultancy.com
//
// This file was last updated on 6th August 2009.  
//

// User Configurable Sections
// ----------------------------
// Please Update these values to those specified for your SSS Shop

// Your SSS Shop Code
var sssShopCode = "SSS1879061875217SC";

// Your SSS Basket Code
var sssBasketCode = "SSS2547353787117BC";

// Your Basket URL
// - Typically this does not need to be changed from the default value
var sssBasketURL = "https://www.securesitesolutions.com/v2/secure/basket.aspx?";

// Your Return URL
// - This is the URL that your visitor will be returned to after adding a
//   product to a basket
var sssBasketReturnURL = "https://www.securesitesolutions.com/v2/secure/basket.aspx"





//
// Coding
// --------
// Do not make any modifications beyond this point.  Any modifications made
// may be unsupported. 
//

function addToSSSBasket(ref, product, price, quantity)
	{
		if(isNaN(quantity)){
			alert("The quantity must be numeric.");
		}else{
			//var sssl1001 = "SSS6481688228010SC";
			//var sssl1002 = "SSS8764087570610BC";
			//var basket_url = "https://www.securesitesolutions.com/beta/secure/basket.aspx?";
			var basket_url = sssBasketURL;
			basket_url += "action=additem";
			basket_url += "&ref=" + ref;
			basket_url += "&item_name=" + product;
			basket_url += "&price=" + price;
			basket_url += "&quantity=" + quantity;
		   // basket_url += "&return_url=" + escape("https://www.securesitesolutions.com/beta/demo/basket.aspx");
			//basket_url += "&sssl1001=" + sssl1001;
			//basket_url += "&sssl1002=" + sssl1002;
			//location.href = basket_url;
			basket_url += "&return_url=" + escape(sssBasketReturnURL);
			basket_url += "&sssl1001=" + sssShopCode;
			basket_url += "&sssl1002=" + sssBasketCode;
			location.href = basket_url;
		}
	}
	
function viewSSSBasket() {
	var basket_url = sssBasketURL;
	basket_url += "action=view";
	basket_url += "&return_url=" + escape(sssBasketReturnURL);
	basket_url += "&sssl1001=" + sssShopCode;
	basket_url += "&sssl1002=" + sssBasketCode;
	location.href = basket_url;	
}

		
// End of Javascript File
