		function OpenPage(index,isblog)
		{
			var link = '';
			switch(index)
			{
				case 1:	
					link = 'Terms/Legal.aspx#about';
					break;
				case 2:	
					link = 'Terms/Legal.aspx#disclaimer';
					break;
				case 3:
					link = 'Terms/Legal.aspx#terms';
					break;
				case 4:	
					link = 'Terms/Legal.aspx#privacy';
					break;
				default:	
					link = 'Terms/Legal.aspx';
					break;
			}
			if(isblog)
			{
				link = "../" + link;
				windowref = window.open(link,'newwin',
				'left=20,top=20,width=600,height=500,toolbar=1, scrollbars=1,resizable=0');	
			}
			else
			{
				link = "http://www.hji.co.uk/" + link;
				windowref = window.open(link,'newwin',
				'left=20,top=20,width=600,height=500,toolbar=1, scrollbars=1,resizable=0');	
			
			}
		}
		
		 var legalWindow = null;
        //Opens the popup window having ddisclaimer, about, policy, term sections        
        function OpenPage(link)
		{
			if (legalWindow != null){
				if(!legalWindow.closed)
					legalWindow.close();
			}			
			var top=300;
            var left=20;			
            if (window.screen && window.screen.height && window.screen.width)
            {
				top = (screen.height-70)/2-250;
				left = screen.width/2-300;			
			}
						
			legalWindow = window.open(link,'newwin',
			'left=' + left + ',top=' + top + ',width=600,height=500,toolbar=1, scrollbars=1,resizable=0');			
			
			legalWindow.focus();	
		}
		
		function OpenDefnPage(index)
		{
			var link = '';
			switch(index)
			{
				case 1:	
					link = 'Terms/definitions.aspx#blog';
					break;
				case 2:
					link = 'Terms/authors.aspx#author';
					break;		
				default:	
					link = 'Terms/definitions.aspx';
					break;
			}
			var hor = document.body.offsetWidth - 250;
			link = "http://www.hji.co.uk/" + link;
			
			windowref = window.open(link,'newwin',
			'left=650,top=200,width=225,height=80,toolbar=0, scrollbars=1,resizable=0,status=0,menubar=0');	
			windowref.moveTo(hor,200);						
		}
		
		function AdjustSkyscraper(){
			Outer=document.getElementById("outer");
			Skyscraper=document.getElementById("skyscraper");
			if (Outer!=null && Skyscraper!=null)
			{
				left=Outer.offsetLeft + Outer.offsetWidth;
				Skyscraper.style.left=left  + "px";					
			}
		}
		
		var registerWindow = null;
		function OpenRegisterPage(link)
		{
			if (registerWindow != null){
				if(!registerWindow.closed)
					registerWindow.close();
			}
			//Adjust the height according to the screen resolution
			var height =800;
			var left=20;
			if (window.screen && window.screen.height && window.screen.width)
			{
				height = screen.height-70;
				left = screen.width/2-380;			
			}			
			registerWindow=window.open (link, 'popupwindow','top=5,width=760,left=' + left + ',' + 'height=' + height + ',scrollbars,resizable');
			registerWindow.focus();						
		}				
		
		
		var authorWindow = null;
		//Opens the link page to confirm the redirection of authorLink
		function confirmNavigation(authorUrl,link){
			
			link=link + "?Author=" + authorUrl;
			if (authorWindow != null){
				if(!authorWindow.closed)
					authorWindow.close();
			}
			var top=300;
			var left=20;
			
			if (window.screen && window.screen.height && window.screen.width)
			{
				top = (screen.height-70)/2-125;
				left = screen.width/2-150;			
			}
			
			authorWindow = window.open(link,'newwin',
			'left=' + left + ',top=' + top + ',width=300,height=250,toolbar=0, scrollbars=0,resizable=0,status=0,menubar=0');	
		    authorWindow.focus();
		}
		
		function redirectAuthor(authorUrl){
       
			window.opener.location.href = authorUrl
			window.close();
		}
		
	
		
		
		
		
		
		
		