
//checking for session


//file for Inserting the controls

/* 
File Name : insctrl.js
Author : Alok Kumar.
Date : 20/3/2001
Revisions : None
Ginni (21.08.2001) - Added fnSearchCitation for Case Summaries
Ginni (3.09.2001)- Added fnCitation for getting equivalent citations
*/
var citationPath = "/citation/citation.asp";
var nxtpath = "/nxt/gateway.dll";

var SC = "sc";


var text = "";
function getActiveText(e) { 


text = (document.all) ? document.selection.createRange().text : document.getSelection();


return true;
}

document.onmouseup = getActiveText;
function fnSearch(inCode){
omenu.style.display ="none";
top.fnRightSearchRedirect(inCode, text)

}

var cw=0;
var cst=null;
var resz=0;
var ctrl;
N=(document.all)?0:1;
var X,Y,p;

function document_onclick(){

 
omenu.style.display ="none";
ch=false;


cst=null;

cw=0;
resz=0;

}

function document_onkeydown()
{
	
	if (event.shiftKey){
		omenu.setCapture();
	}
}

function document_onkeyup()
{
	omenu.releaseCapture();
}
//function to handle the mouseover event on the context menu
function mOver()
{
	window.event.srcElement.parentElement.style.background="#001583";
}
function mOut()
{
	window.event.srcElement.parentElement.style.background="#AD0B16";
}



var ch=false;
function shmenu(){

if (ch==false){

omenu.setCapture();
		if(event.clientX >0){
			omenu.style.left=event.offsetX	;
		}

		if(event.clientY>0){
			omenu.style.top=event.offsetY;
		}
		omenu.style.display ="block";
		ch=true;
		omenu.releaseCapture();
		}
		else {
		omenu.style.display ="none";
		ch=false;
		}
		return false;
}
window.onload=fnInit;
var iOffset=10;
var mv;
function fnInit(){
	mv=false;
	omenu.style.display ="none";
	document.oncontextmenu =shmenu;
}

function fnSearchCitation(strCitationNumber) {
//LOOKS ONLY IN SUPREME COURT
	//window.location.href = nxtpath + '?xhitlist_q="' + strCitationNumber +'"xhitlist&xhitlist_x=Advanced&xhitlist_s=relevance-weight&xhitlist_d=' + SC + '&xhitlist_hc=&xhitlist_xsl=xhitlist.xsl&xhitlist_vpc=first&xhitlist_sel=title%3Bpath%3Bcontent-type%3Bhome-title%3Bhit-context';
	window.location.href =nxtpath + '?xhitlist_q="' + strCitationNumber + '"&f=xhitlist&xhitlist_x=Advanced&xhitlist_s=contents&xhitlist_d=' + SC + '&xhitlist_hc=&xhitlist_xsl=xhitlist.xsl&xhitlist_vpc=first&xhitlist_sel=title%3Bpath%3Bcontent-type%3Bhome-title%3Bhit-context';
}
function fnCitation (strCitation){
	window.location.href = citationPath + '?manu=' + strCitation;
}
function fnPrintEmail() {
	document.write ('<p class="centerAlign"><a href="#" onClick="window.print()">Print this page</a> || <a href="http://www.manupatra.com/email.asp">Email this page</a></p>');
}

function fnOpenMentioned(smanuid)
{
location.href="/asp/mentionedin.asp?code="+smanuid
}

//code for getting cross ciattions by shyam 20050118
function fnOpenGlobalPopUp(vPath,vCode,vType){
var strproperties
if (vType=="1")
{
strproperties="height=300,width=500,top=70,left=100,status=no,scrollbars=yes,resizable=1,maximize=null"
}
else
{
strproperties="height=400,width=600,top=50,left=50,status=no,scrollbars=yes,resizable=1,maximize=null"
}

window.open(vPath +'?code='+vCode,"popup",strproperties);
}


function prnemail()
{
window.open("/PagePrnEmail/print.asp",'prn',"width=400,height=220")
}


function fnOpenCatch(vmanuid){


window.open("/asp/ShowCatch.asp?vmanuid="+vmanuid,"popup","height=400,width=600,top=50,left=50,status=no,scrollbars=yes,resizable=1,maximize=null");
}

function fnMentionedIn(smanu)
{
location.href="/asp/mentionedin.asp?vmanuid="+smanu
}



function OpenNote(paths)
{
window.open("/mynotepad/edittitles.asp?spath="+paths,'note',"width=650,height=500,scrollbars=yes")
}


function fnopencounsel(strname) {
var sURL

sURL = nxtpath + '?xhitlist_q= [field counselsa: ' + strname + '] or  [field counselsr: ' + strname + ']&f=xhitlist&xhitlist_x=Advanced&xhitlist_s=field: decidedon,Desc&xhitlist_d=sc,highcourt1,HighCourt2,HighCourt3,HighCourt4,HighCourt5,tribunal&xhitlist_hc=&xhitlist_xsl=xhitlist.xsl&xhitlist_mh=10000&xhitlist_vpc=first&xhitlist_sel=title%3Bpath%3Bcontent-type%3Bhome-title%3Bhit-context%3Bfield:catchwords';

//sURL = nxtpath + '?xhitlist_q=[field counselsa: ' + strname + ']&f=xhitlist&xhitlist_x=Advanced&xhitlist_s=decidedon,Desc&xhitlist_d=&xhitlist_hc=&xhitlist_xsl=xhitlist.xsl&xhitlist_mh=10000&xhitlist_vpc=first&xhitlist_sel=title%3Bpath%3Bcontent-type%3Bhome-title%3Bhit-context%3Bfield:catchwords';
location.href = sURL; 
}


function buydoc(vmanuid) 
{
	location.href="/ManupatraInternational/Search/BuyProducts.aspx?vmanuid="+vmanuid;
}
