//<!------------------------------------------------------------------------
//
//  Created By    : Shabana Ahmed
//  Created On   : 28/07/10
//  Modified By  :
//  Modified On :
//  History      :
//  Description   :  Custom dialog box. The below functionality renders 
//						div with two confirmation buttons
//----------------------------------------------------------------------->

var leftJsConfirmUri = '';
var rightJsConfirmUri = '';

document.write(
" <div id='overlay'>" +
		"<div id='jsconfirm'>" +
			"<table cellpadding='0' cellspacing='0' border='0'>" +
				"<tr><td id='jsconfirmtitle'></td></tr>" +
				"<tr><td id='jsconfirmcontent'></td></tr>" +
				"<tr><td id='jsconfirmbuttons'>" +
					"<input id='jsconfirmleft' type='button' value='' onclick='leftJsConfirm()' onfocus='if(this.blur)this.blur()'>" +
					"&nbsp;&nbsp;" +
					"<input id='jsconfirmright' type='button' value='' onclick='rightJsConfirm()' onfocus='if(this.blur)this.blur()'>" +
				"</td></tr>" +
			"</table>" +
		"</div></div>"
	);

//<!------------------------------------------------------------------------
//
//  Created By    : Shabana Ahmed
//  Created On   : 28/07/10
//  Modified By  :
//  Modified On :
//  History      :
//  Description   :  The function "leftJsConfirm" redirects to the desired location 
//						upon click of 'Yes' button
//----------------------------------------------------------------------->

function leftJsConfirm() {
    document.getElementById('jsconfirm').style.top = -1000;
   // document.location.href = leftJsConfirmUri;
     if(navigator.appName=='Microsoft Internet Explorer')
    {
      window.open('', '_self', '');
     window.close();
    }
    else {
        document.getElementById('overlay').style.visibility = "hidden";
        window.location = "../_layouts/signout.aspx";
    }
}

//<!------------------------------------------------------------------------
//
//  Created By    : Shabana Ahmed
//  Created On   : 28/07/10
//  Modified By  :
//  Modified On :
//  History      :
//  Description   :The function "rightJsConfirm" displays the parent page 
//						upon click of 'No' button
//----------------------------------------------------------------------->

function rightJsConfirm() {
    document.getElementById('jsconfirm').style.top = -1000;
    //document.location.href = rightJsConfirmUri;
    document.location.href = document.location;
}


//<!------------------------------------------------------------------------
//
//  Created By    : Shabana Ahmed
//  Created On   : 28/07/10
//  Modified By  :
//  Modified On :
//  History      :
//  Description   :  The function "showConfirm" shows the confirm dialog box
//
//----------------------------------------------------------------------->
function showConfirm(confirmtitle, confirmcontent, confirmlefttext, confirmlefturi, confirmrighttext, confirmrighturi) {
 var strUsername = new SP.ClientContext.get_current().get_web();

    var doc = document.getElementById("overlay");
    doc.style.visibility = (doc.style.visibility == "visible") ? "hidden" : "visible";

    document.getElementById("jsconfirmtitle").innerHTML = confirmtitle;
    document.getElementById("jsconfirmcontent").innerHTML = confirmcontent;
    document.getElementById("jsconfirmleft").value = confirmlefttext;
    document.getElementById("jsconfirmright").value = confirmrighttext;

    //leftJsConfirmUri = confirmlefturi;
    //rightJsConfirmUri = confirmrighturi;

    document.getElementById("jsconfirm").style.top = '25%';
    document.getElementById("jsconfirm").style.left = '35%';

}
/*

 function CheckUserLoggedIn()
{
alert("hello");
clientContext = new SP.ClientContext.get_current().get_web().get_currentUser();
 
	if(clientContext!="")
	{
	alert('hi');
	}
}*/





