	function getProperUrl ( strUrl ) {
		  if (strUrl.search('#')>0) {
			var strurl2 = strUrl.substr(strUrl.search('#'));
			var strurl3 = strUrl.substr(strUrl.search('#'),strurl2.search('&'));
			var strurl4 = strUrl.substr(0,strUrl.search('#'));
			var strurl5 = strurl2.substr(strurl2.search('&'),strurl2.length );
			return strurl4 + strurl5 + strurl3;
		  }
		  else {
			return strUrl;
		  }
	}

	
	function ajaxFunction( idupdate, pgtype, classtype, strSort ) {
		checkProgess('idprogressD');
		var xmlHTTP2;
		var strTemp;
		var url="/Funds/Prices/prices.asp";
		if(strSort == null) {
			url=url+"?pgtype="+pgtype+"&classtype="+classtype+"&chkBox=div"+classtype;
		} else {
			url=url+strSort+ "&classtype="+classtype+"&chkBox=div"+classtype;
		}
		url=url+"&sid="+Math.random();

		url = getProperUrl ( url );

		//alert(url);

		try {  // Firefox, Opera 8.0+, Safari  
		  xmlHTTP2=new XMLHttpRequest();  
		}
		catch (e){  // Internet Explorer  
		  try {    xmlHTTP2=new ActiveXObject("Msxml2.XMLHTTP");    }
		  catch (e) {    
		  	try {  xmlHTTP2=new ActiveXObject("Microsoft.XMLHTTP");      }
		    catch (e) {      
				alert("Your browser does not support AJAX!");      
				return false;      }    
			} 
		}
		  xmlHTTP2.onreadystatechange=function() {
		    if(xmlHTTP2.readyState==4){
				
			  var myarray = xmlHTTP2.responseText.split("&*()+");

			  document.getElementById(''+ idupdate + '').innerHTML=myarray[0];
			  
			  if (classtype == 'TRK') {
				strTemp = 'as of ';
			  } else {
				strTemp = 'for ';  
			  }
			  
			  document.getElementById('sp_date').innerHTML=strTemp + myarray[1];
			  
			  if(document.getElementById('sp_date_OLD')!=null) {
			  	document.getElementById('sp_date_OLD').innerHTML=myarray[2];
			  }
			  if(document.getElementById('sp_date_ICS')!=null) {
			  	document.getElementById('sp_date_ICS').innerHTML=myarray[2];
			  }
			  if(document.getElementById('sp_date_SCS')!=null) {
			  	document.getElementById('sp_date_SCS').innerHTML=myarray[2];
			  }
			  if(document.getElementById('sp_date_CCS')!=null) {
			  	document.getElementById('sp_date_CCS').innerHTML=myarray[2];
			  }
			  if(document.getElementById('sp_date_INSTCS')!=null) {
			  	document.getElementById('sp_date_INSTCS').innerHTML=myarray[2];
			  }
			  if(document.getElementById('sp_date_KCS')!=null) {
			  	document.getElementById('sp_date_KCS').innerHTML=myarray[2];
			  }
			  if(document.getElementById('sp_date_RCS')!=null) {
			  	document.getElementById('sp_date_RCS').innerHTML=myarray[2];
			  }
			  if(document.getElementById('sp_date_ANICS')!=null) {
			  	document.getElementById('sp_date_ANICS').innerHTML=myarray[2];
			  }
			  if(document.getElementById('sp_date_ANSCS')!=null) {
			  	document.getElementById('sp_date_ANSCS').innerHTML=myarray[2];
			  }
			  if(document.getElementById('sp_date_QUALIFIED')!=null) {
			  	document.getElementById('sp_date_QUALIFIED').innerHTML=myarray[2];
			  }
			  if(document.getElementById('sp_date_CLOSECS')!=null) {
			  	document.getElementById('sp_date_CLOSECS').innerHTML=myarray[2];
			  }
			  if(document.getElementById('sp_date_TRK')!=null) {
			  	document.getElementById('sp_date_TRK').innerHTML=myarray[2];
			  }

			  //document.getElementById('sp_date_2').innerHTML=myarray[1].format("m/dd/yy");

		      //document.getElementById(''+ idupdate + '').innerHTML=xmlHTTP2.responseText;
			  setTimeout("hideProgess('idprogressD');", 100);	
				
		      //document.getElementById(''+ idupdate + '').innerHTML=xmlHTTP2.responseText;
			  //setTimeout("hideProgess('idprogressD');", 1500);
			  
			  var temp_sp = document.getElementById('sp_open');
			  if (temp_sp.style.visibility == 'hidden') {
				temp_sp.style.visibility = 'visible';
			  }
			  temp_sp = document.getElementById('sp_qa');
			  if (temp_sp.style.visibility == 'hidden') {
				temp_sp.style.visibility = 'visible';
			  }
			  temp_sp = document.getElementById('sp_closed');
			  if (temp_sp.style.visibility == 'hidden') {
				temp_sp.style.visibility = 'visible';
			  }
			  temp_sp = document.getElementById('sp_annuity');
			  if (temp_sp.style.visibility == 'hidden') {
				temp_sp.style.visibility = 'visible';
			  }
		    }
		  }
		  xmlHTTP2.open("GET",url,true);
		  xmlHTTP2.send(null);  
			
	}
	
	function ajaxFunctionPrint( idupdate, pgtype, classtype, sharetype1, sharetype2, sharetype3, sharetype4, strSort ) {
		checkProgess('idprogressD');
		var xmlHTTP3;
		var url="/Funds/Prices/prices.asp";
		if(strSort == null) {
			url=url+"?pgtype="+pgtype+"&classtype="+classtype+"&chkBox=div"+classtype;
		} else {
			url=url+strSort+ "&classtype="+classtype+"&chkBox=div"+classtype;
		}
		url=url+"&sharetype1="+sharetype1+"&sharetype2="+sharetype2+"&sharetype3="+sharetype3+"&sharetype4="+sharetype4;
		url=url+"&sid="+Math.random();

		url = getProperUrl ( url );

		//alert(url);

		try {  // Firefox, Opera 8.0+, Safari  
		  xmlHTTP3=new XMLHttpRequest();  
		}
		catch (e){  // Internet Explorer  
		  try {    xmlHTTP3=new ActiveXObject("Msxml2.XMLHTTP");    }
		  catch (e) {    
		  	try {  xmlHTTP3=new ActiveXObject("Microsoft.XMLHTTP");      }
		    catch (e) {      
				alert("Your browser does not support AJAX!");      
				return false;      }    
			} 
		}
		  xmlHTTP3.onreadystatechange=function() {
		    if(xmlHTTP3.readyState==4){
		      document.getElementById(''+ idupdate + '').innerHTML=xmlHTTP3.responseText;
			  setTimeout("hideProgess('idprogressD');", 1500);
			  
			  var temp_sp = document.getElementById('sp_open');
			  if (temp_sp.style.visibility == 'hidden') {
				temp_sp.style.visibility = 'visible';
			  }
			  temp_sp = document.getElementById('sp_qa');
			  if (temp_sp.style.visibility == 'hidden') {
				temp_sp.style.visibility = 'visible';
			  }
			  temp_sp = document.getElementById('sp_closed');
			  if (temp_sp.style.visibility == 'hidden') {
				temp_sp.style.visibility = 'visible';
			  }
			  temp_sp = document.getElementById('sp_annuity');
			  if (temp_sp.style.visibility == 'hidden') {
				temp_sp.style.visibility = 'visible';
			  }
		    }
		  }
		  xmlHTTP3.open("GET",url,true);
		  xmlHTTP3.send(null);  
			
	}

