

////////////////////////////////////////////////////////////////////////////////////////
//
//
//	"PLAY VIDEOS"
//
//
////////////////////////////////////////////////////////////////////////////////////////
function playVid( strVideo )
{
	var contentVideo = null;
	var contentVidLabel = null;
	var strWidth = "650";
	var strHeight = "517";
	var strTitle = "";

	if( strVideo == "createaccount")
	{
		strVideo = "yahootheater.swf";
		strTitle = "Create Your Account";
	}
	else if( strVideo == "beforeyoubegin")
	{
		strVideo = "beforeyoubegin.flv";
		strTitle = "Building Your Web Page - Before You Begin";
	}
	else if( strVideo == "pagelayout")
	{
		strVideo = "createweblayout.flv";
		strTitle = "Create Your Page Layout";
	}
	else if( strVideo == "headersfooters")
	{
		strVideo = "insertingheader-footer.flv";
		strTitle = "Inserting Headers and Footers";
	}
	else if( strVideo == "pagecolor")
	{
		strVideo = "pagecolor.flv";
		strTitle = "Adding Your Page Color";
	}
	else if( strVideo == "inserttext")
	{
		strVideo = "insertingtext.flv";
		strTitle = "Inserting Text";
	}
	else if( strVideo == "insertimages")
	{
		strVideo = "insertimages.flv";
		strTitle = "Inserting Images";
	}
	else if( strVideo == "insertimagestext")
	{
		strVideo = "inserting-image-with-text.flv";
		strTitle = "Inserting Images With Text";
	}
	else if( strVideo == "pastingtext")
	{
		strVideo = "pastingtext.flv";
		strTitle = "Pasting Text";
	}
	else if( strVideo == "pagebackground")
	{
		strVideo = "pagebackground.flv";
		strTitle = "Page Backgrounds";
	}
	else if( strVideo == "insertvideo")
	{
		strVideo = "insertvideo.flv";
		strTitle = "Inserting Video";
	}
	else if( strVideo == "createlinks")
	{
		strVideo = "createlinks.flv";
		strTitle = "Creating Links";
	}
	else if( strVideo == "awebersetup")
	{
		strVideo = "awebersetup.flv";
		strTitle = "Setting Up Your Autoresponder";
	}
	else if( strVideo == "webform")
	{
		strVideo = "webform.flv";
		strTitle = "Inserting Autoresponder Web Form";
	}
	else if( strVideo == "domainname")
	{
		strVideo = "domainname.flv";
		strTitle = "Get Your Domain Name";
	}
	else if( strVideo == "aweber")
	{
		strVideo = "aweber.flv";
		strTitle = "Get Your Autoresponder";
	}
	else if( strVideo == "buildwebsite")
	{
		strVideo = "buildwebsite.flv";
		strTitle = "Build Your Website";
	}
	else if( strVideo == "googletracking")
	{
		strVideo = "googletracking.flv";
		strTitle = "Get Your Google Tracking Code";
	}
	else if( strVideo == "yahootracking")
	{
		strVideo = "yahootracking.flv";
		strTitle = "Get Your Yahoo Tracking Code";
	}
	else if( strVideo == "msntracking")
	{
		strVideo = "msntracking.flv";
		strTitle = "Get Your MSN Tracking Code";
	}
	else if( strVideo == "zangotracking")
	{
		strVideo = "zangotracking.flv";
		strTitle = "Get Your Zango Tracking Code";
	}
	else if( strVideo == "maskdomain")
	{
		strVideo = "maskdomain.flv";
		strTitle = "Mask Your Domain";
	}
	else if( strVideo == "contactsponsor")
	{
		strVideo = "contactsponsor.flv";
		strTitle = "Contact Your Sponsor";
	}
	else if( strVideo == "flowchart")
	{
		strVideo = "flowchartadgroup.swf";
		strTitle = "Flow Chart";
	}
	else if( strVideo == "createadgroup")
	{
		strVideo = "creatadgroupdemo.swf";
		strTitle = "Creating Ad Groups";
	}
	else if( strVideo == "addkw1")
	{
		strVideo = "keyworddemonstrationpart1.swf";
		strTitle = "Adding Keywords - Part 1";
	}
	else if( strVideo == "addkw2")
	{
		strVideo = "keyworddemonstrationpart2.swf";
		strTitle = "Adding Keywords - Part 2";
	}
	else if( strVideo == "tracking")
	{
		strVideo = "importanceoftracking.swf";
		strTitle = "The Importance of Tracking";
	}
	else if( strVideo == "findkw")
	{
		strVideo = "lookingforgoodkeywords.swf";
		strTitle = "Finding Profitable Keywords";
	}

	contentVidLabel = document.getElementById("vidlabel");
	contentVidLabel.innerHTML = "Currently Playing: <b>" + strTitle + "</b>";


	contentVideo = document.getElementById("player");
	contentVideo.innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='" + strWidth +"' height='" + strHeight +" ' id='player' align='center'>" +
							"<param name='allowScriptAccess' value='samedomain' />" +
							"<param name='movie' value='http://www.ismartnetsystems.com/video/player.swf' />" +
							"<param name='quality' value='high' />" +
							"<param name=scale value=noscale>" +
							"<param name=salign value='LT'>" +
							"<param name=FlashVars value='contentPath=http://www.ismartnetsystems.com/video/"+ strVideo +"&affiliateID=&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=false&hasVideoChrome=true'>" +
							"<param name='bgcolor' value='#C1C3C6' />" +
							"<embed src='http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/player.swf' flashvars='contentPath=http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/"+ strVideo +"&affiliateID=&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=false&hasVideoChrome=true' quality='high' scale=noscale bgcolor='#C1C3C6' width='" + strWidth + "' height='" + strHeight + "' name='player' salign='lt' allowscriptaccess='domainname' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
							"</object>";

}


