function betterhandler(description,pagename,lineno)
{
 /*document.write('An Error occurred! \n'
  +'\n Description: \t'+description
  +'\n Page Name:      \t'+pagename
  +'\n At Line :       \t'+lineno);*/
 alert(
  'An Error occurred! \n'
  +'\n Description: \t'+description
  +'\n Page Name:      \t'+pagename
  +'\n At Line :       \t'+lineno
 )
 return true
}
window.onerror=betterhandler;
function addRowToTable(tblID,tblSource,n_Cell,n_Row,valThis,valEvent)
{
	//alert('n_Row='+n_Row)
	var e_k=valEvent.keyCode;
		//alert(e_k);
	if((((e_k<48) || (e_k>105)) || ((e_k>57) && (e_k<96))) && (e_k!=8)){
		alert("Please fill in number");
		valThis.value='';
		return false;
	}
	if(document.getElementById('check_in').value==''){
		alert("Please select your Check-In Date And fill in again");
		valThis.value='';
		return;
	}
	if(document.getElementById('check_out').value==''){
		alert("Please select your Check-Out Date And fill in again");
		valThis.value='';
		return;
	}
	var objName='';
	var objEna='';
	var ln='';
	var i=parseFloat(0);
	document.getElementById('tbl_total').style.display = ''
	//alert(document.getElementById('period3').style.display);
	if (document.getElementById(tblID).style.display == 'none') {
		  document.getElementById(tblID).style.display = '';
     } else {
          document.getElementById(tblID).style.display = '';
     }
	max_Row=document.getElementById(tblID).rows.length-1;
	delRow(tblID,tblSource,n_Row,max_Row);
	if(n_Cell=='3'){
		st=2;
	}else{
		st=3;
	}
	objName=valThis.name;
	if(objName.substr(0,1)=='d' && document.getElementById(tblSource).rows[n_Row+1].cells[2].innerHTML!='N/A' && document.getElementById("price"+(n_Row+1)+"2").value!='N/A'){
		vv=parseFloat(objName.substr(1))+parseFloat(1);
		objEna='e'+vv;
		if(valThis.value>0){
			document.getElementById(objEna).disabled= false;
		}else{
			document.getElementById(objEna).value='';
			document.getElementById(objEna).disabled= true;
			max_Row=document.getElementById(tblID).rows.length-1;
			delRow(tblID,tblSource,n_Row+1,max_Row);
		}
	}
	var re=parseFloat(valThis.value);
	
  var tbl = document.getElementById(tblID);
  var lastRow = tbl.rows.length;
  var iteration = lastRow;
  var prdCost=findCost(n_Cell);
  //alert('prdCost='+prdCost+' / n_Cell='+n_Cell)
  if(prdCost==''){
	  alert('Your trip out of our period');
	  valThis.value='';
	  return false;
  }
  var prdPrice=prdCost.split("|");
  //alert('prdPrice='+prdPrice);
  var costUse=parseFloat(0);
  var prdUse;
  var zz;
  var th_total;
  var st_th;
  var en_th;
  var wd_th;
  var xxx;
  //if(prdPrice.length>2){
	  /*for(zz=0;zz<prdPrice.length-1;zz++){
			//if(costUse<=document.getElementById(tblSource).rows[2].cells[prdPrice[0]].innerHTML){
				costUse=document.getElementById(tblSource).rows[2].cells[prdPrice[0]].innerHTML;
				prdUse=prdPrice[0];
			//}
	  }*/
  //}else{
	  //alert("n_Row="+n_Row)
	  //alert('prdPrice[0]='+prdPrice[0])
	  costUse=document.getElementById(tblSource).rows[2].cells[prdPrice[0]].innerHTML;
	  //alert('costUse='+costUse)
	  prdUse=prdPrice[0];
	  //alert('prdPrice[0]='+prdPrice[0]+' prdPrice[1]='+prdPrice[1]);
  //}
	  for(i=0;i<re;i++){
		var x=document.getElementById(tblID).insertRow(lastRow+i);
		var bbgColor='#96b7da';
		if(parseFloat(lastRow+i)%2!=0){
			bbgColor='#b4d6f1';
		}else{
			bbgColor='#96b7da';
		}
		amount=parseFloat(0);
		thbSum=parseFloat(0);
		for(r=0;r<=n_Cell;r++){
			var y=x.insertCell(r);
			if(r>1&&r<n_Cell){
				if(r==prdUse){
					//alert('price='+document.getElementById("price"+n_Row+r).value);
					//alert('prd_ng='+document.getElementById('cnt_ng').value);
					//alert('currencyValue='+document.getElementById('currencyValue').value);
					//prd_price=document.getElementById(tblSource).rows[n_Row].cells[r].innerHTML
					prd_price=round_decimals((document.getElementById("price"+n_Row+r).value)/document.getElementById('currencyValue').value,2);
					thbSum=thbSum+parseFloat(document.getElementById("price"+n_Row+r).value);
					y.innerHTML=prd_price + " " + document.getElementById('currencyName').value+ "<input name=pr"+n_Row+i+" type=hidden id=pr"+n_Row+i+" value="+parseFloat(document.getElementById("price"+n_Row+r).value)+" />";
					amount=amount+parseFloat(prd_price);
					//alert('1='+y.innerHTML);
				}else{
					y.innerHTML="-"
				}
				y.align="center";
				y.className="gen-black";
				y.style.backgroundColor = bbgColor;
				y.align="center";
				
			}else if(r==n_Cell){
				y.className="gen-black";
				y.style.backgroundColor = bbgColor;
				y.align="right";
				y.innerHTML=amount + " " + document.getElementById('currencyName').value + "<input name=\"pr"+n_Row+i+"\" type=\"hidden\" id=\"pr"+n_Row+i+"\" value=\""+round_decimals(thbSum,2)+"\" />";
			}else{
				y.className="gen-black";
				y.style.backgroundColor = bbgColor;
				y.innerHTML=document.getElementById("type"+n_Row+r).value
				
			}
		}
	  }
	total=parseFloat(0);
	th_total=parseFloat(0);
	if(n_Cell=='3'){
		sst=2;
	}else{
		sst=3;
	}
	for(cc=sst;cc<document.getElementById(tblID).rows.length;cc++){
		if(navigator.appName=="Microsoft Internet Explorer"){
		st_th=document.getElementById(tblID).rows[cc].cells[n_Cell].innerHTML.search(/value=/);
		//alert('n_Cell='+n_Cell);
		//alert('2='+document.getElementById(tblID).rows[cc].cells[n_Cell].innerHTML);
		//alert ('st_th='+st_th);
		wd_th=document.getElementById(tblID).rows[cc].cells[n_Cell].innerHTML.substr(st_th);
		//alert('wd_th='+wd_th);
		en_th=wd_th.search(/ /)
		//alert ('en_th='+en_th);
		xxx=document.getElementById(tblID).rows[cc].cells[n_Cell].innerHTML.substr(st_th+6,en_th-6);
		//alert ('xxx='+xxx);
		th_total=th_total+parseFloat(xxx);
		//alert ('th_total='+th_total);
		}
		else{
		st_th=document.getElementById(tblID).rows[cc].cells[n_Cell].innerHTML.search(/value=/);
		//alert(document.getElementById(tblID).rows[cc].cells[n_Cell].innerHTML);
		//alert ('st_th='+st_th);
		wd_th=document.getElementById(tblID).rows[cc].cells[n_Cell].innerHTML.substr(st_th);
		//alert('wd_th='+wd_th);
		en_th=wd_th.search(/ /)
		//alert ('en_th='+en_th);
		xxx=document.getElementById(tblID).rows[cc].cells[n_Cell].innerHTML.substr(st_th+7,en_th-8);
		//alert ('xxx='+xxx);
		th_total=th_total+parseFloat(xxx);
		//alert ('th_total='+th_total);
		}
		total=total+parseFloat(document.getElementById(tblID).rows[cc].cells[n_Cell].innerHTML)
	}
	document.getElementById('tbl_total').rows[0].cells[0].innerHTML="<strong>Total (incl.VAT)&nbsp;&nbsp;&nbsp;&nbsp;"+round_decimals(total,2)+"</strong>";
	document.getElementById('hd_total').value=th_total
	document.getElementById('max_Cell').value=n_Cell
	document.getElementById('tbl_Row').value=st+":"+document.getElementById(tblID).rows.length;
}

