/* this code is for animating the resize of the flex app container */
var obj;	// define obj vars
var obj1;	
var obj2;
var obj3;
function tixToggle(onOff) {

	switch (onOff*1){
		case 0 :
			if(typeof(obj1) != 'object') {
				obj1 = $("e_topCat");	
				obj2 = $("e_footer");
				if($("e_textBlock1")) obj3 = $("e_textBlock1");
			}
		break;

		case 1 :
			obj = $("e_leftPanel"); // remove topCategories and footer from the left column.
				obj.removeChild(obj1);
				obj.removeChild(obj2);
			if($("e_textBlock1")) {
				obj = $("e_rightPanel"); // remove the text blocks
					obj.removeChild(obj3);
			}

			obj = $("c_eventResults"); // resize results flex
				obj.style.paddingLeft = "4px";
				obj.style.paddingTop = "0px";
				obj.style.width = "977px";
				obj.style.height = "610px";

			if($("e_textBlock2")) {
				obj = $("e_textBlock2"); // remove the text blocks
				obj.style.width = "975px";
			}
		break;

		case 2 :
			obj = $("e_leftPanel"); // add topCategories and footer to the left column.
				obj.appendChild(obj1);
				obj.appendChild(obj2);
		
			obj = $("c_eventResults"); // resize flex results 
				obj.style.paddingLeft = "6px";
				obj.style.width = "746px";
				obj.style.height = "500px";

			objP = $("e_rightPanel"); 			// create Parent obj
			objC = $("c_eventResults"); 		// create Child obj to insert before
				objP.insertBefore(obj3,objC);	// insert obj3 before objC

			if($("e_textBlock2")) {
				obj = $("e_textBlock2"); // remove the text blocks
				obj.style.width = "730px";
			}
		break;

		default:
			// do nothing
		break;
	}
		
}

// function for popping venue image.
function popVenueWindow(vLink,fWidth,fHeight) {
	//alert(vLink + "\n\n" + fWidth + "\n\n" + fHeight);
	window.open("http://www.cheappremiumtickets.com/includes/include_venueImage.cfm?vSrc=" + vLink.split("=")[1],"venueImage","menubar=0,toolbar=0,location=0,status=0,scrollbars=0,resizable=0,width=" + fWidth + ",height=" + fHeight)
}



// This function will get the event listings.
function getEvents(qString,kwds) {
	
	// Create a new xml object
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {alert ("Browser does not support HTTP Request");return;} 
	
	var url="/includes/ajax_getEvents.cfm";

	url += "?sid="+Math.random();
	url += "&kwds=" + kwds;
	url += "&" + qString;
	
	xmlHttp.onreadystatechange=getEventsDone;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
		
	return false;
}
// Once getFlightTypes XML call has been complete populate the pull down.
function getEventsDone() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		
		$("c_eventResults").innerHTML=xmlHttp.responseText;
/*		
 	 	$("ftTD").innerHTML = xmlHttp.responseText;
		
		if($("fttTD")) {
			$("fttTD").innerHTML = '<select size="6" style="width:300px;font-weight:bold;height:90px;"><option value="0"></option><option value="0"></option><option value="0">&nbsp;&#171;&nbsp;Choose Flight Time First.</option></select>';
		}
		
		// Disable the quantity field and set to blank value.
		if (document.sellVoucher.Quantity) {
			document.sellVoucher.Quantity.value 	= 0;
			document.sellVoucher.Quantity.disabled 	= true;
			// Reset the price per seat value;
			document.sellVoucher.PricePer.value 	= "0.00";
		}
		
		resetPromo(document.sellVoucher);*/
	} 
}