function showChat()
{
	var contentX = null;
	contentVideo = document.getElementById("chatter");
    contentVideo.innerHTML = "<div align='left'><img src='images/livewebcamchattitle.gif' alt='' /></div>" +
                            "<br />" +
                            "<br />" +
                            "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='791' height='780' id='camchat25' align='middle'>" +
                            "<param name='allowScriptAccess' value='sameDomain' />" +
                            "<param name='movie' value='camchat25.swf' />" +
                            "<param name='quality' value='high' />" +
                            "<param name='bgcolor' value='#ffffff' />" +
                            "<embed src='camchat25.swf' quality='high' bgcolor='#ffffff' width='791' height='780' name='camchat25' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
                            "</object>";
}

function showCommunityChat()
{
	var contentX = null;
	contentVideo = document.getElementById("chatter");
    contentVideo.innerHTML = "<?php" +
                            "require_once('inc/common.php');" +
                            "?>" +
                            "<div align='left'><img src='images/communitychattitle.gif' alt='' /></div>" +
                            "<br />" +
                            "<br />" +
                            "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' WIDTH='830' HEIGHT='650'  id='flashchat' ALIGN=''>" +
                            "<PARAM NAME='FlashVars' VALUE=''>" +
                            "<PARAM NAME='movie' VALUE='preloader.swf'>" +
                            "<PARAM NAME='quality' VALUE='high'>" +
                            "<PARAM NAME='menu' VALUE='true'>" +
                            "<PARAM NAME='scale' VALUE='noscale'>" +
                            "<PARAM NAME='salign' VALUE='LT'>" +
                            "<PARAM NAME='BASE' VALUE=''>" +
                            "<EMBED src='preloader.swf' FlashVars='' menu='false' quality='high' scale='noscale' salign='LT' WIDTH='830' HEIGHT='650' NAME='flashchat' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer' BASE=''></EMBED>" +
                            "</OBJECT>" +
                            "<script type='text/javascript' src='js.php'>";
}

function showVideoPresenter()
{
	var contentX = null;
	contentVideo = document.getElementById("chatter");
	contentVideo.innerHTML = "<div align='left'><img src='images/livevideopresentertitle.gif' alt='' /></div>" +
                            "<br />" +
                            "<br />" +
                            "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='860' height='580'>" +
                            "<param name='movie' value='livepresentervieweralpha.swf'>" +
                            "<param name='quality' value='high'>" +
                            "<embed src='livepresentervieweralpha.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='860' height='580'></embed>" +
                            "</object>";

}


