// Override visitargs to fix URL parameter order issue SUP25341
// Make visitargs-generated URL match HREF on dept.asp
// MSR 12/11/07
function visitargs(PageURL, args, SURL) {

	// Start TargetURL with PageURL
	var TargetURL = PageURL;
		
	// If the TargetURL has a trailing ampersand...
	if(TargetURL[TargetURL.length - 1] == "&"){
		
		// Remove the ampersand
		TargetURL = TargetURL.substring(0, TargetURL.length - 1);
	}
	
	// If TargetURL doesn't contain a trailing ?...
	if(TargetURL[TargetURL.length - 1] != "?"){

		// Add the trailing ?
		TargetURL += "?";
	}

	// If args were specified...
    if (args.length > 0) {
	
		// If args contains a leading &...
		if(args[0] == "&"){
	
			// Remove the leading &
			args = args.substring(1, args.length - 1);
		}		
		
		// Add args to TargetURL
		TargetURL += args;
	}
		
	// If no s_id was specified...
	
	if (TargetURL.toLowerCase().indexOf("s_id") < 0 && TargetURL.toLowerCase().indexOf("s%5fid") < 0) {
		
		// Add s_id
		TargetURL += "&s_id=" + i_jscript_uu_sid;
	}

	// If it's a product link...
	if(PageURL == "product.asp"){
		
		// Add a trailing &
		TargetURL += "&";
	}

	/* Disabled to fix product page links*/
	// If no session ID is set...
    if (user_guid != " ") {
	
		// Add the mscssid 
        TargetURL += "&mscssid=" + user_guid;
    }
	
		
	// If secure URL was requested...
    if (SURL == "SURL") {
		
		// Redirect to secure URL
       	location = i_jscript_uu_rootSURL + TargetURL;
		
    } else {
		//alert(TargetURL);
		// Redirect to non-secure URL
        location = i_jscript_uu_rootURL + TargetURL;
    }
	
    return false;
}