function get_id_num(a,b) {
	k_a = a.length;
	k_b = b.length;
	m = a.substr((k_b),(k_a-1));
	return m;
}

function move_to(a) {
	document.location.href=a;
}

function preload_images()
{
	var a = preload_images.arguments;
	var j = a.length;
	var img_new = new Array;
	for(i=0;i<j;i++)
	{
		img_new[i] = new Image;
		img_new[i].src = a[i];
	}
}

function op_win_centre(addr,w,h)
{
	var sc_h = screen.availHeight;
	var sc_w = screen.availWidth;

	sc_h = parseInt((sc_h - h)/2);
	sc_w = parseInt((sc_w - w)/2);

	if ((navigator.userAgent.indexOf('Opera') != -1)&&(navigator.userAgent.indexOf('MSIE') != -1))
	{
		sc_h = sc_h - ((screen.availHeight - document.body.clientHeight) - 29);
	}

	var margins="left="+sc_w+",top="+sc_h;

	window.open(addr,"","toolbars=0,scrollbars=0,directories=0,resizable=1,status=0,width=" + w + ",height=" + h + "," + margins);
}

function label_imit(a)
{
	b = document.getElementById(a);
	if(b.checked == true)
	{
		b.checked = false;
	}
	else
	{
		b.checked = true;
	}
}

function insertFlash(width,height,path,bgcolor,align,id)
{
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'" align="middle">');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<param name="movie" value="'+path+'" />');
    document.write('<param name="quality" value="high" />');
	if(bgcolor)
	{
		document.write('<param name="bgcolor" value="'+bgcolor+'" />');
	}
	else
	{
		document.write('<param name="wmode" value="transparent" />');
	}
    document.write('<embed src="'+path+'" quality="high" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" ');
	if(bgcolor)
	{
		document.write('bgcolor="' + bgcolor + '"');
	}
	else
	{
		document.write('wmode="transparent"');
	}
    document.write('/></object>');
}

function clean_input(name,text,class_name)
{
	if(document.getElementById(name).value == text)
	{
		document.getElementById(name).value = "";
		document.getElementById(name).className = class_name;
	}
}

function check_input_text(name,text,class_name)
{
	if(document.getElementById(name).value == "")
	{
		document.getElementById(name).value = text;
		document.getElementById(name).className = class_name;
	}
}


function write_png(img_name,w,h)
{
	/* IE */
	if ((navigator.userAgent.indexOf('Opera') == -1)&&(navigator.userAgent.indexOf('MSIE') != -1)&&(navigator.userAgent.indexOf('MSIE 5.0') == -1))
		{
		document.write ('<DIV STYLE="height:' + h + 'px; width:' + w + 'px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=' + img_name + '.png);"></DIV>');
		}
	else
	{
		if ((navigator.userAgent.indexOf('MSIE 5.0') != -1))
		{
			document.write ('<div><img src="' + img_name + '.gif" alt="" width="' + w + '" height="' + h + '" border="0"></div>');
		}
		else
		{
			document.write ('<img src="' + img_name + '.png" alt="" width="' + w + '" height="' + h + '" border="0">');
		}
	}
}


