window.status = ":: Business Technology Summit ::";

//location.href = location.href.replace(/^http:/, 'https:');

function divDrag(divId){
	var theHandle = document.getElementById("handle");
	var theRoot = document.getElementById(divId);
	Drag.init(theHandle, theRoot);
}
function closeLayerDiv(divId){
	document.getElementById(divId).style.display="none";
	document.getElementById(divId).style.display="none";
}


/*menu
	.dropdown {float:left; padding-right:5px}
	.dropdown dt {width:188px; border:2px solid #9ac1c9; padding:8px; font-weight:bold; cursor:pointer; background:url(images/header.gif)}
	.dropdown dt:hover {background:url(images/header_over.gif)}
	.dropdown dd {position:absolute; overflow:hidden; width:208px; display:none; background:#fff; z-index:200; opacity:0}
	.dropdown ul {width:204px; border:2px solid #9ac1c9; list-style:none; border-top:none}
	.dropdown li {display:inline}
	.dropdown a, .dropdown a:active, .dropdown a:visited {display:block; padding:5px; color:#333; text-decoration:none; background:#eaf0f2; width:194px}
	.dropdown a:hover {background:#d9e1e4; color:#000}
	.dropdown .underline {border-bottom:1px solid #b9d6dc}*/
	/*var DDSPEED = 10;
	var DDTIMER = 15;

	// main function to handle the mouse events //
	function ddMenu(id, d) {
		var h = document.getElementById(id + '-ddheader');
		var c = document.getElementById(id + '-ddcontent');
		clearInterval(c.timer);
		if(d == 1){
			clearTimeout(h.timer);
			if(c.maxh && c.maxh <= c.offsetHeight) {
				return
			}
			else if(!c.maxh) {
				c.style.display = 'block';
				c.style.height = 'auto';
				c.maxh = c.offsetHeight;
				c.style.height = '0px';
			}
			c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
		}else{
			h.timer = setTimeout(function(){ddCollapse(c)},50);
		}
	}

	// collapse the menu //
	function ddCollapse(c) {
		c.timer = setInterval(function(){ddSlide(c,-1)},DDTIMER);
	}

	// cancel the collapse if a user rolls over the dropdown //
	function cancelHide(id) {
		var h = document.getElementById(id + '-ddheader');
		var c = document.getElementById(id + '-ddcontent');
		clearTimeout(h.timer);
		clearInterval(c.timer);
		if(c.offsetHeight < c.maxh) {
			c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
		}
	}

	// incrementally expand/contract the dropdown and change the opacity //
	function ddSlide(c, d) {
		var currh = c.offsetHeight;
		var dist;
		if(d == 1) {
			dist = (Math.round((c.maxh - currh) / DDSPEED));
		}else {
			dist = (Math.round(currh / DDSPEED));
		}
		if(dist <= 1 && d == 1) {
			dist = 1;
		}
		c.style.height = currh + (dist * d) + 'px';
		c.style.opacity = currh / c.maxh;
		c.style.filter = 'alpha(opacity=' + (currh * 100 / c.maxh) + ')';
		if((currh < 2 && d != 1) || (currh > (c.maxh - 2) && d == 1)){
			clearInterval(c.timer);
		}
	}*/

/**
* This fuction is used to validate email address
*
* @access   public
* @param    str
*
* @return   true / false
*/
function checkEmail(str) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)) {
		return (true);
	}
	alert("Invalid E-mail Address! Please Enter valid E-mail Address.");
	return (false);
}

var keynum;
var keychar;
var numcheck;
/**
* This fuction is used to validate only characters on keypress event on text
*
* @access   public
* @param    e
*
* @return   true / false
*/
function validChar (e)	{
	keynum = (window.event) ? window.event.keyCode : e.which;
	if (keynum == parseInt(8) || keynum == parseInt(0))
		return true;
	keychar = String.fromCharCode(keynum);
	var validchars = new RegExp("[ A-Za-z]");	/*[ A-Za-z0-9&,.-]*/
	return validchars.test(keychar);
}

/**
* This fuction is used to validate character or digits on keypress event on text
*
* @access   public
* @param    e
*
* @return   true / false
*/
function validAlphaChar (e)	{
	keynum = (window.event) ? window.event.keyCode : e.which;
	if (keynum == parseInt(8) || keynum == parseInt(0))
		return true;
	if ( (keynum == parseInt(47)) || (keynum == parseInt(61)) )
		return false;

	keychar = String.fromCharCode(keynum);
	var validchars = new RegExp("[ A-Za-z0-9.-@]");
	return validchars.test(keychar);
}

/**
* This fuction is used to validate only digits on keypress event on text
*
* @access   public
* @param    e
*
* @return   true / false
*/
function validDigits (e)	{
	keynum = (window.event) ? window.event.keyCode : e.which;
	if (keynum == parseInt(8) || keynum == parseInt(0))
		return true;
	keychar = String.fromCharCode(keynum);
	var validchars = new RegExp("[0-9]");
	return validchars.test(keychar);
}


function validateCaptcha() {
	//alert("hai");
	challengeField = $("input#recaptcha_challenge_field").val();
	responseField = $("input#recaptcha_response_field").val();
	//alert(challengeField);
	//alert(responseField);
	//return false;
	var html = $.ajax({
		type: "POST",
		url: "./inc/ext/reCAPTCHA/ajax.recaptcha.php",
		data: "recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField,
		async: false
		}).responseText;

	if(html == "success") {
		document.getElementById('captchaStatus').style.display="";
		//$("#captchaStatus").html("Success. Submitting form.");
		//return false;
		// Uncomment the following line in your application
		return true;
	}
	else {
		document.getElementById('captchaStatus').style.display="";
		$("#captchaStatus").html("Your captcha is incorrect. Please try again");
		Recaptcha.reload();
		return false;
	}
}

