// JavaScript Document

// email obfuscation function
function buildAddy(addy,properName){
	var un = 'ma';
	var du = 'il';
	var tre = 'to:';
	var mld = 'mccinnovations';
	var tld = 'com';
	document.write('<a href="');
	document.write(un+du+tre);
	document.write(addy);
	document.write('&#64;');
	document.write(mld);
	document.write('.');
	document.write(tld);
	document.write('">');
	document.writeln(properName+'</a>');
}

function viewDemo(mylink, windowname)
{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	window.open(href, windowname, 'width=50,height=50,scrollbars=yes');
	return false;
}

function buildAddyWithSubject(addy,properName,subject){
	var un = 'ma';
	var du = 'il';
	var tre = 'to:';
	var mld = 'mccinnovations';
	var tld = 'com';
	document.write('<a href="');
	document.write(un+du+tre);
	document.write(addy);
	document.write('&#64;');
	document.write(mld);
	document.write('.');
	document.write(tld);
	document.write("?Subject=");
	document.write(subject);
	document.write('">');
	document.writeln(properName+'</a>');
}

function ug(page, ugName, ID, ugstart, ugend, ugdate, ugloc, ugtype){
	document.write('<a href="');
	document.write(page);
	document.write("?ugname=");
	document.write(ugName);
	document.write("&ugid=");
	document.write(ID);
	document.write("&ugstart=");
	document.write(ugstart);
	document.write("&ugend=");
	document.write(ugend);
	document.write("&ugdate=");
	document.write(ugdate);
	document.write("&ugloc=");
	document.write(ugloc);
	document.write("&ugtype=");
	document.write(ugtype);
	document.write('">');
	document.writeln(ugName+'</a>');
}

function webinar(page, webinarName, webinarID, status, seats, d, l, t){
	document.write('<a href="');
	document.write(page);
	document.write("?wname=");
	document.write(webinarName);
	document.write("&wid=");
	document.write(webinarID);
	document.write("&wstatus=");
	document.write(status);
	document.write("&wseat=");
	document.write(seats);
	document.write("&wdate=");
	document.write(d);
	document.write("&wlink=");
	document.write(l);
	document.write("&wtime=");
	document.write(t);
	document.write('">');
	document.writeln(webinarName+'</a>');
}

function edit(ugID, ugName){
	document.write('<a target="_blank" href="');
	document.write("webinarsetup.asp?wid=");
	document.write(ugID);
	document.write("&edit=yes");
	document.write("&webinarname=");
	document.write(ugName);
	document.write('">');
	//document.writeln('Attendees</a>');
	document.writeln('Edit</a>');
}

function show(webinarID, webinarName){
	document.write('<a target="_blank" href="');
	document.write("att.asp?wid=");
	document.write(webinarID);
	document.write("&show=yes");
	document.write("&wsname=");
	document.write(webinarName);
	document.write('">');
	//document.writeln('Attendees</a>');
	document.writeln('<img src="attendee.GIF" alt="Attendees" border="0"></a>');
}
function editug(ugID, ugName){
	document.write('<a target="_blank" href="');
	document.write("ugsetup.asp?ugid=");
	document.write(ugID);
	document.write("&edit=yes");
	document.write("&usergroupname=");
	document.write(ugName);
	document.write('">');
	//document.writeln('Attendees</a>');
	document.writeln('Edit</a>');
}
function showug(ugID, ugName, ugDate, ugLoc){
	document.write('<a target="_blank" href="');
	document.write("ugatt.asp?ugid=");
	document.write(ugID);
	document.write("&show=yes");
	document.write("&ugdate=");
	document.write(ugDate);
	document.write("&ugloc=");
	document.write(ugLoc);
	document.write("&ugsname=");
	document.write(ugName);
	document.write('">');
	//document.writeln('Attendees</a>');
	document.writeln('<img src="attendee.GIF" alt="Attendees" border="0"></a>');
}
function closeug(ugName, ugID){
	document.write('<a href="'); 
	document.write("ugsetup.asp?ugid=");
	document.write(ugID);
	document.write("&close=yes");
	document.write("&usergroupname=");
	document.write(ugName);
	document.write('">');
	document.write(ugName);
	document.writeln('</a>');
}
function deleteug(page, ugName, ugID){
	document.write('<a href="');
	document.write(page);
	document.write("?ugname=");
	document.write(ugName);
	document.write("&ugid=");
	document.write(ugID);
	document.write('">');
	//document.writeln('Delete</a>');
	document.writeln('<img src="delete.GIF" alt="Delete" border="0"></a>');
	
}
function reminderug(page, ugName, ugID, reminder){
	document.write('<a href="');
	document.write(page);
	document.write("?ugid=");
	document.write(ugID);
	document.write("&emailreminder=yes");
	document.write('">');
	//document.writeln('Email Reminder</a>');
	document.writeln('<img src="email.GIF" alt="Email Reminder" border="0"></a>');
}

