/* abstract popup starts here */

var http = false;
var mover=0;

var popupwindow;
var isIE3 = (navigator.appVersion.indexOf("MSIE 3") != -1) ? true : false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
}

 
// Login Page Start

function formSubmit(form){
//document.myform.submit();
 //alert("test ");
//alert(form.txtAccount.value);
var str=trim(form.txtAccount.value);
str = str.replace(/\s+/g,'');
var str1=trim(form.txtUserId.value);
str1 = str1.replace(/\s+/g,'');


var pword = form.txtPassword.value;

if (str1 =="" && pword =="" && str ==""){
	alert ("Please enter User Id  and Password or Account no.");
	form.txtUserId.value="";
	form.txtAccount.value="";
	form.txtUserId.focus();
	return false;
}

if (str1 !="" && pword ==""){
	alert ("Please enter Password ");
	form.txtPassword.focus();
	return false;
}

if (str1 =="" && pword !=""){
	alert ("Please enter User Id ");
	form.txtUserId.focus(); 
	return false;
}

if (str1 !="" && pword !="" && str !=""){
	alert ("Please enter either User Id  and Password or Account no.");
	return false;
}

for (var i = 0; i < str.length; i++)  
{
var ch = str.substring(i, i + 1);
if (((ch < "0" || "9" < ch) && (ch < "-" || ":" < ch) && (ch < "(" || ")" < ch)) && ch != ' ')
{
alert("\Invalid Account Number");
form.txtAccount.focus(); 
form.txtAccount.select();
return false;
   }
} 
 
if(str!="" ){
	form.j_username.value=form.txtAccount.value;
	
	form.subnum.value="true";
	//alert(form.j_username.value);
	form.j_password.value=form.txtAccount.value;
	//form.submit(); 
} else if(str1!=""){
	form.j_username.value=form.txtUserId.value;
	form.j_password.value=form.txtPassword.value;
	//alert(form.j_username.value);
	form.subnum.value="false";
	//form.submit(); 
} else {
	alert(" Please enter User Id /account no." );
	return false;
}


//return false;

}

// Login Page End

// Member Login Page Start
function memberlogin_frm(form){
//document.myform.submit();
 //alert("test ");
//alert(form.txtAccount.value);
var str1=trim(form.j_username.value);
str1 = str1.replace(/\s+/g,'');


var pword = form.j_password.value;


if (str1 =="" && pword =="" ){
	alert ("Please enter User Id  and Password ");
	return false;
}

if (str1 !="" && pword ==""){
	alert ("Please enter Password ");
	return false;
}

if (str1 =="" && pword !=""){
	alert ("Please enter User Id ");
	return false;
}


//return false;

}
// Member Login Page End





function tocAbstract_popup(chapUniqueId,evt){
width=screen.width
height=screen.height
//alert("test "+width +" height "+height);
divTag="subcontent"+chapUniqueId;

divTagTemp=document.getElementById(divTag);	
divTagTemp.style.visibility = "visible"; 
 var vv=evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop :
   document.body.scrollTop);
   if(vv>400 &&evt.clientY>400){
divTagTemp.style.top=vv-300;
  }
  else{
  divTagTemp.style.top=vv;
  }
  divTagTemp.style.right=width-evt.clientX-30;
  //alert(" width "+width +" evt.clientX  "+ evt.clientX +"evt.clientY  "+evt.clientY);
 // divTagTemp.style.left=widthvv-300;
//   alert("evt.clientY  "+vv);
   
   
http.open("POST", "tocAbstractPopUp.action",true);

http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

http.send("chapId="+chapUniqueId);

http.onreadystatechange=function(){

if(http.readyState == 4) 

{
//alert(http.responseText);
document.getElementById("subcontent"+chapUniqueId).style.display="inline"
document.getElementById(divTag).innerHTML=http.responseText;	


}

}

}

function pagination(divid,url) {
// alert (divid+"&"+url); 
  http.abort();
  // alert(url) 
	http.open("POST", url, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById(divid).innerHTML = http.responseText;
    }
      }
  http.send(null);
}


function searchPagination(divid,url) {

var users = document.getElementById("users").value;
url = url+"&users="+users;
// alert (divid+"&"+url); 
  http.abort();
  // alert(url) 
	http.open("POST", url, true);
  http.onreadystatechange=function() {
    if(http.readyState == 4) {
      document.getElementById(divid).innerHTML = http.responseText;
    }
      }
  http.send(null);
}

function searchReportsSearch(){
	document.searchReportsForm.action = "searchReportsSearch.action";
	document.searchReportsForm.submit();
}

function nonTextPagination(divid,url){
	http.abort();
	// alert(url)
	
	var startDate = document.getElementById("startDate1").value;
	var endDate = document.getElementById("endDate1").value;
	//alert (instiname +stats+startDate+endDate);
	url=url+"&startDate1="+startDate+"&endDate1="+endDate;
	// alert(url);
	http.open("POST", url, true);
	//http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	//http.send("cmeLogBook.institute=hai")
	//http.send("cmeStatusValue=hai")
	// http.send("startDate="+startDate)
	// http.send("endDate="+endDate)
	
	http.onreadystatechange=function() {
		if(http.readyState == 4) {
		//alert(http.responseText);
		document.getElementById(divid).innerHTML = http.responseText;
		}
	}
	http.send(null);
}

function prgUserPagination(divid,url){
	http.abort();
	
	var fieldName=document.getElementById("fieldName").value;	
	var fieldValue=document.getElementById("TxtFirstName5").value;
	
	//alert (instiname +stats+startDate+endDate);
	url=url+"&fieldName="+fieldName+"&fieldValue="+fieldValue;
	
	http.open("POST", url, true);	
	
	http.onreadystatechange=function() {
		if(http.readyState == 4) {
		//alert(http.responseText);
		document.getElementById(divid).innerHTML = http.responseText;
		}
	}
	http.send(null);
}

