<!--
// Fashion server url
var mvmUrl = "/cgi-bin/mvm_direct.cgi?";

// isolate the browser version
v = parseInt(navigator.appVersion)
var MVMpopup;

function parseSID(sid){
    return sid.substring(sid.indexOf("=")+1, sid.length) + "" ;
}

function createNavBarLink(sid){
    var mysid = sid.substring(sid.indexOf("=")+1, sid.length) + "" ;
    return '<area shape="rect" coords="7,125,128,147" href="javascript:openMVM(\'' + mysid + '\', 840)" alt="My Model" title="My Model">';
}

function createMvmHref(sid,text){
    var mysid = sid.substring(sid.indexOf("=")+1, sid.length) + "" ;
    return '<a href="javascript:openMVM(\'' + mysid + '\', 840)">' + text + '</a>';
}

function openWindow(theURL){
        if (!MVMpopup || MVMpopup.closed){
                MVMpopup=window.open(theURL,"MVMpopup","height=505,width=625,status=yes,menubar=0,location=0,resize=0,scrollbars=0")              
                MVMpopup.focus()
        }
        else{
		if (theURL.indexOf("action=splash") == -1){
	                MVMpopup.location.href=theURL;
		}
                MVMpopup.focus()
        }
}

//  Call this function from a try on button
function dressModel(sid,gStyle,defclr,gender,country){ 
	sid = "&sid=" + sid;
	garment = "&styleNum=" + gStyle;
	defclr = "&defClrCode=" + defclr;
	gender = "&genderCode=" + gender;
	country = "&countryCode=" + country;
	cmPageviewOnClick("MVM Try On","MVM");
	theURL = mvmUrl+"action=tryon"+sid+garment+defclr+gender+country;
	openWindow(theURL);
}

// Call this function from the nav bar
function openMVM(sid, country){
	sid = "&sid=" + sid;
	country = "&countryCode=" + country;
	theURL = mvmUrl+"action=splash"+sid+country;
	cmPageviewOnClick("MVM MAIN","MVM");
	openWindow(theURL);
}

//  Call this function from a Fit Enabled Product
function OpenMVMFit(style,gender){
//var mvmFitUrl = "http://fit.mvm.com/fit/jsp/views/leus/index.jsp?";
var mvmFitUrl = "http://le.mvm.com/landsend_ctx/jsp/handlers/main/mvmfithandler.jsp?";
        garment = "&g=" + style;
        gender = "&pop=" + gender;
	cmPageviewOnClick("MVM Fit","MVM");
        theFitUrl = mvmFitUrl+"action=init&roc=leus&v=500"+garment+gender;
                Fitpopup=window.open(theFitUrl,"MVMpopup","height=505,width=625,status=yes,scrollbars=0")
                Fitpopup.focus();
}

//-->
