
function getCopy(){
	return '<a href=\"javascript:pop()\" class=copy>&copy; ' + GetYear() + '</a>'
}

function GetYear(){
	var d = new Date()
	return d.getFullYear()
}

function GetADate(){
	var d = new Date()
	var months = new Array()
	months[0] = "January"
	months[1] = "February"
	months[2] = "March"
	months[3] = "April"
	months[4] = "May"
	months[5] = "June"
	months[6] = "July"
	months[7] = "August"
	months[8] = "September"
	months[9] = "October"
	months[10] = "November"
	months[11] = "December"
	return d.getDate() + ' ' + months[d.getMonth()] + ' ' + d.getFullYear()
}

function GetMonthYear(){
	var d = new Date()
	var months = new Array()
	months[0] = "January"
	months[1] = "February"
	months[2] = "March"
	months[3] = "April"
	months[4] = "May"
	months[5] = "June"
	months[6] = "July"
	months[7] = "August"
	months[8] = "September"
	months[9] = "October"
	months[10] = "November"
	months[11] = "December"
	return months[d.getMonth()] + ' ' + d.getFullYear()
}

function destination(oList){
    var page = oList.options[oList.selectedIndex].value
	if(page != ""){
		var cmd = "parent.location = 'links/" + page + ".html'"
		eval(cmd);
	}
}


function pop(){
    window.open('http://www.aspartame.info/aji.htm','aji','scrollbars=no,menubar=no,width=200,height=170,toolbar=no,scrolling=no')
}


function validate_form(){

    validity = true;

    if (!check_empty(document.search.txt_search.value)){ 
        validity = false; 
        alert('Search field is empty!');
        return false;
    }

}

function check_empty(text){
    return (text.length > 0)
}

// Checks for email in send to a friend
function FormValidate(theForm){


    if ((theForm.email.value == "")
    || (theForm.email.value.indexOf ('@') == -1)
    || (theForm.email.value.indexOf ('.') == -1)){
        
        alert("Please enter a valid email address")
        theForm.email.focus()
        return (false)
        
    }
 
}


function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

function rollin(obj, c){
	//eval("obj.style.cssText='background-color:" + c + "'")
	eval("obj.style.cssText = 'border:solid 1px #000000'")
	obj.style.cursor = 'pointer'
}
function rollout(obj, c){
	//eval("obj.style.cssText='background-color:" + c + "'")
	eval("obj.style.cssText = 'border:solid 1px #b0b0b0'")
}

// Validates the contact form
function ContactValidate(theForm){


    if (theForm.name.value==""){
            
        alert("Please enter a name")
        theForm.name.focus()
        return (false)
    }

    if (theForm.comment.value==""){
            
        alert("Please enter some comments")
        theForm.comment.focus()
        return (false)
    }
    
      
    var intIdx = theForm.country.selectedIndex;
    var strCCode = theForm.country.options[intIdx].value;
    var strOtherCountry = theForm.othercountry.value
       
    if (strCCode=="Choose Country" && strOtherCountry == ""){
        alert("Please choose a country from the list or specify a country in the box below the list.")
        theForm.country.focus()
        return false
    }
            
    if ((theForm.email.value == "")
    || (theForm.email.value.indexOf ('@') == -1)
    || (theForm.email.value.indexOf ('.') == -1)){
        
        alert("Please enter a valid email address")
        theForm.email.focus()
        return (false)
        
    }
    
    if (theForm.email.value != theForm.confirmemail.value){
        alert("Your confirm email address does not match your first email address")
        theForm.confirmemail.focus()
        return (false)
        
    }
        
}



function openWindow( pageToLoad, winName, width, height, center, x, y) {		 
	xposition=0; yposition=0;
	if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
		xposition = (screen.width - width) / 2;
		yposition = (screen.height - height) / 2;
	}
	args = "width=" + width + "," 
	+ "height=" + height + "," 
	+ "location=0," 
	+ "menubar=0,"
	+ "resizable=0,"
	+ "scrollbars=0,"
	+ "status=0," 
	+ "titlebar=1,"
	+ "toolbar=0,"
	+ "hotkeys=0,"
	+ "screenx=" + x + ","  //NN Only
	+ "screeny=" + y + ","  //NN Only
	+ "left=0" + xposition + ","     //IE Only
	+ "top=0" + yposition;           //IE Only
	window.open( pageToLoad,winName,args );
}