function showAboutWSVideo()
{
	var contentX = null;
	contentVideo = document.getElementById("player1");
	contentVideo.innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='490' height='400' id='player' align=''>" +
                            "<param name='movie' value='http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/player.swf' />" +
                            "<param name='allowScriptAccess' value='samedomain' />" +
                            "<param name='quality' value='high' />" +
                            "<param NAME='scale' VALUE='noscale'>" +
                            "<param NAME='salign' VALUE='LT'>" +
                            "<param NAME='FlashVars' VALUE='contentPath=http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/aboutws.flv&affiliateID=&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=false&hasVideoChrome=true'>" +
                            "<param name='bgcolor' value='#ffffff' />" +
                            "<embed src='http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/player.swf' FlashVars='contentPath=http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/aboutws.flv&affiliateID=&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=false&hasVideoChrome=true' quality='high' scale='noscale' bgcolor='#ffffff' width='490' height='400' name='player' salign='lt' allowScriptAccess='samedomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
                            "</object>";

    contentX = null;
	contentVideo = document.getElementById("player2");
    contentVideo.innerHTML = "<A href='javascript:showCompPlanVideo();' onmouseover='window.status=''; return true' onmouseout='window.status=''; return true'><IMG title='Click Here To View Compensation Plan Video' alt='Click Here To View Compensation Plan Video' src='http://www.ismartnetsystems.com/wsmembers/images/startvideo1.jpg' border='0'></A>";
}


function showCompPlanVideo()
{
	var contentX = null;
	contentVideo = document.getElementById("player2");
	contentVideo.innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='490' height='400' id='player' align=''>" +
                            "<param name='movie' value='http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/player.swf' />" +
                            "<param name='allowScriptAccess' value='samedomain' />" +
                            "<param name='quality' value='high' />" +
                            "<param NAME='scale' VALUE='noscale'>" +
                            "<param NAME='salign' VALUE='LT'>" +
                            "<param NAME='FlashVars' VALUE='contentPath=http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/compplan.flv&affiliateID=&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=false&hasVideoChrome=true'>" +
                            "<param name='bgcolor' value='#ffffff' />" +
                            "<embed src='http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/player.swf' FlashVars='contentPath=http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/compplan.flv&affiliateID=&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=false&hasVideoChrome=true' quality='high' scale='noscale' bgcolor='#ffffff' width='490' height='400' name='player' salign='lt' allowScriptAccess='samedomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
                            "</object>";

    contentX = null;
	contentVideo = document.getElementById("player1");
    contentVideo.innerHTML = "<A href='javascript:showAboutWSVideo();' onmouseover='window.status=''; return true' onmouseout='window.status=''; return true'><IMG title='Click Here To View Compensation Plan Video' alt='Click Here To View Compensation Plan Video' src='http://www.ismartnetsystems.com/wsmembers/images/startvideo1.jpg' border='0'></A>";
}



function showExistCompPlanVideo()
{
	var contentX = null;
	contentVideo = document.getElementById("player4");
	contentVideo.innerHTML = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='490' height='400' id='player' align=''>" +
                            "<param name='movie' value='http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/player.swf' />" +
                            "<param name='allowScriptAccess' value='samedomain' />" +
                            "<param name='quality' value='high' />" +
                            "<param NAME='scale' VALUE='noscale'>" +
                            "<param NAME='salign' VALUE='LT'>" +
                            "<param NAME='FlashVars' VALUE='contentPath=http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/compplan.flv&affiliateID=&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=false&hasVideoChrome=true'>" +
                            "<param name='bgcolor' value='#ffffff' />" +
                            "<embed src='http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/player.swf' FlashVars='contentPath=http://s3.amazonaws.com/chrismcknight/wealthsponsoring/videos/compplan.flv&affiliateID=&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=false&hasVideoChrome=true' quality='high' scale='noscale' bgcolor='#ffffff' width='490' height='400' name='player' salign='lt' allowScriptAccess='samedomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />" +
                            "</object>";

    contentX = null;
	contentVideo = document.getElementById("player1");
    contentVideo.innerHTML = "<A href='javascript:showAboutWSVideo();' onmouseover='window.status=''; return true' onmouseout='window.status=''; return true'><IMG title='Click Here To View Compensation Plan Video' alt='Click Here To View Compensation Plan Video' src='http://www.ismartnetsystems.com/wsmembers/images/startvideo1.jpg' border='0'></A>";
}

