
function gotoSubscriptionPage()
{ auf('Drm_dialog');
    //document.getElementById("detail").src="RestrictedSite.aspx?ResType="+ parent.document.getElementById("hdRestrictionType").value;	
}

function setPageUrl(pgno)
{   if(!parent.location.hash || parent.location.hash.indexOf("#pg") != 0)   
    {
       parent.location.hash='pg1';
       
    }
    else
    {   
        parent.location.hash = "pg"+pgno;
    }
}
function handleAll(pgno,sh)
{

  if(Number(pgno)<=Number(parent.document.getElementById("hdNumPageDRM").value))
    {
	    parent.document.getElementById("pgno").value=pgno;	
	    setDetailSrc(sh);
	    changestatus(pgno);
	    handlePageSrc();
	    setPageUrl(pgno);		    
    }
    else    
    {
        var searchPage = Number(parent.document.getElementById("hdSearchPage").value)
        var n = Number(parent.document.getElementById("hdNumPageDRM").value)
        if(searchPage>0)
        { if ((searchPage - n)< Number(pgno)&& (searchPage + n)> Number(pgno))
            {
                parent.document.getElementById("pgno").value=pgno;	
	            setDetailSrc(sh);
	            changestatus(pgno);
	            handlePageSrc();
	            setPageUrl(pgno);
            }
            else
            {
             gotoSubscriptionPage();
            }
        }
        else
        {     
          gotoSubscriptionPage();
        }
    }
}

function setDetailSrc(sh)
{   windowWidth = getWidth();
	windowHeight = getHeight();	
    if(sh)
    {
        parent.document.getElementById("detail").src="fullimage1.aspx?ed="+parent.document.getElementById("hdQEid").value+"&pgno="+  parent.document.getElementById("pgno").value +" &mode=" + parent.document.getElementById("mode").value + "&standardview=" + parent.document.getElementById("txtstandardviewpath").value + "&search=S&magnifiedview=" + parent.document.getElementById("txtMagnifiedViewPath").value + "&Sresolution=" + windowWidth+"&pageLimit="+parent.document.getElementById("hdNumPageDRM").value;			
    }
    else
    {
        parent.document.getElementById("detail").src="fullimage1.aspx?ed="+parent.document.getElementById("hdQEid").value+"&pgno="+  parent.document.getElementById("pgno").value +" &mode=" + parent.document.getElementById("mode").value + "&standardview=" + parent.document.getElementById("txtstandardviewpath").value + "&magnifiedview=" + parent.document.getElementById("txtMagnifiedViewPath").value + "&Sresolution=" + windowWidth+"&pageLimit="+parent.document.getElementById("hdNumPageDRM").value;			
    }
}

function getWidth() 
{
    var width;
    if (self.innerWidth)
     {  
        width = parent.self.innerWidth;
     }
else if (document.documentElement && document.documentElement.clientWidth) 
{
        width = parent.document.documentElement.clientWidth;
       
}
else if (document.body) 
{
        width = parent.document.body.clientWidth;
        
}
else 
{
        // don't know width
        width = 0;
}
    return width;
}

function getHeight() {
    var height;
    //alert('height');
    if (self.innerHeight) {
      height = parent.self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) {
        height = parent.document.documentElement.clientHeight;
    }
    else if (document.body) {
        height = parent.document.body.clientHeight;
    }
    else {
        // don't know height
        height = 0;
    }
    return height;
}

//Disable Right Click
function clickIE4()
{
    if (event.button==2)
    { return false; }
}

function clickNS4(e)
{	if (document.layers||document.getElementById&&!document.all)
	{	if (e.which==2||e.which==3)
		{return false;
		}
	}
}

/*End - Disable right click*/

function openWindow(url,name) 
{
    //avoid pop-up blocking
	name = 'w' + Math.round(Math.random()*(1000000000));
	w = screen.width - 10;
	h = screen.height - 40;
	nurl = url;
	window.open(nurl,name,'toolbar=no,menubar=no,resizable=yes,scrollbars=yes,left=0,top=0,width=' + w + ',height=' + h);
}


function download()
{
openStandardWindow('download.asp?FileName='+readCookie("PdfName"),'download');
}


