idseminar = '".($data[N_TYPE]==3 ? $data[EVENTDATA][0][S_ID_SEMINAR] : $id)."';

function checkit(f) {
	if (f.name.value=='') {
		alert("Please enter your friend's name.");
		f.name.focus();
		return false;
	}
	if (!CheckEmail(f.email)) {
		alert("Please enter a valid e-mail.");
		f.email.focus();
		return false;
	}
	return true;
}

function checkit2(f){
    if(f.name.value==''){
        alert("Please enter your name | Mohon masukkan nama anda");
        f.name.focus();
        return false;
    }
    if(f.phone.value==''){
        alert("Please enter your phone | Mohon masukkan nomor anda");
        f.phone.focus();
        return false;
    }else if(f.phone.value.match(NUM_CHECK) == null) {
        alert("Please enter your valid phone | Mohon masukkan nomor anda yang valid");
        f.phone.focus();
        return false;
    }
    if(f.email.value==''){
        alert("Please enter your email | Mohon masukkan email anda");
        f.email.focus();
        return false;
    }else if(f.email.value.match(EMAIL_CHECK) == null){
        alert("Please enter your valid email | Mohon masukkan email anda yang valid");
        f.email.focus();
        return false;
    }
    f.submit();
    return true;
}

function SetEmail (obj) {
	myform = document.form1;
	str = obj.options[obj.selectedIndex].text;
	myform.fname.value = str.substring(0, str.lastIndexOf(' - '));
	myform.email.value = str.substring(str.lastIndexOf(' - ')+3);
	obj.selectedIndex = 0;
}

function CheckEmail (email) {
	if (
	(   (email.value.indexOf("@") >= 1) &&
	(email.value.lastIndexOf("@") < email.value.length - 4)
	) &&
	(
	(email.value.indexOf(".") < 0) ||
	(
	(email.value.indexOf(".") >= 1) &&
	(email.value.lastIndexOf(".") < email.value.length - 2)
	)
	)
	) {
		return true;
	}
	email.focus();
	return false;
}

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function popup_place(id) {

	place = window.open('http://www.6221.net/popup.html?key=place&id='+id, '_blank', 'toolbar=no,location=0,directories=no,status=no,menubar=0,scrollbars=yes,resizable=1,copyhistory=0,width=330,height=470');
}

function promo_popup() {
	<!--promopopup-->
}

function popup_disclaimer(id) {
	place = window.open('http://www.6221.net/popup.html?key=disclaimerid='+id, '_blank', 'toolbar=no,location=0,directories=no,status=no,menubar=0,scrollbars=yes,resizable=1,copyhistory=0,width=550,height=470');
}

function popup(url) {
	window.open(url, '_blank', 'toolbar=no,location=0,directories=no,status=no,menubar=0,scrollbars=yes,resizable=1,copyhistory=0,width=500,height=370');
}

function popup2(url,winName) {
	window.open(url, winName, 'toolbar=yes,location=1,directories=no,status=no,menubar=1,scrollbars=yes,resizable=1,copyhistory=0,width=400,height=500');
}

function popupcatalog(url, winName){
	window.open(url);
}

function popup_organizer(id) {
	organizer = window.open('http://www.6221.net/popup.html?key=organizer&id='+id, '_blank', 'toolbar=no,location=0,directories=no,status=no,menubar=0,scrollbars=yes,resizable=1,copyhistory=0,width=350,height=370');
}

function popup_map(mapimg) {

	window.open( escape(mapimg), '_blank', 'toolbar=no,location=0,directories=no,status=no,menubar=0,scrollbars=yes,resizable=1,copyhistory=0,width=330,height=470');
}

function popup_speaker(id) {
        organizer = window.open('http://www.6221.net/popup.html?key=speaker&id='+id, '_blank', 'toolbar=no,location=0,directories=no,status=no,menubar=0,scrollbars=yes,resizable=1,copyhistory=0,width=350,height=370');
}

function clickmore(id) {
	document.location='".$url_moreinfo."&id='+id;
}

function tellfriend(id){
	window.opener.location.href = 'foot.html?key=tf&id=' +escape(id);
	self.close();
}