function set_main_size()
{
	if(window.resizeTo)
	{
		if(navigator.userAgent.indexOf('Gecko')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
		{
			self.resizeTo(1030,800);
		}
		else if	(navigator.userAgent.indexOf('MSIE')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
		{
			self.resizeTo(1035,800);
		}
	}

	if(navigator.userAgent.indexOf('Gecko')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
	{
		if(document.getElementById('left-col').offsetHeight<640)
		{
			document.getElementById('bottom_nav').style.left = '-10px';
		}
		else
		{
			document.getElementById('bottom_nav').style.left = '0px';
		}
	}
	else if	(navigator.userAgent.indexOf('MSIE')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
	{
		if(document.getElementById('left-col').offsetHeight<640)
		{
			document.getElementById('bottom_nav').style.marginRight = '18px';
		}
		else
		{
			document.getElementById('bottom_nav').style.marginRight = '0px';
		}
	}
}


function set_size()
{
	if(window.resizeTo)
	{
		if(navigator.userAgent.indexOf('Gecko')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
		{
			self.resizeTo(1054,800);
		}
		else if	(navigator.userAgent.indexOf('MSIE')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
		{
			self.resizeTo(1060,800);
		}
	}

	if(navigator.userAgent.indexOf('Gecko')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
	{
		if(document.getElementById('left-col').offsetHeight<565)
		{
			document.getElementById('bottom_nav').style.left = '-10px';
		}
		else
		{
			document.getElementById('bottom_nav').style.left = '0px';
		}
	}
	else if	(navigator.userAgent.indexOf('MSIE')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
	{
		if(document.getElementById('left-col').offsetHeight<565)
		{
			document.getElementById('bottom_nav').style.marginRight = '18px';
		}
		else
		{
			document.getElementById('bottom_nav').style.marginRight = '0px';
		}
	}
}



function set_elems_size() // function for other pages
{
	if(navigator.userAgent.indexOf('Gecko')!=-1)
	{
		win_height = window.innerHeight;
	}
	else
	{
		if(self != self.parent)
		{
//			win_height = document.body.offsetHeight - 173;
			win_height = document.body.offsetHeight;
		}
		else
		{
			win_height = document.body.offsetHeight;
		}
	}

//alert(win_height);
//window.status = win_height;

	bod = document.getElementById('big_outer_div_id');
	trt = document.getElementById('top_row_td');
	ocd = document.getElementById('other_centre_div_id');
	ocid = document.getElementById('other_inner_centre_div_id');
	cd = document.getElementById('content_div_id');


	win_height = (win_height<653 ? win_height : 653)

//	if(win_height<658)
//	{
		if	(navigator.userAgent.indexOf('MSIE')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
		{
			if	(navigator.userAgent.indexOf('MSIE 5')!=-1)
			{
				bod.style.height = win_height - 29;
				trt.style.height = win_height - 90;
				ocd.style.height = win_height - 90;
				ocid.style.height = win_height - 90;
				cd.style.height = win_height - 90;
			}
			else
			{
				bod.style.height = win_height - 29;
				trt.style.height = win_height - 90;
				ocd.style.height = win_height - 90;
				ocid.style.height = win_height - 90;
				cd.style.height = win_height - 90;
			}
		}
		else if(navigator.userAgent.indexOf('Opera')!=-1)
		{
				bod.style.height = 561;
				trt.style.height = 509;
				ocd.style.height = 499;
				ocid.style.height = 499;
				cd.style.height = 499;
		}
		else// if(navigator.userAgent.indexOf('Opera')==-1)
		{
//				win_height = (win_height<654 ? win_height : 654)

				bod.style.height = win_height - 31;
				trt.style.height = win_height - 82;
				ocd.style.height = win_height - 92;
				ocid.style.height = win_height - 92;
				cd.style.height = win_height - 92;
		}
//	}

  var tripticketFrame = document.getElementById("tripticket-frame");
	if (tripticketFrame) {
    tripticketFrame.style.height = cd.style.height;
  }
}



function bottom_set_elems_size() // function for bottom nav panel pages
{
	if(navigator.userAgent.indexOf('Gecko')!=-1)
	{
		win_height = window.innerHeight;
	}
	else
	{
		if(self != self.parent)
		{
//			win_height = document.body.offsetHeight - 173;
			win_height = document.body.offsetHeight;
		}
		else
		{
			win_height = document.body.offsetHeight;
		}
	}
//	window.status = win_height;

	bod = document.getElementById('big_outer_div_id');
	trt = document.getElementById('top_row_td');
	ocd = document.getElementById('other_centre_div_id');
	ocid = document.getElementById('other_inner_centre_div_id');
	cd = document.getElementById('content_div_id');


	win_height = (win_height<638 ? win_height : 638)

//	if(win_height<658)
//	{
		if	(navigator.userAgent.indexOf('MSIE')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
		{
			if	(navigator.userAgent.indexOf('MSIE 5')!=-1)
			{
				bod.style.height = win_height - 29;
				trt.style.height = win_height - 67;
				ocd.style.height = win_height - 67;
				ocid.style.height = win_height - 67;
				cd.style.height = win_height - 67;
			}
			else
			{
				bod.style.height = win_height - 29;
				trt.style.height = win_height - 67;
				ocd.style.height = win_height - 67;
				ocid.style.height = win_height - 67;
				cd.style.height = win_height - 67;
			}
		}
		else if(navigator.userAgent.indexOf('Opera')!=-1)
		{
				bod.style.height = 561;
				trt.style.height = 509;
				ocd.style.height = 499;
				ocid.style.height = 499;
				cd.style.height = 499;
		}
		else// if(navigator.userAgent.indexOf('Opera')==-1)
		{
//				win_height = (win_height<639 ? win_height : 639)

				bod.style.height = win_height - 30;
				trt.style.height = win_height - 68;
				ocd.style.height = win_height - 68;
				ocid.style.height = win_height - 68;
				cd.style.height = win_height - 68;
		}
//	}
}



function main_set_elems_size() // function for main page
{
	if(navigator.userAgent.indexOf('Gecko')!=-1)
	{
		win_height = window.innerHeight;
	}
	else
	{
		if(self != self.parent)
		{
//			win_height = document.body.offsetHeight - 173;
			win_height = document.body.offsetHeight;
		}
		else
		{
			win_height = document.body.offsetHeight;
		}
	}

	trt = document.getElementById('main_top_row_td');
	cd = document.getElementById('content');

	fid = document.getElementById('footer_inner_div');

// central part height fixing
//	if(win_height<605)
//	{


		win_height2 = (win_height<620 ? win_height : 620);


		if	(navigator.userAgent.indexOf('MSIE')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
		{
			if	(navigator.userAgent.indexOf('MSIE 5')!=-1)
			{
				trt.style.height = win_height2 - 29;
				cd.style.height = win_height2 - 29;
			}
			else
			{
				trt.style.height = win_height2 - 29;
				cd.style.height = win_height2 - 29;
			}
		}
		else if(navigator.userAgent.indexOf('Opera')!=-1)
		{
/*				trt.style.height = 600;
				cd.style.height = 590;*/
		}
		else// if(navigator.userAgent.indexOf('Opera')==-1)
		{
				trt.style.height = win_height2 - 30;
				cd.style.height = win_height2 - 30;
		}
//	}

/*
// bottom panel alignment
	if(navigator.userAgent.indexOf('Gecko')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
	{
		if(trt.offsetHeight<640)
		{
			document.getElementById('footer').style.paddingRight = '20px';
		}
		else
		{
			document.getElementById('footer').style.paddingRight = '0px';
		}
	}
	else if	(navigator.userAgent.indexOf('MSIE')!=-1&&navigator.userAgent.indexOf('Opera')==-1)
	{
		if(trt.offsetHeight<640)
		{
			fid.style.marginRight = '18px';
		}
		else
		{
			fid.style.marginRight = '0px';
		}
	}
*/
}


/* functions for window resize */

function main_set_width()
{
	if(navigator.userAgent.indexOf('Gecko')!=-1)
	{
		window.resizeTo(1030,768);
	}
	else
	{
		if(self != self.parent)
		{
			window.resizeTo(1020,768);
		}
		else
		{
			window.resizeTo(1030,768);
		}
	}
}

function other_set_width()
{
	if(navigator.userAgent.indexOf('Gecko')!=-1)
	{
		window.resizeTo(1034,768);
	}
	else
	{
		if(self != self.parent)
		{
			window.resizeTo(1024,768);
		}
		else
		{
			window.resizeTo(1034,768);
		}
	}
}