function prgReportPagination(divid,url){
	http.abort();
	
	var wcStatDate=document.getElementById("wcStatDate").value;	
	var wcEndDate=document.getElementById("wcEndDate").value;
	
	//alert (instiname +stats+startDate+endDate);
	url=url+"&wcStatDate="+wcStatDate+"&wcEndDate="+wcEndDate;
	
	http.open("POST", url, true);	
	 
	http.onreadystatechange=function() {
		if(http.readyState == 4) {
		//alert(http.responseText);
		document.getElementById(divid).innerHTML = http.responseText;
		}
	}
	http.send(null);
}


function cmePagination(divid,url) {
	http.abort();
	// alert(url)
	var instiname=document.getElementById("cmeLogBook.institute").value;	
	var stats=document.getElementById("cmeStatusValue").value;
	var startDate = document.getElementById("startDate").value;
	var endDate = document.getElementById("endDate").value;
	//alert (instiname +stats+startDate+endDate);
	url=url+"&cmeLogBook.institute="+instiname+"&cmeStatusValue="+stats+"&startDate="+startDate+"&endDate="+endDate;
	//alert(url);
	http.open("POST", url, true);
	//http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	//http.send("cmeLogBook.institute=hai")
	//http.send("cmeStatusValue=hai")
	// http.send("startDate="+startDate)
	// http.send("endDate="+endDate)
	
	http.onreadystatechange=function() {
		if(http.readyState == 4) {
		//alert(http.responseText);
		document.getElementById(divid).innerHTML = http.responseText;
		}
	}
	http.send(null);
}


function ppvReportPagination(divid,url) {
	http.abort();
	// alert(url)
	// alert (document.getElementById("acpChapters.chapterId").value+" & "+document.getElementById("startDate").value+" & "+document.getElementById("endDate").value);
	var chapterId=document.getElementById("acpChapters.chapterId").value;	
	var startDate = document.getElementById("startDate").value;
	var endDate = document.getElementById("endDate").value;
	//alert (instiname +stats+startDate+endDate);
	url=url+"?acpChapters.chapterId="+chapterId+"&startDate="+startDate+"&endDate="+endDate;
	// alert(divid+" &&& "+url);
	http.open("POST", url, true);
	//http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	//http.send("cmeLogBook.institute=hai")
	//http.send("cmeStatusValue=hai")
	// http.send("startDate="+startDate)
	// http.send("endDate="+endDate)
	
	http.onreadystatechange=function() {
		if(http.readyState == 4) {
		// alert(http.responseText);
		document.getElementById(divid).innerHTML = http.responseText;
		}
	}
	http.send(null);
}


function tocAbstract_popout(chapUniqueId){

	divTag="subcontent"+chapUniqueId;
	mover=1;
	setTimeout("hideDiv('" + divTag + "')", 100);

}



function hideDiv(divTag)
{
	if (mover==1)
	{
	//document.getElementById(divTag).innerHTML="";
	document.getElementById(divTag).style.display="none";
	}
}



function displayContent()
{
	mover=0;
}


function unloadContent(divId)
{
	mover=1;
	setTimeout("hideDiv('" + divId + "')", 100);

}



