﻿var WinPrint;
function CallPrint() {


    var prtContent = document.getElementById('printareaid');
    var WinPrint = window.open('', '', 'resizable=yes,letf=0,top=0,width=800,height=600,toolbar=0,scrollbars=1,status=0');
  
    WinPrint.document.write("<input type='button' value='Print' onclick='window.print();'></br>");
    WinPrint.document.write(prtContent.innerHTML);  
    
    WinPrint.document.close();    
    WinPrint.focus();   
   // WinPrint.print();
   // WinPrint.close();
    //prtContent.innerHTML = strOldOne;
    return false;
     
   
}

function Download(Pageurl) {
    //alert(Pageurl);
    window.open(Pageurl, '', 'letf=0,top=0,width=800,height=600,toolbar=0,scrollbars=0,status=0');
    return false;

}

function CallAuthenticationFunction() {
    alert('You are not authenticated user to rate this article.');
    return false;
}


function Confirmalertmessage(signin)
{
var  alerttext=document.getElementsByTagName('input');
var confirmMessage = false;


	for(var Count=0; Count<alerttext.length ; Count++ )
	{
	 if(alerttext[Count].attributes['type']!=null)
	 {
	  	var imagetype = alerttext[Count].attributes['type'].value;	          				
		if(imagetype =='image') 
		{
			
			 if(alerttext[Count].attributes['title'].value=="Alert Me")
		     {
		        if(signin != 'false')
			     {
			        confirmMessage=confirm("Are you sure to receive an alert if there is any new information in this section ?");
			     }
			    else if(signin != 'true')
			     {
			        alert("Plese login/signin for alert functionality.");
			     }
		     }
		     else if(alerttext[Count].attributes['title'].value=="Remove Alert")
		     {
		  	      confirmMessage=confirm("Are you sure to stop receiving an alert if any new information is added in this section ?");	     
		     }
		}	
	 } 
	}

if (confirmMessage)
  {
 // alert(confirmMessage);
  return true;
  }
else
  {
  return false;
  }
  
 // return confirmMessage;

}


/*function Confirmalertmessage()
{
	//alert("Alert");
	
	var  alerttext=document.getElementsByTagName('input');
	var confirmMessage;
	//alert(alerttext);
	for(var Count=0; Count<alerttext.length ; Count++ )
	{
	 if(alerttext[Count].attributes['type']!=null)
	 {
	  	var imagetype = alerttext[Count].attributes['type'].value;	          				
		if(imagetype =='image') 
		{
			
			 if(alerttext[Count].attributes['title'].value=="Alert Me")
		     {
		     // alert(alerttext[Count].attributes['title'].value);
		     confirmMessage=confirm("Are you sure to receive an alert if there is any new information in this section ?");
		     }
		     else if(alerttext[Count].attributes['title'].value=="Remove Alert")
		     {
		    // alert(alerttext[Count].attributes['title'].value);
		      confirmMessage=confirm("Are you sure to stop receiving an alert if any new information is added in this section ?");	     
	
		     }
		}	
	 } 
	}
	if (confirmMessage)
	  {
	 // alert(confirmMessage);
	  return true;
	  }
	else
	  {
	  return false;
	  }
  
 // return confirmMessage;
}


*/

/*
window.onunload = function()
{
	if(self.screenTop>9000)
		alert('Closed.');
}
*/
/*
window.onbeforeunload = function()
{
	if((window.event.clientX<0)||(window.event.clientY<0))
		alert("close");
}
*/
/*
window.onclose = function()
{
	alert("do you want to exit");
}

*/

//document.body.onUnload = eraseCookie("SiteState");
/*
window.onbeforeunload = function(evt)
{
 	eraseCookie("SiteState");
}*/

/*
var bodyelement=document.getElementsByTagName("body");
//alert(bodyelement);
bodyelement.setAttribute('onUnload','alert("Hi")');
alert(bodyelement.onUnload);
*/