function PopUp(ref) {	
	var args = "toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=no,height=540,width=700";
	var win = window.open(ref, "", args);
	win.opener = top;
}
function PopUpEditAnswer(ref) {	

	var args = "toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=yes,height=600,width=800";
	var win = window.open(ref, "", args);
	win.opener = top;
}
function PopUp2(ref) {	
	var args = "toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=yes,height=350,width=500";
	var win = window.open(ref, "", args);
	win.opener = top;
}
function PopUp3(ref) {	
	var args = "toolbar=no,status=no,menubar=no,location=no,scrollbars=no,resizable=no,height=500,width=500,left=300,top=200";
	var win = window.open(ref, "", args);
	win.opener = top;
}
function CustPopUp(ref,height,width) {		
	var args = "toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=yes,height=" + height + ",width=" + width + ",top=" + ((screen.height - 600)/2).toString()+ ",left="+((screen.width - 800)/2).toString();	
	var win = window.open(ref, "popup", args);
	win.opener = top;
}
function CustPopUp2(ref,height,width) {	
	var args = "toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=no,height=" + height + ",width=" + width + ",top=" + ((screen.height - 600)/2).toString()+ ",left="+((screen.width - 800)/2).toString();
	var win = window.open(ref, "P2", args);
	win.opener = top;
}
function PopUpSelling(ref) {	
	var args = "toolbar=no,status=no,menubar=no,location=no,scrollbars=yes,resizable=yes,height=500,width=980";
	var win = window.open(ref, "", args);
	win.opener = top;
}

function CheckMaxLimit(str)
{
	if(str.length>2500)
	 {
	  alert("The text entered is too long to be displayed on the report. Limit is 2500 characters. The message \"The sponsor's notes are too long to appear in the summary report. Please refer to the reference pages in the Offering Memorandum/ Prospectus for details on this topic.\" will be displayed for this field on report.")
	 }		
}

function CheckMaxCharLimit(str,len)
{
	if(str.length>len)
	 {
	  alert("Maximum limit of " + len + " characters has been exceeded. Current length is: " + str.length + " characters." )
	 }		
}

function windowOpener(windowHeight, windowWidth, windowName, windowUri)
{
    var centerWidth = (window.screen.width - windowWidth) / 2;
    var centerHeight = (window.screen.height - windowHeight) / 2;

    newWindow = window.open(windowUri, windowName, 'resizable=0,width=' + windowWidth + 
        ',height=' + windowHeight + 
        ',left=' + centerWidth + 
        ',top=' + centerHeight);

    newWindow.focus();
    //return newWindow.name;
}
function CustPopUpWithToolbar(ref,height,width) {		
	var args = "toolbar=yes,status=no,menubar=no,location=yes,scrollbars=yes,resizable=yes,height=" + height + ",width=" + width + ",top=" + ((screen.height - 600)/2).toString()+ ",left="+((screen.width - 800)/2).toString();	
	var win = window.open(ref, "popup", args);
	win.opener = top;
}