function closewebinar(webinarName, webinarID){
	document.write('<a href="');
	document.write("techwebinarsetup.asp?wid=");
	document.write(webinarID);
	document.write("&close=yes");
	document.write("&webinarname=");
	document.write(webinarName);
	document.write('">');
	document.write(webinarName);
	document.writeln('</a>');
}
function closewebinars(webinarName, webinarID){
	document.write('<a href="');
	document.write("webinarsetup.asp?wid=");
	document.write(webinarID);
	document.write("&close=yes");
	document.write("&webinarname=");
	document.write(webinarName);
	document.write('">');
	document.write(webinarName);
	document.writeln('</a>');
}

function deletewebinar(page, webinarName, webinarID){
	document.write('<a href="');
	document.write(page);
	document.write("?wname=");
	document.write(webinarName);
	document.write("&wid=");
	document.write(webinarID);
	document.write('">');
	//document.writeln('Delete</a>');
	document.writeln('<img src="delete.GIF" alt="Delete" border="0"></a>');
	
}
function reminder(page, webinarName, webinarID, reminder){
	document.write('<a href="');
	document.write(page);
	document.write("?wid=");
	document.write(webinarID);
	document.write("&emailreminder=yes");
	document.write('">');
	//document.writeln('Email Reminder</a>');
	document.writeln('<img src="email.GIF" alt="Email Reminder" border="0"></a>');
}

function popup(mylink, windowname)
{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	window.open(href, windowname, 'width=800,height=600,scrollbars=yes');
	return false;
}

function popup2(mylink, windowname)
{
	if (! window.focus)return true;
	var href;
	if (typeof(mylink) == 'string')
	   href=mylink;
	else
	   href=mylink.href;
	window.open(href, windowname, 'width=800,height=500,scrollbars=yes');
	return false;
}

function CheckAdmin()
{
	return true
}

function Check()
{
	var oFirstName,oLastName,oEmail,oJob,oOrgan,oPhone,oAdd1,oAdd2,oCity,oState,oZip
	var gFirstName,gLastName,gEmail,gJgb,ggrgan,gPhgne,gAdd1,gCity,gState,gZip
	var sum

	oFirstName = document.getElementById("First_Name")
	oLastName  = document.getElementById("Last_Name")
	oJob = document.getElementById("Title")
	oOrgan  = document.getElementById("Organization")
	oEmail = document.getElementById("Email")
	oPhone = document.getElementById("Phone")
	oAdd1  = document.getElementById("Address1")
	oAdd2  = document.getElementById("Address2")
	oCity = document.getElementById("City")
	oState = document.getElementById("State")
	oZip  = document.getElementById("Zip")

	sum = 0
	
	if (oFirstName.value != "")
	{
		sum = 1
	}
	if (oLastName.value != "")
	{
		sum = 2
	}
	if (oJob.value != "")
	{
		sum = 3
	}
	if (oOrgan.value != "")
	{
		sum = 4
	}
	if (oEmail.value != "")
	{
		sum = 5
	}
	if (oPhone.value != "")
	{
		sum = 6
	}
	if (oAdd1.value != "")
	{
		sum = 7
	}
	if (oCity.value != "")
	{
		sum = 8
	}
	if (oState.value != "")
	{
		sum = 9
	}
	if (oZip.value != "")
	{
		sum = 10
	}
	
	if ( sum == 10) 
	{
		return true
	}
	else
	{
		return false
	}
}


function DateFormat(theDate)
{
	var strMonthArray = new Array(13);
	strMonthArray[1] = "January";
	strMonthArray[2] = "February";
	strMonthArray[3] = "March";
	strMonthArray[4] = "April";
	strMonthArray[5] = "May";
	strMonthArray[6] = "June";
	strMonthArray[7] = "July";
	strMonthArray[8] = "August";
	strMonthArray[9] = "Sepember";
	strMonthArray[10] = "October";
	strMonthArray[11] = "November";
	strMonthArray[12] = "December";

	var myArray = new Array();
	var mDate = "" + theDate;
	var myArray = mDate.split("/");
	
	var mMonth = myArray[0];
	var mDay = myArray[1];
	var mYear = myArray[2];
	
	var dMonth = parseFloat(mMonth);
	if (mYear.length < 4)
	{
		mYear = "20" + mYear;
	}
	//var firstSlash;
	//var lastSlash;
	//firstSlash = theDate.indexOf("/")
	//lastSlash = theDate.lastIndexOf("/")
	
	//if (theDate.length == 6 && dateCheck)
		//var mMonth = vDateName.value.substr(0,2);
	document.write(strMonthArray[dMonth] + " " + mDay + ", " + mYear);
}

//function Check()
//{
	//var oInclude
	//var oRedirect
	//var oFirstName,oLastName,oEmail
	
	//oInclude =  document.getElementById("include")
	//oRedirect = document.getElementById("redirect")
	
	//oFirstName = document.getElementById("First_Name")
	//oLastName  = document.getElementById("Last_Name")
	//oEmail = document.getElementById("Email")
	
	//if (!CheckRequired(form1,oInclude,",",true,true))
	 	//return false
	 
	//oName = document.getElementById("ContactName")
	//oName.value = oFirstName.value + " " + oLastName.value
	//oRedirect.value = "/events/webinars/inviteguests.asp?webinarid=282&inviter="  + oFirstName.value + "&inviteremail=" + oEmail.value
	//return true
//}