var cookies=new CookieUtil("TMIELEARN",0);

function goSearch(){
	if(form1.searchText.value.length>0){
		form1.submit();
	}else{
		alert("Please provide search criteria.");
	}
}

function showEula(){
	window.open('eula.htm','mywin','width=500,height=500,scrollbars=1,toolbar=0,resizable=0');
}


function launchDemo(d){
	window.open('demo.asp?dbid='+d,'demo','width=500,height=250,scrollbars=1,toolbar=0,resizable=0');
}

function AddToCart(f){
	if(!cookies.getSubValue("TMIELEARN")){
		document.getElementById("panel").style.display="none";
		document.getElementById("eula").style.display="block";
		if(document.getElementById("eulaText").scrollHeight<350){
			//no need to scroll to bottom (350 + 30 padding);
			document.getElementById("accept").disabled=false;
			document.getElementById("decline").disabled=false;
		}
	}else{
		f.submit();
	}
}


function checkEULA(){
	var objDiv = document.getElementById("eulaText");
	if((objDiv.offsetHeight+objDiv.scrollTop)>= objDiv.scrollHeight){
		document.getElementById("accept").disabled=false;
		document.getElementById("decline").disabled=false;
	}else{
		document.getElementById("accept").disabled=true;
		document.getElementById("decline").disabled=true;
	}
}

function acceptEula(f){
	cookies.setSubValue("TMIELEARN",1);
	f.submit();
}

function declineEula(){
	document.getElementById("panel").style.display="block";
	document.getElementById("eula").style.display="none";
}

function mktDemo(d,w,h){
	window.open('portfolio_view.asp?myFile='+d,'mywin','width='+w+',height='+h+',scrollbars=0,toolbar=0,resizable=0');
}

