var dialogObj=null;

function checkBrowserVersion() {
	var indexOfIE = window.navigator.appVersion.indexOf("IE");
	if( indexOfIE != -1) {
		var IEVersion = window.navigator.appVersion.substr(indexOfIE + 3, 1);
		if(IEVersion > 7){
			showModalDialog("UIServices");
		}
	}
}


function showModalDialog(modName) {
	var proto = "http:";
	if(window.top.location.protocol == "https:"){
		proto = "https:";
	}
	var domainString ='';
	domainString = proto + '//'+ document.domain;

	dojo.registerModulePath(modName, domainString + "/ComponentApp/NOW/common/js/global/includes/UIServices");
	dojo.require("UIServices.util.Dialog");

	dialogObj = new UIServices.util.Dialog({
    content 			: getText(),
	enableTitleBar 		: false,
	enableCloseButton 	: false,
	title 				: 'My Title',
	style				: 'top: 50px; left: 30%'
	});
}

function getText() {
	var returnText = '';

		returnText +=   '<table width="546" border="0" cellspacing="0" cellpadding="0">';
		returnText +=   '	<tr>';
		returnText +=   '		<td><img src="/ComponentApp/NOW/default/PCNow/US/Subscription/images/now_opt_popuptopcurve2.gif" width="546" height="12" /></td>';
		returnText +=   '	</tr>';
		returnText +=   '	<tr>';
		returnText +=   '		<td align="center" background="/ComponentApp/NOW/default/PCNow/US/Subscription/images/now_opt_popupmidbg2.gif">';
		returnText +=   '			<table width="500" border="0" cellspacing="0" cellpadding="0">';
		returnText +=   '				<tr>';
		returnText +=   '					<td align="left" >';
		returnText +=   '						Your Internet Explorer Version is not yet supported by WebEx Application. Please turn on the browser\'s Compatibility mode by clicking on Tools -> Compatibility View option, to ensure proper functioning.';
		returnText +=   '					</td>';
		returnText +=   '				</tr>';
		returnText +=   '				<tr>';
		returnText +=   '					<td align="center">';
		returnText +=   '						<a javascript:void(null)" onClick="browserVersionOK();"><img src="/ComponentApp/NOW/default/PCNow/US/Subscription/images/btnow_opt_popok.gif" width="44" height="26" border="0" align="middle" onClick="browserVersionOK();"/></a>';
		returnText +=   '					</td>';
        returnText +=   '				</tr>';
		returnText +=   '			</table>';
		returnText +=   '		</td>';
		returnText +=   '	</tr>';
		returnText +=   '	<tr>';
		returnText +=   '		<td valign="top"><img src="/ComponentApp/NOW/default/PCNow/US/Subscription/images/now_opt_popupbotcurve2.gif" width="546" height="12" /></td>';
		returnText +=   '	</tr>';
		returnText +=   '</table>';

		return returnText;
}


function browserVersionOK() {
	dialogObj.dialog.destroy();
}
