	function headerGoToPage(action, method){
	var methodParam = action.indexOf("method=");
	var param = action.indexOf("?");
	if (methodParam == -1)
	{
		if (param != -1)
		{
			action = action + "&method=" + method;
		} else {
			action = action + "?method=" + method;
		}
	}
	
	document.forms[0].action = action;
	document.forms[0].submit();
}

function trimAll(sString)
{
	if (null != sString) {
		var a = sString.replace(/^\s+/, '');
		return a.replace(/\s+$/, '');
	}
	return sString;
}

function popUpConfirmation(action, pageName){
	document.getElementById("eUrl").value = action;
	setOmnitureDetail(pageName);
	$(function(){
					$(window).openDOMWindow({ 
					    eventType:null,
					    borderSize: 0,
					    width: 750,
					    height: 500,
					    windowBGColor: 'none',
					    windowSourceID:'#confirmationMessage' 
	});
	});
}

function popUpConfirm(action, method, pageName){
	setOmnitureDetail(pageName);
	var methodParam = action.indexOf("method=");
	var param = action.indexOf("?");
	if (methodParam == -1)
	{
		if (param != -1)
		{
			action = action + "&method=" + method;
		} else {
			action = action + "?method=" + method;
		}
	}
	
	document.getElementById("eUrl").value = action;

	$(function(){
					$(window).openDOMWindow({ 
					    eventType:null,
					    borderSize: 0,
					    width: 750,
					    height: 500,
					    windowBGColor: 'none',
					    windowSourceID:'#confirmationMessage' 
	});
	});
}


function submitForm(){
	document.forms[0].action = document.getElementById("eUrl").value;
	document.forms[0].submit();
}

$("#popClose").click(function(e) {
	e.preventDefault();
	$.closeDOMWindow();
	return false;
});



function popUpWindowWithOmniture(theURL, pageName) {
		setOmnitureDetail(pageName);
		window.open(theURL);
}

function setOmnitureDetail(pageName){
var langCode = 'en';
	if($('#languageCode') != null){
		langCode = $('#languageCode').val();
	}
setOmnitureVal(pageName,'US:gold',langCode,true);
}

function showModalWindow(pagetype){
	if(pagetype == 'redeemPoints'){
		setOmnitureDetail("rightNavRedeemPoints");
		$(function(){
	
			$(window).openDOMWindow({ 
			
			eventType:null,
			
			borderSize: 0,
			
			width: 750,
			
			height: 500,
			
			windowBGColor: 'none',
			
			windowSourceID:'#confirmationMessageredeemPoint'
	
	       });
	        
	  });
	  }else if(pagetype == 'orderStatus'){
	  $(function(){
			setOmnitureDetail("rightNavOrderStatus");
			$(window).openDOMWindow({ 
			
			eventType:null,
			
			borderSize: 0,
			
			width: 750,
			
			height: 500,
			
			windowBGColor: 'none',
			
			windowSourceID:'#confirmationMessageOrderStatus' 
	
	       });
	        
	  });
	  }
	  else{
	   $(function(){
			setOmnitureDetail("rightNavRedeemPointsExceeded");
			$(window).openDOMWindow({ 
			
			eventType:null,
			
			borderSize: 0,
			
			width: 750,
			
			height: 500,
			
			windowBGColor: 'none',
			
			windowSourceID:'#confirmationMessageRedeemPointsExceeded' 
	
	       });
	        
	  });
	  
	  }
  }
	 
function blockPhoneandDiscountPending(type)
{
if(type == 'PHONE_ITEM_BLOCKED'){
		$(function(){
	
			$(window).openDOMWindow({ 
			
			eventType:null,
			
			borderSize: 0,
			
			width: 750,
			
			height: 500,
			
			windowBGColor: 'none',
			
			windowSourceID:'#confirmationMessagePhoneItem'
	
	       });      
	
	  });
	 }
 else{
 
 $(function(){
	
			$(window).openDOMWindow({ 
			
			eventType:null,
			
			borderSize: 0,
			
			width: 750,
			
			height: 500,
			
			windowBGColor: 'none',
			
			windowSourceID:'#confirmationMessageDiscountPending'
	
	       });
	       	
	  }); 
 }
	 
}

function popupStaticLink(url){
	if(null!=url){
		window.open(url, 'WesternUnion','scrollbars=yes,toolbar=0,location=0,directories,menubar=0,resizable=1,dependent=0,status=0,width=600,height=700,left=50,top=50');	 		
	}
}

	 