<!--

//var applicationURL = 'https://secure.logomaker.com/logoMaker.html';
var applicationURL = 'https://secure.logomaker.com/do/login.php';
var applicationURL_ebay = 'https://secure.logomaker.com/proStoresLogoMaker.html';
var applicationURL_1and1 = 'https://secure.logomaker.com/1And1LogoMaker.html';
var applicationHeight = 575;
var applicationWidth = 800;

// browser compatibility
var isNS4 = (document.layers) ? true : false;
var isIE4 = (document.all && !document.getElementById) ? true : false;
var isIE5 = (document.all && document.getElementById) ? true : false;
var isNS6 = (!document.all && document.getElementById) ? true : false;

// ???? Who knows
function goURL(incURL){
	document.location.href = incURL;
}

// old function for handling logins (not used)
function Launch(page,user,pass){
	openNewWindow(page, "formProc", applicationHeight, applicationWidth);

	document.loginForm.username.value = user;
	document.loginForm.password.value = pass;

	document.loginForm.submit();
}

// this function is used in several places thoughout app to open pop-up windows
function openNewWindow(url,windowName,height,width,scrollbars){
	// calcs window center point
	var windowLeft = 0;
	var windowTop = 0;
	windowLeft = (screen.width - width) / 2;
	windowTop = (screen.height - height) / 2;

	if(!scrollbars){
		scrollbars = 0;
	}

	var index = url.indexOf("?");
        	if(index == -1){
             		preStr = "?";
        	}else{
                	preStr = "&";
        	}

	// fires window.open
	loadWindow = window.open(url+preStr+'fromSite=&source=&domain=logomaker.com',windowName,'height=' + height +',width=' + width + ',status=yes,toolbar=no,scrollbars=' + scrollbars + ',left=' + windowLeft + ',top='  +windowTop);
	loadWindow.focus();
	window.location.reload(0);
}

function tryIt(lmURL,height,width) {
	// calcs window center point
	var windowLeft = 0;
	var windowTop = 0;
	windowLeft = (screen.width - width) / 2;
	windowTop = (screen.height - height) / 2;

	if(!scrollbars){
		scrollbars = 0;
	}

	var index = url.indexOf("?");
        	if(index == -1){
             		preStr = "?";
        	}else{
                	preStr = "&";
        	}

	// fires window.open
	instaLogo = window.open(lmURL+preStr+'fromSite=&source=&domain=logomaker.com',"instaLogoWin",'height=' + height +',width=' + width + ',status=yes,toolbar=no,scrollbars=' + scrollbars + ',left=' + windowLeft + ',top='  +windowTop);
	instaLogo.focus();
	window.location.reload(0);
}

// new login function (requires the presence of the MD5.js file for hex_md5() function call)
function processLogin(incUsername, incPassword, company){
	if(incUsername != ''){
		// gets md5 hash of input username and password
		loginUsername = hex_md5(incUsername.toLowerCase());
		loginPassword = hex_md5(incPassword);
		if(company == 'ebay'){
			tempURL = applicationURL_ebay + '?loginUsername=' + loginUsername + '&loginPassword=' + loginPassword;
			openNewWindow(tempURL, "formProc", applicationHeight, applicationWidth);
		}else if(company == '1and1'){
			tempURL = applicationURL_1and1 + '?loginUsername=' + loginUsername + '&loginPassword=' + loginPassword;
			openNewWindow(tempURL, "formProc", applicationHeight, applicationWidth);
		}else {
			//send clear user and md5 pass to form and submit to URL
			//document.loginForm1.loginUsername.value = incUsername; 
			document.loginForm1.loginPassword.value = loginPassword;
			document.loginForm1.action = applicationURL;
			openNewWindow('', 'securePopup', 575, 800);
			document.loginForm1.submit();
			
			//no longer open and pass through GET 10-29-08 -rr
			//tempURL = applicationURL + '?loginUsername=' + loginUsername + '&loginPassword=' + loginPassword;
			//openNewWindow(tempURL, "formProc", applicationHeight, applicationWidth);
		}
	}else{
		alert('Please provide a valid username');
	}
}

function determinehDiv(strDivName){
	//identify the element based on browser type
	if(isNS4){
		objElement = document.layers[strDivName];
	}else if(isIE4){
		objElement = document.all[strDivName];
	}else if(isIE5 || isNS6){
		objElement = document.getElementById(strDivName);
	}
	return objElement.style.visibility;
}

function switchDiv(strDivName,bolVisible){
	//identify the element based on browser type
	if(isNS4){
		objElement = document.layers[strDivName];
	}else if(isIE4){
		objElement = document.all[strDivName];
	}else if(isIE5 || isNS6){
		objElement = document.getElementById(strDivName);
	}

	// toggles the visibility of the div parameter
	if(!bolVisible){
		objElement.style.visibility = "hidden";
	}else{
		objElement.style.visibility = "visible";
	}
}

// sets up the keyboard listener
if(document.layers){
	document.captureEvents(Event.KEYPRESS);
}
document.onkeypress=processkey;

// this function handles the keyboard events
function processkey(e){
	// determines browser type
	if(!document.all){
		// Netscape
		key = e.which;
	}else{
		// IE
		key = window.event.keyCode;
	}
	my_char = String.fromCharCode(key);

	// handles the numbers 1-4 when pressed
	switch(key){
		// handle 'Enter' key press
		case 13:
			if(determinehDiv('loginBox') == 'visible'){
				processLogin(document.loginForm.username.value, document.loginForm.password.value);
			}
			break;
	}
}

function toggleLayer(whichLayer, theOtherOne)
{
	if (document.getElementById)
	{
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
		var style1 = document.getElementById(theOtherOne).style;
		style1.display = style1.display? "":"none";

	}
}
-->
