<!--
// 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,style,defclr,gender,country){ 
	cmPageviewOnClick("MVM Try On","MVM");
	openWindow("http://levdr.mvm.com/index.html?param1="+style+"&pop="+gender);
}

// Call this function from the nav bar
function openMVM(sid, country){
	cmPageviewOnClick("MVM MAIN","MVM");
	openWindow("http://levdr.mvm.com/index.html");
}

//  Call this function from a Fit Enabled Product
function OpenMVMFit(style,gender){
	cmPageviewOnClick("MVM Fit","MVM");
	openWindow("http://levdr.mvm.com/index.html?endpoint=fitdetails&param1="+style+"&pop="+gender);
}

//  Call this function from a try on button
function ViewInRoom(sid,gStyle,country){ 
	cmPageviewOnClick("Virtual Room","MVR");
	openWindow("http://lemvr.mvm.com/index.html");
}

//-->
