if(!LEXUS_ROOT_URL && LEXUS_ROOT_URL != ''){
	var LEXUS_ROOT_URL = 'http://' + 'www.lexus.com';
	var LEXUS_ROOT_ASSET = ( (location.href.indexOf('http:') > -1) ? ('http://' + 'www.lexus.com') : ('https://' + 'secure.' +'www.lexus.com'.replace('www.', '')) ) ;
}
function include_js(script_filename) {
	document.write('<script type="text/javascript" src="'+script_filename+'" language="javascript"></script>');
	return false;
}

function include_css(script_filename) {
    var html_doc = document.getElementsByTagName('head').item(0);
    var css = document.createElement('link');
    css.setAttribute('rel', 'stylesheet');
    css.setAttribute('type', 'text/css');
    css.setAttribute('href', script_filename);
    html_doc.appendChild(css);
    return false;
}

/* --- BEGIN DEALERIZED PAGE JS --- */
// For links from dealer sites -- hostname and frameset detection
// Used for dealerized competitive comparison on lexus.edmunds.com

var inFrameset = 0;
var isDlrSite = 0;

// if user is on lexus.edmunds.com page in frameset, page should be dealerized
function checkIfDlr() {
	var hostname = self.location.hostname;
	checkIfInFrameset();
	if((hostname.indexOf('lexus.edmunds.com') > -1) && (inFrameset == 1)) {
		isDlrSite = 1;
	}
}

checkIfDlr();

// check if page is in frameset
function checkIfInFrameset() {
	if (window != top) {
		inFrameset = 1;
	}
}

/* --- END DEALERIZED PAGE JS --- */

include_js(LEXUS_ROOT_ASSET + '/lexus-share/js/lexus_3_5.js');

include_css(LEXUS_ROOT_ASSET + '/lexus-share/css/lexus_3_5.css');

var agt = navigator.userAgent.toLowerCase();
var ie6 = (agt.indexOf("msie 6.") != -1);
var ie7 = (agt.indexOf("msie 7.") != -1);
if(document.all){
	if(ie7){ include_css(LEXUS_ROOT_ASSET + '/lexus-share/css/lexus_ie7_3_5.css'); }
	if(!ie7){ include_css(LEXUS_ROOT_ASSET + '/lexus-share/css/lexus_ie_3_5.css'); }
}

/*
var galleryWindow;
function galleryManager(){
	this.launchGallery=function(modelId)
	{
		launchGalleryPopup(modelId);
	}
}
var GalleryManager = new galleryManager();
function launchGalleryPopup(modelId) {
	
	var windowWidth = (document.all) ? document.body.offsetWidth : window.innerWidth;
	var windowHeight = (document.all) ? document.body.offsetHeight : window.innerHeight;
	
	var left = Math.round( (windowWidth - 804) / 2 );
	var top =  Math.round( (windowHeight - 620) / 2 );
	
	closeGalleryPopup();
	
	galleryWindow  = window.open(LEXUS_ROOT_URL + '/lexus-share/gallery/popup.html?launchGallery=true&model=' + modelId,'galleryWindow','width=' 
																	+ 804 + ',height=' + 620
																	+ ',menubar=no,location=no,resizable=no,scrollbars=no,status=no,left=' + left + 'px,top=' + top + 'px');
	galleryWindow.focus();	
	
	// We have to add these events without prototype, since prototype might not
	// be loaded at this point
	if (window.addEventListener) {
      window.addEventListener('unload', closeGalleryPopup, null);
    } else if (window.attachEvent) {
      window.attachEvent('on' + 'unload', closeGalleryPopup);
    }
}

function closeGalleryPopup() {
	if(galleryWindow && !galleryWindow.closed) {
		galleryWindow.close();
		galleryWindow = null;
	}
	
}
*/