////////////////////////////////////////////////////////////////////////////////////////
//
//
//	"Callback Page
//
//
////////////////////////////////////////////////////////////////////////////////////////
function validateCallbackPage( strId )
{
	if( validateCallback() == true)
	{
		document.index01.action = "processCallback.php?id=" + strId;
		document.index01.submit();	
	}
}


function validateCallback()
{

	vFname = document.index01.txtFname.value;
	vLname = document.index01.txtLname.value;
	vEmail = document.index01.txtEmail.value;
	vPhone = document.index01.txtPhone.value;

	if(jsTrim(vFname) == '')
	{
		alert("Please enter your first name.");
		document.index01.txtFname.focus();
		document.index01.txtFname.select();
		return false;
	}
	else if( containsQuotes( vFname ) )
	{
		alert("Your first name cannot contain quotation marks.");
		document.index01.txtFname.focus();
		document.index01.txtFname.select();
		return false;
	}
	else if(jsTrim(vLname) == '') // last name
	{
		alert("Please enter your last name.");
		document.index01.txtLname.focus();
		document.index01.txtLname.select();
		return false;
	}
	else if( containsQuotes( vLname ) )
	{
		alert("Your last name cannot contain quotation marks.");
		document.index01.txtLname.focus();
		document.index01.txtLname.select();
		return false;
	}
	else if(jsTrim(vEmail) == '')
	{
		alert("Please enter your email address.");
		document.index01.txtEmail.focus();
		document.index01.txtEmail.select();
		return false;
	}
	else if( containsQuotes( vEmail ) )
	{
		alert("Your email address cannot contain quotation marks or colons.");
		document.index01.txtEmail.focus();
		document.index01.txtEmail.select();
		return false;
	}
	else if(ValidateEmail( vEmail )!= true)
	{
		alert("You have entered a bad email address.");	
		document.index01.txtEmail.focus();
		document.index01.txtEmail.select();
		return false;
	}
	else if(jsTrim(vPhone) == '')
	{
		alert("Please enter your telephone number.");
		document.index01.txtPhone.focus();
		document.index01.txtPhone.select();
		return false;
	}

	if(jsTrim(vPhone) != '')
	{
		if( containsQuotes( vPhone ) )
		{
			alert("Phone number cannot contain quotation marks.");
			document.index01.txtPhone.focus();
			document.index01.txtPhone.select();
			return false;
		}
		else if ( !isCharsOk( vPhone, "0123456789-"))
		{
			alert("Phone number should not contain any special characters");
			document.index01.txtPhone.focus();
			document.index01.txtPhone.select();
			return false;
		}
	}


	if(document.index01.cboTimeZone.options[document.index01.cboTimeZone.selectedIndex].value == '-1')
	{
		alert("Please select your Time Zone.");
		document.index01.cboTimeZone.focus();
		return false;
	}

	// set these now before submitting to pass them on to the next page...
	document.index01.hprospectfirstname.value = vFname;
	document.index01.hprospectlastname.value = vLname;
	document.index01.hprospectemail.value = vEmail;
	document.index01.hprospectphone.value = vPhone;
	document.index01.hprospecttimezone.value = document.index01.cboTimeZone.options[document.index01.cboTimeZone.selectedIndex].text;
	return true;

}

////////////////////////////////////////////////////////////////////////////////////////
//
//
//	"SUPPORT TICKET"
//
//
////////////////////////////////////////////////////////////////////////////////////////
function validateSupportTicket( strLink )
{
    if( validateSupport() == true )
    {
		document.mailform.action = "processSupportTicket.php?id=" + strLink;
		document.mailform.submit();	        
    }
}


