
var preloadFlag = false;
	if (document.images) {
		button1off=new Image();button1off.src="/images/buttons/infooff.gif";
		button1on=new Image();button1on.src="/images/buttons/infoon.gif";
		preloadFlag = true;
}

function swapImages(name,bn,status){
	if (document.images && (preloadFlag == true)) {
    	loc=name + bn;
    	document[loc].src=eval(name+ bn + status +".src");
  	}
}

function openPopup() {
   var url="/products/familyversions/buyingguide/tablepopup.html";
   var height = 500;            
   var width = 600;             
   var att='width=' + width + ',height=' + height;
   WorkingMessagePopup=window.open(url,"wmp",att);
}

function openFlash(url) {
   var height = 400;            
   var width = 400;             
   var att='width=' + width + ',height=' + height;
   WorkingMessagePopup=window.open(url,"wmp",att);
}
function demos(product,host) {
   var url="";
   if(host=="external") {
   		url = "http://www.llsupdates.com/"+product+"/";	
	} else {
		url = "/demos/"+product+"/";
	}
   var height = 512;            
   var width = 759;             
   var att='width=' + width + ',height=' + height;
   WorkingMessagePopup=window.open(url,"wmp",att);
} 

function show(thistag) {
		  	obj = document.getElementById(thistag);
		  	obj.style.display = 'inline';	
}
function hide(thistag) {
	  		obj = document.getElementById(thistag);
			obj.style.display = 'none';
			text = document.getElementById('school');
			text.value = '';
			text = document.getElementById('title');
			text.value = '';
}
function popUp(URL){
day = new Date();
id = day.getTime();
w=320;
h=310;
if (URL.substring(URL.length-3, URL.length) == "mov"){
	w=255;
	h=209;
}
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+w+",height="+h+",left = 0,top = 0');");
}

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

function toggle(id) {
if(document.getElementById(id).className == "displaynone") {
	document.getElementById(id).className = "displayblock";
	document.getElementById("i" + id).src = "/images/icons/minus.gif";
	document.getElementById("i" + id).title = "Collapse";
	document.getElementById("i" + id).alt = "Collapse";
} else {
	document.getElementById(id).className = "displaynone";
	document.getElementById("i" + id).src = "/images/icons/plus.gif";
	document.getElementById("i" + id).title = "Expand";
	document.getElementById("i" + id).alt = "Expand";
}
}		



function checkemail(obj) {
var obj = eval(obj);
if (obj.email != null) {
	var tmpaddress = obj.email.value;
}
if (obj.custEmail != null) {
	var tmpaddress = obj.custEmail.value;
}
var tvar;
	if ((tmpaddress.indexOf('@') < 0) || ((tmpaddress.charAt(tmpaddress.length-4) != '.') && (tmpaddress.charAt(tmpaddress.length-3) != '.'))) {
		tvar = "\n     -  Correct E-mail Address";
	} else {
        tvar = "";
	}
	return tvar;
}

// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()-. ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}
function checkphone(obj) {
var obj = eval(obj);
var tmpphone = obj.phone.value;
var error = "";
	if (checkInternationalPhone(tmpphone)==false){
		error = "\n     -  Please Enter a Valid Phone Number";
	}
return error;
}

function WithoutContent(ss) {
if(ss.length > 0) { return false; }
return true;
}

function NoneWithContent(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].value.length > 0) { return false; }
	}
return true;
}

function NoneWithCheck(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].checked) { return false; }
	}
return true;
}

function WithoutCheck(ss) {
if(ss.checked) { return false; }
return true;
}

function WithoutSelectionValue(ss) {
for(var i = 0; i < ss.length; i++) {
	if(ss[i].selected) {
		if(ss[i].value.length) { 
			return false; 
		}
	}
}
return true;
}