/* abstract popup ends here */

        
/*
Advanced Search Start here
*/
			function trim(str){	
				while(str.substring(0,1) == " "){		
					str = str.substring(1);
				}
				while(str.substring(str.length-1,str.length) == " "){		
					str = str.substring(0,str.length-1);
				}
				return str;
			}
			/*
			function clearText(){
				document.searchWindow.keyWord.value = "";
			} 
			function callChapterSearch(search){
				  
					search = trim(search);
				if (search.length == 0) {
					alert ('Please enter your search item');
					document.chapterSearch.searchKeyWord.value="";
					document.chapterSearch.searchKeyWord.focus();
				}
				else {
					document.chapterSearch.action = "chapterSearch.action";
					document.chapterSearch.method = "post";
					document.chapterSearch.submit(); 
				}
				
			}
			
			function calladvancedSearchHTML(search){
				search = trim(search);
				if (search.length == 0) {
					alert ('Please enter your search item');
					document.chapterSearch.searchKeyWord.value="";
					document.chapterSearch.searchKeyWord.focus();
					return false;
				}
				if(search.length < 3){
					alert('Please enter your search item atleast three character');
				}else{
					if(checkSpecialCharacter(search)){
						alert('Special characters like & # % \' are not allowed');
					}else{						
						return true; 
					}
				}
				return false;				
			}
			function checkKeyWord(str){
				document.searchWindow.advancedSearchKeyWord.focus();
				str = trim(str);
				if(str.length == 0){
					alert('Please enter your search item');
					document.searchWindow.advancedSearchKeyWord.value="";
					return false;
				}
				if(document.searchWindow.thesaurus.checked && str.length < 2){
						alert('Please enter your search item atleast two character');
				}else if(!document.searchWindow.thesaurus.checked && str.length < 3){
						alert('Please enter your search item atleast three character');
				}else{
					if(checkSpecialCharacter(str)){
						alert('Special characters like & # % are not allowed');
					}else if(checkCheckBox()) {						
						return true;
					}else{
						alert('Please choose at least one check box from include');
					}
				}
				return false;
			}
			
			*/
			
			function defaultSearchHTML(keyword){
			
				keyword = trim(keyword);
				
				if (keyword.length == 0) {
					alert ('Please enter your search item');
					document.chapterSearch.searchKeyWord.value="";
					document.chapterSearch.searchKeyWord.focus();
					return false;
				}
				if(keyword.length < 2){
					alert('Please enter your search item atleast two character');
				}else if(restrictCharacters(keyword)){
					return true;
				}
				return false;
			}
			
			function restrictCharacters(keyword){
				if (keyword.substring(0,1) == "*" || keyword.substring(1,1) == "*" || keyword.substring(0,1) == "?" || keyword.substring(1,1) == "?") {
					alert ('The first and second character should not be a * or ?.');
					return false;
				}				
				return true;
			}
			
			function advancedSearchHTML(keyword){
			
				document.searchWindow.advancedSearchKeyWord.focus();
				keyword = trim(keyword);
				if(keyword.length == 0){
					alert('Please enter your search item');
					document.searchWindow.advancedSearchKeyWord.value="";
					return false;
				}
				if(document.searchWindow.thesaurus.checked && keyword.length < 2){
						alert('Please enter your search item atleast two character');
				}else if(!document.searchWindow.thesaurus.checked && keyword.length < 3){
						alert('Please enter your search item atleast three character');
				}else if(restrictCharacters(keyword)){
					if(checkCheckBox()) {						
						return true;
					}else{
						alert('Please choose at least one check box from include');
					}
				}
				return false;
			}
			/*
			function checkSpecialCharacter(str){				
				for(var i=0;i<str.length;i++){
					if(str.substring(i,i+1) == '&' || str.substring(i,i+1) == '#' || str.substring(i,i+1) == '%'){
						return true;
					}
				}
				return false;
			}
			*/
			
			function saveAndSearch(){
				keyword = trim(document.searchWindow.advancedSearchKeyWord.value);
				searchTitle = trim(document.searchWindow.searchTitle.value);
				if(advancedSearchHTML(keyword)){
					if(searchTitle.length > 0){
					 	if(isAlphabet(searchTitle)){					 		
							document.searchWindow.action = "htmlAdvSaveAndSearch.action";
							document.searchWindow.method = "post";
							document.searchWindow.submit();
						}
						else{
							alert('Please enter only alphabets to save');
						}
					}else{
						alert('Please enter your search title');
					}
				}
			}
			
			
			
			/*
			function saveAndSearch(){
				keyword = trim(document.searchWindow.advancedSearchKeyWord.value);
				searchTitle = trim(document.searchWindow.searchTitle.value);
				if(advancedSearchHTML(keyword)){
					if(searchTitle.length > 0){
						document.searchWindow.action = "htmlAdvSaveAndSearch.action";
						document.searchWindow.method = "post";
						document.searchWindow.submit();
					}else{
						alert('Please enter your search title');
					}
				}
			}
			*/
			
			function isAlphabet(str){								
				var alpha = new Array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ");
				var flag = false;
				var count = 0; 			
				for(var i=0;i<str.length;i++){
					for(var j=0;j<alpha.length;j++){
						if(str.substring(i,i+1).toUpperCase() == alpha[j]){
							count = count + 1;
						}
					}
				}
				if(count == str.length){
					flag = true;
				}
				return flag;
			}
			
			function checkKeyWordReset(){
				document.searchWindow.reset();
				document.searchWindow.advancedSearchKeyWord.value="";
				document.searchWindow.searchTitle.value="";
				
				checkKeyWordResetDefault();
			}
			
			function checkKeyWordResetDefault(){
				//document.searchWindow.thesaurus.checked="thesaurus";	
				document.searchWindow.thesaurus.checked=false;								
				document.searchWindow.chapter.checked=true;
				document.searchWindow.table.checked=true;
				document.searchWindow.figure.checked=true;
				document.searchWindow.mcmaster.checked=true;
				document.searchWindow.reference.checked=false;				
			}
			
			function thesaurusPop(){
				window.open('thesaurusPop.action','Thesaurus','width=700,height=500,top=180,left=75,scrollbars=yes');
			}
			
			function searchTips(){								
				window.open('searchTips.action','searchTips','width=700,height=500,top=180,left=75,scrollbars=yes');
			}
			
			function checkCheckBox(){
				var flag = false;
				if(document.searchWindow.chapter.checked || document.searchWindow.figure.checked || document.searchWindow.reference.checked || document.searchWindow.table.checked || document.searchWindow.mcmaster.checked){
					flag = true;
				}
				return flag;
			}			
			function popup(date,id)     
   			 { 
   			 
	  				var w = 1200;   
					var h = 700;  
					var winl = (screen.width-w)/2;
					var wint = (screen.height-h)/2;
					if (winl < 0) winl = 0;
						if (wint < 0) wint = 0;
							var page = "cmeQuestion.action?attendDate="+date+"&cmeTopics.cmetopicId="+id+"&firstlog=true";               
 							windowprops = "height="+h+",width="+w+",top="+ wint +",left="+ winl +",location=0,"
								+ "scrollbars=yes,menubars=yes,toolbars=yes,resizable=yes,status=yes";
								popupwindow=window.open(page, "Popup", windowprops);
				  				popupwindow.moveTo(winl,wint);
  		 	}  
  		 	
  		 	
  		 	
  		 	function cmeTestPopup(id,attendDate){
    //alert (id);
  var w = 1200; 
  var h = 700; 
  var winl = (screen.width-w)/2;
  var wint = (screen.height-h)/2;
  if (winl < 0) winl = 0; 
  if (wint < 0) wint = 0;
  var page = "cmeTest.action?cmeTopics.cmetopicId="+id+"&attendedDate="+attendDate+"&adate="+attendDate; 
 
  windowprops = "height="+h+",width="+w+",top="+ wint +",left="+ winl +",location=0,"
   + "scrollbars=yes,menubars=yes,toolbars=yes,resizable=yes,status=yes";
   popupwindow=window.open(page, "Popup", windowprops);
   popupwindow.moveTo(winl,wint);
 
} 

	

/*  		 	
function cmesample()    
   			 { 
	  				var w = 700;  
					var h = 800;  
					var winl = (screen.width-w)/2;
					var wint = (screen.height-h)/2;
					if (winl < 0) winl = 0;
						if (wint < 0) wint = 0;
							var page = "cmeGuest.action";               
 							windowprops = "height="+h+",width="+w+",top="+ wint +",left="+ winl +",location=0,"
								+ "scrollbars=yes,menubars=yes,toolbars=yes,resizable=yes,status=yes";
								popupwindow=window.open(page, "Popup", windowprops);
				  				popupwindow.moveTo(winl,wint);
  		 	}
*/