/**
* This fuction is used to save contact
*
* @access   public
* @param    null
*
* @return   null
*/
function saveContact() {
	if ( contactValidation() ) {
		if ( validateCaptcha() ) {
			$("#action").val("SaveContact");
			$("#pageform").submit();
		}
	}
}

/**
* This fuction is used to validate contact details
*
* @access   public
* @param    null
*
* @return   true / false
*/
function contactValidation() {
	if ( $("#moreinfo").val()=='new' ) {
		alert("Please select contact title.");
		$("#moreinfo").focus();
		return;
	}
	else if ( $("#firstname").val().match(/^ *$/) ) {
		alert("Please enter first name");
		$("#firstname").focus();
		return;
	}
	else if ( $("#lastname").val().match(/^ *$/) ) {
		alert("Please enter last name.");
		$("#lastname").focus();
		return;
	}
	else if (checkEmail( $("#email").val() )!=true ) {
		$("#email").val('');
		$("#email").focus();
		return;
	}
	return true;
}

function viewText(divId) {
	document.getElementById(divId).style.display="";
	document.getElementById('imgkeynoteminus'+divId).style.display="";
	document.getElementById('imgkeynoteplus'+divId).style.display="none";
}
function notviewText(divId) {
	document.getElementById(divId).style.display="none";
	document.getElementById('imgkeynoteplus'+divId).style.display="";
	document.getElementById('imgkeynoteminus'+divId).style.display="none";
}

/**
* This fuction is used to re-direct registration process
*
* @access   public
* @param    null
*
* @return   null
*/
function gotoRegisterPage() {
	if (document.getElementById("payMod").value=='new') {
		alert("Please select the payment mod.");
		document.getElementById("payMod").focus();
	}
	else {
		data=document.getElementById('payMod').value;
		if (data=='Cheque/DD') {
			window.location = "registrationChequeDD.html";
		}
		else {
			window.open('https://www.eventavenue.com/attReglogin.do?eventId=EVT2221');
		}
	}
}

