/*
* COPYRIGHT 2011 Jobvite, Inc. All rights reserved. This copyright notice is Copyright Management 
* Information under 17 USC 1202 and is included to protect this work and deter copyright infringement.  
* Removal or alteration of this Copyright Management Information without the express written permission 
* of Jobvite, Inc. is prohibited, and any such unauthorized removal or alteration will be a violation of 
* federal law.
*/
function importOutlook(target)
{
	var domain = document.getElementById('YourEmail');
	if (domain)
	{
		domain = domain.value;
		var p = domain.indexOf('@');
		if (p != -1)
			domain = domain.substr(p);
		domain = '?domain=' + domain;
	}
	else
		domain = '';
	popup(target, '../Info/ImportFromOutlook.aspx' + domain, 600, 520);
}
function importOutlookPB(target)
{
	var domain = document.getElementById('YourEmail');
	if (domain)
	{
		domain = domain.value;
		var p = domain.indexOf('@');
		if (p != -1)
			domain = domain.substr(p);
		domain = '?domain=' + domain;
	}
	else
		domain = '';
	callBack(target, '../Info/ImportFromOutlook.aspx' + domain);
}
function importFile(target)
{
	popup(target, '../Info/ImportFromFile.aspx', 600, 520);
}
function importFilePB(target)
{
	callBack(target, '../Info/ImportFromFile.aspx');
}
function importFile2(target)
{
	var height = window.screen.availHeight - 50;
	if (height > 700)
		height = 700;
	popup(target, '../Info/ImportFromFile.aspx', 600, height);
}
function importFile2PB(target)
{
	callBack(target, '../Info/ImportFromFile.aspx');
}
function importDocument(target)
{
	popup(target, '../Info/UploadFile.aspx', 470, 520);
}
function importDocumentPB(target)
{
	callBack(target, '../Info/UploadFile.aspx');
}
function spellCheck(target)
{
	popup(target, '../Info/Spellcheck.aspx', 600, 520);
}
function spellCheckPB(target)
{
	callBack(target, '../Info/Spellcheck.aspx');
}
function selectUser(target)
{
	var height = window.screen.availHeight - 50;
	if (height > 500)
		height = 500;
	popup(target, '../Common/SelectUser.aspx', 600, height);
}
function selectUserPB(target)
{
	callBack(target, '../Common/SelectUser.aspx');
}
function contact(target)
{
	var opt = '';
	var o = document.getElementById('m');
	if (o)
		opt = '?m=1';
	var height = window.screen.availHeight - 50;
	if (height > 500)
		height = 500;
	popup(target, '../Common/ContactList.aspx' + opt, 600, height);
}
function contactPB(target)
{
	var opt = '';
	var o = document.getElementById('m');
	if (o)
		opt = '?m=1';
	callBack(target, '../Common/ContactList.aspx' + opt);
}
function employee(target)
{
	var height = window.screen.availHeight - 50;
	if (height > 550)
		height = 550;
	popup(target, '../Common/Employees.aspx', 600, height);
}
function employeePB(target)
{
	callBack(target, '../Common/Employees.aspx');
}
function preview(target)
{
	var height = window.screen.availHeight - 50;
	if (height > 650)
		height = 650;
	popup(target, '../Info/Preview.aspx', 600, height);
}
function previewPB(target)
{
	callBack(target, '../Info/Preview.aspx');
}
function previewJobVite(target)
{
	var height = window.screen.availHeight - 50;
	if (height > 650)
		height = 650;
	popup(target, '../Info/Preview.aspx?type=jobvite', 600, height);
}
function previewJobVitePB(target)
{
	callBack(target, '../Info/Preview.aspx?type=jobvite');
}
function previewLogo(target)
{
	var height = window.screen.availHeight - 50;
	if (height > 650)
		height = 650;
	popup(target, '../Info/Preview.aspx?type=logo', 600, height);
}
function previewLogoPB(target)
{
	callBack(target, '../Info/Preview.aspx?type=logo');
}
function enterNames(target)
{
	var args = '?firstname=';
	var o = findControl('FirstName');
	if (o)
		args += o.value;
	args += '&lastname=';
	o = findControl('LastName');
	if (o)
		args += o.value;
	args += '&email=';
	o = findControl('Email');
	if (o)
		args += o.value;
	var height = window.screen.availHeight - 50;
	if (height > 700)
		height = 700;
	popup(target, '../Info/EnterNames.aspx' + args, 600, height);
}
function enterNamesPB(target)
{
	var args = '?firstname=';
	var o = findControl('FirstName');
	if (o)
		args += o.value;
	args += '&lastname=';
	o = findControl('LastName');
	if (o)
		args += o.value;
	args += '&email=';
	o = findControl('Email');
	if (o)
		args += o.value;
	callBack(target, '../Info/EnterNames.aspx' + args);
}
function findControl(name)
{
	var p = document.getElementById('Form1');
	if (p)
	{
		for (i = 0; i < p.elements.length; i++)
		{
			if (p.elements[i].name.indexOf(name) != -1)
				return p.elements[i];
		}
	}
}
function selectCoverLetter(target)
{
	var height = window.screen.availHeight - 50;
	if (height > 700)
		height = 700;
	popup(target, '../Common/SelectText.aspx?type=coverletter', 600, height);
}
function selectCoverLetterPB(target)
{
	callBack(target, '../Common/SelectText.aspx?type=coverletter');
}
function selectResume(target)
{
	var height = window.screen.availHeight - 50;
	if (height > 700)
		height = 700;
	popup(target, '../Common/SelectText.aspx?type=resume', 600, height);
}
function selectResumePB(target)
{
	callBack(target, '../Common/SelectText.aspx?type=resume');
}
function importOther(target)
{
	popup(target, '../Info/ImportLearnMore.aspx', 600, 500);
}
function importOtherPB(target)
{
	callBack(target, '../Info/ImportLearnMore.aspx');
}