//////////////////////////CME GUEST //////////////////////
 function cmesample()    
    			 { 
 	  				var w = 700;  
					var h = 800;  
					var winl = (screen.width-w)/2;
					var wint = (screen.height-h)/2;
					if (winl < 0) winl = 0;
						if (wint < 0) wint = 0;
							var page = "cmeGuest.action";               
 							windowprops = "height="+h+",width="+w+",top="+ wint +",left="+ winl +",location=0,"
								+ "scrollbars=yes,menubars=yes,toolbars=yes,resizable=yes,status=yes";
								popupwindow=window.open(page, "Popup", windowprops);
				  				popupwindow.moveTo(winl,wint);
  		 	}

 ///////////////////////////////////////////////////////////////

  			
  			function drug(){
  				var textvalue = trim(document.drugInfo.queryText.value);
  				if (textvalue.length>0){
  					document.drugInfo.action = "http://search.medscape.com/drug-reference-search?queryText="+textvalue;
  					document.drugInfo.target="_blank";
  					// document.drugInfo.submit();
  					return true;
  				}
  				else{
  					alert ("Please enter something in the drugInfo box");
  					document.drugInfo.queryText.focus();
  					document.drugInfo.queryText.value="";
  					return false;
  				}
  			}
  			
  			function druginfoPopup()    
   			 {  
		window.open('http://www.medscape.com/px/drugdirectory/about-druginfo.jsp','drugInfo','width=400,height=500,menubars=yes,toolbars=yes,resizable=yes,status=yes,scrollbars=yes');		
  			 
  		 
  				
  			}
		        
/*
Advanced Search End
*/


function toggledisplaylib(id)
{	
	if(document.getElementById(id).style.display=="none" || document.getElementById(id).style.display=="")
	{
		document.getElementById(id).style.display="inline";
		//document.getElementById(imgid).src="../images/"+img1;		
	}
	else
	{
		document.getElementById(id).style.display="none";
		//document.getElementById(imgid).src="../images/"+img2;
	}
} 
function toggledisplaylibsearch(id)
{	
	if(document.getElementById(id).style.display=="none" || document.getElementById(id).style.display=="")
	{
		document.getElementById(id).style.display="inline";		
		var searchKey = trim(document.searchWindow.advancedSearchKeyWord.value);
		
		if(searchKey.length == 0){
			checkKeyWordResetDefault();
		}
	}
	else
	{
		document.getElementById(id).style.display="none";
		//document.getElementById(imgid).src="../images/"+img2;
	}
} 



function toggledisplayshowhide(showid,hideid,hidenewid)
{
 
document.getElementById(hideid).style.display="none";
document.getElementById(showid).style.display="inline";
document.getElementById(hidenewid).style.display="none";
}


function tocDivClose(hideid)
{

document.getElementById(hideid).style.display="none";
}



			function OpenBook(chapId) {
			var scw = screen.width
			var sch = screen.height 
			var book= window.open('getGuestFlexApp.action?chapterId='+chapId,null,'width='+scw+',height='+sch+',status=no,toolbar=no,menubar=no,location=no,titlebar=no,top=0,left=0,resizable=no,scrollbars=no'); 
		    }
		function RegOpenBook(chap) {
			var scw = screen.width
			var sch = screen.height 
			var book= window.open('getRegFlexApp.action?chapterId='+chap,null,'width='+scw+',height='+sch+',status=no,toolbar=no,menubar=no,location=no,titlebar=no,top=0,left=0,resizable=no,scrollbars=no'); 
		    }
		    
		    
		    function InstOpenBook(chap) {
			var scw = screen.width
			var sch = screen.height 
			var book= window.open('getInstFlexApp.action?chapterId='+chap,null,'width='+scw+',height='+sch+',status=no,toolbar=no,menubar=no,location=no,titlebar=no,top=0,left=0,resizable=no,scrollbars=no'); 
		    }

function to_old_win(theURL)
{
	opener.location.href = theURL;
}

function close_win()
{
document.forms[0].action= '../j_acegi_logout';
document.forms[0].submit();

}

function doUnload()
{
if (window.closed)
{
  document.forms[0].action= '../j_acegi_logout';
document.forms[0].submit();
}
 //if (window.event.clientX <=0 && window.event.clientY <= 0)
 //{
 
 //}
}

/////////////////////////////////////////////////////
function checkStateWhatsnew(dropdown)

{ 

var selectState;

var myindex = dropdown.selectedIndex;

selectState = dropdown.options[myindex].value;


if(selectState=="Others")
{

	if(dropdown.name=="signUpWhatsNew.state")
	{
	document.getElementById('stateOther').style.display="inline";
	
	}
	
}
	else if(dropdown.name=="signUpWhatsNew.state")
	{
	
	document.getElementById('stateOther').style.display="none"; // this is for hiding
	document.getElementById('stateOther').value="";
	}
}
/////////////////////////////////////////////////////


/////// Program Director Create User State ////////
function checkStatePrg(dropdown)
{

var selectState;

var myindex = dropdown.selectedIndex;

selectState = dropdown.options[myindex].value;


if(selectState=="Others")
{

	if(dropdown.name=="renewalForm.state")
	{
	document.getElementById('renewalForm.stateOther').style.display="inline";
	
	}
	
}
	else if(dropdown.name=="renewalForm.state")
	{
	
	document.getElementById('renewalForm.stateOther').style.display="none"; // this is for hiding
	document.getElementById('renewalForm.stateOther').value="";
	}
}

/////// Non Subscription ////////
function checkSubscribe(dropdown)
{

var selectState;

var myindex = dropdown.selectedIndex;

selectState = dropdown.options[myindex].value;


if(selectState=="0")
{

	if(dropdown.name=="check")
	{
	document.getElementById('checkOther').style.display="inline";
	
	}
	
}
	else if(dropdown.name=="check")
	{
	
	document.getElementById('checkOther').style.display="none"; // this is for hiding
	document.getElementById('checkOther').value="";
	}
}

/////// Non Subscription ////////

/////// Program Director Create User State ////////

function checkState(dropdown)

{ 

var selectState;

var myindex = dropdown.selectedIndex;

selectState = dropdown.options[myindex].value;


if(selectState=="Others")
{

	if(dropdown.name=="payPerOrderDetails.state")
	{
	document.getElementById('stateOther').style.display="inline";
	
	}
	
}
	else if(dropdown.name=="payPerOrderDetails.state")
	{
	
	document.getElementById('stateOther').style.display="none"; // this is for hiding
	document.getElementById('stateOther').value="";
	}
}
function downloadtimeout(){
document.successForm.action="download.action";
  document.successForm.submit();
	setTimeout("payPerTimeOut();",2000);
	}
	
