// JavaScript Document
	var ie=document.all
	var dom=document.getElementById
	var ns4=document.layers
	var calunits=document.layers? "" : "px"
	var PopupWin_bouncelimit
	var direction="up"
	var PopupWin_usedropin=0
	function PopupMe(url){
	if (!dom&&!ie&&!ns4){
	window.open(url, "", "scrollbars=1")}else{
	PopupWin_bouncelimit=32 //(must be divisible by 8)
	PopupWin_crossobj=(dom)?document.getElementById("PopupWin_dropin").style : ie? document.all.PopupWin_dropin : document.PopupWin_dropin
	PopupWin_crossframe=(dom)?document.getElementById("PopupWin_cframe") : ie? document.all.PopupWin_cframe : document.PopupWin_cframe
	PopupWin_crossframe.src=url
	if(PopupWin_usedropin){
	scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
	PopupWin_crossobj.top=scroll_top-250+calunits}
	PopupWin_crossobj.visibility=(dom||ie)? "visible" : "show"
	if(PopupWin_usedropin){
	PopupWin_dropstart=setInterval("PopupWin_dropin()",50)}}}
	function PopupWin_dropin(){
	scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
	if (parseInt(PopupWin_crossobj.top)<0+scroll_top){
	PopupWin_crossobj.top=parseInt(PopupWin_crossobj.top)+40+calunits
	if (parseInt(PopupWin_crossobj.top)>0+scroll_top){PopupWin_crossobj.top=0+scroll_top}}else{
	clearInterval(PopupWin_dropstart)
	PopupWin_bouncestart=setInterval("PopupWin_bouncein()",50)}}
	function PopupWin_bouncein(){
	PopupWin_crossobj.top=parseInt(PopupWin_crossobj.top)-PopupWin_bouncelimit+calunits
	if (PopupWin_bouncelimit<0)
	PopupWin_bouncelimit+=8
	PopupWin_bouncelimit=PopupWin_bouncelimit*-1
	if (PopupWin_bouncelimit==0){
	clearInterval(PopupWin_bouncestart)}}
	function PopupWin_dismissbox(){
		$('#mask, .window').hide();
		if (window.PopupWin_bouncestart) clearInterval(PopupWin_bouncestart)
		PopupWin_crossframe.src=""
		PopupWin_crossobj.visibility="hidden";
		
		//document.getElementById("heading_div").innerHTML="";
		var aval = eval(document.getElementById("PAGE_NAME"));
		//alert(aval);
		if(aval!=null){
			Source=document.getElementById("PAGE_NAME").value;
			//alert(Source);
			if(Source=="SCANER")
			{
				document.getElementById("PAGE_NAME").value="";
				getScanerImageName();
			}
			if(Source=="calender_view")
			{
				document.getElementById("PAGE_NAME").value="";
				dayPlus1();
				
			}
			if(Source=="weekly_view")
			{
				document.getElementById("PAGE_NAME").value="";
				weeklyRefresh();
			}
			if(Source=="p_paid")
			{
				document.getElementById("PAGE_NAME").value="";
				window.location=document.location.href;
			}
			if(Source=="E_UPLOAD")
			{
				document.getElementById("PAGE_NAME").value="";
				window.location=document.location.href;
			}
			
			
		}
		if(window.dayPlus1)
		dayPlus1();

	}
	

	
	function truebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}


/*code editred by rajeev */
var InsCardSide='';
function handleHttpResponseGetScanerImageName() {    
	if(http.readyState == 4){ 
		if(http.status==200) { 
			var results=http.responseText; 
			//alert(results);
			if(results != ""){
				if(InsCardSide=='scanFront')
					document.getElementById("scanDataResultFront").value=results;
				else if(InsCardSide=='scanBack')
					document.getElementById("scanDataResultBack").value=results;
				else
					document.getElementById("scanDataResult").value=results;						
			} 
		} 
	}
}
function getScanerImageName()
{
	
	var url = "getScanerImageName.php"; // The server-side script
	http.open("GET", url,true);
    http.onreadystatechange = handleHttpResponseGetScanerImageName; 
    http.send(null);
}

function getHTTPObject() { 
		  var xmlhttp; 
		
		  if(window.XMLHttpRequest){ 
			xmlhttp = new XMLHttpRequest(); 
		  } 
		  else if (window.ActiveXObject){ 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
			if (!xmlhttp){ 
				xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
			} 
			
		} 
		  return xmlhttp; 
		} 
		var http = getHTTPObject();