function removeElement(tblID,n_Cell,st) {
	tbl_Row=document.getElementById(tblID).rows.length;
	//alert(tbl_Row);
	for(i=st;i<tbl_Row;i++){
		//alert(i+'-'+st);
		for(r=0;r<=n_Cell;r++){
			//alert(document.getElementById(tblID).rows[i].cells[r].innerHTML);
			var y=document.getElementById(tblID).rows[i].cells[r];
			if(r>1&&r<n_Cell){
				//alert("Debug");
				el_id='c:'+(i-st)+':'+r;
				//alert(el_id);
				var el=document.getElementById(el_id);
				//alert(el);
				y.removeChild(el);
			}else if(r==n_Cell){
				el_id='c:'+(i-st)+':5';
				var el=document.getElementById(el_id);
				y.removeChild(el);
				el_id='c:'+(i-st)+':0';
				var el=document.getElementById(el_id);
				y.removeChild(el);
				el_id='c:'+(i-st)+':1';
				var el=document.getElementById(el_id);
				y.removeChild(el);
			}
			//alert(document.getElementById(tblID).rows[i].cells[r].innerHTML);
		}
	}
}

function addElement(tblID,n_Cell){
	tbl_Row=document.getElementById(tblID).rows.length;
	if(n_Cell==3){
		st=2;
	}else{
		st=3;
	}
	for(i=st;i<tbl_Row;i++){
		amount=parseFloat(0);
		for(r=0;r<=n_Cell;r++){
			var y=document.getElementById(tblID).rows[i].cells[r];
			if(r>1&&r<n_Cell){
				/*ng=cntNight(r-2,n_Cell)
				prd_price=document.getElementById(tblSource).rows[n_Row].cells[r].innerHTML*ng
				y.innerHTML=ng + " nights - " + prd_price + " baht"*/
				var input = document.createElement("input");
				input.type = 'hidden';
				  input.name = 'c:'+(i-st)+':'+r;
				  input.id = 'c:'+(i-st)+':'+r;
				  input.value = y.innerHTML;
				y.appendChild(input);
				//amount=amount+parseFloat(prd_price);
			}else if(r==n_Cell){
				//y.innerHTML=amount
				var input = document.createElement("input");
				input.type = 'hidden';
				  input.name = 'c:'+(i-st)+':5';
				  input.id = 'c:'+(i-st)+':5';
				  input.value = y.innerHTML;
				y.appendChild(input);
				var input = document.createElement("input");
				input.type = 'hidden';
				  input.name = 'c:'+(i-st)+':0';
				  input.id = 'c:'+(i-st)+':0';
				  input.value = document.getElementById(tblID).rows[i].cells[0].innerHTML;
				y.appendChild(input);
				var input = document.createElement("input");
				input.type = 'hidden';
				  input.name = 'c:'+(i-st)+':1';
				  input.id = 'c:'+(i-st)+':1';
				  input.value = document.getElementById(tblID).rows[i].cells[1].innerHTML;
				y.appendChild(input);
			}/*else{
				y.innerHTML=document.getElementById(tblSource).rows[n_Row].cells[r].innerHTML
				
			}*/
			//alert(document.getElementById(tblID).rows[i].cells[r].innerHTML);
		}
	}
}