function payPerTimeOut()
{
  document.successForm.action="payPerExpir.action";
  document.successForm.submit();
}

function divclose(divTag)
{

divTagTemp=document.getElementById(divTag);	
divTagTemp.style.visibility = "hidden"; 
//divTagTemp.style.display= "none";
}
	
// <script type="text/javascript">

function report(title,correct_ans,chapterID, question){

var ques = question-1; 



 
var submitOK="true";

 if ( ( document.f1.choiceVal[0].checked == false ) && ( document.f1.choiceVal[1].checked == false ) && ( document.f1.choiceVal[2].checked == false ) && ( document.f1.choiceVal[3].checked == false ) && ( document.f1.choiceVal[4].checked == false ) )
    {
        alert ( "Please select the choice" ); 
         submitOK="false" 
    } 

if (submitOK == "true"){ 

	    
	document.f1.action = "cmeReport.action?title="+title+"&correct_ans="+correct_ans+"&chapterID="+chapterID+"&questionID="+ques;  


	document.f1.submit();
}	
else{}
}

function checkChoice_back(question){
document.f1.action = "cmeQuestion.action?question="+question;  
document.f1.submit(); 
}

function checkChoice(question,correct_ans){ 

var submitOK="true"; 

 if ( ( document.f1.choiceVal[0].checked == false ) && ( document.f1.choiceVal[1].checked == false ) && ( document.f1.choiceVal[2].checked == false ) && ( document.f1.choiceVal[3].checked == false ) && ( document.f1.choiceVal[4].checked == false ) )
    {
        alert ( "Please select the choice" );
         submitOK="false" 
    } 

if (submitOK == "true"){ 
   
	var ans = ( document.f1.choiceVal[0].checked == false ) && ( document.f1.choiceVal[1].checked == false ) && ( document.f1.choiceVal[2].checked == false ) && ( document.f1.choiceVal[3].checked == false ) && ( document.f1.choiceVal[4].checked == false );
	document.f1.action = "cmeQuestion.action?question="+question+"&correct_ans="+correct_ans+"&cmeTopics.cmetopicId=0";   
	document.f1.submit();  
}
else{}
}

function call(ta,ca){

isSelected=1;
		
		if(ta==ca)
		{ 
			 document.getElementById("anserDiv").style.display="inline";
			 document.getElementById("falseDiv").style.display="none";
			 document.getElementById("ca").innerHTML=ca;
		}  
		else
		{  
			 document.getElementById("falseDiv").style.display="inline";
			 document.getElementById("anserDiv").style.display="none";
			 document.getElementById("ta").innerHTML=ta; 
			 document.getElementById("cura").innerHTML=ca; 
   		}	
   		document.f1.choice.value=ta;
   		var maxChoice = document.getElementById("maxChoice").value;
   		
   		for (i=1;i<=maxChoice;i++) {
   			document.getElementById(i).disabled="true";
   		}
   		 
}


function weekCuriQA(ta,ca){

isSelected=1;
		
//alert("ta "+ta);
//alert("ca "+ca);
	if(ta==ca){


		document.getElementById("anserDiv").style.display="inline";

		document.getElementById("falseDiv").style.display="none";

		document.getElementById("ca").innerHTML=ca;

		document.wc.action = "getWeekCuriculamScore.action?score=1";

		document.wc.submit();

	}else{


	document.getElementById("falseDiv").style.display="inline";

	document.getElementById("anserDiv").style.display="none";

	document.getElementById("ta").innerHTML=ta;

	document.getElementById("cura").innerHTML=ca;

	document.wc.action = "getWeekCuriculamScore.action?score=0";

	document.wc.submit();

}

	document.wc.choice.value=ta;

	var maxChoice = document.getElementById("maxChoice").value;

			for (i=1;i<=maxChoice;i++) {

				document.getElementById(i).disabled="true";

	}
   		 
   		 
   		 
}



function resetUserForm(){	
	document.individualUserForm.reset();
}

function deleteCofirmation(id){	

	var confirm = window.confirm("Are you sure want to delete?")
	if(confirm){
		document.individualUserForm.action = "programDirectorDeleteUser.action?individualUser.individualId=" + id;
		document.individualUserForm.method = "post";
		document.individualUserForm.submit();		
	}
}

function resiDeleteCofirmation(resiUserId){	

	var confirm = window.confirm("Are you sure want to delete?")
	if(confirm){
	
		document.individualUserForm.action = "resiDeleteUser.action?individualUser.individualId=" + resiUserId;
		document.individualUserForm.method = "post";
		document.individualUserForm.submit();		
	}
}

function toggleopen(id,imgid,img1,img2)
{
	
	if(document.getElementById(id).style.display=="inline" || document.getElementById(id).style.display=="")
	{
		document.getElementById(id).style.display="none";
		document.getElementById(imgid).src="../images/"+img2;
		
		
	}
	else
	{
		document.getElementById(id).style.display="inline";
		document.getElementById(imgid).src="../images/"+img1;
	}
}

/*
function checkFieldValue(action){
var fieldValue = trim(document.individualUserForm.fieldValue.value);
	if(fieldValue.length>0){
		document.individualUserForm.action = action;
		document.individualUserForm.method = "post";
		document.individualUserForm.submit();		
	}else{
		alert('Contains field should not be empty');
	}
}
*/

function checkContainsField(){
	var fieldValue = trim(document.individualUserForm.fieldValue.value);
	if(fieldValue.length>0){
		return true;
	}else{
		alert('Contains field should not be empty');
	}
	return false;
}


///////////CME GUEST Onclick///////////////////////

function callNewGuest(ta,ca){

document.f1.choice.value = ta;
   		 
   		for (i=1;i<=5;i++) {
   		if (document.getElementById(i)!=null)
   			document.getElementById(i).disabled="true";
   		} 

isSelected=1; 
		 
		if(ta==ca)
		{  
			 document.getElementById("anserDiv").style.display="inline";
			 document.getElementById("falseDiv").style.display="none";
			 document.getElementById("ca").innerHTML=ca;
		}  
		else
		{  
			 document.getElementById("falseDiv").style.display="inline";
			 document.getElementById("anserDiv").style.display="none";
			 document.getElementById("ta").innerHTML=ta; 
			 document.getElementById("cura").innerHTML=ca; 
   		}	
   		
}
///////////////////////////////////////////////////////