function validateSupport()
{
	vName = document.mailform.txtName.value;
	vEmail = document.mailform.txtEmail.value;
	vMsg = document.mailform.txtMsg.value;

	if( (jsTrim(vName) == '') || (vName == 'Name:')  )	// name
	{
		alert("Please enter your name.");
		document.mailform.txtName.focus();
		document.mailform.txtName.select();
		return false;
	}
	else if( containsQuotes( vName ) )
	{
		alert("Your name cannot contain quotation marks.");
		document.mailform.txtName.focus();
		document.mailform.txtName.select();
		return false;
	}
	else if( (jsTrim(vEmail) == '') || (vEmail == 'Email:')  )	// email
	{
		alert("Please enter your email address.");
		document.mailform.txtEmail.focus();
		document.mailform.txtEmail.select();
		return false;
	}
	else if( containsQuotes( vEmail ) )
	{
		alert("Your email address cannot contain quotation marks or colons.");
		document.mailform.txtEmail.focus();
		document.mailform.txtEmail.select();
		return false;
	}
	else if(ValidateEmail( vEmail )!= true)
	{
		alert("You have entered a bad email address.");	
		document.mailform.txtEmail.focus();
		document.mailform.txtEmail.select();
		return false;
	}
	else if( (jsTrim(vMsg) == '') || (vMsg == 'Message:') )	// msg
	{
		alert("Please enter a problem description.");
		document.mailform.txtMsg.focus();
		document.mailform.txtMsg.select();
		return false;
	}
	else if( containsQuotes( vMsg ) )
	{
		alert("Your problem descrittion cannot contain quotation marks or colons.");
		document.mailform.txtMsg.focus();
		document.mailform.txtMsg.select();
		return false;
	}



	document.mailform.hname.value = vName;
	document.mailform.hemail.value = vEmail;
	document.mailform.hmsg.value = vMsg;

    return true;
}


////////////////////////////////////////////////////////////////////////////////////////
//
//
//	"PERSONAL INFOR UPDATE"
//
//
////////////////////////////////////////////////////////////////////////////////////////
function validatePersonalInfoUpdatePage()
{
	if( validatePersonalInfo() == true)
	{
		document.form.action = "processUpdatePersonalInfo.php";
		document.form.submit();	
	}
}

function validatePersonalInfo()
{
	vFname = document.form.txtFname.value;
	vLname = document.form.txtLname.value;
	vPassword = document.form.txtPassword.value;
	vEmail = document.form.txtEmail.value;
	vPhone = document.form.txtPhone.value;
	vGoogleTracking = document.form.txtGoogleTrack.value;
	vYahooTracking = document.form.txtYSMTrack.value;
	vMSNTracking = document.form.txtMSNTrack.value;
	vZangoTracking = document.form.txtZangoTrack.value;
	vOppURL = document.form.txtOppURL.value;
	
	if(jsTrim(vFname) == '')	//first name
	{
		alert("Please enter your first name.");
		document.form.txtFname.focus();
		document.form.txtFname.select();
		return false;
	}
	else if( containsQuotes( vFname ) )
	{
		alert("Your first name cannot contain quotation marks.");
		document.form.txtFname.focus();
		document.form.txtFname.select();
		return false;
	}
	else if(jsTrim(vLname) == '') // last name
	{
		alert("Please enter your last name.");
		document.form.txtLname.focus();
		document.form.txtLname.select();
		return false;
	}
	else if( containsQuotes( vLname ) )
	{
		alert("Your last name cannot contain quotation marks.");
		document.form.txtLname.focus();
		document.form.txtLname.select();
		return false;
	}
	else if(jsTrim(vPassword) == '') // password
	{
		alert("Please choose a password.");
		document.form.txtPassword.focus();
		document.form.txtPassword.select();
		return false;
	}
	else if( containsQuotes( vPassword ) )
	{
		alert("Your password cannot contain quotation marks.");
		document.form.txtPassword.focus();
		document.form.txtPassword.select();
		return false;
	}
	else if(jsTrim(vEmail) == '')	// email
	{
		alert("Please enter your email address.");
		document.form.txtEmail.focus();
		document.form.txtEmail.select();
		return false;
	}
	else if( containsQuotes( vEmail ) )
	{
		alert("Your email address cannot contain quotation marks or colons.");
		document.form.txtEmail.focus();
		document.form.txtEmail.select();
		return false;
	}
	else if(ValidateEmail( vEmail )!= true)
	{
		alert("You have entered a bad email address.");	
		document.form.txtEmail.focus();
		document.form.txtEmail.select();
		return false;
	}
	else if(jsTrim(vPhone) == '')	// phone
	{
		alert("Please enter your telephone number.");
		document.form.txtPhone.focus();
		document.form.txtPhone.select();
		return false;
	}
	else if ( !isCharsOk( vPhone, "()0123456789-. "))
	{
		alert("Your telephone number should not contain any special characters");
		document.form.txtPhone.focus();
		document.form.txtPhone.select();
		return false;
	}
	else if(jsTrim(vOppURL) != '')	// website
	{
	    if( containsQuotes( vOppURL ) )
	    {
		    alert("Your website address cannot contain quotation marks.");
		    document.form.txtOppURL.focus();
		    document.form.txtOppURL.select();
		    return false;
	    }	
	}
	
	document.form.hfirstname.value = vFname;
	document.form.hlastname.value = vLname;
	document.form.hpassword.value = vPassword;
	document.form.hemail.value = vEmail;
	document.form.hphone.value = vPhone;
	document.form.hgoogletracking.value = vGoogleTracking;
	document.form.hyahootracking.value = vYahooTracking;
	document.form.hmsntracking.value = vMSNTracking;
	document.form.hzangotracking.value = vZangoTracking;
	document.form.hoppurl.value = vOppURL;
	return true;
}