/*********************************settings-start*****************************/
function setChanges()
{           


		/*check which radio button is clicked*/
		var radioCheckvalue;
		var ZoomCheckValue,ZoomCheckValue_M,standardview,magnifiedview;
		var i;
		windowWidth = getWidth();
		windowHeight = getHeight();
		//single page,two page 
		for (i = 0; i < document.Form1.RadioZoom.length; i++) 
		{
			if (document.Form1.RadioZoom[i].checked)
			{
			radioCheck = document.Form1.RadioZoom[i].value;
			}
		}
		//set the value of mode textbox
		document.getElementById("mode").value=radioCheck;
			
		
		//check zoom level
	
	for (i = 0; i < document.Form1.ZoomLevel.length; i++) 
		{
			if (document.Form1.ZoomLevel[i].checked)
			{
			//ZoomCheckValue = document.Form1.ZoomLevel[i].value;
		
			ZoomCheckValue = document.Form1.ZoomLevel[i].value;
			
			}
		}
		
		//full zomm
			if (document.Form1.chkIncZoomfactor.checked)
			{
			ZoomCheckValue_M ="true";
			}
	
		
		//document.getElementById("txtstandardviewpath").value=ZoomCheckValue;
		document.getElementById("txtstandardviewpath").value =  ZoomCheckValue;
		document.getElementById("txtMagnifiedViewPath").value=ZoomCheckValue_M;
	
			//changeSelZoom(ZoomCheckValue);
		zu('settings_dialog');
		var pgno,mode;
		
		if(document.getElementById("detail").src.indexOf("javapagecontent.html")>=0  )
		{
			document.getElementById("detail").src="javapagecontent.html";
		}
		else if(document.getElementById("detail").src.indexOf("fullimage1.aspx")>=0 || document.getElementById("detail").src=="" )
		{
		    setDetailSrc();		
		}
	
}


function OpenContent()
{      
		document.getElementById("pgno").value =readCookie("ContentPage");		
		setDetailSrc();
		changestatus(document.getElementById("pgno").value);
		handlePageSrc();
		setPageUrl(document.getElementById("pgno").value);
}

/*Handle goto*/
function gotopage(pageno)
{	
	var c,i;	
	c=readCookie("LastPage");
	i=parseInt(c);
	if(pageno=="Cover 1")
				pgno=1;
	else if(pageno=="Cover 2")
				pgno=2;
	else if(pageno=="Cover 3")
				pgno=i-1;
	else if(pageno=="Cover 4")
				pgno=i;
	else
				pgno=pageno;

   handleAll(pageno);
}


function gotoTextPage()
{
var windowWidth = getWidth();
var pageno;
	var standardview,magnifiedview;
	var c,i;
	var standardview,magnifiedview;
	windowWidth = getWidth();
	windowHeight = getHeight();
	c=readCookie("LastPage");
	i=parseInt(c);
	
	pageno=parent.document.getElementById("ToolBar_TxtGoToPage").value;
		
	if(pageno=="Cover 1")
				pgno=1;
	else if(pageno=="Cover 2")
				pgno=2;
	else if(pageno=="Cover 3")
				pgno=i-1;
	else if(pageno=="Cover 4")
				pgno=i;
	else
				pgno=pageno;	
					
	handleAll();
	
}


/*function to hide and show div tags - search,links,contents,archives,settings*/