function findCost(n_Cell){
	var ch_in;
	var ch_out;
	var prd;
	var prdCost='';
	ch_in=document.getElementById('check_in').value.split("-");
	ch_out=document.getElementById('check_out').value.split("-");
	ch_in[1]=parseFloat(ch_in[1])-parseFloat(1);
	ch_out[1]=parseFloat(ch_out[1])-parseFloat(1);
	var checkinDate  = new Date(ch_in[0],ch_in[1],ch_in[2],0,0,0);
	var checkoutDate = new Date(ch_out[0],ch_out[1],ch_out[2],0,0,0);
	ch_inDate=checkinDate.getTime();
	ch_outDate=checkoutDate.getTime();
	if(n_Cell=='4'){
		pr=document.getElementById('period2').innerHTML.split("|")
	}else if(n_Cell=='5'){
		pr=document.getElementById('period').innerHTML.split("|");
		//alert('pr='+pr)
	}else{
		pr=document.getElementById('period1').innerHTML.split("|")
	}
	for(prd=0;prd<pr.length;prd++){
		spr=pr[prd].split(",")
		for(j=0;j<spr.length;j++){
			sspr=spr[j].split("-")
			ch_ins=sspr[0].split("/");
			ch_outs=sspr[1].split("/");
			ch_ins[1]=parseFloat(ch_ins[1])-parseFloat(1);
			ch_outs[1]=parseFloat(ch_outs[1])-parseFloat(1);
			var st_date  = new Date(ch_ins[0],ch_ins[1],ch_ins[2],0,0,0);
			var en_date  = new Date(ch_outs[0],ch_outs[1],ch_outs[2],0,0,0);
			s_date=st_date.getTime();
			e_date=en_date.getTime();
			//alert(ch_inDate+'>='+s_date+' && '+ch_outDate+'<='+e_date+' = '+ch_inDate>=s_date && ch_outDate<=e_date);
			if(ch_inDate>=s_date && ch_inDate<=e_date){
				prdCost=prdCost+(prd+2)+'|';
				break;
			}else if(ch_outDate>=s_date && ch_outDate<=e_date){
				prdCost=prdCost+(prd+2)+'|';
				break;
			}
		}
	}
	//alert('prdCost='+prdCost)
	return prdCost;
}
function reCal(){
	var valPrd=document.getElementById("currencePrd").value.split("|");
	var tblRow=document.getElementById(valPrd[1]).rows.length;
	var nCell;
	var tblSource;
	var valCost;
	var ng;
	var i;
	var j;
	var k;
	var prd_price;
	//alert(valPrd[0]);
	var stSource;
	var stDestination;
	if(valPrd[0]=='period'){
		nCell=5;
		tblSource='source3';
		stSource=2;
		stDestination=3;
	}else if(valPrd[0]=='period2'){
		nCell=4;
		tblSource='source2';
		stSource=2;
		stDestination=3;
	}else{
		nCell=3;
		tblSource='source1';
		stSource=1;
		stDestination=2;
	}
	var prdCost=findCost(nCell);
  var prdPrice=prdCost.split("|");
  var costUse=parseFloat(0);
  var prdUse;
  var zz;
  
	for(i=stDestination;i<tblRow;i++){
		amount=parseFloat(0);
		var tblSourceRow=document.getElementById(tblSource).rows.length;
		valCost='';
		for(j=stSource;j<tblSourceRow;j++){
			//alert(document.getElementById(valPrd[1]).rows[i].cells[0].innerHTML+'=='+document.getElementById(tblSource).rows[j].cells[0].innerHTML+' && '+document.getElementById(valPrd[1]).rows[i].cells[1].innerHTML+'=='+document.getElementById(tblSource).rows[j].cells[1].innerHTML);
			if((document.getElementById(valPrd[1]).rows[i].cells[0].innerHTML==document.getElementById(tblSource).rows[j].cells[0].innerHTML) && (document.getElementById(valPrd[1]).rows[i].cells[1].innerHTML==document.getElementById(tblSource).rows[j].cells[1].innerHTML)){
				/*for(k=2;k<=nCell-1;k++){
					valCost=valCost+'|'+document.getElementById(tblSource).rows[j].cells[k].innerHTML;
				}*/
			if(prdPrice.length>2){
				  for(zz=0;zz<prdPrice.length-1;zz++){
						if(costUse<=document.getElementById(tblSource).rows[j].cells[prdPrice[zz]].innerHTML){
							costUse=document.getElementById(tblSource).rows[j].cells[prdPrice[zz]].innerHTML;
							prdUse=prdPrice[zz];
						}
				  }
			  }else{
				  costUse=document.getElementById(tblSource).rows[j].cells[prdPrice[0]].innerHTML;
				  prdUse=prdPrice[0];
			  }
				//alert(valCost);
				break;
			}
		}
		//valCost=valCost.split("|");
		for(j=2;j<=nCell;j++){
			if(j>=2 && j<nCell){
				if(prdUse==j){
					prd_price=parseFloat(costUse);
					amount=amount+prd_price;
					document.getElementById(valPrd[1]).rows[i].cells[j].innerHTML=prd_price + " baht";
				}else{
					document.getElementById(valPrd[1]).rows[i].cells[j].innerHTML="-";
				}
			}else{
				//document.getElementById(valPrd[1]).rows[i].cells[j].innerHTML=amount;
				document.getElementById(valPrd[1]).rows[i].cells[j].innerHTML="NaN";
			}
			//alert(document.getElementById(valPrd[1]).rows[i].cells[j].innerHTML);
		}	
	}
	var total=parseFloat(0);
	var sst;
	var cc;
	if(nCell=='3'){
		sst=2;
	}else{
		sst=3;
	}
	for(cc=sst;cc<tblRow;cc++){
		total=total+parseFloat(document.getElementById(valPrd[1]).rows[cc].cells[nCell].innerHTML)
	}
	document.getElementById('tbl_total').rows[0].cells[0].innerHTML="<strong>Total (incl.VAT)&nbsp;&nbsp;&nbsp;&nbsp;"+total+"</strong>";
	document.getElementById('hd_total').value=total
}
function delRow(tblID,tblSource,n_Row,max_Row){
	/*alert(max_Row)
	alert (document.getElementById(tblID).rows[max_Row].cells[0].innerHTML)
	alert (document.getElementById(tblSource).rows[n_Row].cells[0].innerHTML)*/
	//if((document.getElementById(tblSource).rows[n_Row].cells[0].innerHTML==document.getElementById(tblID).rows[max_Row].cells[0].innerHTML)&&(document.getElementById(tblSource).rows[n_Row].cells[1].innerHTML==document.getElementById(tblID).rows[max_Row].cells[1].innerHTML)){
	if((document.getElementById("type"+n_Row+"0").value==document.getElementById(tblID).rows[max_Row].cells[0].innerHTML)&&(document.getElementById("type"+n_Row+"1").value==document.getElementById(tblID).rows[max_Row].cells[1].innerHTML)){
		document.getElementById(tblID).deleteRow(max_Row)		
	}
	//max_Row=document.getElementById(tblID).rows.length
	//alert(max_Row)
	if(tblID=='periodx'){
		min_Row=2
	}else{
		min_Row=3
	}
	if(max_Row>min_Row){
		max_Row=max_Row-1
		delRow(tblID,tblSource,n_Row,max_Row)
	}
}