function submit_thedata(forms1, key){
	if(key == "direct"){
		//for leftpanel.php
		forms1.submit();
		//validateInput(document.forms["noteform"]);
		return;
	}else if(key == "directchecked"){
		if(validateInput2(forms1))
			forms1.submit();
	}else if(key == "orderquantity"){
		var qty = document.getElementById('qty').value;
		var id = document.getElementById('id').value;
		document.getElementById('key').value='confirm';
		forms1.action="http://www.6221.net/transact.html?key=confirm&qty="+escape(qty)+"&id="+ escape(id);
		forms1.submit();
	}else if(key == "orderquantityclose"){
		qty = forms1.qty.value;
		id = forms1.id.value;
		window.opener.location.href = 'http://www.6221.net/transact.html?key=confirm&qty='+ escape(qty) + '&id=' + escape(id);
		self.close();
	}else if(key == "pageminus"){
		forms1.page.value = forms1.pageTop.value;
		forms1.prcpage.value="pageminus";
		forms1.submit();
	}else if(key == "pageplus"){
		forms1.page.value = forms1.pageTop.value;
		forms1.prcpage.value="pageplus";
		forms1.submit();
	}else if(key == "setpagetop"){
		forms1.page.value = forms1.pageTop.value;
		forms1.submit();
	}else if(key == "setpagebelow"){
		forms1.page.value = forms1.pageBelow.value;
		forms1.submit();
	}else{
		forms1.submit();
	}
}

function submit_neworder(forms1, idx, idseminar){
	qtyid = 'qty'+idx
	var qtyorder = document.getElementById(qtyid).value;
	document.getElementById("qtyorder").value= qtyorder;
	var idorder = idseminar;
	document.getElementById("idseminar").value=idseminar;
	document.getElementById('key').value='confirm';
	forms1.action="transact.html?key=confirm&qtyorder="+escape(idx)+"&idorder="+ escape(idorder);
	forms1.submit();	
}

function check_input (form)
{
	alert("this is it.");
	var test;
	var i, cr;
	i=1;
	cr = true;
	while (cr && i<=1)
	{
		test = "form.elements["+i+"].value!=''";
		if(form.name[i].value == '' || form.name[i].value == null){
			cr= false;
		}
		i++;
	}
	if (!cr)
	{
		alert ("Please fill out all names");
	}
	return cr;
}

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Philip Myers :: http://virtualipod.tripod.com/bookmark.html */

function bookmark(url,title){
	if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
		window.external.AddFavorite(url,title);
	} else if (navigator.appName == "Netscape") {
		window.sidebar.addPanel(title,url,"");_
	} else {
		alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
	}
}
function notify(id, url_notify) {
	document.location=url_notify+'&id='+id;
}

var EMAIL_CHECK2="/^.+@.+\.[a-z]+$/";

var EMAIL_CHECK=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/;
var STRING_CHECK=/^[a-z]+$/gi;
var ALPHANUM_CHECK=/^[a-z]+[0-9]*$/gi;
var STRING2_CHECK=/^[A-Z]*(\s)*[A-Z]*$/gi;
var NUM_CHECK=/^[0-9]*$/gi;

//var receiveReq = getXmlHttpRequestObject();

function validateInput(form1){

	var error_str="";
	var name = form1.name.value;
	var phone = form1.phone.value;
	var email = form1.email.value;
	//alert(name);
	//Check whether the Email Address and its confirmation text input
	//is filled by data.
	if(name=="")
	error_str += "Please fill your name. It is a mandatory field\n";
	if(phone=="")
	error_str += "Please fill in your phone. It is a mandatory field\n";

	if(email == "")
	error_str += "Please fill your email address. It is mandatory field\n";

	if(name != ""){
		if(name.match(STRING2_CHECK) == null){
			error_str += "Name Field: Your first name is not a valid name input\n. Please check your first name.\n";
		}
	}
	if(phone != ""){
		if(phone.match(NUM_CHECK) == null){
			error_str += "Phone Field: Please fill in only numbers\n";
		}
	}

	if(email != "" ){
		if(email.match(EMAIL_CHECK) == null){
			error_str += "Email Field: Your email address is not a valid email address\n.Please check the email address.\n";
		}

	}



	if(error_str != ""){
		alert (error_str);
		return;
	}

	//getParam(theForm);
	form1.submit();
}


function validateInput(form1, actionString){
	var error_str="";
	var name = form1.name.value;
	var phone = form1.phone.value;
	var email = form1.email.value;
	//alert(name);
	//Check whether the Email Address and its confirmation text input
	//is filled by data.
	if(name=="")
	error_str += "Please fill your name. It is a mandatory field\n";
	if(phone=="")
	error_str += "Please fill in your phone. It is a mandatory field\n";

	if(email == "")
	error_str += "Please fill your email address. It is mandatory field\n";

	if(name != ""){
		if(name.match(STRING2_CHECK) == null){
			error_str += "Name Field: Your first name is not a valid name input\n. Please check your first name.\n";
		}
	}
	if(phone != ""){
		if(phone.match(NUM_CHECK) == null){
			error_str += "Phone Field: Please fill in only numbers\n";
		}
	}

	if(email != "" ){
		if(email.match(EMAIL_CHECK) == null){
			error_str += "Email Field: Your email address is not a valid email address\n.Please check the email address.\n";
		}

	}



	if(error_str != ""){
		alert (error_str);
		return;
	}

	form1.action=actionString;
	form1.submit();
}