function checkRequiredFields(obj) {
var obj = eval(obj);
var missinginfo = "";
	if (obj.yourname != null) {
		if(WithoutContent(obj.yourname.value)) { 
			missinginfo += "\n     -  Your Name";
		} 
	}
	if (obj.email != null) {
		if(WithoutContent(obj.email.value)) { 
			missinginfo += "\n     -  E-mail Address";
		}
		if(!WithoutContent(obj.email.value)) { 
			missinginfo += checkemail(obj);
		} 
	}
	if (obj.phone != null) {
		if(WithoutContent(obj.phone.value)) { 
			missinginfo += "\n     -  Phone";
		}
		if(!WithoutContent(obj.phone.value)) { 
			missinginfo += checkphone(obj);
		}
	}
	if (obj.schoolname != null) {
		if(WithoutContent(obj.schoolname.value)) {
			missinginfo += "\n     -  School Name";
		} 
	} 
	if (obj.address != null) {
		if(WithoutContent(obj.address.value)) {
			missinginfo += "\n     -  School Address";
		} 
	}
	if (obj.city != null) {
		if(WithoutContent(obj.city.value)) {
			missinginfo += "\n     -  City";
		} 
	}
	if (obj.state != null) {
		if(WithoutContent(obj.state.value)) {
			missinginfo += "\n     -  State";
		} 
	}
	if (obj.zip != null) {
		if(WithoutContent(obj.zip.value)) {
			missinginfo += "\n     -  Zip";
		} 
	}
	if (obj.custName != null) {
		if(WithoutContent(obj.custName.value)) { 
			missinginfo += "\n     -  Name";
		} 
	}
	if (obj.custEmail != null) {
		if(WithoutContent(obj.custEmail.value)) { 
			missinginfo += "\n     -  E-mail Address";
		}
		if(!WithoutContent(obj.custEmail.value)) { 
			missinginfo += checkemail(obj);
		} 
	}
// Put field checks above this point.
	if(missinginfo.length > 2) {
		missinginfo ="_____________________________\n" +
			"Please fill in the following information:\n" +
			missinginfo + "\n_____________________________" +
			"\nPlease re-enter and submit again.";
			alert(missinginfo);
		return false;
		}
	return true;
	} // end of function CheckRequiredFields()
	
function checkOfferForm(obj) {
var obj = eval(obj);
var missinginfo = "";
	if (obj.nameFirst != null) {
		if(WithoutContent(obj.nameFirst.value)) { 
			missinginfo += "\n     -  First Name";
		} 
	}
	if (obj.nameLast != null) {
		if(WithoutContent(obj.nameLast.value)) { 
			missinginfo += "\n     -  Last Name";
		} 
	}
	if (obj.Position != null) {
		if(WithoutContent(obj.Position.value)) { 
			missinginfo += "\n     -  Position";
		}
	}
	if (obj.schoolName != null) {
		if(WithoutContent(obj.schoolName.value)) { 
			missinginfo += "\n     -  School Name";
		}
	}
	if (obj.schoolname != null) {
		if(WithoutContent(obj.schoolname.value)) {
			missinginfo += "\n     -  School Name";
		} 
	} 
	if (obj.StreetAddress != null) {
		if(WithoutContent(obj.StreetAddress.value)) {
			missinginfo += "\n     -  School Address";
		} 
	}
	if (obj.city != null) {
		if(WithoutContent(obj.city.value)) {
			missinginfo += "\n     -  City";
		} 
	}
	if (obj.state != null) {
		if(WithoutContent(obj.state.value)) {
			missinginfo += "\n     -  State";
		} 
	}
	if (obj.zip != null) {
		if(WithoutContent(obj.zip.value)) {
			missinginfo += "\n     -  Zip";
		} 
	}
	if (obj.phone != null) {
		if(WithoutContent(obj.phone.value)) { 
			missinginfo += "\n     -  Phone";
		} 
	}
	if (obj.email != null) {
		if(WithoutContent(obj.email.value)) { 
			missinginfo += "\n     -  E-mail Address";
		}
	}
// Put field checks above this point.
	if(missinginfo.length > 2) {
		missinginfo ="_____________________________\n" +
			"Please fill in the following information:\n" +
			missinginfo + "\n_____________________________" +
			"\nPlease re-enter and submit again.";
			alert(missinginfo);
	} else {
		obj.submit();
	}
} // end of function CheckOfferForm()