function getNight() {
	ch_in=document.form1.check_in.value.split("-");
	ch_in[1]=parseFloat(ch_in[1])-parseFloat(1);
	var nowDate= new Date();
	var checkinDate  = new Date(ch_in[0],ch_in[1],ch_in[2],0,0,0);
	var checkinTime  = checkinDate.getTime();
	var nowTime=nowDate.getTime()+((1000 * 60 * 60 *24)*2);
	if(checkinTime<=nowTime){
		alert('We require minimum 2 days advance for hotel bookings.');
		document.form1.check_in.value='';
		return false;
	}
	a_d=parseFloat(ch_in[2])+parseFloat(document.form1.tourDay.value);
	var checkoutDate = new Date(ch_in[0],ch_in[1],a_d,0,0,0);
	iYear=checkoutDate.getFullYear();
	var iMonth=String(checkoutDate.getMonth()+1);
	var iDate=String(checkoutDate.getDate());
	if(iMonth.length==1){
		iMonth='0'+iMonth;
	}
	if(iDate.length==1){
		iDate='0'+iDate;
	}
	document.getElementById("check_out").value=iYear+'-'+iMonth+'-'+iDate;
	reCal();
}

function check_number(valThis,valEvent){
	var e_k=valEvent.keyCode;
	if(((e_k>=48) && (e_k<=57)) || ((e_k>=96) && (e_k<=105)) || ((e_k==8) || (e_k==13))){
		return;
	}else{
		alert("Please fill in number");
		valThis.value='';
		return false;
	}
}
function OnSubmitForm(){
	if(document.getElementById('tbl_Row').value==''){
		alert('Please select your room preference.');
		return false;
	}
	if(document.getElementById('hd_total').value=='' || document.getElementById('hd_total').value=='NaN'){
		alert('Please select your room preference.');
		return false;
	}
	var objVal;
	objVal=document.getElementById('tbl_Row').value.split(':');
	if(objVal[0]==objVal[1]){
		alert('Please select your room preference.');
		return false;
	}
	var par=document.getElementById('par').value.split(',');
	//alert('par='+par[0]+par[1]);
	addElement(par[0],par[1]);
  return true;
}

