﻿$(document).ready(function() {
    //View ISO Certificate
    $(".ISOViewer").click(
	    function()
	    {
		    $.blockUI(
		    {
			    //theme: true,
			    //draggable: true,
			    message: $('#divISO')
		    });
			
		    $(".divISOClose").click($.unblockUI);
	    }
    );

    fitDiv();
});

//Enter key press for Login
function onKeyLoginCallBack(evt) {
	if(evt != null) {
		var kCode = evt.keyCode;		
		if(kCode == null)
			kCode = evt.charCode;			
		if(kCode != null && kCode == 13)
			__doPostBack("lbox1$btnLoginX","");
	}
}

//Resizing the ISO modal to fit in any screen resolution
function fitDiv()
{
	var screenHeight = screen.height;
	var adjustingDiv = document.getElementById('divISO');
	var adjustingImg = document.getElementById('imgISO');
	//alert(screenHeight);
	
	if (screenHeight >= 960 || screenHeight >= 1024)
	{
		
		adjustingDiv.style.width = "560px";
		adjustingDiv.style.marginTop = "-310px";
		adjustingDiv.style.marginLeft= "-90px";
		adjustingDiv.style.marginRight = "auto";
		adjustingImg.style.width = "460px";
	}
	else if(screenHeight < 960 && screenHeight >= 768)
	{
		adjustingDiv.style.width = "410px";
		adjustingDiv.style.marginTop = "-240px";
		adjustingDiv.style.marginLeft= "-60px";
		adjustingDiv.style.marginRight = "auto";
		adjustingImg.style.width = "320px";
	}
	else if(screenHeight < 768 && screenHeight >= 700)
	{
		adjustingDiv.style.width = "400px";
		adjustingDiv.style.marginTop = "-235px";
		adjustingDiv.style.marginLeft= "-50px";
		adjustingDiv.style.marginRight = "auto";
		adjustingImg.style.width = "310px";
	}
	else if(screenHeight < 700 && screenHeight >= 600)
	{
		adjustingDiv.style.width = "300px";
		adjustingDiv.style.marginTop = "-180px";
		adjustingDiv.style.marginLeft= "-35px";
		adjustingDiv.style.marginRight = "auto";
		adjustingImg.style.width = "210px";
	}
	else if(screenHeight < 600 && screenHeight >= 490)
	{
		adjustingDiv.style.width = "280px";
		adjustingDiv.style.marginTop = "-175px";
		adjustingDiv.style.marginLeft= "-20px";
		adjustingDiv.style.marginRight = "auto";
		adjustingImg.style.width = "200px";
	}
}