//////////////////////////////////

function close_bookmark(url)
{
	
	document.f1.action = url; 
    document.f1.submit();

}

function callNew(ta,ca){
document.getElementById("bookmarkhide").style.display="none";
document.getElementById("isAttend").value="yes";
document.f1.choice.value = ta;
   		 
   		for (i=1;i<=5;i++) {
   		if (document.getElementById(i)!=null)
   			document.getElementById(i).disabled="true";
   		} 

isSelected=1; 
		 
		if(ta==ca)
		{  
			 document.getElementById("anserDiv").style.display="inline";
			 document.getElementById("falseDiv").style.display="none";
			 document.getElementById("ca").innerHTML=ca;
		}  
		else
		{  
			 document.getElementById("falseDiv").style.display="inline";
			 document.getElementById("anserDiv").style.display="none";
			 document.getElementById("ta").innerHTML=ta; 
			 document.getElementById("cura").innerHTML=ca; 
   		}	
   		
}

///////////////// CME GUEST NEXT QST //////////////////////////////////////////
function cmeNextQstGuest(nextQst, correct_ans){
	
	var submitOK="true"; 
	if (document.f1.choice1.length == 3){
		if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false))
			{ 
			 alert ( "Please select the choice" );
         	 submitOK="false" 
		}
	}
	else if (document.f1.choice1.length == 4){
		if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false)&&(document.f1.choice1[3].checked == false))
		{
		 alert ( "Please select the choice" );
         submitOK="false" 
		}
	}
	else {
		if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false)&&(document.f1.choice1[3].checked == false)&&(document.f1.choice1[4].checked == false))
		{
		 alert ( "Please select the choice" );
       	 submitOK="false"    
		}
	} 

if (submitOK == "true"){ 
	
	document.f1.action = "cmeNextQstGuest.action?nextQst="+nextQst+"&correct_ans="+correct_ans; 
    document.f1.submit();
    }
else{} 
} 
////////////////////////////////////////////////////



function cmeNextQst(nextQst, correct_ans){
	
	var submitOK="true"; 
	if (document.f1.choice1.length == 3){
		if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false))
			{ 
			 alert ( "Please select the choice" );
         	 submitOK="false" 
		}
	}
	else if (document.f1.choice1.length == 4){
		if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false)&&(document.f1.choice1[3].checked == false))
		{
		 alert ( "Please select the choice" );
         submitOK="false" 
		}
	}
	else {
		if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false)&&(document.f1.choice1[3].checked == false)&&(document.f1.choice1[4].checked == false))
		{
		 alert ( "Please select the choice" );
       	 submitOK="false"    
		}
	} 

if (submitOK == "true"){ 
	
	document.f1.action = "cmeNextQst.action?nextQst="+nextQst+"&correct_ans="+correct_ans; 
    document.f1.submit();
    }
else{} 
} 


////////////////////////////CME GUEST REPORT START //////////////////////////////////////
function report_new_guest(){
	var submitOK="true"; 
	if (document.f1.choice1.length == 3){
		if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false))
		{ 
			alert ( "Please select the choice" );
			submitOK="false" 
		}
	}
	else if (document.f1.choice1.length == 4){
		if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false)&&(document.f1.choice1[3].checked == false))
		{
			alert ( "Please select the choice" );
			submitOK="false" 
		}
	}
	else {
		if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false)&&(document.f1.choice1[3].checked == false)&&(document.f1.choice1[4].checked == false))
		{
			alert ( "Please select the choice" );
			submitOK="false" 
		}
	} 

	if (submitOK == "true"){ 
		document.f1.action = "reportGuest.action";
		document.f1.submit();  
	}

	else{} 
}
///////////////////////////CME GUEST REPORT ENDS/////////////////////////////////



function report_new(questionID,chapterID,title,attendedDate,nextQst,correct_ans){

var submitOK="true"; 

if (document.f1.choice1.length == 3){

if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false))

{ 

alert ( "Please select the choice" );

submitOK="false" 

}

}

else if (document.f1.choice1.length == 4){

if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false)&&(document.f1.choice1[3].checked == false))

{

alert ( "Please select the choice" );

submitOK="false" 

}

}

else {

if ((document.f1.choice1[0].checked == false )&&(document.f1.choice1[1].checked == false)&&(document.f1.choice1[2].checked == false)&&(document.f1.choice1[3].checked == false)&&(document.f1.choice1[4].checked == false))

{

alert ( "Please select the choice" );

submitOK="false" 

}

} 


if (submitOK == "true"){ 


document.f1.action = "report.action?questionID="+questionID+"&chapterID="+chapterID+"&title="+title+"&attendedDate="+attendedDate+"&nextQst="+nextQst+"&correct_ans="+correct_ans+"&attendDate="+attendedDate;

document.f1.submit(); 

}

else{} 

} 

function formvalidation(){ 
	var flag = "true";
	var uname = trim(document.forms[0].j_username.value);
	uname = uname.replace(/\s+/g,'');
	var pword = trim (document.forms[0].j_password.value);
	pword = pword.replace(/\s+/g,'');
//alert(pword +uname)
	if (uname == "" && pword == ""){
		alert ("Please enter User Id and Password");
		document.forms[0].j_username.value = "";
		document.forms[0].j_password.value = "";
		document.forms[0].j_username.focus();
		flag = "false";
		return false;
	}

	if (uname == ""){
		alert ("Please enter User Id");
		document.forms[0].j_username.focus();
		flag = "false";
		return false;
	}

	if (pword == ""){
		alert ("Please enter Password");
		document.forms[0].j_password.value = "";
		document.forms[0].j_password.focus();
		flag = "false";
		return false;
	}

	if (flag == "true"){
		// document.forms[0].login_button.disabled = true;
		document.getElementById("logShow").style.display="inline";
		document.getElementById("logHide").style.display="none";
		//document.forms[0].action = url;
		//document.forms[0].submit();
		return true;
	}
}
 
  
function indvLoginFormvalidation(){

	var flag = "true";
	var uname = trim(document.login.j_username.value);
	uname = uname.replace(/\s+/g,'');
	var pword = trim (document.login.j_password.value);
	pword = pword.replace(/\s+/g,'');
//alert(pword +uname)
	if (uname == "" && pword == ""){
		alert ("Please enter User Id and Password");
		document.login.j_username.value = "";
		document.login.j_password.value = "";
		document.login.j_username.focus();
		flag = "false";
		return false;
	}

	if (uname == ""){
		alert ("Please enter User Id");
		document.login.j_username.focus();
		flag = "false";
		return false;
	}

	if (pword == ""){
		alert ("Please enter Password");
		document.login.j_password.value = "";
		document.login.j_password.focus();
		flag = "false";
		return false;
	}

	if (flag == "true"){
		// document.login.login_button.disabled = true;
		document.getElementById("logShow").style.display="inline";
		document.getElementById("logHide").style.display="none";
		//document.login.action = url;
		//document.login.submit();
		return true;
	}
}
 