function auf(bildertausch)
{
	createCookie("valueofdiv",bildertausch);
	document.getElementById("searchresult").value=bildertausch;	
	document.getElementById("download_dialog").style.visibility="hidden";
    document.getElementById("print_dialog").style.visibility="hidden";   
    document.getElementById("archives_dialog").style.visibility="hidden";
    document.getElementById("find_dialog").style.visibility="hidden";			      
    document.getElementById("share_dialog1").style.visibility="hidden";	
    document.getElementById("comments_dialog").style.visibility="hidden"; 
    document.getElementById("settings_dialog").style.visibility="hidden"; 
      document.getElementById("Drm_dialog").style.visibility="hidden"; 
    document.getElementById(bildertausch).style.visibility="visible";	  
	if (bildertausch=="settings_dialog")
	{		    
        var radiostandardview,radiomagnifiedview,radiomode;  
        //show the radio buttons that are checked
        radiomode=readCookie("Mode");		      
	    //check for magnified zoom value
		radiomode=parent.document.getElementById("mode").value;				
		
	    if ("1"==radiomode)
	    {
    	   document.Form1.RadioZoom[0].checked=true;
	    }
	    else
	    {
			document.Form1.RadioZoom[1].checked=true;
	    }        
	 }

    else if(bildertausch=="share_dialog1")
    {  
        document.getElementById("sharewindow").src="mailanartical.aspx?pg="+ document.Form1.pgno.value + "&mode=" + document.Form1.mode.value;
    }
     else if(bildertausch=="archives_dialog")
    {  
        document.getElementById("archiveWindow").src="archive.aspx";
    }
    else if(bildertausch=="comments_dialog")
    {	
        document.getElementById("CommentsWindow").src="comments.aspx?pg="+ document.Form1.pgno.value + "&mode=" + document.Form1.mode.value;
    }
    else if(bildertausch=="print_dialog")
    {	
        document.getElementById("printwindow").src="printpage.aspx?pagelimit="+ document.getElementById("hdNumPageDRM").value;
    }
    else if(bildertausch=="Drm_dialog")
    {	
        document.getElementById("drmWindow").src="RestrictedSite.aspx?ResType="+ parent.document.getElementById("hdRestrictionType").value+"&cid="+parent.document.getElementById("hdCid").value+"&QEid="+parent.document.getElementById("hdQEid").value;	
    }
		return;
}	
	/*Function to call thumb view of pages*/	
	function handleThumbsClick()
	{
	    document.getElementById("detail").src="javapagecontent.html";	
	}
	
	/* Function to close the div tags*/	    
	function zu(bildertausch) 
	{	
        parent.document.getElementById("searchresult").value="";    
        parent.document.getElementById(bildertausch).style.visibility="hidden";        
    }	
          
 
var ie=document.all
var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers
var InitTwoWaitTime = 100;
win1=false
win2=false
win3=false
aa=1
bb="30523650"
var ie=document.all
var ns6=document.getElementById&&!document.all
var boxid
var parentid
var dragapproved=false
var z,x,y
var menu1=false;
var menu2=false;
function drags(e){
if (!ie&&!ns6)
return
var firedobj=ns6? e.target : event.srcElement
var topelement=ns6? "HTML" : "BODY"
if (firedobj.tagName!="INPUT" && firedobj.tagName!="scrollbar" && firedobj.id!="settings2" && firedobj.id!="archive1")
{
    while (firedobj.tagName!=topelement&&firedobj.className!="drag")
    {	
		firedobj=ns6? firedobj.parentNode : firedobj.parentElement
    }
   
 }

if (firedobj.className=="drag")
{
	dragapproved=true
	z=firedobj
	temp1=parseInt(z.style.left+0)
	temp2=parseInt(z.style.top+0)
	x=ns6? e.clientX: event.clientX
	y=ns6? e.clientY: event.clientY
	document.onmousemove=move
	return false
}
}

function move(e)
{
if (dragapproved)
{

z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
if (parseInt(z.style.top)<32 )  
{
	
		z.style.top=32;
}

if (parseInt(z.style.left)<0 ) 
	z.style.left=0;
	//	alert(screen.width);
if(ie)
{
 if((z.style.left + 370) > screen.width)
 z.style.left=370;
 }
 if(ns6)
 {
 if((z.style.left + 370) > document.body.clientWidth)
 z.style.left=370;
  }

return false
}
}

function createCookie(name,value) 
{   
  document.cookie = name+"="+value;
}