////////////////////////////////////////////////////////////////////////////////////////
//
//
//	"BUILD YOUR OWN PAGE"
//
//
////////////////////////////////////////////////////////////////////////////////////////
function validateFilePicker( strLink )
{
    if( confirmAddFile() == true)
    {
		strPageName = document.filepick.hfilename.value + ".php";
		document.filepick.action = "byow.php?id=" + strLink + "&pagename=" + strPageName;
		document.filepick.submit();	    
    }
}

function confirmAddFile()
{
	vFname = document.filepick.txtfileName.value;

	if(jsTrim( vFname ) == '') // file name
	{
		alert("Please enter a page name .");
		document.filepick.txtfileName.focus();
		document.filepick.txtfileName.select();
		return false;
	}	
	else if( containsQuotes( vFname ) )
	{
		alert("Your page name cannot contain quotation marks.");
		document.filepick.txtfileName.focus();
		document.filepick.txtfileName.select();
		return false;
	}
	else if ( !isCharsOk( vFname, "abcdefghijklmnopqrstuvwxyz0123456789-ABCDEFGHIJKLMNOPQRSTUVWXYZ_"))
	{
		alert("Your page name should not contain any special characters");
		document.filepick.txtfileName.focus();
		document.filepick.txtfileName.select();
		return false;
	}


    document.filepick.hfilename.value = vFname;
    return true;
}



function deletePage( strFileToDelete, strLink )
{
    if( confirmDelete() == true)
    {
		document.filedelete.action = "byow.php?id=" + strLink + "&dFile=" + strFileToDelete;
		document.filedelete.submit();	    
    }
}

function confirmDelete()
{
    var msg1 = confirm("Are You Sure? - Continuing will PERMANENTLY DELETE the selected page!");
    if( msg1 == true )
    {
        return true;
    }
    else
    {
        return false;
    }
}

////////////////////////////////////////////////////////////////////////////////////////
//
//
//	"MISC"
//
//
////////////////////////////////////////////////////////////////////////////////////////

function jsTrim(TXT)
{
    return TXT.replace(/(^\s+)|(\s+$)/g,"");
}

function isCharsOk(sFirstName, sList)
{
	var i,c;
	for (i = 0; i < sFirstName.length; i++)
	{
		c = sFirstName.charAt(i);
		if (sList.indexOf(c) == -1)
		{
			return false;
		}
	}
	return true;
}