function checkUpload(){
	var filePath = trim(document.individualUserForm.upload.value);
	if(filePath.length > 0){
		document.individualUserForm.action = "programDirectorCreateBulkUserAccount.action";
		document.individualUserForm.method = "post";
		document.individualUserForm.enctype = "multipart/form-data";
		document.individualUserForm.submit();
	}else{
		alert("Add bulk user field should not be empty");
	}
}

function checkCountry(){	
	/*
	var countryName = trim(document.individualUserForm.country.value);	
	if(countryName != "United States of America"){				
		document.individualUserForm.state.value = "Others";
	}
	*/
}

function loginPopup()    
   			 { 
	
  		var w = 600;  
			var h = 400;  
			var winl = (screen.width-w)/2;
			var wint = (screen.height-h)/2;
				if (winl < 0) winl = 0;
					if (wint < 0) wint = 0;
						var page = "loginPopup.action";               
 
						windowprops = "height="+h+",width="+w+",top="+ wint +",left="+ winl +",location=0,"
						+ "scrollbars=yes,menubars=yes,toolbars=yes,resizable=yes,status=yes";
						popupwindow=window.open(page, "Popup", windowprops);
						 
  				popupwindow.moveTo(winl,wint);
  		 
  		
  				
  			}

function limitText(limitField, limitNum) {
    if (limitField.value.length > limitNum) {
        limitField.value = limitField.value.substring(0, limitNum);
    } 
}


/*
function checkAdvancedSearchAmp(){	
	var searchKey = trim(document.searchWindow.advancedSearchKeyWord.value);	
	if(searchKey.substring(searchKey.length-1,searchKey.length) == '&'){	
		document.searchWindow.advancedSearchKeyWord.value = searchKey.substring(0,searchKey.length-1);		
	}
}

function checkDefaultSearchAmp(){	
	var searchKey = trim(document.chapterSearch.searchKeyWord.value);	
	if(searchKey.substring(searchKey.length-1,searchKey.length) == '&'){	
		document.chapterSearch.searchKeyWord.value = searchKey.substring(0,searchKey.length-1);		
	}
}
*/
// </script>	


/////// Trail Registration  ////////

function checkStatePrgTrail(dropdown)
{
	var selectState;
	var myindex = dropdown.selectedIndex;
	selectState = dropdown.options[myindex].value;

	if(selectState=="Others")
	{
		if(dropdown.name=="trailRegistration.state")
		{
			document.getElementById('stateOther').style.display="inline";
		}
	}

	else if(dropdown.name=="trailRegistration.state")
	{
		document.getElementById('stateOther').style.display="none"; // this is for hiding
		document.getElementById('stateOther').value="";
	}
}


///////  Trail Registration  ////////


function doLogOut(){
//alert(arguments[0]);
//alert(arguments[0].contains("../j_acegi_logout"));
//alert("temp  "+temp);
//alert(arguments[0]);
if(arguments[0]=="../j_acegi_logout" || arguments[0]=="../j_acegi_logout?logOutId=1&login_error=1" || arguments[0]=="../j_acegi_logout?logOutId=2&login_error=2"){

if(confirm("Are you sure you want to Logout?"))
{
 
 if (isIE3) {
         popupwindow = window.open("","Popup","HEIGHT=200,WIDTH=200")    
     }
if (popupwindow && !popupwindow.closed) {
	popupwindow.close();
}

document.menuNavigator.action = arguments[0];
document.menuNavigator.submit();
}}else{
document.menuNavigator.action = arguments[0];
document.menuNavigator.submit();
}

} 


// HIT START HERE

currentHit = new Number(0)

function initNextHit(){
   //alert("nextHit  ==  "+currentHit);
	var	x;
	nextHitVal=new String(currentHit);
	goString= new String("#hit"+nextHitVal);
	var ancObj = new Array();
	ancObj=parent.htmlReaderFrame.document.getElementsByTagName("input");
	//alert(ancObj.length);
	if(nextHitVal<ancObj.length){
	for (var i=nextHitVal; i < ancObj.length;i++){
	x = new String(ancObj[i].name)
		if (x=="hit") 
			break;
	}
	hitString= new String(ancObj[nextHitVal].value);
		parent.htmlReaderFrame.document.location.hash="#"+hitString;
		currentHit++
	}else{
		alert("There are no more terms for this document.")
	}
}


function nextHit(){
 	var	x;
	nextHitVal=new String(currentHit+1);
	goString= new String("#hit"+nextHitVal);
	var ancObj = new Array();
	ancObj=parent.htmlReaderFrame.document.getElementsByTagName("input");
	//alert(ancObj.length);
	if(nextHitVal<ancObj.length){
	for (var i=nextHitVal; i < ancObj.length;i++){
	x = new String(ancObj[i].name)
		if (x=="hit") 
			break;
	}
	hitString= new String(ancObj[nextHitVal].value);
		parent.htmlReaderFrame.document.location.hash="#"+hitString;
		currentHit++
	}else{
		alert("There are no more terms for this document.")
	}
}


