function printPage() {
    window.print();  
}

function stateSort(){
	var visType = checkObjectDisplay('sub1')
	if(visType=="none"){
		changeObjectDisplay('sub1', 'block');
	}else{
		changeObjectDisplay('sub1', 'none');
	}

}


     var preloadImageArray = Array();
	 var popupPrintWindow = null; //to open a popup window
	 var pageName = ""; //must me initialized with the page name of the current page!!
	 var videoWindow = null;
	 var videoPopUpWindow = null;
	 
	 function initializePageGlobal(){
			enlargeRightColumn();
			//checkForAdvocacyTables();
			preloadImages();
   	}
	
	function getEvent( event ){
		if (!event) event = window.event

		if (event.target) {
			if (event.target.nodeType == 3) event.target = event.target.parentNode
		} else if (event.srcElement) {
			event.target = event.srcElement
		}

		return event
	}
	
	function handleEnterSubmission (field, evt) {
		var keyCode = evt.which ? evt.which : evt.keyCode;
		if (keyCode == 13) {
				field.form.submit();
				
			 var aform = document.getElementById("searchform1")
			 
			 if ( aform){
				 //var keyword = document.getElementById("keyword")
				
				 aform.submit();
			 }
				return false;
		}
		else{ 
			return true;
		}
	}
		
	
	
	
	
	
	function reloadFor800Resolution(){
		var criticalWidth = 800;
		var toredirect = "";
		if ( pageName!= "" && screen.width && screen.width <= criticalWidth ) {
			//alert("screen is less than "+ criticalWidth +"!!");
			if ( pageName.indexOf("?") == -1 ) {
				toredirect = pageName + "?res800=true";
			}else{
				toredirect = pageName + "&res800=true";
			}
	
			window.location = toredirect;

		}
	}
	 

	 /* Enlarge right column, to make it expand all the way down (to the footer) */
	 function enlargeRightColumn(){

			var rightcol = document.getElementById("rightcol2content");
			if ( rightcol ) {

				var tablecenter = document.getElementById("tablecenter");
				if ( tablecenter ) {
					var aheight = getObjectHeight(tablecenter);
					rightcol.style.height =  aheight+ "px";					
				}
			}else{
				//alert("not found");
			}
		 
	 }
	 
     function preloadImages() {

			for(var loop = 0; loop < preloadImageArray.length; loop++) {
				var an_image = new Image();
				//alert("preloading " + preloadImageArray[loop] );
				an_image.src = preloadImageArray[loop];
				
			}                
    }
	
	function preloadImage( imagesrc ) {
		// Cristhian Alcantara 20060117
		// preload 1 single image only
		var an_image = new Image();
		an_image.src = imagesrc
		//alert("preloading " + imagesrc );
	}
	
	function toggleImages(thisImg, thisToggleImg) {
		// In Koo Kim 20051228
		// this method toggles the images (usually on a mouseover)
		// thisImg == image id 
		// thisToggleImg == new image relative path
		document.images[thisImg].src = thisToggleImg;
	}
	function toggleImageObj(aimg, thisToggleImg) {
		// In Koo Kim 20051228
		// this method toggles the images (usually on a mouseover)
		// thisImg == image id 
		// thisToggleImg == new image relative path
		aimg.src = thisToggleImg;
	}
	
	
	function toggleCss( id , newcss ) {
		
		var obj = document.getElementById( id );
		if ( obj ) {
				obj.className = newcss;
		}
	}
	
	function getObjectHeight( divobj ){

			var height = 0;
		
			if ( !divobj ){
				alert("error");
			}
		
			if(divobj.offsetHeight){ 	
		
				height = divobj.offsetHeight;
				
			}else if(divobj.style.pixelHeight){ 	
				height = divobj.style.pixelHeight;
			}
		
			else if(divobj.style.height){ 	
				height = divobj.style.height;
			}
		
			//alert( "height is " + height );
		
			return height;
  }

  function openPrintWindow( url ) {
	  	
			var nWidth = 650;
			var nHeight = 650;
			var x = (screen.width - nWidth) / 3;
			var y = (screen.height - nHeight) / 3;		

			var optionString = "scrollbars=yes,location=no,resizable=yes,status=no,";
			optionString += "height=" + nHeight + ",width=" + nWidth;
			optionString += ",screenX="+ x +",screenY="+ y +",top="+ y +",left="+ x;

		    if (! popupPrintWindow || popupPrintWindow.closed ) {
		    	popupPrintWindow = window.open(url,"windowPrintView",optionString);
		    } else {
		    	// window already exists, so bring it forward
			    popupPrintWindow.location.href=url;
			    popupPrintWindow.focus();
			}
	}

	function openVideoClip( url ) {
		
			var nWidth = 375;
			var nHeight = 325;
			var x = (screen.width - nWidth) / 3;
			var y = (screen.height - nHeight) / 3;		

			var optionString = "scrollbars=yes,location=no,resizable=yes,status=no,";
			optionString += "height=" + nHeight + ",width=" + nWidth;
			optionString += ",screenX="+ x +",screenY="+ y +",top="+ y +",left="+ x;

		    if (! videoWindow || videoWindow.closed ) {
		    	videoWindow = window.open(url,"videoWindow",optionString);
		    } else {
		    	// window already exists, so bring it forward
			    videoWindow.location.href=url;
			    videoWindow.focus();
			}
		
	}

 	function doPrintPage(){
		
			window.print();
	}
	
	
	/* Interstitial and protected popup javascript windows */
	
    var subModalTargetPage = '/Default.asp';  //default
	var subModalProtectedTargetPage = ""; 
	var openNewWindow = false
	
    function inter1(targetPage) {
				openNewWindow = false
                if (targetPage && targetPage != '') {
                    subModalTargetPage = targetPage;
                }
                scroll(0,0);
				if (  document.getElementById('popupTitle') ) {
					document.getElementById('popupTitle').innerHTML = '';
				}
                showPopWin('/inter1.html', 510, 290);
                changeOpac(40,'popupMask');
                
                
                return false;
  	}

    function interFlash(targetPage) {
				openNewWindow = false
                if (targetPage && targetPage != '') {
                    subModalTargetPage = targetPage;
                }
                scroll(0,0);
				if (  document.getElementById('popupTitle') ) {
					document.getElementById('popupTitle').innerHTML = '';
				}
                showPopWin('/inter1.html', 510, 290);
                changeOpac(40,'popupMask');
                
                
             
  	}

	
	
	function inter2(targetPage) {
				inter3(targetPage)
                
                return false;
  	}
	
	function inter4(targetPage) {
				inter3(targetPage)
    
  	}
	
	
	
	
	function inter3(targetPage) {
				openNewWindow = true
                if (targetPage && targetPage != '') {
                    subModalTargetPage = targetPage;
                }
                scroll(0,0);
				if (  document.getElementById('popupTitle') ) {
					document.getElementById('popupTitle').innerHTML = '';
				}
                showPopWin('/inter1.html?new=true', 510, 290);
                changeOpac(40,'popupMask');
                
                
                
  	}
	

	function protectedpage( protectedTargetPage ) {
				
		  		
                subModalProtectedTargetPage = protectedTargetPage ;
              
		
                scroll(0,0);
				if (  document.getElementById('popupTitle') ) {
					document.getElementById('popupTitle').innerHTML = '';
				}
                showPopWin('/protected.html', 510, 210);
                changeOpac(40,'popupMask');
                
                
  	}
	
	
	function popup1(){
		 showPopup1Inter( window.location.href );
	}
	
	function showPopup1Inter( targetPage ) {
				
		  		
                subModalProtectedTargetPage = targetPage ;
              
		
                scroll(0,0);
				if (  document.getElementById('popupTitle') ) {
					document.getElementById('popupTitle').innerHTML = '';
				}
                showPopWin('/popup1.asp', 508, 350);
                changeOpac(40,'popupMask');
                
                
  	}
	
	
	
	function noflashinter() {
				
		  		
                scroll(0,0);
				if (  document.getElementById('popupTitle') ) {
					document.getElementById('popupTitle').innerHTML = '';
				}
                showPopWin('/noflash.html', 510, 210);
                changeOpac(40,'popupMask');
                
                
  	}
	
	
    function changeOpac(opacity, objectid) {
                    var object = document.getElementById( objectid ).style;
                    object.opacity = (opacity / 100); 
                    object.MozOpacity = (opacity / 100); 
                    object.KhtmlOpacity = (opacity / 100); 
                    object.filter = "alpha(opacity=" + opacity + ")"; 
                    // object.style.filter = "alpha(opacity=" + opacity + ")"; 
    }	

	
	
	function TooltipKeyword(keyword, definition) {
                this.keyword=keyword;
                this.definition=definition;
    }
    function ConstructTooltip(tooltipKeyObj) {
    
				var tooltip_body = '<table cellpadding="0" cellspacing="0" border="0" id="tooltiptable" >'+
										'<tr>' +
											'<td width="8"><img src="/images/tooltip/tool_01.gif" width="8" height="6"></td>' +
											'<td width="268" class="backtop"><img src="/images/b.gif" width="1" height="1"></td>' +
											'<td width="6"><img src="/images/tooltip/tool_03.gif" width="6" height="6"></td>' +
										'</tr>'+
										'<tr>' +
											'<td class="backleft"><img src="/images/b.gif" width="1" height="1"></td>' +
											'<td class="content"><span class="title">'+  tooltipKeyObj.keyword+ '</span> '+ tooltipKeyObj.definition +'</td>' +
											'<td class="backright"><img src="/images/b.gif" width="1" height="1"></td>' +
										'</tr>'+
										'<tr>' +
											'<td><img src="/images/tooltip/tool_07.gif" width="8" height="6"></td>' +
											'<td class="backbottom"><img src="/images/b.gif" width="1" height="1"></td>' +
											'<td><img src="/images/tooltip/tool_09.gif" width="6" height="6"></td>' +
										'</tr>'+
									'</table>';
										
										
                return tooltip_body;
    }

	function TooltipConfig(e, width, xOffset, yOffset, above) {
                // In Koo Kim 20060104
                // the following configures the wz_tooltip
                if (xOffset && xOffset != null) {
                    e.T_OFFSETX=xOffset;
                } else {
                    e.T_OFFSETX=10;
                    e.T_OFFSETY=10;
                }
                if (yOffset && yOffset != null) {
                    e.T_OFFSETY=yOffset;
                } else {
                    e.T_OFFSETY=10;
                }
                if (above && above != null) {
                    e.T_ABOVE=above;
                }
                e.T_DELAY = 300;
                e.T_BGCOLOR='';
                e.T_BGIMG='';
                e.T_BORDERWIDTH=0;
                e.T_BORDERCOLOR='';
                e.T_FONTCOLOR='#333333';
                e.T_FONTFACE='Verdana, Geneva, Arial, Helvetica, sans-serif';
                e.T_FONTSIZE='12px';
                e.T_OPACITY=100;
                e.T_PADDING=0;
                e.T_STATIC=true;
                e.T_TEXTALIGN='right';
                e.T_TITLE='';
                e.T_TITLECOLOR='#ff6666';
                e.T_WIDTH=width;
                return e;
      }
	  
	  function onVideoClickOpenRegistrationParent(){
		  alert('will try to redirect parent ')
		  window.parent.location.href = "/join/register.asp"
		  window.close();
	  }
	  
	  /* To close the videoclips and show registration page afterwards */
	  
	  function popclose(){
		  
		  
		  window.opener.location = "/join/register.asp?pro=/hear"
		  window.close();
		  
	  }
	  
	
	  /* Popup blocker detection */
	  
	  function IsPopupBlocker() {
				
		  		var strNewURL = "/blank.html"
				var Strfeature = "" ;
				var WindowOpen = window.open(strNewURL,"MainWindow",Strfeature);
				try{
					var obj = WindowOpen.name;
					WindowOpen.close();
					return false;
					//alert("Popup blocker NOT detected");
				} 
				catch(e){ 
					//alert("System has been blocked by POP-UP BLOCKER.\nPlease disable the POP-UP BLOCKER and try again\nor\nPlease contact your system administrator. ");
					
				}
				return true;
	}
	
	function openvideo( anid ){
			
				var url = "/downloadwrapper.asp?id=" + anid + "&nocache=" + (new Date()).getTime();
				scroll(0,0);
				if (  document.getElementById('popupTitle') ) {
					document.getElementById('popupTitle').innerHTML = '';
				}
                showPopWin(  url , 510, 210);
                changeOpac(40,'popupMask');
	}
	function openvideoNewWindowPopup( anid ){
	
				    
					//alert("will open " + anid )
					
			//openvideoWithoutWrapper( anid )
					//var url = "/downloadwrapper.asp?id=" + anid + "&nocache=" + (new Date()).getTime();
					
					//try{
											//var url = "/download.asp?id=" + anid + "&nocache=" + (new Date()).getTime();
						//alert("url will be " + url)
											//window.location =  url
						//window.open(url)
					//}catch(e){
						//var r = '';
						//for (var p in e)
						//  r += p + ': ' + e[p] + '\n';
						//alert(r);
					//}
		
				//alert("received " + anid )
				
				
				
				var message = "\n\nPlease disable your popup blocker system to be able to download the videos\n\n" 
				//if ( IsPopupBlocker() ) {
				//	alert(message);
				//}else{
					//var url = "/download.asp?id=" + anid + "&nocache=" + (new Date()).getTime();
					var url = "/downloadwrapper.asp?id=" + anid + "&nocache=" + (new Date()).getTime();
					//alert("will open " + url )
					try{
							var nWidth = 500;
							var nHeight = 200;
							var x = (screen.width - nWidth) / 3;
							var y = (screen.height - nHeight) / 3;		
				
							var optionString = "scrollbars=no,location=no,resizable=no,status=no,";
							optionString += "height=" + nHeight + ",width=" + nWidth;
							optionString += ",screenX="+ x +",screenY="+ y +",top="+ y +",left="+ x;
				
							if (! videoPopUpWindow || videoPopUpWindow.closed ) {
								videoPopUpWindow = window.open(url,"videoPopUpWindow",optionString);
							} else {
								// window already exists, so bring it forward
								videoPopUpWindow.location.href=url;
								videoPopUpWindow.focus();
							} 
					}catch(e){
						alert(message);
					}
				
					
					
					
	}
	
	function openvideoWithoutWrapper( anid ){
		
				
	
				//var message = "\n\nPlease disable your popup blocker system to be able to download the videos\n\n" 
				//if ( IsPopupBlocker() ) {
						//alert(message);
				//}else{
					//var url = "/download.asp?id=" + anid + "&nocache=" + (new Date()).getTime();
					var url = "/downloadwrapper.asp?id=" + anid + "&nocache=" + (new Date()).getTime();
					//alert("will open " + url )
					try{
						window.location.href =  url
					}catch(e){
						//alert(message);
					}
				//}
				
					
					
					
	}
	  
	function addToDiv( divid, toadd) {
	
		var adiv = document.getElementById( divid );
		if ( adiv){
			adiv.innerHTML += toadd;
		}
	}

	var flashVersion = 0;
	
	function getFlashVersion ( ) {
		
			/*
			for(var i=7; i>0; i--){
				flashVersion = 0;
				try{
					var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
					flashVersion = i;
				}
				catch(e){
						var r = '';
						for (var p in e)
						  r += p + ': ' + e[p] + '\n';
						alert(r);

				}
			}
			return flashVersion;
			*/
			var flashinstalled = 0;
			var flashversion = 0;
			MSDetect = "false";
			if (navigator.plugins && navigator.plugins.length)
			{
				x = navigator.plugins["Shockwave Flash"];
				if (x)
				{
					flashinstalled = 2;
					if (x.description)
					{
						y = x.description;
						flashversion = y.charAt(y.indexOf('.')-1);
					}
				}
				else
					flashinstalled = 1;
				if (navigator.plugins["Shockwave Flash 2.0"])
				{
					flashinstalled = 2;
					flashversion = 2;
				}
			}
			else if (navigator.mimeTypes && navigator.mimeTypes.length)
			{
				x = navigator.mimeTypes['application/x-shockwave-flash'];
				if (x && x.enabledPlugin)
					flashinstalled = 2;
				else
					flashinstalled = 1;
			}
			else{
				MSDetect = "true";
			}
			
			return flashversion 
			
	}
	
	
	
	
	function openLanguage(  dd ){
		
		var url = "";
		if ( dd ) {
			
			var val = parseInt(dd.value);
			switch( val ) {
				case 1:
					url = "http://www.crohnsandme.eu";  //eu
					break;
				case 2:
					url = "http://www.crohninfo.com";  //french
					break;
				case 3:
					url = "http://www.crohnradio.de";   //german?
					break;
				case 4:
					url = "http://www.noieilcrohn.it";  //italy
					break;
				case 5:
					url = "http://www.zonacrohn.com";   //spain
					break;
				case 6:
					url = "http://crohnathome.nl/";   //dutch
					break;
				case 7:
					url = "http://www.crohnenik.be/";   //Flemish (belgium)
					break;
				case 8:
					url = "http://www.crohnetmoi.be/";   //French (Belgium)
					break;
				case 9:
					url = "http://www.crohnsandme.gr/";   //Greek
					break;	
				case 10:
					url = "http://www.euecrohn.pt/";   //Portuguese
					break;					
				default:
					//alert("not found for " + dd.value );
				
			}
			
			
			
			if (url != "" ) {
				window.open( url );
				dd.value = 0;
			}
			
		}
		
				
		
		
		
		
	}
	
	
	
	function common_addToDropDown ( dropdownobj, valueelement, nameelement, valueselected ){
		
			if ( dropdownobj ){
				
					var newelement = document.createElement("option" );				
					newelement.setAttribute("value", valueelement );
					newelement.appendChild( document.createTextNode( nameelement ) );
					
					if ( valueelement == valueselected ) {
							newelement.setAttribute("selected", true);
					}
					
					dropdownobj.appendChild( newelement );			
			}
			
	}
	
	
	
	
	function changeAdvocacyPrintVersionTable(){
		
		try{
		
				var oTables = document.getElementsByTagName("table");
				var acell = null;
				for(var i=0; i< oTables.length; i++){
					
						var rows1 = oTables[i].getElementsByTagName('tr');
						var cells1 = rows1.item(0).getElementsByTagName('td');
						//alert( cells1[0].innerHTML );
						if ( cells1[0].innerHTML.indexOf("Print Letter") != -1 ) {
							acell = cells1[0];
							//alert("Found" + cells1[0].innerHTML);
							break;
							
						}
					
				}
				
				if ( acell != null ) {
						var tables = acell.getElementsByTagName('table');
						var rowsparent = tables[0].getElementsByTagName('tr');
						
						
						
						for(var z=0; z < rowsparent.length; z++){
							var cells = rowsparent.item(z).getElementsByTagName('td');
							if ( cells[0].innerHTML.indexOf("Print Letter") != -1 ) {
								//found cell!!
								//alert( cells[0].innerHTML );
								cells[0].style.backgroundColor = "#ffffff";
								cells[0].style.border = "none";
								
								
								//now look for representative tables and change colors of rows
								
								var innerrows = cells[0].getElementsByTagName("tr");
								
								for( var r=0; r < innerrows.length; r++){
									
										if ( innerrows[r].className == "xc_altlistB"){
										
										}else if ( innerrows[r].className == "xc_altlistA" ) {
									
											innerrows.item(r).style.backgroundColor='#D8EFE6';
											
											
											
										}
										
								}
								
								break;
							}
						}
						
						
						/*
						var rows1 = oTables[i].getElementsByTagName('tr');
						var cells1 = rows1.item(0).getElementsByTagName('td');
						//alert( cells1[0].innerHTML );
						if ( cells1[0].innerHTML.indexOf("Print Letter") != -1 ) {
							alert("Found");
							cells1[0].style.backgroundColor = "red";
							
						}*/
				}
	
		}catch(e){
			//alert(e);
		}
				
	}
	
	
	
	
	
	
	
	function getElementsByClassName(classname){
		var a = [];
		var re = new RegExp('\\b' + classname + '\\b');
		var els = document.getElementsByTagName("*");
		for(var i=0,j=els.length; i<j; i++)
			if(re.test(els[i].className))a.push(els[i]);
		return a;
	}
	
	
	
	
	function interRA(content  ) {
		scroll(0,0);
		//document.getElementById('popupTitle').innerHTML = '';
		showPopWin( content  , 430, 290, 'bogus',320, 200);
		changeOpac(40,'popupMask');
		return false;
	}
	
	
	function changeOpac(opacity, objectid) {
		    var object = document.getElementById( objectid ).style;
		    object.opacity = (opacity / 100); 
		    object.MozOpacity = (opacity / 100); 
		    object.KhtmlOpacity = (opacity / 100); 
		    object.filter = "alpha(opacity=" + opacity + ")";
	
	}	
	function doInter(siteURL){  
		  var content= '';  
		  var styleObject = getStyleObject('popupInner');
		  styleObject.border  = "1px solid #FF6600";
	  	content += '<div style="margin:30px 10px 10px 10px;width:380px;float:left;text-align:center;">';
	   	content += '<p style="color:#000000;font-weight:bold;">You are about to enter a site that is not HelpPayRA.</p><p style="color:#000000;font-weight:bold;"> </p>';
	   	content += '<br><p><a  href="#" onclick="location.href=\'' + siteURL + '\'" ><img src="/images/continue3.gif" border="0"></a> &nbsp; &nbsp; <a href="#" onclick="hidePopWin();return false;"><img src="/images/cancel3.gif" border="0"  ></a></p>';
	   			 
		  content += '</div>';
		  interRA( content );
		}
	
		
	function doInterNewWindow(siteURL){  
		  var content= '';  
		  var styleObject = getStyleObject('popupInner');
		  styleObject.border  = "1px solid #43759a";
		content += '<div style="background-image: url(/images/interstitial.gif); background-repeat: no-repeat;margin:0px 0px0px 0px;height: 290px;width:420px;float:left;text-align:center;">';
		content += '<div style="display: block;padding-top: 40px;padding-left: 10px;font-size: 14px;"><p ><span style="color:#000000;font-weight:bold;color: #43759a">NOTICE:</span><br> You are now leaving HelpPayRA.com. </p><p>This link is provided as a service to our Web site visitors. It will take you to a site maintained by a third party who is solely responsible for its content. UCB, Inc. is not responsible for the contents of any such site or any further links from such site.</p><p>Click "Yes" to proceed to the third-party Web site or "No" to return to HelpPayRA.com.</p>';
		content += '<p><a target="_blank" href="' + siteURL + '" onclick="hidePopWin();" ><img src="/images/interstitial_yes_button.gif" border="0"></a> &nbsp; &nbsp; <a href="#" onclick="hidePopWin();return false;"><img src="/images/interstitial_no_button.gif" border="0"  ></a></p></div>';

		  content += '</div>';
		  interRA( content );
	}	
	function doSecurityInter(toURL){  
		  var content= '';  
		  var styleObject = getStyleObject('popupInner');
		  styleObject.border  = "1px solid #43759a";
		  styleObject.width = "501px";
		  styleObject.height = "310px";
	  	content += '<div style="height: 260px;background-image: url(/images/login_prompt.gif);background-repeat: no-repeat;margin:0px 0px 0px 0px;width:500px;float:left;text-align:center;">';
	   		   	
		content += '<table style="width: 180px;position: absolute; top: 100px; left: 5px;"  border=0 cellpadding=0 cellspacing=0><tr><td align=left><span style="font-weight: bold;">In order to view the content on this page you will need to login or <a href="/reg.asp?URL=' + toURL + '"> register for the site>></a></span></td></tr></table>';

		content += '<form action="/reg.asp" method="POST"><table style="position: absolute; top: 125px; left: 210px;" cellpadding=0 cellspacing=0 border=0><tr><td align="left" nowrap=nowrap>E-mail address:</td><td align="left"><input style="width: 150px;"  type="text" name="loginemail" id="loginemail" value=""></td></tr><tr><td align="left" style="padding-top: 10px;">';
			
		content+= 'Password:</td><td align="left"><input style="width: 150px;" type="password" name="loginpass" id="loginpass" value=""></td></tr><tr><td style="padding-top: 10px;"><input type="checkbox" name="rememberme" id="rememberme"> Remember&nbsp;Me</td><td><input type="image" src="/images/login_button.gif" name="loginbtn" id="loginbtn"></span></td></tr><tr><td align="left" style="padding-top: 14px;" colspan=2><br><a href="/forgot.asp">Forgot my password</a></td></tr><tr><td colspan=2 align=left style="padding-top: 14px;"><a href="#" onclick="hidePopWin();return false;">Take me back</a> to where I was</td></tr></table><input type=hidden name=URL value="' + toURL +'"></form>';

	   	
	   			 
		  content += '</div>';
		  interSecurity( content );
	}
		
		
	function interSecurity(content  ) {
		scroll(0,0);
		//document.getElementById('popupTitle').innerHTML = '';
		showPopWin( content  , 501, 310, 'bogus',320, 200);
		changeOpac(40,'popupMask');
		return false;
	}	
		
function ChangeFontSize(id, addsize) {
	var styleObject = getStyleObject(id);
	var size;
	var currentSize;
	currentSize = CheckFontSize(id);
	
	size = parseInt(currentSize.substring(0,currentSize.length-2) )+ addsize ;
	if(size < 11){ size=11;}
	if(size > 15){size=15;}
	//alert(size);
	document.getElementById(id).style.fontSize = size + "px";
	//set cookie
	Set_Cookie("helppayrafont",size, 365,'','','');
	
}	
function CheckFontSize(objectId) {	
	//document.getElementById(id).style.fontSize = size + "px";
	var styleObject = getStyleObject(objectId);
	return styleObject.fontSize;
}	
function SetFontSize(objectId) {	
	//check cookie
	var size;
	if( Get_Cookie("helppayrafont")!=null){
		size = Get_Cookie("helppayrafont");
	}else{
		size = 13;
	}
	//if cookie then size = cookie
	
	//document.getElementById(id).style.fontSize = size + "px";
	var styleObject = getStyleObject(objectId);
	styleObject.fontSize = size + "px";
	
}		
		 
		
function Set_Cookie( name, value, expires, path, domain, secure ) 
{
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires )
	{
	expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}
function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}	
		