function chkNAN(char2chk)
{
	var validNum = "0123456789-()";
	
	if (validNum.indexOf(char2chk) == "-1")
		return (confirm("You have entered a non-numeric character."));
}


function ValidateEmail( strVal )	// email validation
{	
	var email1,atemail,atoccurance,splitter;
	email1 = strVal;
	atemail=email1.indexOf("@");
	
	if (atemail==-1)
	{
		return false;
	}
	else
	{
		atoccurence=email1.indexOf("@");
		dotcheck=email1.indexOf(".",atoccurence);
				
		 if (dotcheck==-1)
			{
				return false;
			}	
				
			splitter=email1.substring(atoccurence+1,2);
		if (splitter==".")
		{
					return false;
		}
		if(email1.indexOf("@.")!=-1)
		{
			return false;
		}
								
		len=email1.length-1;
		if(email1.substr(len,1)==".")
		{
			return false;
		}									
					
		checky = email1.substr(len,1);
		if ((checky=="~")||(checky=="!")||(checky=="#")||(checky=="$")||(checky=="$")||(checky=="%")||(checky=="^")||(checky=="&")||(checky=="*")||(checky=="(")||(checky==")")||(checky=="_")||(checky=="+")||(checky=="|")||(checky=="-")||(checky=="?")||(checky==">")||(checky=="<")||(checky=="/")||(checky=="{")||(checky=="}")||(checky=="[")||(checky=="]")||(checky=="'")||(checky==":")||(checky==";")||(checky==",")||(checky=="`"))
		{
			return false;
		}
											
		if(email1.substr(0,1)=="@")
		{
			return false;
		}
		if(email1.substr(0,1)==".")
		{
			return false;
		}
		var speChar=0;
		for(i=0;i<email1.length;i++)
		{
			if(email1.substr(i,1)=="@")
			{
				speChar+=1;
			}
		}
		if(speChar>1)
		{
			return false;
		}
	}
	return true;
}

function containsSpaces( strValue )
{
	var temp;
    for( var i = 0; i < strValue.length; i++ )
    {
        temp = "" + strValue.substring(i, i+1);
        if( temp == " " )
        {
			return true;
        }
    }
	return false;
}

function containsQuotes( strValue )
{
	var temp;
    for( var i = 0; i < strValue.length; i++ )
    {
        temp = "" + strValue.substring(i, i+1);
        if( (temp == "'") || (temp == '"') || (temp == ";") )
        {
			return true;
        }
    }
	return false;
}


////////////////////////////////////////////////////////////////////////////////////////
//
//
//	"PROSPECT STUFF"
//
//
////////////////////////////////////////////////////////////////////////////////////////
function prospectDelete( strId )
{
	var itemPreviouslySelected = false;
    var strDelete = 0;
	var strDeleteString = "SELECT * FROM prospects WHERE prospect_id = ";
	
	for ( var i = 0; i < document.formDelete.elements.length; i++)
	{
		if ( document.formDelete.elements[i].type == "checkbox" )
		{
			// field was set to "checked"
			if( document.formDelete.elements[i].checked )
			{
                strDelete = 1;
				// this goes in the loop
				if( itemPreviouslySelected == true )
				{
					strDeleteString	= strDeleteString + " OR prospect_id = " + document.formDelete.elements[i].value;				
				}
				else
				{
					strDeleteString	= strDeleteString + document.formDelete.elements[i].value;
					itemPreviouslySelected = true;
				}
			}
		}
	}
	
//	document.formDelete.action = "affiliates.php?id=" + strId + "&strDeleteQuery=" + strDeleteString + "&del=" + strDelete ;
    if( strDelete == 1 )
    {
	    document.formDelete.action = "affiliates.php?id=" + strId + "&del=" + strDelete ;
        document.formDelete.hdeletestring.value = strDeleteString;
//        alert( document.formDelete.hdeletestring.value );
	    document.formDelete.submit();
	}
}


function prospectUpdateNotes( strProspectId )
{
    var strNotes = document.formUpdate.txtNotes.value;

    document.formUpdate.hnotes.value = strNotes;
    document.formUpdate.action = "pnotes.php?pid=" + strProspectId + "&save=1";
    document.formUpdate.submit();
}