	function ajaxCart(URL,ResponseId,param,ammount)
	{
		var method = "GET";
		if(param == true)
		{
			method = "POST";
			if(ammount == true)
			{
				var selectedAmmount = document.getElementById('giftcard_amount');
				selctedValue = selectedAmmount.options[selectedAmmount.selectedIndex].value;
				var params = "qty="+document.getElementById('qty').value+"&giftcard_sender_name="+document.getElementById('giftcard_sender_name').value+"&giftcard_sender_email="+document.getElementById('giftcard_sender_email').value+"&giftcard_recipient_name="+document.getElementById('giftcard_recipient_name').value+"&giftcard_recipient_email="+document.getElementById('giftcard_recipient_email').value+"&giftcard_message="+document.getElementById('giftcard_message').value+"&giftcard_amount="+selctedValue;
			}
			else
			{
				var params = "qty="+document.getElementById('qty').value+"&giftcard_sender_name="+document.getElementById('giftcard_sender_name').value+"&giftcard_sender_email="+document.getElementById('giftcard_sender_email').value+"&giftcard_recipient_name="+document.getElementById('giftcard_recipient_name').value+"&giftcard_recipient_email="+document.getElementById('giftcard_recipient_email').value+"&giftcard_message="+document.getElementById('giftcard_message').value;
			}
		}
		if(window.XMLHttpRequest)
		{
			xmlhttp = new XMLHttpRequest();
		}
		else
		{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.onreadystatechange = function()
		{
			var success = jQuery('#'+ResponseId);
			if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
			{	
			str = xmlhttp.responseText.split("^^");
				success.html(str[1]+' product added');
				success.fadeIn(1000, function() {
				});
				nostr = str[0].split("-");
				document.getElementsByClassName('top-link-cart cart-img')[0].innerHTML = nostr[0]; 	
			}
			else
			{
				success.html('product adding...');
				success.fadeIn(1000, function() {
				}); 
			}
		}
		xmlhttp.open(method,URL,true);
		if(param == true)
		{
			xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			xmlhttp.setRequestHeader("Content-length", params.length);
			xmlhttp.setRequestHeader("Connection", "close");
			xmlhttp.send(params);
		}
		else
		{
			xmlhttp.send();
		}
		URL = "";
	}
	function getInterMsg(URL,from)
	{
		if(from == 'billing')
		{
			var country_code = document.getElementById('billing:country_id').options[document.getElementById('billing:country_id').selectedIndex].value;
		}
		else 
		if(from == 'shipping')
		{				
			var country_code = document.getElementById('shipping:country_id').options[document.getElementById('shipping:country_id').selectedIndex].value;
		}
		
		if(window.XMLHttpRequest)
		{
			xmlhttp = new XMLHttpRequest();
		}
		else
		{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.onreadystatechange = function()
		{
			if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
			{	
				document.getElementById("international_msg").innerHTML = xmlhttp.responseText;	
			}
		}
		xmlhttp.open('GET',URL+'?country_code='+country_code,true);
		xmlhttp.send();
		URL = "";
	}
	
     function stripHtml(s){

		s = s.replace(/&(lt|gt);/g, function (strMatch, p1){
 		 	return (p1 == "lt")? "<" : ">";
 		});
 		var strTagStrippedText = s.replace(/<\/?[^>]+(>|$)/g, "");
		return strTagStrippedText;
      }