function checkUsergroupForm(obj) {
var obj = eval(obj);
var missinginfo = "";
	if (obj.name_r != null) {
		if(WithoutContent(obj.name_r.value)) { 
			missinginfo += "\n     -  Name";
		} 
	}
	if (obj.school != null) {
		if(WithoutContent(obj.school.value)) { 
			missinginfo += "\n     -  School Name";
		}
	}
	if (obj.school_address != null) {
		if(WithoutContent(obj.school_address.value)) {
			missinginfo += "\n     -  School Address";
		} 
	} 
	if (obj.school_city != null) {
		if(WithoutContent(obj.school_city.value)) {
			missinginfo += "\n     -  City";
		} 
	}
	if (obj.school_state != null) {
		if(WithoutContent(obj.school_state.value)) {
			missinginfo += "\n     -  State";
		} 
	}
	if (obj.school_zip != null) {
		if(WithoutContent(obj.school_zip.value)) {
			missinginfo += "\n     -  Zip";
		} 
	}
	if (obj.phone_r != null) {
		if(WithoutContent(obj.phone_r.value)) { 
			missinginfo += "\n     -  Phone";
		} 
	}
	if (obj.email_address_r != null) {
		if(WithoutContent(obj.email_address_r.value)) { 
			missinginfo += "\n     -  E-mail Address";
		}
	}
// Put field checks above this point.
	if(missinginfo.length > 2) {
		missinginfo ="_____________________________\n" +
			"Please fill in the following information:\n" +
			missinginfo + "\n_____________________________" +
			"\nPlease re-enter and submit again.";
			alert(missinginfo);
	} else {
		obj.submit();
	}
} // end of function CheckUsergroupForm()

function checkLearnMoreForm(obj) {
var obj = eval(obj);
var missinginfo = "";
	if (obj.name_r != null) {
		if(WithoutContent(obj.name_r.value)) { 
			missinginfo += "\n     -  Name";
		} 
	}
	if (obj.school != null) {
		if(WithoutContent(obj.school.value)) { 
			missinginfo += "\n     -  School Name";
		}
	}
	if (obj.school_address != null) {
		if(WithoutContent(obj.school_address.value)) {
			missinginfo += "\n     -  School Address";
		} 
	} 
	if (obj.school_city != null) {
		if(WithoutContent(obj.school_city.value)) {
			missinginfo += "\n     -  City";
		} 
	}
	if (obj.school_state != null) {
		if(WithoutContent(obj.school_state.value)) {
			missinginfo += "\n     -  State";
		} 
	}
	if (obj.school_zip != null) {
		if(WithoutContent(obj.school_zip.value)) {
			missinginfo += "\n     -  Zip";
		} 
	}
	if (obj.phone_r != null) {
		if(WithoutContent(obj.phone_r.value)) { 
			missinginfo += "\n     -  Phone";
		} 
	}
	if (obj.offer_code != null) {
		if(WithoutContent(obj.offer_code.value)) { 
			missinginfo += "\n     -  Offer Code";
		} 
	}
	if (obj.email_address_r != null) {
		if(WithoutContent(obj.email_address_r.value)) { 
			missinginfo += "\n     -  E-mail Address";
		}
	}
// Put field checks above this point.
	if(missinginfo.length > 2) {
		missinginfo ="_____________________________\n" +
			"Please fill in the following information:\n" +
			missinginfo + "\n_____________________________" +
			"\nPlease re-enter and submit again.";
			alert(missinginfo);
	} else {
		obj.submit();
	}
} // end of function CheckLearnMoreForm()

function checkAdwordForm(obj) {
var obj = eval(obj);
var missinginfo = "";
	if (obj.inqSource != null) {
		var myOption = -1;
		for (i=obj.inqSource.length-1; i > -1; i--) {
			if (obj.inqSource[i].checked) {
				myOption = i; 
				i = -1;
			}
		}
		if (myOption == -1) {
			missinginfo += "\n     -  Role";
		} 
	}
	if (obj.fname != null) {
		if(WithoutContent(obj.fname.value)) { 
			missinginfo += "\n     -  First Name";
		} 
	}
	if (obj.lname != null) {
		if(WithoutContent(obj.lname.value)) { 
			missinginfo += "\n     -  Last Name";
		} 
	}
	if (obj.zipcode != null) {
		if(WithoutContent(obj.zipcode.value)) {
			missinginfo += "\n     -  Zip";
		} 
	}
	if (obj.email != null) {
		if(WithoutContent(obj.email.value)) { 
			missinginfo += "\n     -  E-mail Address";
		}
	}
	if (obj.title != null) {
		if(document.getElementById("title").selectedIndex == 0) { 
			missinginfo += "\n     -  Title";
		}
	}
	if (obj.school != null) {
		if(document.getElementById("title").selectedIndex < 9 && WithoutContent(obj.school.value)) { 
			missinginfo += "\n     -  School";
		}
	}
// Put field checks above this point.
	if(missinginfo.length > 2) {
		missinginfo ="_____________________________\n" +
			"Please fill in the following information:\n" +
			missinginfo + "\n_____________________________" +
			"\nPlease re-enter and submit again.";
			alert(missinginfo);
	} else {
		obj.submit();
	}
} // end of function CheckAdwordForm()