function showHide(inID) {
     if (document.getElementById(inID).style.display == 'none') {
          document.getElementById(inID).style.display = 'block';
     } else {
          document.getElementById(inID).style.display = 'none';
     }
}

function showHideTransport(thisVal) {
     if (thisVal.value == '0') {
          document.getElementById('tDetail').style.display = 'none';
     } else {
          document.getElementById('tDetail').style.display = '';
     }
}

function Check_Value(a,b,c,d,e,z) {
	//var x = i.value/n
	/*alert(a)
	alert(b)
	alert(c)
	alert(d)
	alert(e)
	alert(z)
	//radio_form.radio_button[counter].checked
	//alert(document.getElementById["t_type"][0].value)
	
	alert(form1.adults.value)
	alert(form1.t_type[0].checked)*/
	x=0
	if(document.form1.t_type[1].checked){
		if(document.form1.adults.value<=2){
			//alert("2")
			//a=parseFloat(a)
			x=a*document.form1.adults.value
		}else if(document.form1.adults.value<=4){
			//alert("4")
			x=b*document.form1.adults.value
		}else if(document.form1.adults.value<=6){
			x=c*document.form1.adults.value
			//alert("6")
		}else if(document.form1.adults.value<=8){
			x=d*document.form1.adults.value
			//alert("8")
		}else if(document.form1.adults.value<=10){
			x=e*document.form1.adults.value
			//alert("10")
		}else{
			document.getElementById("price").value=-1
			document.getElementById("showPrice").innerHTML="On Request"
			//x="On Request"
			exit()
		}	
	}else{
		//z=parseFloat(z)
		x=document.form1.adults.value*z
		//x=parseFloat(x)
	}
	//var x = i.value/n
	document.getElementById("price").value=x
	document.getElementById("showPrice").innerHTML=round_decimals(x,2)
	//document.getElementById("showPrice").innerHTML=Math.round(100*x)/100
}
function round_decimals(original_number, decimals) {
    var result1 = original_number * Math.pow(10, decimals)
    var result2 = Math.round(result1)
    var result3 = result2 / Math.pow(10, decimals)
    return pad_with_zeros(result3, decimals)
}

function pad_with_zeros(rounded_value, decimal_places) {

    // Convert the number to a string
    var value_string = rounded_value.toString()
    
    // Locate the decimal point
    var decimal_location = value_string.indexOf(".")

    // Is there a decimal point?
    if (decimal_location == -1) {
        
        // If no, then all decimal places will be padded with 0s
        decimal_part_length = 0
        
        // If decimal_places is greater than zero, tack on a decimal point
        value_string += decimal_places > 0 ? "." : ""
    }
    else {

        // If yes, then only the extra decimal places will be padded with 0s
        decimal_part_length = value_string.length - decimal_location - 1
    }
    
    // Calculate the number of decimal places that need to be padded with 0s
    var pad_total = decimal_places - decimal_part_length
    
    if (pad_total > 0) {
        
        // Pad the string with 0s
        for (var counter = 1; counter <= pad_total; counter++) 
            value_string += "0"
        }
    return value_string
}

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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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];}
}