function previousHit(){
	if(currentHit > 0){
		prevHitVal=new String(currentHit-1);
		var ancObj = new Array();
		ancObj=parent.htmlReaderFrame.document.getElementsByTagName("input");
		parent.htmlReaderFrame.document.location.hash="#"+ancObj[prevHitVal].value;
		currentHit--
	}else{
		alert("This is the first term in this document.")
	}
}

function showHitDiv(actionUrl){
//alert(" actionUrl   "+actionUrl);
	parent.hitViewFrame.location=actionUrl;
	parent.document.getElementById("hitViewDiv").style.display="inline";
}

function hideHitDivDoc(actionUrl1,actionUrl2){

	parent.htmlReaderFrame.location=actionUrl1;
	parent.hitViewFrame.location=actionUrl2;
	parent.document.getElementById("hitViewDiv").style.display="none";
}
function hideHitDiv(){

	parent.document.getElementById("hitViewDiv").style.display="none";
}
function printwc(){
	
	var month = document.f1.month.value;
	var year = document.f1.year.value;
	
	alert (month +" & " +year);
	document.f1.action = "print_wc_logbook.action?month="+month+"&year="+year;
	document.f1.submit();
	
}
function wc_print(){
	
	document.f1.action = "wc_print.action";
	document.f1.target = "_blank";
	document.f1.submit();
}
function wc_search1(){ 
	
	document.f1.target = "_self";
	document.f1.action = "wc_search.action";
	document.f1.submit();	
}
function inst_wc_print(){
	document.f1.action = "inst_wc_print.action";
	document.f1.target = "_blank";
	document.f1.submit();	
}
function inst_wc_search1(){
	document.f1.target = "_self";
	document.f1.action = "inst_wc_search.action";
	document.f1.submit();	
}
// HIT END HERE

function toggleDisplayDivTagImg(id,imgid,img1,img2)
{
	if(document.getElementById(id).style.display=="none" || document.getElementById(id).style.display=="")
	{
		document.getElementById(id).style.display="inline";
		document.getElementById(imgid).src="../images/"+img1;
	}
	else
	{
		document.getElementById(id).style.display="none";
		document.getElementById(imgid).src="../images/"+img2;
	}
}

function toggleDisplayDivTag(id)
{
	if(document.getElementById(id).style.display=="none" || document.getElementById(id).style.display=="")
	{
		document.getElementById(id).style.display="inline";
	}
	else
	{
		document.getElementById(id).style.display="none";
	}
}

function indiv_prg_search1() {
	document.f1.target = "_self";
	document.f1.action = "prg_indiv_search.action";
	document.f1.submit();
}

function indiv_prg_print(){
	
	document.f1.action = "indiv_prg_print.action";
	document.f1.target = "_blank";
	document.f1.submit();
}


function prg_search1(){

	document.f1.target = "_self";
	document.f1.action = "prg_search.action";
	document.f1.submit();
	
}
function prg_print(){
	
	document.f1.action = "prg_print.action";
	document.f1.target = "_blank";
	document.f1.submit();
}

function McMaterRatting(spanId,val){
	var i=1;
	var img='';
	for (i=1;i<=val;i++){
	img=img+"<img  src='../images/blacked_star.gif' />";
	}
	for (i=val;i<7;i++){
	img=img+"<img  src='../images/open_star.gif' />";
	}
	
	document.getElementById(spanId).innerHTML=img; 
}
function mcMasterSavedArticleJs(val1,val2,val3,val4,val5){

 	http.abort();
	var url="mcMasterSavedArticle.action?saveArticle.articleId="+val1+"&saveArticle.articleTitle="+val2+"&saveArticle.articleSource="+val3+"&saveArticle.authors="+val4+"&saveArticle.PMID="+val5;
	http.open("POST", url, true);	
	http.onreadystatechange=function() {
		if(http.readyState == 4) {
		alert(http.responseText);
		//document.getElementById(divid).innerHTML = http.responseText;
		}
	}
	http.send(null);
}

function mcMasterDeleteArticleJs(val1){
 	http.abort();
	var url="mcMasterDeleteArticle.action?saveArticle.id="+val1;
	http.open("POST", url, true);	
	http.onreadystatechange=function() {
		if(http.readyState == 4) {
		alert(http.responseText);
		}
	}
	http.send(null);
}
function mcMasterDeleteArticleJs(){
		alert("The article was successfully deleted from the article list.");
}
function mcMasterSavedArticleFromReaderJs(val1,val2,val3,val4,val5){

 	http.abort();
	var url="mcMasterSavedArticleFromReader.action?saveArticleFromReader.articleId="+val1+"&saveArticleFromReader.articleTitle="+val2+"&saveArticleFromReader.articleSource="+val3+"&saveArticleFromReader.PMID="+val4+"&saveArticleFromReader.acpChapterName="+val5;
	http.open("POST", url, true);	
	http.onreadystatechange=function() {
		if(http.readyState == 4) {
		alert(http.responseText);
		//document.getElementById(divid).innerHTML = http.responseText;
				}
	}
	http.send(null);
	
	/*
		var url="mcMasterSavedArticleFromReader.action?saveArticleFromReader.articleId="+val1+"&saveArticleFromReader.articleTitle="+val2+"&saveArticleFromReader.articleSource="+val3+"&saveArticleFromReader.PMID="+val4+"&openDivArticleId="+val1;
	document.bestNewEvidenceForm.action=url;
	document.bestNewEvidenceForm.method="post";
	document.bestNewEvidenceForm.submit();
	*/
	
}

function mylogbooks(){ 
		       
   			 
	
  		var w = 1200;  
			var h = 700;  
			var winl = (screen.width-w)/2;
			var wint = (screen.height-h)/2;
				if (winl < 0) winl = 0;
					if (wint < 0) wint = 0;
						var page = "mylogbook.action";               
 
						windowprops = "height="+h+",width="+w+",top="+ wint +",left="+ winl +",location=0,"
						+ "scrollbars=yes,menubars=yes,toolbars=yes,resizable=yes,status=yes";
						popupwindow=window.open(page, "Popup", windowprops);
						 
  				popupwindow.moveTo(winl,wint);
  		 
  		
  				
  			
		    }