﻿// JScript File

function IsMCPath()
{
    var domain = window.location.host.toLowerCase();
    
    if (domain.indexOf("priceless.com") > -1)
    {
        return true;
    }
    else
    {
        return false;
    }


}

function HttpsRedirect()
{
    if (IsMCPath())
    {   if (document.location.protocol != "https:")
		{
			document.location.href = 'https://' + document.location.host + document.location.pathname + document.location.search;
		}
		
    }
}

HttpsRedirect();
//change URL if the page is served locally
function GetMCPath(path)
{
    if (IsMCPath())
    {
        return path + "?";
    }
    else
    {
        return "/us/personal/en/promos/jeans/proxy.aspx?";
    }
}
//utility function to append parameter
function WriteParam(name, value)
{
    return "&" + name + "=" + value;
}
//convert DOM for IE browers
function parseXml(xml) {
    if (jQuery.browser.msie) {
        var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.loadXML(xml);
        return xmlDoc;
    }
    else 
    {   
        return xml;
    }
   
}





