/**
 * jQuery lightBox plugin
 * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
 * and adapted to me for use like a plugin from jQuery.
 * @name jquery-lightbox-0.5.js
 * @author Leandro Vieira Pinho - http://leandrovieira.com
 * @version 0.5
 * @date April 11, 2008
 * @category jQuery plugin
 * @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
 * @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
 * @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
 */

// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
(function($) {
	/**
	 * $ is an alias to jQuery object
	 *
	 */
	$.fn.lightBox = function(settings) {
		// Settings to configure the jQuery lightBox plugin how you like
		settings = jQuery.extend({
			// Configuration related to overlay
			overlayBgColor: 		'#000',		// (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
			overlayOpacity:			0.8,		// (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
			// Configuration related to navigation
			fixedNavigation:		false,		// (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
			// Configuration related to images
			imageLoading:			'/eDamanApp/en/images/lightbox-ico-loading.gif',		// (string) Path and the name of the loading icon
			
			imageBtnClose:			'/eDamanApp/en/images/lightbox-btn-close.gif',		// (string) Path and the name of the close btn
			//imageBlank:				'images/lightbox-blank.gif',			// (string) Path and the name of a blank image (one pixel)
			// Configuration related to container image box
			containerBorderSize:	0,			// (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
			containerResizeSpeed:	400,		// (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
			// Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
			txtImage:				'Image',	// (string) Specify text "Image"
			txtOf:					'of',		// (string) Specify text "of"
			// Configuration related to keyboard navigation
			keyToClose:				'c',		// (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
			keyToPrev:				'p',		// (string) (p = previous) Letter to show the previous image
			keyToNext:				'n',		// (string) (n = next) Letter to show the next image.
			// Don�t alter these variables in any way
			activeImage:			0
		},settings);
		// Caching the jQuery object with all elements matched
		/**
		 * Initializing the plugin calling the start function
		 *
		 * @return boolean false
		 */
		function _initialize() {
			_start(this); // This, in this context, refer to object (link) which the user have clicked
			return false; // Avoid the browser following the link
		}
		/**
		 * Start the jQuery lightBox plugin
		 *
		 * @param object objClicked The object (link) whick the user have clicked
		 * @param object jQueryMatchedObj The jQuery object with all elements matched
		 */
		function _start(objClicked) {
			
			// Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
			$('embed, object, select').css({ 'visibility' : 'hidden' });
			// Call the function to create the markup structure; style some elements; assign events in some elements.
			_set_interface();
			// Unset image active information
			settings.activeImage = 0;
			// Call the function that prepares image exibition
			_set_image_to_view();
		}
		
		function _set_interface() {
			//$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><div id="lightbox-image"><div id="popDetail" style="display:block;"><div class="popVideo" onclick="showDetail()"><img src = "/eDamanApp/en/images/full-screen.gif" id="popupIcon" width="25" height="21" title="Full Screen" /></div><div id="lightbox-secNav-btnClose"><img src="/eDamanApp/en/images/close.gif" width="25" height="21" title="close" /></div></div><table cellpadding="0" cellspacing="0" width="936" height="575" class="big_box" border="0" id="demoTable"><tr><td valign="top" width="186" style="padding:5px 5px 0px 5px;" id="headLogo"><img src="/eDamanApp/en/images/demo-icon.gif" width="169" height="48" /></td></tr><tr><td height="522" width="196" valign="top" id="videoLink"><table cellpadding="2" cellspacing="0" border="0" style="margin-left:21px;"><tr><td><table id="member"><tr><td width="8">&nbsp;</td><td class="black_titles" width="160" style="cursor:pointer;border:1px solid #ffffff;" onclick="showMembers()">Members <img src="/eDamanApp/en/images/down-arrow.gif" id="memredImg"/></td></tr><tr><td colspan="2"><div id="memsubMenu"><table border="0" cellpadding="2" cellspacing="0"><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(1,this,'+"'member'"+')">Homepage & Sign-in</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(2,this,'+"'member'"+')">My Daman and Member Benefits</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(3,this,'+"'member'"+')">Claims Tracking</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(4,this,'+"'member'"+')">Claims Submission</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(5,this,'+"'member'"+')">Locate a Provider</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(6,this,'+"'member'"+')">Locate Branches</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(7,this,'+"'member'"+')">Rate a Provider</a></td></tr></table></div></td></tr></table></td></tr><tr><td><table id="policyHolder"><tr><td width="8">&nbsp;</td><td class="black_titles" width="160" style="cursor:pointer;border:1px solid #ffffff;" onclick="showpolicyHolders()">Policy holders <img src="/eDamanApp/en/images/down-arrow.gif" id="policyredImg" /></td></tr><tr><td colspan="2"><div id="policysubMenu"><table border="0" cellpadding="2" cellspacing="0"><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td colspan="2"><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(1,this,'+"'policyHolder'"+')">Homepage & Sign-in</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td colspan="2"><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(2,this,'+"'policyHolder'"+')">My Daman and Member Portfolio</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td colspan="2"><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(3,this,'+"'policyHolder'"+')">Schedule of Benefits</a></td></tr><tr><td width="11">&nbsp;</td><td width="154"><span class="fontNormal spanExpand" onclick="showsubMenu()">Endorsements <img src="/eDamanApp/en/images/red-arrow.gif" id="redImg" /></span></td></tr><tr><td colspan="2"><div id="subMenu" style="display:none;"><table style="margin-left: 12px;" cellpadding=2 cellspacing=0 border=0><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(4,this,'+"'policyHolder'"+')"> Update Policy Details</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(5,this,'+"'policyHolder'"+')"> Add Member</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(6,this,'+"'policyHolder'"+')"> Report a Lost Card</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(7,this,'+"'policyHolder'"+')"> Correct Member Details</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(8,this,'+"'policyHolder'"+')"> Cancel Member</a></td></tr></table></div></td></tr></table></div></td></tr></table></td></tr></table></td><td style="padding-right:10px;"><table class=demo_box width="100%" border="0" id="demoBox"><td><div id="wrapper"></div></td></tr></table></td></tr></table></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');
			//$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="shareBoxOverlay"></div><div id="shareBox" class="shareouterWidget"><div class="shareinnerWidget"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="right"><img src="/eDamanApp/en/images/shareCloseIcon.gif" onclick="closeShareVideo()" style="cursor:pointer;" /></td></tr><tr><td class="pageHeader borderBottom">SHARE THIS VIDEO</td></tr><tr><td style="padding-top:20px;"><div style="color:#ff0000;" id="msgDiv"></div><table border="0" cellpadding="6" cellspacing="0" width="100%"><tr><td>Your Name <span style="color:#ff0000;">*</span></td><td align="center">:</td><td><input type="Text" value="" /></td></tr><tr><td>Recipient Name  <span style="color:#ff0000;">*</span></td><td align="center">:</td><td><input type="Text" /></td></tr><tr><td>Recipient Email  <span style="color:#ff0000;">*</span></td><td align="center">:</td><td><input type="Text" /></td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td><table border="0" cellpadding="0" cellspacing="0" class="btnBg"><tr><td class="btnLeft">&nbsp;</td><td><input type="submit" value="Submit" onclick="shareVideoToFriend()" class="btnRight btnBg" /></td></tr></table></td></tr></table></td></tr></table></div></div><div id="lightbox-container-image-box"><div id="lightbox-container-image"><div id="lightbox-image"><div id="popDetail" style="display:block;"><div style="position:absolute;right:10px;top:34px;" id="shareLink"><span style="cursor:pointer;position:relative;top:2px;right:5px;" onclick="shareVideo()"><img src="/eDamanApp/en/images/shareVideoImg.gif" /></span><a class="fontNormal" href="javascript:void(0)" onclick="shareVideo()">Share this Video</a></div><div class="popVideo" onclick="showDetail()"><img src = "/eDamanApp/en/images/full-screen.gif" id="popupIcon" width="25" height="21" title="Full Screen" /></div><div id="lightbox-secNav-btnClose"><img src="/eDamanApp/en/images/close.gif" width="25" height="21" title="close" /></div></div><table cellpadding="0" cellspacing="0" width="936" height="575" class="big_box" border="0" id="demoTable"><tr><td valign="top" width="186" style="padding:5px 5px 0px 5px;" id="headLogo"><img src="/eDamanApp/en/images/demo-icon.gif" width="169" height="48" /></td></tr><tr><td height="522" width="196" valign="top" id="videoLink"><table cellpadding="2" cellspacing="0" border="0" style="margin-left:21px;"><tr><td><table id="member"><tr><td width="8">&nbsp;</td><td class="black_titles" width="160" style="cursor:pointer;border:1px solid #ffffff;" onclick="showMembers()">Members <img src="/eDamanApp/en/images/down-arrow.gif" id="memredImg"/></td></tr><tr><td colspan="2"><div id="memsubMenu"><table border="0" cellpadding="2" cellspacing="0"><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(1,this,'+"'member'"+')">Homepage & Sign-in</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(2,this,'+"'member'"+')">My Daman and Member Benefits</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(3,this,'+"'member'"+')">Claims Tracking</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(4,this,'+"'member'"+')">Claims Submission</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(5,this,'+"'member'"+')">Locate a Provider</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(6,this,'+"'member'"+')">Locate Branches</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(7,this,'+"'member'"+')">Rate a Provider</a></td></tr></table></div></td></tr></table></td></tr><tr><td><table id="policyHolder"><tr><td width="8">&nbsp;</td><td class="black_titles" width="160" style="cursor:pointer;border:1px solid #ffffff;" onclick="showpolicyHolders()">Policy holders <img src="/eDamanApp/en/images/down-arrow.gif" id="policyredImg" /></td></tr><tr><td colspan="2"><div id="policysubMenu"><table border="0" cellpadding="2" cellspacing="0"><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td colspan="2"><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(1,this,'+"'policyHolder'"+')">Homepage & Sign-in</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td colspan="2"><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(2,this,'+"'policyHolder'"+')">My Daman and Member Portfolio</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td colspan="2"><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(3,this,'+"'policyHolder'"+')">Schedule of Benefits</a></td></tr><tr><td width="11">&nbsp;</td><td width="154"><span class="fontNormal spanExpand" onclick="showsubMenu()">Endorsements <img src="/eDamanApp/en/images/red-arrow.gif" id="redImg" /></span></td></tr><tr><td colspan="2"><div id="subMenu" style="display:none;"><table style="margin-left: 12px;" cellpadding=2 cellspacing=0 border=0><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(4,this,'+"'policyHolder'"+')"> Update Policy Details</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(5,this,'+"'policyHolder'"+')"> Add Member</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(6,this,'+"'policyHolder'"+')"> Report a Lost Card</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(7,this,'+"'policyHolder'"+')"> Correct Member Details</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(8,this,'+"'policyHolder'"+')"> Cancel Member</a></td></tr></table></div></td></tr></table></div></td></tr></table></td></tr></table></td><td style="padding-right:10px;"><table class=demo_box width="100%" border="0" id="demoBox"><tr><td><div id="wrapper"></div></td></tr></table><div id="cautionTxt">Are you experiencing problems viewing this video? <a href="javascript:void(0)" onclick="downloadFlash()">Click here</a> to update your adobe flash player.</div></td></tr></table></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');
			$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="shareBoxOverlay"></div><div id="shareBox" class="shareouterWidget"><div class="shareinnerWidget"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="right"><img src="/eDamanApp/en/images/shareCloseIcon.gif" onclick="closeShareVideo()" style="cursor:pointer;" /></td></tr><tr><td class="pageHeader borderBottom">SHARE THIS VIDEO</td></tr><tr><td style="padding-top:20px;"><div style="color:#ff0000;" id="msgDiv"></div><table border="0" cellpadding="6" cellspacing="0" width="100%"><tr><td>Your Name <span style="color:#ff0000;">*</span></td><td align="center">:</td><td><input type="Text" value="" /></td></tr><tr><td>Recipient Name  <span style="color:#ff0000;">*</span></td><td align="center">:</td><td><input type="Text" /></td></tr><tr><td>Recipient Email  <span style="color:#ff0000;">*</span></td><td align="center">:</td><td><input type="Text" /></td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td><table border="0" cellpadding="0" cellspacing="0" class="btnBg"><tr><td class="btnLeft">&nbsp;</td><td><input type="submit" value="Submit" onclick="shareVideoToFriend()" class="btnRight btnBg" /></td></tr></table></td></tr></table></td></tr></table></div></div><div id="lightbox-container-image-box"><div id="lightbox-container-image"><div id="lightbox-image"><div id="popDetail" style="display:block;"><div style="position:absolute;right:10px;top:34px;" id="shareLink"><span style="cursor:pointer;position:relative;top:2px;right:5px;" onclick="shareVideo()"><img src="/eDamanApp/en/images/shareVideoImg.gif" /></span><a class="fontNormal" href="javascript:void(0)" onclick="shareVideo()">Share this Video</a></div><div class="popVideo" onclick="showDetail()"><img src = "/eDamanApp/en/images/full-screen.gif" id="popupIcon" width="25" height="21" title="Full Screen" /></div><div id="lightbox-secNav-btnClose"><img src="/eDamanApp/en/images/close.gif" width="25" height="21" title="close" /></div></div><table cellpadding="0" cellspacing="0" width="936" height="575" class="big_box" border="0" id="demoTable"><tr><td valign="top" width="186" style="padding:5px 5px 0px 5px;" id="headLogo"><img src="/eDamanApp/en/images/demo-icon.gif" width="169" height="48" /></td></tr><tr><td height="522" width="196" valign="top" id="videoLink"><table cellpadding="2" cellspacing="0" border="0" style="margin-left:21px;"><tr><td><table id="member"><tr><td width="8">&nbsp;</td><td class="black_titles" width="160" style="cursor:pointer;border:1px solid #ffffff;" onclick="showMembers()">Members <img src="/eDamanApp/en/images/down-arrow.gif" id="memredImg"/></td></tr><tr><td colspan="2"><div id="memsubMenu"><table border="0" cellpadding="2" cellspacing="0"><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(1,this,'+"'member'"+')">Homepage & Sign-in</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(2,this,'+"'member'"+')">My Daman and Member Benefits</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(3,this,'+"'member'"+')">Claims Tracking</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(4,this,'+"'member'"+')">Claims Submission</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(5,this,'+"'member'"+')">Locate a Provider</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(6,this,'+"'member'"+')">Locate Branches</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(7,this,'+"'member'"+')">Rate a Provider</a></td></tr></table></div></td></tr></table></td></tr><tr><td><table id="policyHolder"><tr><td width="8">&nbsp;</td><td class="black_titles" width="160" style="cursor:pointer;border:1px solid #ffffff;" onclick="showpolicyHolders()">Policy holders <img src="/eDamanApp/en/images/down-arrow.gif" id="policyredImg" /></td></tr><tr><td colspan="2"><div id="policysubMenu"><table border="0" cellpadding="2" cellspacing="0"><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td colspan="2"><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(1,this,'+"'policyHolder'"+')">Homepage & Sign-in</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td colspan="2"><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(2,this,'+"'policyHolder'"+')">My Daman and Member Portfolio</a></td></tr><tr><td width="11"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td colspan="2"><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(3,this,'+"'policyHolder'"+')">Schedule of Benefits</a></td></tr><tr><td width="11">&nbsp;</td><td width="154"><span class="fontNormal spanExpand" onclick="showsubMenu()">Endorsements <img src="/eDamanApp/en/images/red-arrow.gif" id="redImg" /></span></td></tr><tr><td colspan="2"><div id="subMenu" style="display:none;"><table style="margin-left: 12px;" cellpadding=2 cellspacing=0 border=0><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(4,this,'+"'policyHolder'"+')"> Update Policy Details</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(5,this,'+"'policyHolder'"+')"> Add Member</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(6,this,'+"'policyHolder'"+')"> Report a Lost Card</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(7,this,'+"'policyHolder'"+')"> Correct Member Details</a></td></tr><tr><td width="13"></td><td width="13"><img src="/eDamanApp/en/images/red-arrow.gif" width="5" height="8" /></td><td><a href="javascript:void(0)" class="fontNormal" onclick="showVideo(8,this,'+"'policyHolder'"+')"> Cancel Member</a></td></tr></table></div></td></tr></table></div></td></tr></table></td></tr></table></td><td style="padding-right:10px;"><table class=demo_box width="100%" border="0" id="demoBox"><tr><td><div id="wrapper"></div></td></tr></table><div id="cautionTxt">You may experience problems viewing this video since your current version of Adobe Flash Player is <span id="versionNumber"></span>. <a href="javascript:void(0)" onclick="downloadFlash()">Click here</a> to update to the latest version.</div></td></tr></table></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');

			/*allowing only english in input fields starts*/
			$("#shareBox :text").blur(function(){
					   checkLanguage();
						});

			/*allowing only english in input fields ends*/
			setPos();
			
			$('#versionNumber').html(globalvarflashVersion);
			setTimeout((function() { getFrame() }), 500);
			//getFrame();
			
			// Get page sizes
			var arrPageSizes = ___getPageSize();
			// Style overlay and show it
			if (navigator.appVersion.indexOf("MSIE")!=-1)
                {
				$('#jquery-overlay').css({
				backgroundColor:	settings.overlayBgColor,
				opacity:			settings.overlayOpacity,
				width:				arrayPageSize[2],
				height:				arrayPageSize[1]+30
					}).fadeIn();
				}
			else{
				$('#jquery-overlay').css({
				backgroundColor:	settings.overlayBgColor,
				opacity:			settings.overlayOpacity,
				width:				arrayPageSize[2],
				height:				arrayPageSize[1]
					}).fadeIn();
			}
			
			
			// Assigning click events in elements to close overlay
			$('#jquery-overlay').click(function() {
				_finish();									
			});
			// Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
			$('#lightbox-secNav-btnClose').click(function() {
				_finish();
				return false;
			});
			// If window was resized, calculate the new overlay dimensions
			$(window).resize(function() {
				// Get page sizes
				var arrPageSizes = ___getPageSize();
				// Style overlay and show it
				if (navigator.appVersion.indexOf("MSIE")!=-1)
                {
				$('#jquery-overlay').css({
					width:		arrayPageSize[2],
					height:		arrayPageSize[1]+30
				});
				}
				else{
				$('#jquery-overlay').css({
					width:		arrayPageSize[2],
					height:		arrayPageSize[1]
				});
				}
				
				
			});
		}
		
		var Screen, ScreenWidth , ScreenHeight ,ImgTop , ImgLeft , MyWidth , MyHeight;
		function setPos(){
			//var Screen, ScreenWidth , ScreenHeight ,ImgTop , ImgLeft , MyWidth , MyHeight;
                                if (navigator.appVersion.indexOf("MSIE")!=-1){
                                MyHeight = document.body.offsetHeight;
                                MyWidth = document.body.offsetWidth;
                                ScreenHeight = document.body.clientHeight;
                                ScreenWidth = document.body.clientWidth;                                      
                                
                                var contentHeight = 580;
                                var contentWidth = 936;

								
								var arrPageScroll = ___getPageScroll();
								var arrPageSizes = ___getPageSize();
                                ImgTop = arrayPageScroll[1] + ((arrayPageSize[3]+10) - contentHeight) / 2 +'px';
                                ImgLeft = arrayPageScroll[0] + (arrayPageSize[2] - contentWidth)  / 2 +'px';
                               
                                
                }
                else{
                		 		MyHeight = parseInt(document.getElementById('template').scrollHeight) + 'px';
                                MyWidth = document.getElementById('template').scrollWidth + 'px';                    
                                ScreenHeight = window.innerHeight;
                                ScreenWidth = window.innerWidth;
                                
                               var contentHeight = 580;
                               var contentWidth = 936;
                                
								var arrPageScroll = ___getPageScroll();
                                ImgTop = arrayPageScroll[1] + (ScreenHeight-contentHeight) / 2 + 'px';
                                ImgLeft = arrayPageScroll[0] + (ScreenWidth - contentWidth)  / 2 + 'px';		
                                
                }
								if(flag1!=2){
								document.getElementById('jquery-lightbox').style.top = ImgTop;
                                document.getElementById('jquery-lightbox').style.left = ImgLeft;
								}
								
		}
		
		
		function getFrame(){

			if(globalvarParam=='member' && globalnormalBox==''){
				$('#policysubMenu').slideToggle("slow");
				document.getElementById('policyredImg').src = '/eDamanApp/en/images/red-arrow.gif';
			}
			else if(globalvarParam=='policyHolder' && globalnormalBox==''){
				$('#memsubMenu').slideToggle("slow");
				document.getElementById('memredImg').src = '/eDamanApp/en/images/red-arrow.gif';
			}
			
			if(globalnormalBox!='normalBox'){
			if(globalsubMenuParam){
					$('#subMenu').slideToggle('normal',function() {
					if ($(this).is(':visible')) {
						$('#redImg').attr('src',$('#redImg').attr('src').replace('red-arrow','down-arrow'));
					}
					else {
						$('#redImg').attr('src',$('#redImg').attr('src').replace('down-arrow','red-arrow'));
					}
				});}
				}
			for(t=0;t<xmlobj.length;t++){
	if(globalvarParam==xmlobj[t].getAttribute('name'))
		{
				var videoLink = xmlobj[t].getElementsByTagName('link');
				var srcLink = videoLink[globalvar-1].childNodes[0].nodeValue;
				var videoLinks = document.getElementById(globalvarParam).getElementsByTagName('a');
				if(preObj!=null){
				videoLinks[globalvar-1].className = 'fontNormal';
				}
				videoLinks[globalvar-1].className = 'fontBold';
				preObj = videoLinks[globalvar-1];
		}
}			
			document.getElementById('wrapper').innerHTML='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="100%" HEIGHT="490" id="myMovieName"><PARAM NAME=movie VALUE="'+srcLink+'"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><param name="wmode" value="transparent"><EMBED src="'+srcLink+'" quality=high bgcolor=#FFFFFF WIDTH="100%" HEIGHT="490" NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash" wmode="opaque" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
			
			}
			
		
			
		/**
		 * Prepares image exibition; doing a image�s preloader to calculate it�s size
		 *
		 */
		function _set_image_to_view() { // show the loading
			// Show the loading
			$('#lightbox-loading').show();
			if ( settings.fixedNavigation ) {
				$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
			} else {
				// Hide some elements
				$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
			}
			
				// Perfomance an effect in the image container resizing it
				_resize_container_image_box(936,580);

		};
		/**
		 * Perfomance an effect in the image container resizing it
		 *
		 * @param integer intImageWidth The image�s width that will be showed
		 * @param integer intImageHeight The image�s height that will be showed
		 */
		function _resize_container_image_box(intImageWidth,intImageHeight) {
			// Get current width and height
			var intCurrentWidth = $('#lightbox-container-image-box').width();
			var intCurrentHeight = $('#lightbox-container-image-box').height();
			// Get the width and height of the selected image plus the padding
			var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image�s width and the left and right padding value
			var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image�s height and the left and right padding value
			// Diferences
			var intDiffW = intCurrentWidth - intWidth;
			var intDiffH = intCurrentHeight - intHeight;
			// Perfomance the effect
			$('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });
			if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {
				if ( $.browser.msie ) {
					___pause(250);
				} else {
					___pause(100);	
				}
			} 
			$('#lightbox-container-image-data-box').css({ width: intImageWidth });
			$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
		};
		/**
		 * Show the prepared image
		 *
		 */
		function _show_image() {
			$('#lightbox-loading').hide();
			$('#lightbox-image').fadeIn(function() {
				//_show_image_data();
			});
			_enable_keyboard_navigation();
		};
		/**
		 * Show the image information
		 *
		 */
		function _show_image_data() {
			$('#lightbox-container-image-data-box').slideDown('fast');
			$('#lightbox-image-details-caption').hide();
		}
		
		function _enable_keyboard_navigation() {
			$(document).keydown(function(event) {
				_keyboard_action(event);
			});
		}
		/**
		 * Disable the support to keyboard navigation
		 *
		 */
		function _disable_keyboard_navigation() {
			$(document).unbind();
		}
		/**
		 * Perform the keyboard actions
		 *
		 */


		function _keyboard_action(e) {
			
			
			var kC  = (window.event) ?    // MSIE or Firefox?
                 event.keyCode : e.keyCode;

			
			if(kC==27 && flag1==1){
				_finish();
			}

			if(kC==27 && flag1==3){
				_finish();
			}
			
			if(kC==27 && flag1==2){
				normalState();
			}
			
			
		}

		function normalState(){
			setPos();
			var lgtLogo = document.getElementById('headLogo');
			var lgtLftNav = document.getElementById('videoLink');
			var videoObj = document.getElementById('myMovieName');
			var embedObj = document.getElementsByTagName('EMBED');
			var popImg = document.getElementById('popupIcon');
			if(document.getElementById('demoBox')){
			var rgtTd = document.getElementById('demoBox').offsetParent;
			}
			flag1=0;
				setTimeout(function(){clearFlag()},100);
				$(lgtLogo).fadeIn("slow");
				$(lgtLftNav).fadeIn("slow");
				videoObj.style.height = 490+"px";
				videoObj.style.width = '100%';
				if(navigator.appVersion.indexOf("MSIE")==-1){
				embedObj[0].style.height = 490+"px";
				embedObj[0].style.width = '100%';
				}

				/*if(navigator.appVersion.indexOf("MSIE")!=-1){
				$('#jquery-lightbox').animate({
				width: 936,
				height: 580,
				left:ImgLeft,
				top:ImgTop
			  }, 100 );
				}*/

				//else{
					$('#jquery-lightbox').css({
					width: 936,
					height: 580,
					left: ImgLeft,
					top:ImgTop
				  });
					$('#lightbox-container-image-box').css({
					width: 936,
					height: 580
				  });
					$('#demoTable').css({
					width: 936,
					height: 580
				  });
				//}

				/*$('#lightbox-container-image-box').animate({
				width: 936,
				height: 580
			  }, 500 );
				$('#demoTable').animate({
				width: 936,
				height: 580
			  }, 500 );*/

			  //setTimeout(function(){setData()},10);


				document.getElementById('demoBox').style.width="100%";
				document.getElementById('demoBox').style.border='1px solid #d6dee1';
				document.getElementById('popDetail').style.display = '';
				rgtTd.style.paddingRight = '10px';
				//document.getElementById('popupIcon').src = '/eDamanApp/en/images/full-screen.gif';
				setTimeout(function(){document.getElementById('popupIcon').src = '/eDamanApp/en/images/full-screen.gif'},10);
				document.getElementById('lightbox-secNav-btnClose').style.display = '';
				document.getElementById('cautionTxt').style.display = '';
				var parentDiv = document.getElementById('popupIcon').parentNode;
				parentDiv.style.right = '35px';
				$('#shareLink').show();
		}

		function setData(){
			  document.getElementById('lightbox-container-image-box').style.width = 936+"px";
			  document.getElementById('lightbox-container-image-box').style.height = 580+"px";
			  document.getElementById('demoTable').style.width = 936+"px";
			  document.getElementById('demoTable').style.height = 580+"px";
		}
		
		function clearFlag(){
		 flag1 = 1;
		}

		
		function _finish() {
			$("object").remove();
			$('#jquery-lightbox').remove();
			if(document.getElementById('toolTip')){
			document.getElementById('toolTip').style.display = 'none';
			}
			$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
			// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
			$('embed, object, select').css({ 'visibility' : 'visible' });
		}
		/**
		 / THIRD FUNCTION
		 * getPageSize() by quirksmode.com
		 *
		 * @return Array Return an array with page width, height and window width, height
		 */
		function ___getPageSize() {
			var xScroll, yScroll;
			if (window.innerHeight && window.scrollMaxY) {	
				xScroll = window.innerWidth + window.scrollMaxX;
				yScroll = window.innerHeight + window.scrollMaxY;
			} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
				xScroll = document.body.scrollWidth;
				yScroll = document.body.scrollHeight;
			} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
				xScroll = document.body.offsetWidth;
				yScroll = document.body.offsetHeight;
			}
			var windowWidth, windowHeight;
			if (self.innerHeight) {	// all except Explorer
				if(document.documentElement.clientWidth){
					windowWidth = document.documentElement.clientWidth; 
				} else {
					windowWidth = self.innerWidth;
				}
				windowHeight = self.innerHeight;
			} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode		
				windowWidth = document.documentElement.clientWidth;
				windowHeight = document.documentElement.clientHeight;
			} else if (document.body) { // other Explorers
				windowWidth = document.body.clientWidth;
				windowHeight = document.body.clientHeight;
			}	
			// for small pages with total height less then height of the viewport
			if(yScroll < windowHeight){
				pageHeight = windowHeight;
			} else { 
				pageHeight = yScroll;
			}
			// for small pages with total width less then width of the viewport
			if(xScroll < windowWidth){	
				pageWidth = xScroll;		
			} else {
				pageWidth = windowWidth;
			}
			arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
			return arrayPageSize;
		};
		/**
		 / THIRD FUNCTION
		 * getPageScroll() by quirksmode.com
		 *
		 * @return Array Return an array with x,y page scroll values.
		 */
		function ___getPageScroll() {
			var xScroll, yScroll;
			if (self.pageYOffset) {
				yScroll = self.pageYOffset;
				xScroll = self.pageXOffset;
			} else if (document.documentElement && document.documentElement.scrollTop) {	 // Explorer 6 Strict
				yScroll = document.documentElement.scrollTop;
				xScroll = document.documentElement.scrollLeft;
			} else if (document.body) {// all other Explorers
				yScroll = document.body.scrollTop;
				xScroll = document.body.scrollLeft;	
			}
			arrayPageScroll = new Array(xScroll,yScroll);
			return arrayPageScroll;
		};
		 /**
		  * Stop the code execution from a escified time in milisecond
		  *
		  */
		 function ___pause(ms) {
			var date = new Date(); 
			curDate = null;
			do { var curDate = new Date(); }
			while ( curDate - date < ms);
		 };
		// Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
		return this.unbind('click').click(_initialize);
	};
	
})(jQuery); // Call and execute the function immediately passing the jQuery object