function readCookie(name)
 {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++)
    {
        var c = ca[i];
        while (c.charAt(0)==' ')
        c = c.substring(1,c.length);
        if (c.indexOf(nameEQ) == 0)
        return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*Handle Image src click*/
function handlePageSrc()
{
    var pgno,i;
    var c;

    c=readCookie("LastPage");
    i=parseInt(c);

    pgno=parseInt(parent.document.getElementById("pgno").value);
    if(pgno<1)
    {
	    pgno=1;
	    parent.document.getElementById("pgno").value='1';
    }
    else if(pgno>i) 
    {
	    pgno=i;
	    parent.document.getElementById("pgno").value=c;
    }

    //first page button
    if(pgno=="1")
    {	    
        if(parent.document.getElementById("previous-page").src.indexOf("over")<=0)	
	    document.getElementById("previous-page").src = document.getElementById("previous-page").src.replace(/.gif/, "_over.gif");
    		
	    if(parent.document.getElementById("First-page").src.indexOf("over")<=0)
	    parent.document.getElementById("First-page").src = parent.document.getElementById("First-page").src.replace(/.gif/, "_over.gif");
    }
    else
    {  
	    parent.document.getElementById("previous-page").src = parent.document.getElementById("previous-page").src.replace(/_over/, "");	 
	    parent.document.getElementById("First-page").src = parent.document.getElementById("First-page").src.replace(/_over/, "");	
    		
    }
    if(pgno==i)
    { 
        if(parent.document.getElementById("Next-page").src.indexOf("over")<=0)  
	    parent.document.getElementById("Next-page").src = parent.document.getElementById("Next-page").src.replace(/.gif/, "_over.gif");	
    	 
	    if(parent.document.getElementById("Last-page").src.indexOf("over")<=0)  
 	    parent.document.getElementById("Last-page").src = parent.document.getElementById("Last-page").src.replace(/.gif/, "_over.gif");   
    }
    else
    {   	
	    parent.document.getElementById("Next-page").src = parent.document.getElementById("Next-page").src.replace(/_over/, "");	 	  
 	    parent.document.getElementById("Last-page").src = parent.document.getElementById("Last-page").src.replace(/_over/, "");		
    }
}



/*Handle previous Page click*/

function handlePreviousPageClick()
{
    var c,lastpage,mode,pgno;
    if(!parent.document.getElementById("pgno"))
    {			
	    return false;
    }
    if(isNaN(parent.document.getElementById("pgno").value))
    {
	    return false;
    }

    var ie=document.all
    var ns6=document.getElementById&&!document.all	

    pgno=parseInt(parent.document.getElementById("pgno").value)
    if(pgno=="1")
    return;		
		
    mode=parent.document.getElementById("mode").value;
    if(mode==2)
    {
	    if(pgno>1)
		    pgno=parseInt(parent.document.getElementById("pgno").value) - 2;
	    else
		    pgno=parseInt(parent.document.getElementById("pgno").value);
    }
    else
    {
	
	    if(pgno>1)
		    pgno=parseInt(parent.document.getElementById("pgno").value) - 1;
	    else
		    pgno=parseInt(parent.document.getElementById("pgno").value);
    }
      
      handleAll(pgno);
  			
}

function handleLastPageClick()
{
    var c,nextpagevalue,pgno;
    var i;
   
    if(!parent.document.getElementById("pgno"))
    {
	    return false;
    }
    if(isNaN(parent.document.getElementById("pgno").value))
    {
	    return false;
    }
    c=readCookie("LastPage");

    if(parent.document.getElementById("pgno").value==c)
    return;
    
    pgno=c;    
    handleAll(c);       
}
function changepage(pgno)
{
	var c,mode,pgno;
	var i,mode1;		
    parent.document.getElementById("pgno").value=pgno;   
    setDetailSrc();     
}

function handleNextPageClick()
{
    var c,mode,pgno;
    if(!parent.document.getElementById("pgno"))
    {
	    return false;
    }
    if(isNaN(parent.document.getElementById("pgno").value))
    {
	    return false;
    }
    var no=parent.document.getElementById("pgno").value;
    var i,mode1;
    c=readCookie("LastPage");

    if(parseInt(c)%2!=0 && (parseInt(no) +1)==c)
    {
        parent.document.getElementById("pgno").value=parseInt(no) +1;
    }
    if(parent.document.getElementById("pgno").value==c)
    return;
    var ns6=document.getElementById&&!document.all;		
    var ie=document.all;
    	
    if(parent.document.getElementById("pgno").value=="")
        parent.document.getElementById("pgno").value=1;
        
    if(parent.document.getElementById("mode").value=="")
        parent.document.getElementById("mode").value=2;
        
    mode=parent.document.getElementById("mode").value;

    if(mode==2)
	    pgno=parseInt(parent.document.getElementById("pgno").value) + 2;
    else
	    pgno=parseInt(parent.document.getElementById("pgno").value) + 1;

    handleAll(pgno);       
  	
}


/*first page*/
function handleFirstPageClick()
{       
		var ie=document.all
		var ns6=document.getElementById&&!document.all
		if(!parent.document.getElementById("pgno"))
		{
			return false;
		}
		if(isNaN(parent.document.getElementById("pgno").value))
		{
			return false;
		}		
		pgno=parseInt(parent.document.getElementById("pgno").value)
		
		if(pgno=="1")
		return;		
		
		 handleAll(1);      
  	
}

//for text serach
function movenext(pgno)
{
    document.getElementById("startingrecord").value = pgno;
    document.Form1.submit();
    document.getElementById("startingrecord").value = pgno;

}

//for search in another site
function movenextsite(pgno,site)
{
    document.getElementById("startingrecord").value = pgno;
    window.open(site);
}

//function Changepg()
//{
//    document.getElementById("detail").src="fullimage1.aspx";
//}

function changediv()
{
    document.Form1.submit();
    document.Form1.divtagsvisibility.value="find_dialog"
    if(document.Form1.divtagsvisibility.value=="find_dialog")
    document.getElementById("find_dialog").style.visibility="visible";
}
	
function getsearchPage(pgno,searchword,pdfname,site,publication)
	{
		var  mode;	
		var search;		
		if (document.all)
	    {   // IE version
			try 
			{
				var xml = new ActiveXObject("Microsoft.XMLHTTP");
				xml.Open( "GET", "SearchInputPage.aspx?searchword=" + searchword + "&pdfname=" + pdfname + "&pageno=" + pgno +"&mode="+ parent.document.getElementById("mode").value, false );
				xml.Send()
				rp=xml.responseText;
			}
			catch (e) 
			{
			var xml = new ActiveXObject("MSXML2.XMLHTTP.4.0");
			xml.Open( "GET", "SearchInputPage.aspx?searchword=" + searchword + "&pdfname=" + pdfname + "&pageno=" + pgno+"&mode="+ parent.document.getElementById("mode").value, false );
			xml.Send()
			rp=xml.responseText;
			}
		}
		else
		{
			// Mozilla/Netscrap 6+ version			
			var xml=new XMLHttpRequest();
			xml.open("GET","SearchInputPage.aspx?searchword=" + searchword + "&pdfname=" + pdfname + "&pageno=" + pgno+"&mode="+ parent.document.getElementById("mode").value,false);
			xml.send(null);
			rp=xml.responseText;
		}
		
		//mode=parent.document.getElementById("mode").value;
		//parent.document.getElementById("pgno").value=pgno.toString();	
	
		if (publication=="current")
		{  handleAll(pgno,'search');       
		//setDetailSrc('search');
		
		}
		else
		{
		
		var site1=site + "?pg=" + pgno + "&mode=" + parent.document.getElementById("mode").value ;
		window.open(site1);
		
		}		
		//changestatus(pgno);	
	}
	

var DELAY_AFTER_KEYDOWN = 50;  // in ms (1000 = 1s)
var ALT_KEY = 18;

var SHIFT_X_KEY     = 88;
var PAGE_UP_KEY     = 33;
var PAGE_DOWN_KEY   = 34;
var ARROW_UP_KEY    = 38;
var ARROW_DOWN_KEY  = 40;
var ARROW_LEFT_KEY  = 37;
var ARROW_RIGHT_KEY = 39;
//alert(document.captureEvents(Event.KEYDOWN));
var ns4 = (document.layers)? true:false;
var ie4 = (document.all)? true:false;

var current_x = 0; // Know where we are, scrolling around...
var current_y = 0; // Know where we are, scrolling around...

var last_x = 0; // So we remember where we were the last time we moved...
var last_y = 0; // So we remember where we were the last time we moved...

document.onkeydown = handleKeyDown;
window.onscroll    = handleScroll;

if (ns4) {
  document.captureEvents(Event.KEYDOWN);
}

function handleScroll () {
    current_x = document.body.scrollLeft || window.pageXOffset;
    current_y = document.body.scrollTop || window.pageYOffset;
}

/* **************************************************
   handleKeyDown()

   Responds to key press events.

 ************************************************** */

function handleKeyDown (e) {
if ((event.keyCode=='122') && window.opener)
window.close('fs');
  var pushed_key = 'default';

  if (ie4) {
    pushed_key = event.keyCode;
  } else {
    pushed_key = e.which;
    
  }

  setTimeout("getScrollPos("+pushed_key+")", DELAY_AFTER_KEYDOWN);
}


function getScrollPos(pushed){

  if (!ie4) { return; }

  // Note: all of these document.body.scrollTop and
  // document.body.scrollLeft entries are IE-specific, and will need a
  // netscape check using self.pageYOffset (and X)... I think.

  if(current_y == last_y) { // Then we're at the end, move on:
  //pushed == PAGE_DOWN_KEY  ||
    if ( pushed == ARROW_DOWN_KEY || pushed == PAGE_DOWN_KEY ) {
         handleNextPageClick();
    }
    //pushed == PAGE_UP_KEY ||
    if ( pushed == ARROW_UP_KEY || pushed == PAGE_UP_KEY){
   // alert('prev1');
      handlePreviousPageClick();
    }
  }

  if(current_x == last_x) { // Then we're at the end, move on:
    if (pushed == ARROW_LEFT_KEY){
   // alert('next2');
      handlePreviousPageClick();
    }
    if (pushed == ARROW_RIGHT_KEY){
  //alert('prev2');
      handleNextPageClick();
    }
  }

  last_x = current_x;
  last_y = current_y;
}

function changestatus(pgno)
{
		c=readCookie("LastPage");		
		if(parseInt(pgno)>parseInt(c))
				pgno=c;
		 if(pgno=="0")
		 pgno="1";
		
		var feature=readCookie("GoTo");
		
		if (feature=="DropDown")
		{
		if(pgno=="1")
		{
					parent.window.status="Cover 1";
					parent.document.getElementById("ToolBar_ddPages").value="1";
					
		}
			
		else if(pgno=="2")
		{

					parent.window.status="Cover 2";
					parent.document.getElementById("ToolBar_ddPages").value="1";
					
			
		}
		else if(parseInt(pgno)==parseInt(c)-1)
		{
					parent.window.status="Cover 3";
					parent.document.getElementById("ToolBar_ddPages").value=(parseInt(c)-1).toString();
					
		}
		else if(parseInt(pgno)==parseInt(c))
		{
					
					parent.window.status="Cover 4";
					parent.document.getElementById("ToolBar_ddPages").value=c.toString();
					
		}
		else
			{					
					parent.document.getElementById("ToolBar_ddPages").value=pgno;
					
					var tooltipval=parent.document.getElementById("tooltip1").value;
					
					var toolval= tooltipval.split(";");
					
					for(i=0;i<toolval.length;i++)
					{
					if(toolval[i].indexOf(pgno.toString() +":")==0)
					{
						var a=toolval[i].replace(pgno.toString() +":",'')
						if (isNaN(a))
							parent.window.status=a;
						else
							parent.window.status="Page " + a;
					 
					 }
					}
				
			}
	
	}
	
	if (feature=="Text")
	{
	//For GoTo TextBox
	if(pgno=="1")
		{
		
		
					parent.window.status="Cover 1";
					parent.document.getElementById("ToolBar_TxtGoToPage").value="1";
					
		}
			
		else if(pgno=="2")
		{	parent.window.status="Cover 2";
			parent.document.getElementById("ToolBar_TxtGoToPage").value="2";	
		}
		else if(parseInt(pgno)==parseInt(c)-1)
		{
					parent.window.status="Cover 3";
					parent.document.getElementById("ToolBar_TxtGoToPage").value=(parseInt(c)-1).toString();
		}
		else if(parseInt(pgno)==parseInt(c))
		{
					parent.window.status="Cover 4";
					parent.document.getElementById("ToolBar_TxtGoToPage").value=c.toString();
					
		}
		else
			{
					
					parent.document.getElementById("ToolBar_TxtGoToPage").value=pgno;					
					var tooltipval=parent.document.getElementById("tooltip1").value;					
					var toolval= tooltipval.split(";");					
					for(i=0;i<toolval.length;i++)
					{
					if(toolval[i].indexOf(pgno.toString() +":")==0)
					{
						var a=toolval[i].replace(pgno.toString() +":",'')
						if (isNaN(a))
							parent.window.status=a;
						else
							parent.window.status="Page " + a;
					 }
					}
					
			}
	
	}
			
}

function openReSizableWindow(url,name) {
	name = 'w' + Math.round(Math.random()*(1000000000));	
	nurl = url;
	window.open(nurl,name);//,'toolbar=no,menubar=no,resizable=yes,scrollbars=yes,left=0,top=0,width=' + w + ',height=' + h);
}
function openStandardWindow(url,name) 
{
	//alert('hiy');
	name = 'w' + Math.round(Math.random()*(1000000000));
	parent.window.open(url,name,'toolbar=yes,menubar=yes,resizable=yes,scrollbars=yes,left=5,top=5');
}

function zoomimagedimensions()
{
if (dragexecuted) return; 
	var imagezoomval=parent.document.getElementById("TxtZoomFolders").value;
	var imageval= imagezoomval.split(",");
	var zoomx;
	var zoomy;
    var k ;
    var size;
    var m,n;
    size = imageval.length-1;
	if (zoomfactor1 ==0)
	{
    var iL =document.getElementById("imp").offsetLeft;
    var iT= document.getElementById("imp").offsetTop;  
    var sWidth= document.getElementById("img0").style.width.replace("px","");
    sWidth = Number(sWidth); sWidth=sWidth/2;
    
      pagex=pagex-(iL-sWidth);   
      pagey=pagey-iT;
        //alert(pagex);
		zoomfactor1 = 1;
		var windowWidth1 = getWidth();
		var windowHeight1 = getHeight();
		document.getElementById("img1").style.display="block";
		document.getElementById("img0").style.display="none";
		setvideoDiv("img1");
		var i,j;
		
	   
	for (i=1; i<=(size/2); i++)
	    {   
	        if(document.getElementById("stSize").value==i)
		    { 
	            for(j=i+1; j<=(size/2); j++)
	            { 
			        if(document.getElementById("mfSize").value==j)
			        {
			            m=i*2;
			            n=j*2
			           
			           zoomx=imageval[n-2]/imageval[m-2];
				       zoomy=imageval[n-1]/imageval[m-1];
				       
				        break;	
			        }	
			       	   
			    } 
			     break;   	    
	        }
	       
	    }
	
	var windowWidth = getWidth();
	var windowHeight = getHeight();
	if ((windowWidth-60>pagex) && (windowHeight-60>pagey) &&  document.getElementById("mfSize").value<=10)
	{
		//alert("in");
		pagey=parseInt(eval((pagey*zoomy)-(windowHeight/2)),10);
		pagex=parseInt(eval((pagex*zoomx)-(windowWidth/2)),10);
		
	}
	else
	{	//alert("out");
	    pagey=parseInt(eval((pagey*zoomy)),10);
	    pagex=parseInt(eval((pagex*zoomx)),10);
	    
	}
	
	if (pagey < 0) 
	{
	pagey = 0;
	}
	if (pagex < 0)
	{
	pagex = 0;
	}

	scrollTo(pagex,pagey);	
}
    else if (zoomfactor1 ==1)
    {
        zoomfactor1 = 0;
        document.getElementById("img0").style.display="block";
        document.getElementById("img1").style.display="none";
        setvideoDiv("img0");
    }
	
}

    
    function removeComponent(pagename,pgno)
    {			
        parent.document.getElementById("pgno").value =pgno;	
        handleAll(pgno);
    }

	
	function MyFuntion()
	{
	   setTimeout('zoomfactor()',50);
	}            