var today = new Date;
var myDate = new Date;

function ceschedule (mm, dd, yy, title, c1, c2, c3, c4) {
	
	myDate.setDate(dd);
	myDate.setMonth(mm-1); // January = 0
	myDate.setFullYear(yy); 
	
	if (myDate > today) {
		document.write('<p>');
		document.write('<span id="titles">' + title + '</span><br>');
  		document.write('<span class="c1">' + c1 + '</span>');
		document.write('<span class="c2">' + c2 + '</span>');
		document.write('<span class="c3">' + c3 + '</span>'); 
   	document.write('<span class="c4">' + c4 + '</span><br>'); 
		document.write('</p>');
	}
}
function cereg (mm, dd, yy, idvalue, title) {
/* regular select 1 at a time  */	
	myDate.setDate(dd);
	myDate.setMonth(mm-1); // January = 0
	myDate.setFullYear(yy); 
	
	if (myDate > today) {
		document.write('<option value="' + idvalue + '">' + title + '</option>'); 
	}
}
function ceregm (mm, dd, yy, idvalue, title) {
/* select multiple classes  */	
	myDate.setDate(dd);
	myDate.setMonth(mm-1); // January = 0
	myDate.setFullYear(yy); 
	
	if (myDate > today) {
		document.write('<input type="checkbox" name="ce' + idvalue +'">' + title + '<br /><br />');
	}
}	
	
function prelicsch (mm, dd, yy, line1, line2, line3) {
	
	myDate.setDate(dd);
	myDate.setMonth(mm-1); // January = 0
	myDate.setFullYear(yy); 
	
	if (myDate > today) {
//		document.write('		<option value="' + id + '">' + title + '</option>');
		document.write(line1); 
		document.write(line2); 
		document.write(line3); 
	}
}	

var EQUAL = "=";
var AMP = "&";
var QUE = "?";
var EMPTY = "";

function ExistParameter ( ParameterName )
{
var url = window.document.URL.toString();

if ( url.indexOf ( QUE ) > 0 )
{
var Parameters = url.split ( QUE ) [ 1 ].split ( AMP );

for ( i = 0; i < Parameters.length; i++ )
{
if ( Parameters [ i ].indexOf ( EQUAL ) > 0 )
{
if ( Parameters [ i ].split ( EQUAL )[ 0 ] == ParameterName )
return true;
}
}
}
return false;
}


function GetParamterValue ( ParameterName )
{
var url = window.document.URL.toString();

if ( url.indexOf ( QUE ) > 0 )
{
var Parameters = url.split ( QUE ) [ 1 ].split ( AMP );

for ( i = 0; i < Parameters.length; i++ )
{
if ( Parameters [ i ].indexOf ( EQUAL ) > 0 )
{
var ParameterValue = Parameters [ i ].split ( EQUAL );

if ( ParameterValue [ 0 ] == ParameterName )
return ParameterValue [ 1 ];
}
}
}
return EMPTY;
}

// Sets cookie values. Expiration date is optional.
//
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
// Returns a cookie value, given the name of the cookie.
//
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1; 
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    } 
  }
return "";
}