/**
 * Validate input. Force input for required fields
 * 
*/
function validateInput2(form){
	lenForm = form.elements.length;
	
	var strError = "";
	var isChecked = false;
	
	//strName = "";
	
	for(var it=0; it < requiredInput.length; it++){
		deLabel = requiredInput[it][0];
		//strName += " Label " +deLabel;
		deName = requiredInput[it][1];
		//strName += "||Name " +deName;
		deType = requiredInput[it][2];
		//strName += "||Type " +deType;
		isRequired = requiredInput[it][3];
		//strName += "||Is Required "+isRequired;
		
		//alert(strName);
		
		
		elementValue ="";				
		if(deType == "radio"){
			var objs = form.elements[deName];
			
			
			for(j=0; j < objs.length; j++){
				if(objs[j].checked == true){
					elementValue = objs[j].value;
					isChecked=true;					
				}
			}
		}else{
			elementValue = form.elements[deName].value;
		}
		
		if(isRequired == "required" && elementValue== "" && deType != "radio"){
			strError += deLabel + " is required \n";
		}else if(isRequired == "required" && deType == "radio" && !isChecked){
			strError += deLabel + " is required \n";
		}
		
		//Check data validity
		if(deType == "number"){
			if(elementValue.match(NUM_CHECK) == null)
				strError += deLabel + " is invalid. Please input only Number values.\n";
		}else if(deType == "email"){
			if(elementValue.match(EMAIL_CHECK) == null)
				strError += deLabel + " is invalid. Please check your input.\n";
		}
	}
	
	if(strError != ""){
		alert(strError);
		return false;
	}
	return true;
}

function validateInput3(form){
	alert ("VAlidate Input 3");
	var formLen = form.elements.length;
	strName="";
	for(i=0;i < formLen;i++){
		strName += "Name -- " + form.elements[i].name + " Type " + form.elements[i].type + " Value " + form.elements[i].value + "\n";
	}
	alert(strName);
}

/**
* Additional function for ajax implementation.
*/
var xmlhttp = false;

function getxmlhttp(){

	try{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}catch(e2){
			xmlhttp = false;
		}
	}

	if(!xmlhttp && typeof XMLHttpRequest != undefined){
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function processajax(serverPage, obj, getOrPost, str){
	xmlhttp = getxmlhttp();
	alert = "server page" + serverPage;
	if(getOrPost == 'get'){
		xmlhttp.open("GET", serverPage);
		xmlhttp.onreadystatechange = function(){
			if(xmlhttp.readyState==4 && xmlhttp.status == 200){
				obj.innerHTML = xmlhttp.responseText;
			}
		}//end function
		xmlhttp.send(null);
	} else {
		xmlhttp.open("POST", serverPage, true);
		xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		xmlhttp.onreadystatechange = function(){
			if(xmlhttp.readyState==4 && xmlhttp.status == 200){
				obj.innerHTML = xmlhttp.responseText;
			}
		}//end function
		xmlhttp.send(str);
	}
}

function grabselect(theelement, key){
	serverPage="grabvalue.html";
	if(!xmlhttp)
	xmlhttp = getxmlhttp();
	var obj = document.getElementById(theelement);
	var value = obj.options[obj.selectedIndex].value;
	serverPage="grabvalue.html?key="+key+"&value='"+value+"'";

	if(key == 'city'){
		if(navigator.appName == "Microsoft Internet Explorer")
		selHotel = document.getElementById('hotel_div');
		else
		selHotel = document.getElementById('sel_hotel');

		xmlhttp.open("GET", serverPage);
		xmlhttp.onreadystatechange = function (){
			if(xmlhttp.readyState == 4 && xmlhttp.status == 200 ){
				selHotel.innerHTML = xmlhttp.responseText;
			}else{
				if(navigator.appName == "Microsoft Internet Explorer"){
					selHotel.innerHTML = "<select><option value='loading'>Loading hotel...</select>";
				}else
				selHotel.innerHTML = "<option value='loading'>Loading hotel...";
			}
		}
	}
	xmlhttp.send(null);
}