function getHTTPObject() {
	var xmlhttp;
	/*@cc_on
	@if (@_jscript_version >= 5)
	try {
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	try {
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
	xmlhttp = false;
	}
	}
	@else
	xmlhttp = false;
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		}
		catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}

/**/
function loadProposal() {
	var presentation;

	presentation=document.getElementById("presentation");
	presentation.innerHTML='';
	index=document.getElementById("proposalno").selectedIndex;
	//alert(index);
	for(i=1; i<=(index+1); i++) {
		//alert(i);
		//presentation=document.getElementById("presentation").innerHTML;
		presentation.innerHTML +="<div>";
		presentation.innerHTML +="<div style='padding: 10px 0px 0px 0px;width:0px;float:left;border:0px solid;'>";
		presentation.innerHTML +="<div class='proposals'>Proposal #"+i+"</div>";
		presentation.innerHTML +="<div class='clear' style='height:10px;clear:both'></div>";
		presentation.innerHTML +="<div id='presentInner' style='border:1px solid #4173A8;height:110px;margin:-5px 0px 0px 0px;_margin:0px 0px 0px 0px;width:400px;'>		<p style='text-align:left;background:#4173A8;margin:0px 0px 0px 0px;color:white;font-family:Arial, Helvetica, Sans-serif;'><b>Add New Presentation</b></p>			<div style=' padding: 8px 0px 0px 10px;text-align:left;float:left;font-size:12px;border:0px solid;font-family:Arial, Helvetica, Sans-serif;'>Select presentation type to add:</div>			<div id='presentation1' name='presentation1' style='text-align:left;float:left;width:200px;padding:8px 0px 0px 10px;'><select onchange='typeMessage("+i+");typeHead("+i+")' name='present"+i+"' id='present"+i+"'/></select></div><br /><br />			<div onclick=viewDescLayer(event,'present"+i+"','presentDescLayer') >			<div style='margin:0px 0px 10px 10px;_margin:0px 0px 10px 5px;cursor: pointer;color:#4173A8;font-size:12px;border:0px solid;width:132px;float:left'> What do we expect from</div>			<div style='cursor: pointer;border:0px solid;font-size:12px;margin:0px 0px 0px 0px;color:#4173A8;float:left' id='head"+i+"'></div>			<div style='cursor: pointer;border:0px solid;float:left'>&nbsp;<img src='img/question.jpg'></div><div id='propos"+i+"' style='margin: 2px 10px 0px 10px;text-align:left;float:left;font-size:9pt;border:0px solid;font-family:Arial, Helvetica, Sans-serif;'></div>			</div>";

		//document.getElementById('present');	
		//alert(typeVal);
		presentation.innerHTML +="";
		presentation.innerHTML +="</div>";
		presentation.innerHTML +="</div>";
		presentation.innerHTML +="<div class='clear'></div>";
		//typeVal=document.getElementById("present"+i).selectedIndex;



		//presentation.innerHTML +="<div style='padding: 0px 0px 0px 0px;width:400px;float:left;border:1px solid;'>";
		presentation.innerHTML +="<div style='clear:both;height:10px'></div>";
		presentation.innerHTML +="<div style='width:180px;margin: 5px 0px 0px 0px;text-align:left;float:left;font-size:10pt;border:0px solid;'><p>Choose the Conference</p></div>";
		presentation.innerHTML +="<div style='clear:both;height:5px'></div>";
		presentation.innerHTML +="<div style='float:left;width:48%;'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='radio' name='' id='' /> Code In the Cloud - Nov 11 &nbsp;&nbsp;&nbsp;&nbsp;<input type='radio' name='' id='' /> SOA In a Day - Nov 12</div>";
		presentation.innerHTML +="<div class='middle'><img border='0' alt='' class='horizontalLine' src='./img/line.jpg' width='400' /></div>";
		presentation.innerHTML +="<div style='clear:both;'></div>";


		presentation.innerHTML +="<div style='width:180px;margin: 5px 0px 0px 0px;text-align:left;float:left;font-size:10pt;border:0px solid;'><p>Choose the Track(s)</p></div>";
		presentation.innerHTML +="<div style='clear:both;'></div>";
		presentation.innerHTML +="<div style='float:left;width:33%;margin-left:20px'><p class='nopad_ma' style='margin-bottom:0px'><input type='checkbox' name='' id='' />&nbsp;Cloud Development</p><p class='nopad_mar' style='margin-bottom:0px'><input type='checkbox' name='' id='' />&nbsp;Cloud Workshops</p><p class='nopad_mar'><input type='checkbox' name='' id='' />&nbsp;Cloud Case Studies</p><p class='nopad_mar'><input type='checkbox' name='' id='' />&nbsp;Cloud Governance</p></div>";

		presentation.innerHTML +="<div style='float:left;width:61%;'><p class='nopad_mar'><input type='checkbox' name='' id='' />&nbsp;SOA Case Studies</p><p class='nopad_mar'><input type='checkbox' name='' id='' />&nbsp;SOA Integration</p><p class='nopad_mar'><input type='checkbox' name='' id='' />&nbsp;SOA Deployment & Management</p><p class='nopad_mar'><input type='checkbox' name='' id='' />&nbsp;BPM in Practice</p></div>";
		presentation.innerHTML +="<div style='clear:both;'></div>";
		presentation.innerHTML +="<div class='middle'><img border='0' alt='' class='horizontalLine' src='./img/line.jpg' width='400' /></div>";

		
		presentation.innerHTML +="<div style='clear:both;height:10px'></div>";

		presentation.innerHTML +="<div style='width:180px;margin: 5px 0px 0px 0px;text-align:left;float:left;font-size:10pt;border:0px solid;'><p>Enter the Title of Your Proposal:</p></div>";
		presentation.innerHTML +="<div><input type='text' name='proposalTitle"+i+"' id='proposalTitle"+i+"' size='32' value=''></div>";
		presentation.innerHTML +="<div class='clear'></div>";
		presentation.innerHTML +="<div style='width:180px;margin: 5px 0px 0px 0px;text-align:left;float:left;font-size:10pt;border:0px solid;display:none;'><p>Choose the Conference:</p></div>";
		presentation.innerHTML +="<div><select style='width:218px;height:70px;display:none;' size='4' multiple='multiple' name='conference"+i+"' id='conference"+i+"' /></select></div>";
		presentation.innerHTML +="<div><input type='hidden' name='hidconference"+i+"' id='hidconference"+i+"' value=''></div>";
		presentation.innerHTML +="<div style='clear:both;margin-top:10px'></div>";
		presentation.innerHTML +="<div class='conflist'><input type='hidden' name='hidconftrack"+i+"' id='hidconftrack"+i+"' value=''></div>";
		presentation.innerHTML +="<div style='clear:both;margin-top:10px'></div>";
		presentation.innerHTML +="<div style='width:180px;margin: 5px 0px 0px 0px;text-align:left;float:left;font-size:10pt;border:0px solid;'><p>Level of Difficulty:</p></div>";
		presentation.innerHTML +="<div class='difficultlist'><select style='width:218px' size='5' multiple='multiple' name='difficult"+i+"' id='difficult"+i+"' /></select></div>";
		presentation.innerHTML +="<div class='conflist'><input type='hidden' name='hiddifficult"+i+"' id='hiddifficult"+i+"' value=''></div>";
		presentation.innerHTML +="<div style='clear:both;margin-top:10px'></div>";
		presentation.innerHTML +="<div style='width:180px;margin: 5px 0px 0px 0px;text-align:left;float:left;font-size:10pt;border:0px solid;'><p>Enter the Short Abstract:</p></div>";

		presentation.innerHTML +="<div class='calabstract'><textarea type='text' name='abstract"+i+"' id='abstract"+i+"' cols='24' rows='3' ></textarea></div><br />";
		presentation.innerHTML +="<div class='clear'></div>";

		presentation.innerHTML +="<p style='margin: -5px 0px 0px 0px;_margin: -10px 0px 0px 0px;font-size:8pt;font-weight:none'>* Abstract only please. Do not include the title or presenters. Abstract must be a minimum of 1000 characters, but no longer than 2000 characters. You may copy and paste or type in your short abstract text.</p>";
		presentation.innerHTML +="</div>";
		presentation.innerHTML +="</div>";
		presentation.innerHTML +="</div>";
		presentation.innerHTML +="<div class='clear'></div>";

		presentation.innerHTML +="<div id='presentDescLayer'  style='background-color:#ffffff;width:350px;_height:auto;display:none;position: absolute;z-index:400;border:1px solid #4173A8;margin-left:175px;'></div>";
		typeMessage(i);
		typeHead(i);
		confTrack(i);
	}
	createPresentType();
	//conferenceList();
}

//-----This function is used to create presentation type layer
function createPresentType() {
	//alert("came");
	var createType;
	//params ="action=createpresentationtype";

	createType = "callforpaper.html?action=createpresentationtype";
	http = getHTTPObject(); // We create the HTTP Object
	http.open("GET", createType, true);
	http.onreadystatechange = function (){HttpResponse()};
	http.send(null);
}

function HttpResponse() {
	if (http.readyState == 4) {
		// only if "OK"
		if (http.status == 200) {
			response  = http.responseText;
			//alert("came");
			var sr=eval("("+http.responseText+")");

			//	result+="<div><select onchange='' name='proposaltype' id='proposaltype'/>";

			for(i = 0; i < sr['presentTypeArray'].length; i++) {
				//result ="<option value="+sr.presentTypeArray[i].key+" />"+sr.presentTypeArray[i].value+"</option>";
				key = sr.presentTypeArray[i].key;
				//key1 = sr.presentTypeArray[i].key1;
				value = sr.presentTypeArray[i].value;
				//value1 = sr.presentTypeArray[i].value1;

				//var present=present+i;

				if(document.getElementById("present1"))
					document.forms['pageform'].present1.options[i] = new Option(value ,key);
				if(document.getElementById("present2"))
					document.forms['pageform'].present2.options[i] = new Option(value ,key);
				if(document.getElementById("present3"))
					document.forms['pageform'].present3.options[i] = new Option(value ,key);
				if(document.getElementById("present4"))
					document.forms['pageform'].present4.options[i] = new Option(value ,key);
				if(document.getElementById("present5"))
					document.forms['pageform'].present5.options[i] = new Option(value ,key);
			}
			for(i = 0; i < sr['conferenceArray'].length; i++) {
				//result ="<option value="+sr.presentTypeArray[i].key+" />"+sr.presentTypeArray[i].value+"</option>";
				//key = sr.presentTypeArray[i].key;
				key = sr.conferenceArray[i].key;
				//value = sr.presentTypeArray[i].value;
				value = sr.conferenceArray[i].value;
				//alert(value1);

				if(document.getElementById("conference1"))
					document.forms['pageform'].conference1.options[i] = new Option(value ,key);
				if(document.getElementById("conference2"))
					document.forms['pageform'].conference2.options[i] = new Option(value ,key);
				if(document.getElementById("conference3"))
					document.forms['pageform'].conference3.options[i] = new Option(value ,key);
				if(document.getElementById("conference4"))
					document.forms['pageform'].conference4.options[i] = new Option(value ,key);
				if(document.getElementById("conference5"))
					document.forms['pageform'].conference5.options[i] = new Option(value ,key);
			}

			for(i = 0; i < sr['difficultyArray'].length; i++) {
				key   = sr.difficultyArray[i].key;
				value = sr.difficultyArray[i].value;

				if(document.getElementById("difficult1"))
					document.forms['pageform'].difficult1.options[i] = new Option(value, key);
				if(document.getElementById("difficult2"))
					document.forms['pageform'].difficult2.options[i] = new Option(value, key);
				if(document.getElementById("difficult3"))
					document.forms['pageform'].difficult3.options[i] = new Option(value, key);
				if(document.getElementById("difficult4"))
					document.forms['pageform'].difficult4.options[i] = new Option(value, key);
				if(document.getElementById("difficult5"))
					document.forms['pageform'].difficult5.options[i] = new Option(value, key);

			}
		}
	}
}

function confTrack(tr) {
	//alert(document.getElementById("conference"+tr).selectedIndex);
	selected = new Array();
	var obj = document.getElementById("conference"+tr);
	//alert(obj);
	for(var i=0;i<obj.options.length;i++) {
		if(obj.options[i].selected) {
			selected.push(obj.options[i].value);
		}
	}

	//alert(selected);
	var createType;
	//params ="action=createpresentationtype";

	createType = "callforpaper.html?action=getconferencetrack&key="+selected;
	http = getHTTPObject(); // We create the HTTP Object
	http.open("GET", createType, true);
	http.onreadystatechange = function (){HttpResponsetrack(tr)};
	http.send(null);
}

function HttpResponsetrack(tr) {
	//alert(tr);
	if (http.readyState == 4) {
		// only if "OK"
		if (http.status == 200) {
			response  = http.responseText;
			//alert("came");
			var sr=eval("("+http.responseText+")");
			//alert (sr);

			if(document.getElementById("conftrack"+tr))
				document.getElementById("conftrack"+tr).options.length=0;

			for(i = 0; i < sr['trackArray'].length; i++) {
				key = sr.trackArray[i].key;
				value = sr.trackArray[i].value;
				if(document.getElementById("conftrack"+tr))
					var name="conftrack"+tr;
				eval('document.pageform.'+name).options[i] = new Option(value ,key);

			}
		}
	}
}


//-------This function is used to display the layer using json method------
function viewDescLayer(e, present, divId) {
	preType = document.getElementById(present).options[document.getElementById(present).selectedIndex].text;

	typeIndex=document.getElementById(present).selectedIndex+2;
	//alert(typeIndex);
	var posx = 0;
	var posy = 0;
	if (!e) e = window.event;
	//alert(e);
	if (e.pageX || e.pageY) {
		//posx = e.pageX+10;
		posy = e.pageY-180;
		document.getElementById(divId).style.top = posy+187+"px";
		//posy = e.pageY-180;
		//document.getElementById(divId).style.top = 1310;
		document.getElementById(divId).style.left=260 ;
	}
	else if (e.clientX || e.clientY) { //IE
		posy = e.clientY + document.body.scrollTop;
		document.getElementById(divId).style.top = posy+10+"px";
		document.getElementById(divId).style.left= 55;
		//posx = e.clientX + document.body.scrollLeft;
		//posy = e.clientY + document.body.scrollTop;
		//document.getElementById(divId).style.top = 90+"px";
		//document.getElementById(divId).style.right= 40;
	}
	var createLayer;

	createLayer = "callforpaper.html?action=createpresentdesclayer&typeIndex="+typeIndex+"";
	http = getHTTPObject(); // We create the HTTP Object
	http.open("GET", createLayer, true);
	http.onreadystatechange = function (){HttpResponse1(divId,preType)};
	http.send(null);

}

function HttpResponse1(divId, preType) {
	if (http.readyState == 4) {
		// only if "OK"
		if (http.status == 200) {

			// http.responseText;
			var sr=eval("("+http.responseText+")");

			if((sr['presentDescArray'].length)>0) {
				document.getElementById(divId).style.display="";

				//for(i = 0; i < sr['presentDescArray'].length; i++) {
				key = sr.presentDescArray[0].key;
				decr = sr.presentDescArray[0].value;
				result="<div style='width:100%;font-size:11;border:1px solid #4173A8'";
				result="<div id='handle' width='100%' style=background:#4173A8;color:white;height:20px;_height:25px;cursor:move' ><p style='float:left;color:white;font-size:10pt;margin:0px 0px 0px 5px;font-weight:bold'>"+preType+"</p><a href='javascript:void(0);' onclick='closeLayerDiv(\"presentDescLayer\")'><b style='color:white;font-size:10pt;float:right;margin:0px 3px 0px 0px;cursor:pointer;'>Close[X]</b></a></div>";

				result+="<div style='display:block;background:#ffff;margin:10px 5px 10px 5px;text-align:left;font-size:10pt'>"+decr+"</div>";

				result+="</div>";
			}
			document.getElementById(divId).innerHTML = result;
			divDrag(divId);
		}
	}
}

//---------This function is used to display the message ie time duration for each presentation---------
function typeMessage(i) {
	//alert(i);
	proposalIndex=document.getElementById("present"+i).selectedIndex;
	if(proposalIndex=='-1')
		proposalIndex=0;

	var messageArray = new Array();

	messageArray[0]="The proposal type [Focused Session] you have selected is of 50 minute duration.";
	messageArray[1]="The proposal type [Power Panel] you have selected is of 60 minute duration.";
	messageArray[2]="The proposal type [Case Study] you have selected is of 45-minute duration.";
	messageArray[3]="The proposal type [Hands-on-Workshop] you have selected is of 150-minute (half-day) or 300-minute (full-day) duration.";

	document.getElementById("propos"+i).innerHTML = messageArray[proposalIndex];
}

//---------This function is used to display the title of presentation time duration for each presentation---------
function typeHead(i) {
	//alert(i);
	proIndex=document.getElementById("present"+i).selectedIndex;
	if(proIndex=='-1')
		proIndex=0;

	var headArray = new Array();

	//headArray[0]="Keynotes";
	headArray[0]="Focused Sessions";
	headArray[1]="Power Panels";
	headArray[2]="Case Studies";
	headArray[3]="In-depth Workshops";

	document.getElementById("head"+i).innerHTML = headArray[proIndex];
}

/**
* This fuction is used to save or update Speaker
*
* @access   public
* @param    null
*
* @return   null
*/
function saveSpeaker() {
	index=document.getElementById("proposalno").selectedIndex;
	for(i=1;i<=index+1;i++) {
		confselect = new Array();
		var obj = document.getElementById("conference"+i);
		if (obj==null)
			return;
		//alert(obj);
		for(var j=0;j<obj.options.length;j++) {
			if(obj.options[j].selected) {
				confselect.push(obj.options[j].value);
			}
		}
		//alert(confselect);
		document.getElementById("hidconference"+i).value=confselect;

		difficultselect = new Array();
		var obj = document.getElementById("difficult"+i);
		if (obj==null)
			return;
		//alert(obj);
		for(var j=0;j<obj.options.length;j++) {
			if(obj.options[j].selected) {
				difficultselect.push(obj.options[j].value);
			}
		}
		//alert(difficultselect);
		document.getElementById("hiddifficult"+i).value=difficultselect;
	}
	if(callforValidation()) {
		if(validateCaptcha()) {
			document.getElementById("action").value="SaveSpeaker";
			document.getElementById("pageform").submit();
		}
	}
}

/**
* This fuction is used to validate callfor details
*
* @access   public
* @param    null
*
* @return   true / false
*/
function callforValidation() {
	if(document.getElementById("firstname").value.match(/^ *$/)) {
		document.getElementById("firstNameMsg").style.display="";
		document.getElementById('firstNameMsg').innerHTML ="";
		document.getElementById('firstNameMsg').innerHTML +="*Please enter your first name.";
		//alert("Please enter your phone number.");
		document.getElementById("firstname").focus();
		return false;
	}
	else if(document.getElementById("lastname").value.match(/^ *$/))
	{
		document.getElementById("lastNameMsg").style.display="";
		document.getElementById('lastNameMsg').innerHTML ="";
		document.getElementById('lastNameMsg').innerHTML +="*Please enter your last name.";
		document.getElementById("lastname").focus();
		return false;
	}
	else if(document.getElementById("company").value.match(/^ *$/))
	{
		document.getElementById("companyMsg").style.display="";
		document.getElementById('companyMsg').innerHTML ="";
		document.getElementById('companyMsg').innerHTML +="*Please enter your company.";
		document.getElementById("company").focus();
		return false;
	}

	else if(document.getElementById("address1").value.match(/^ *$/))
	{
		document.getElementById("AddressMsg").style.display="";
		document.getElementById('AddressMsg').innerHTML ="";
		document.getElementById('AddressMsg').innerHTML +="*Please enter your current address.";
		document.getElementById("address1").focus();
		return false;
	}
	else if(document.getElementById("city").value.match(/^ *$/))
	{
		document.getElementById("cityMsg").style.display="";
		document.getElementById('cityMsg').innerHTML ="";
		document.getElementById('cityMsg').innerHTML +="*Please enter your city.";
		document.getElementById("city").focus();
		return false;
	}
	/*else if(document.getElementById("state").value.match(/^ *$/))
	{
		cityMsg.innerHTML ="";
		stateMsg.innerHTML ="";
		stateMsg.innerHTML +="*Please enter your state.";
		//alert("Please enter your state.");
		document.getElementById("state").focus();
		return;
	}*/
	else if(document.getElementById("state").value.match(/^ *$/))
	{
		document.getElementById("stateMsg").style.display="";
		document.getElementById('stateMsg').innerHTML ="";
		document.getElementById('stateMsg').innerHTML +="*Please enter your state.";
		document.getElementById("state").focus();
		return false;
	}
	else if(document.getElementById("pincode").value.match(/^ *$/))
	{
		document.getElementById("zipMsg").style.display="";
		document.getElementById('zipMsg').innerHTML ="";
		document.getElementById('zipMsg').innerHTML +="*Please enter a valid zip/postal code.";
		document.getElementById("pincode").focus();
		return false;
	}
	else if(document.getElementById("country").value=='new')
	{
		document.getElementById("countryMsg").style.display="";
		document.getElementById('countryMsg').innerHTML ="";
		document.getElementById('countryMsg').innerHTML +="*Please select your country.";
		document.getElementById("country").focus();
		return false;
	}
	else if((document.getElementById("phone").value==null)||(document.getElementById("phone").value==""))
	{
		document.getElementById("phoneMsg").style.display="";
		document.getElementById('phoneMsg').innerHTML ="";
		document.getElementById('phoneMsg').innerHTML +="*Please enter your phone number.";
		document.getElementById("phone").focus();
		return false;
	}
	else if((document.getElementById("handphone").value==null)||(document.getElementById("handphone").value==""))
	{
		document.getElementById("handPhoneMsg").style.display="";
		document.getElementById('handPhoneMsg').innerHTML ="";
		document.getElementById('handPhoneMsg').innerHTML +="*Please enter your hand phone number.";
		document.getElementById("handphone").focus();
		return false;
	}
	else if(checkEmail(document.getElementById("email").value)!=true)
	{
		document.getElementById("emailMsg").style.display="";
		document.getElementById('emailMsg').innerHTML ="";
		document.getElementById('emailMsg').innerHTML +="*Invalid E-mail Address! Please Enter valid E-mail Address.";
		document.getElementById("email").focus();
		return false;
	}
	else if(document.getElementById("biography").value.match(/^ *$/))
	{
		document.getElementById("bioMsg").style.display="";
		document.getElementById('bioMsg').innerHTML ="";
		document.getElementById('bioMsg').innerHTML +="*Please enter your biography.";
		document.getElementById("biography").focus();
		return false;
	}
	else if(document.getElementById("agree").checked==false)
	{
		document.getElementById("callAgreeMsg").style.display="";
		document.getElementById('callAgreeMsg').innerHTML ="";
		document.getElementById('callAgreeMsg').innerHTML +="*Agree the above guidelines and the selection, notification, and responsibilities.";
		document.getElementById("agree").focus();
		return false;
	}
	return true;
}

/**
* This fuction is used to save Registration details
*
* @access   public
* @param    null
*
* @return   null
*/
function saveRegister() {
	if(validationRegister()) {
		if(validateCaptcha()) {
			if(document.getElementById("agree").checked==false) {
				document.getElementById("agreeMsg").innerHTML ="";
				document.getElementById("agreeMsg").innerHTML +="*Agree the Terms and Conditions.";
				//alert("Agree the Terms and Conditions.");
				document.getElementById("agree").focus();
				return;
			}

			//alert("came");
			document.getElementById("action").value="SaveRegister";
			document.getElementById("pageform").submit();
			//window.location=" 2009/CIO_reg.html?insertexpo=ciosuccess#ciomsg"
		}
	}
}

/**
* This fuction is used to validate sponsor
* @access   public
* @param    null
*
* @return   true / false
*/
function validationRegister() {
	if(document.getElementById("dayPass1").checked==false && document.getElementById("dayPass2").checked==false && document.getElementById("dayPass3").checked==false)// && document.getElementById("dayPass4").checked==false)
	{
		document.getElementById("passMsg").style.display="";
		document.getElementById("passMsg").innerHTML ="";
		document.getElementById("passMsg").innerHTML +="*Please choose your pass.";
		//alert("Please enter your phone number.");
		window.location.hash='passMsg';
		return false;
	}
	else if(document.getElementById("firstname").value.match(/^ *$/))
	{
		document.getElementById("firstNameMsg").style.display="";
		document.getElementById("firstNameMsg").innerHTML ="";
		document.getElementById("firstNameMsg").innerHTML +="*Please enter your first name.";
		//alert("Please enter your phone number.");
		document.getElementById("firstname").focus();
		return false;
	}
	else if(document.getElementById("lastname").value.match(/^ *$/))
	{
		document.getElementById("lastNameMsg").style.display="";
		document.getElementById("lastNameMsg").innerHTML ="";
		document.getElementById("lastNameMsg").innerHTML +="*Please enter your last name.";
		//alert("Please enter your phone number.");
		document.getElementById("lastname").focus();
		return false;
	}
	else if(document.getElementById("designation").value.match(/^ *$/))
	{
		document.getElementById("desigMsg").style.display="";
		document.getElementById("desigMsg").innerHTML ="";
		document.getElementById("desigMsg").innerHTML +="*Please enter your designation.";
		document.getElementById("designation").focus();
		return false;
	}
	else if(document.getElementById("company").value.match(/^ *$/))
	{
		document.getElementById("companyMsg").style.display="";
		document.getElementById("company").focus();
		return;
	}
	else if(document.getElementById("conference1").checked==false && document.getElementById("conference2").checked==false && document.getElementById("conference3").checked==false && document.getElementById("conference4").checked==false && document.getElementById("conference5").checked==false && document.getElementById("conference6").checked==false)
	{
		alert('Please select two primary topics.');
		document.getElementById("conference1").focus();
		return false;
	}
	else if (NewCount < 2 || NewCount > 2)
	{
		alert('Please select two primary topics.');
		document.getElementById("conference1").focus();
		return false;
	}
	else if(document.getElementById("address1").value.match(/^ *$/))
	{
		document.getElementById("AddressMsg").style.display="";
		document.getElementById("address1").focus();
		return;
	}
	else if(document.getElementById("city").value.match(/^ *$/))
	{
		document.getElementById("cityMsg").style.display="";
		document.getElementById("city").focus();
		return;
	}
	else if(document.getElementById("country").value=='new')
	{
		document.getElementById("countryMsg").style.display="";
		document.getElementById("country").focus();
		return;
	}
	else if((document.getElementById("phone2").value==null)||(document.getElementById("phone2").value==""))
	{
		document.getElementById("phoneMsg").style.display="";
		document.getElementById("phoneMsg").innerHTML ="";
		document.getElementById("phoneMsg").innerHTML +="*Please enter your area code.";
		//alert("Please enter your phone number.");
		document.getElementById("phone2").focus();
		return false;
	}
	else if ((document.getElementById("phone2").value)==false){

		document.getElementById("phoneMsg").style.display="";
		document.getElementById("phoneMsg").innerHTML ="";
		document.getElementById("phoneMsg").innerHTML +="*Please enter a valid area code";
		//alert("Please enter a valid phone number")
		document.getElementById("phone2").value=""
		document.getElementById("phone2").focus()
		return false;
	}
	else if((document.getElementById("phone3").value==null)||(document.getElementById("phone3").value==""))
	{
		document.getElementById("phoneMsg").style.display="";
		document.getElementById("phoneMsg").innerHTML ="";
		document.getElementById("phoneMsg").innerHTML +="*Please enter your phone number.";
		//alert("Please enter your phone number.");
		document.getElementById("phone3").focus();
		return false;
	}
	else if (document.getElementById("phone3").value==false){

		document.getElementById("phoneMsg").style.display="";
		document.getElementById("phoneMsg").innerHTML ="";
		document.getElementById("phoneMsg").innerHTML +="*Please enter a valid phone number";
		//alert("Please enter a valid phone number")
		document.getElementById("phone3").value=""
		document.getElementById("phone3").focus()
		return false;
	}
	/*else if (document.getElementById("fax2").value==false){

		document.getElementById("faxMsg").style.display="";
		document.getElementById("faxMsg").innerHTML ="";
		document.getElementById("faxMsg").innerHTML +="*Please enter a valid area code";
		//alert("Please enter a valid phone number")
		document.getElementById("fax2").value=""
		document.getElementById("fax2").focus()
		return false;
	}*/
	if(document.getElementById("fax2").value!="")
	{
		if (document.getElementById("fax3").value==false){
			document.getElementById("faxMsg").style.display="";
			document.getElementById("faxMsg").innerHTML ="";
			document.getElementById("faxMsg").innerHTML +="*Please enter a valid fax number";
			//alert("Please enter a valid phone number")
			document.getElementById("fax3").value=""
			document.getElementById("fax3").focus()
			return false;
		}
	}
	if(checkEmail(document.getElementById("email").value)!=true)
	{
		document.getElementById("emailMsg").style.display="";
		document.getElementById("emailMsg").innerHTML ="";
		document.getElementById("emailMsg").innerHTML +="*Invalid E-mail Address! Please Enter valid E-mail Address.";
		document.getElementById("email").value=""
		document.getElementById("email").focus();

		return;
	}
	if(document.getElementById("bulkBooking").checked)
	{
		if (document.getElementById("coordinatorName").value.match(/^ *$/)){

			document.getElementById("crdNameMsg").style.display="";
			document.getElementById("crdNameMsg").innerHTML ="";
			document.getElementById("crdNameMsg").innerHTML +="*Please enter the coordinators name";
			//alert("Please enter a valid phone number")
			document.getElementById("coordinatorName").value="";
			document.getElementById("coordinatorName").focus();
			return false;
		}
		else if (checkEmail(document.getElementById("coordinatorEmail").value)!=true){
			document.getElementById("crdEmailMsg").style.display="";
			document.getElementById("crdEmailMsg").innerHTML ="";
			document.getElementById("crdEmailMsg").innerHTML +="*Invalid E-mail Address! Please Enter valid E-mail Address.";
			//alert("Please enter a valid phone number")
			document.getElementById("coordinatorEmail").value="";
			document.getElementById("coordinatorEmail").focus();
			return false;
		}
	}
	return true;
}

function showCordinator() {
	if(document.getElementById("bulkBooking").checked) {
		document.getElementById("cordinatorDiv").style.display='';
		//document.getElementById("paymentCalculationDiv").style.display='none';
	}
	else {
		document.getElementById("cordinatorDiv").style.display='none';
		document.getElementById("paymentCalculationDiv").style.display='';
	}
}

function showCoordinatorMsg() {
	document.getElementById("coordinatorMessage").innerHTML="<div  style='margin:5px 0px 0px 5px'><b>  Your manager/training coordinator with whom we can liase with for your registration payment.</b></div>";
	document.getElementById("coordinatorMessage").style.display='';
	//divDrag("coordinatorMessage");
}

function calculateAmount() {
	$("div#displayAmount").text('');
	//document.getElementById('displayAmount').innerHTML='';
	var str = "<div style='font-size:11px;color:#4F4F4F;margin:0px;padding:0px'>Total = ( INR <input type='text' name='netAmt' id='netAmt' style='border:none;width:35px' readonly> ) + 10.3% Service Tax + 5% Offline Payment Charge =&nbsp;INR&nbsp;<input type='text' name='totalAmt' id='totalAmt' style='border:none;color:#3B7AAD;font-weight:bold' readonly></div>";
	$("div#displayAmount").html(str);
	regCode = $("#regCode").val();

	var totalAmount=0;
	var totalAmount1=0;
	var myDate = new Date;
	myDate.setDate(19);
	myDate.setMonth(7); // January = 0
	myDate.setFullYear(2010);
	var myDate1 = new Date;
	myDate1.setDate(13);
	myDate1.setMonth(8); // January = 0
	myDate1.setFullYear(2010);
	var today = new Date;
	if (today < myDate) {
		if ( $("#dayPass1").attr('checked') )
			totalAmount1 = totalAmount1+999;
		if ( $("#dayPass2").attr('checked') )
			totalAmount1 = totalAmount1+999;
		if ( $("#dayPass3").attr('checked') )
			totalAmount1 = totalAmount1+1499;
		totalAmount = parseInt(totalAmount1)+(totalAmount1*0.1530);
		totalAmount = Math.round(totalAmount);
	}
	else if (today >= myDate && today < myDate1) {
		if ( $("#dayPass1").attr('checked') )
			totalAmount1 = totalAmount1+1499;
		if ( $("#dayPass2").attr('checked') )
			totalAmount1 = totalAmount1+1499;
		if ( $("#dayPass3").attr('checked') )
			totalAmount1 = totalAmount1+2499;
		totalAmount = parseInt(totalAmount1)+(totalAmount1*0.1530);
		totalAmount = Math.round(totalAmount);
	}
	else{
		if ( $("#dayPass1").attr('checked') )
			totalAmount1 = totalAmount1+2999;
		if ( $("#dayPass2").attr('checked') )
			totalAmount1 = totalAmount1+2999;
		if ( $("#dayPass3").attr('checked') )
			totalAmount1 = totalAmount1+3999;
		totalAmount = parseInt(totalAmount1)+(totalAmount1*0.1530);
		totalAmount = Math.round(totalAmount);
	}
/*	{
		if ( $("#dayPass1").attr('checked') )
			totalAmount1 = totalAmount1+2999;
		if ( $("#dayPass2").attr('checked') )
			totalAmount1 = totalAmount1+2999;
		if ( $("#dayPass3").attr('checked') ) {
			var myDate1 = new Date;
			var myDate2  = new Date;
			myDate1.setDate(5);
			myDate1.setMonth(8); // January = 0
			myDate1.setFullYear(2009);

			myDate2.setDate(2);
			myDate2.setMonth(10); // January = 0
			myDate2.setFullYear(2009);
			myDate2.setHours(20,00,00);


			if(regCode=='BTS091D2FSMM' || regCode=='BTS091D2FKS' || regCode=='BTS091D2FCPM' || regCode=='BTS091D2FNO1' || regCode=='BTS091D2FNO2' || regCode=='BTS091D2FNO3')
			{
				if(today < myDate1)
					totalAmount1=totalAmount1+2999;
				else
					totalAmount1=totalAmount1+3999;
			}
			else if(today<myDate2)
			{
                   if(regCode=='SMBT361109DST')  totalAmount1=999;
                   if(regCode=='SMBT341109RBDS') totalAmount1=499;
			}
			else
				totalAmount1=totalAmount1+3999;

		}
		totalAmount = parseInt(totalAmount1)+(totalAmount1*0.1030);
		totalAmount = Math.round(totalAmount);
	}*/

	$("#netAmt").val(totalAmount1);
	$("#totalAmt").val(totalAmount);
}

/**
* This fuction is used to save or update Sponsor
*
* @access   public
* @param    null
*
* @return   null
*/
function saveSponsor() {
	if(sponsorValidation()) {
		if(validateCaptcha()) {
			document.getElementById("action").value="SaveSponsor";
			document.getElementById("pageform").submit();
		}
	}
}

/**
* This fuction is used to validate sponsor
* @access   public
* @param    null
*
* @return   true / false
*/
function sponsorValidation() {
	if(document.getElementById("firstname").value.match(/^ *$/))
	{
		alert("Please enter first name");
		document.getElementById("firstname").focus();
		return;
	}
	else if(document.getElementById("lastname").value.match(/^ *$/))
	{
		alert("Please enter last name.");
		document.getElementById("lastname").focus();
		return;
	}
	else if(document.getElementById("company").value.match(/^ *$/))
	{
		alert("Please enter your company.");
		document.getElementById("company").focus();
		return;
	}
	else if(checkEmail(document.getElementById("email").value)!=true)
	{
		//alert("Please Enter valid Email.!!!!");
		document.getElementById("email").focus();
		return;
	}
	else if(document.getElementById("city").value.match(/^ *$/))
	{
		alert("Please enter your city.");
		document.getElementById("city").focus();
		return;
	}
	else if(document.getElementById("state").value.match(/^ *$/))
	{
		alert("Please enter your state.");
		document.getElementById("state").focus();
		return;
	}
	else if(document.getElementById("pincode").value.match(/^ *$/))
	{
		alert("Please enter your zip/postal code.");
		document.getElementById("pincode").focus();
		return;
	}
	else if(document.getElementById("country").value=='new')
	{
		alert("Please select your country.");
		document.getElementById("country").focus();
		return;
	}
	else if(document.getElementById("phone").value.match(/^ *$/))
		{
		alert("Please enter your phone number.");
		document.getElementById("phone").focus();
		return;
	}
	else if(document.getElementById("handphone").value.match(/^ *$/))
		{
		alert("Please enter your hand phone number.");
		document.getElementById("handphone").focus();
		return;
	}
	else if(document.getElementById("investment").value.match(/^ *$/))
		{
		alert("Please enter your approximate investment.");
		document.getElementById("investment").focus();
		return;
	}
	return true;
}


/***********SESSION**********/
	
	function sessionover(){
	document.getElementById("newtable").style="sessionout";
	}
	function sessionout(){
	document.getElementById("newtable").style="sessionover";
	}
