function getElementsByBaseTagClass(base, tag, className) { 
    var classPat = new RegExp('\\b'+className+'\\b'); 
    var nodes = base.getElementsByTagName(tag); 
    var matching = []; 
    for (var i = 0; i < nodes.length; i++) { 
        if (classPat.test(nodes[i].className)) { 
            matching.push(nodes[i]); 
        } 
    } 
	return matching; 
}
//-------------------------------------------------------------------------------------
// Form action
//-------------------------------------------------------------------------------------
function SubmitForm (frm, act) {
	if (frm) {
		frm.act.value = act;
		frm.submit();
	}
}
function SubmitCmm (frmName, cmm, param) {
	var frm = eval("document."+frmName);
	if (cmm=="delBkItem"){
		if (!confirm("Would you like to remove this booking item from your travel basket?")) return;
	}
	frm.cmm.value = cmm;
	if (param && frm.param) frm.param.value = param;
	frm.submit();
}

///----------------------------------------------------------------------------------
/// Function	: AddComboOption
/// Description	: Add a new combo option into combo box
/// Input		: combo-box elm, text and value of new option
/// Output		: N/A
///----------------------------------------------------------------------------------
function AddComboOption()
{	
	var newitem = document.createElement("OPTION");
	newitem.text  = arguments[1];
	newitem.value = arguments[2];
	if (arguments.length==4 && arguments[3])
		newitem.selected=true;
	e = arguments[0];
	if (Browser.is_ie) e.add(newitem);
	else e.add(newitem,null);
}
//-------------------------------------------------------------------------------------
// Photo Gallery Functions
//-------------------------------------------------------------------------------------
function dropImg (id, curfaq) {
	for (i=0; i<curfaq.length; i++){
		if (i != id) curfaq[i].style.display = "none";
	}
	curfaq[id].style.display="block";
}

function highlight (id, curlink) {
	for (i=0; i < curlink.length; i++) {
		if (i!=id) curlink[i].className ="normalmg";
	}
	curlink[id].className ="activeImg";
}
//-------------------------------------------------------------------------------------


//-------------------------------------------------------------------------------------
// Extent Content In Paragraph
//-------------------------------------------------------------------------------------
function ReadMore(id) {
	var next_para = document.getElementById(id+'_next');
	next_para.style.display = "inline";
	var next_a = document.getElementById(id+'_a');
	next_a.style.display = "none";
}

function ShowContent(idContent) {
	var elmContent = document.getElementById(idContent);
	var elmLink = document.getElementById("lnk_"+idContent);
	if ( document.getElementById("img_"+idContent) != null )
		var elmImg  = document.getElementById("img_"+idContent);	
	
	if (elmContent.style.display == "none")
	{	
		elmContent.style.display = "block";	
		if ( document.getElementById("img_"+idContent) != null )
			elmImg.src = "/_en/images/icon_h3_show.gif";
		if (elmLink) elmLink.className = "linkArr";
	} else {
		elmContent.style.display = "none";	
		if ( document.getElementById("img_"+idContent) != null )
			elmImg.src = "/_en/images/icon_h3_hide.gif";	
		if (elmLink) elmLink.className = "activeArr";					
	}	
}
function LoadImages(arrId,arrImg,elmPrefix){
	for (var i=0; i<arrId.length; i++){
		var img = document.images[elmPrefix+arrId[i]];
		if (img){
			if (arrImg[i] && arrImg[i]!='') img.src = sxPrefix+arrImg[i];
			else img.src = "/_en/images/no_photo.gif";
		}
	}
}

function IsEmail(s){
	if (s.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]{2,6}$/) != -1)
		return true ;
	return false ;
}
