	////////////////////////////////////////////////////////////////////////////////////////////////////// F I N D    O B J E C T
		function Find(sId){
			if (document.all) return document.all[sId];
			if (document.getElementById) return document.getElementById(sId);
			return false;
		}
		//////////////////////////////////////////////////////////////////////////////////////////////
		function Dump(oObject){
			//var sResult = "<pre>";
			var sResult = "";
			for (var i in oObject) {
				if(typeof(oObject[i]) == "object"){
					//Dump(oObject[i]);
				}
				if(typeof(oObject[i]) != "function"){
					sResult += "("+ typeof(oObject[i])  +")\tObject." + i + " = " + oObject[i] + "\n";
				}
			}
			//sResult += "</pre>";
			alert(sResult);
			document.write(sResult);
		}
		//////////////////////////////////////////////////////////////////////////////////////////////
		function CopyInfo(){
			if(Find("Copy").checked){
				Find("RecipientFName").value = Find("RegFName").value;
				Find("RecipientMName").value = Find("RegMName").value;
				Find("RecipientLName").value = Find("RegLName").value;
				Find("RecipientCity").value = Find("RegCity").value;
				Find("RecipientAddress").value = Find("RegAddress").value;
			}else{
				Find("RecipientFName").value = '';
				Find("RecipientMName").value = '';
				Find("RecipientLName").value = '';
				Find("RecipientCity").value = '';
				Find("RecipientAddress").value = '';
			}
		}
		function CopyInfo_reg(){
			if(Find("Copy_reg").checked){
				Find("RegFName").value = Find("RegFName_login").value;
				Find("RegMName").value = Find("RegMName_login").value;
				Find("RegLName").value = Find("RegLName_login").value;
				Find("EGN").value = Find("EGN_login").value;
				Find("RegCity").value = Find("RegCity_login").value;
				Find("RegAddress").value = Find("RegAddress_login").value;
			}else{
				Find("RegFName").value = '';
				Find("RegMName").value = '';
				Find("RegLName").value = '';
				Find("RegCity").value = '';
				Find("RegAddress").value = '';
			}
		}		
		//////////////////////////////////////////////////////////////////////////////////////////////
		function GetPrice(nomercheto){
			var mnoj_es=new Array("0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0");
			var mnoj_drugi=new Array("0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0","0");
			//za kraina premiq na zelena karta//
			var mnoj_zk=new Array("0","30","30","30","30","30","30","40","200","200","200","200","50","50","100","100","30","30","0","0");
	  var mnoj_zk_NOPTP=new Array("0","30","30","30","30","30","30","40","200","200","150","150","50","50","100","100","39","31","0","0");
			var mnoj_izvajdane=new Array("13","13","10","10","10","10","10","10","10","10","10","10","10","11","10","10","11","10");
			var mnoj_izvajdane_zk=new Array("0","13","10","10","13","11","11","10","11","12","10","10","11","11","12","12","12","10","10","11");
			
			var mnoj_izvajdane_vnoski_SA=new Array("0","13","12","12","11","13","13","10","11","12","10","10","10","10","10","10","10","12","10","11");
			var mnoj_izvajdane_vnoski_DRUGI=new Array("0","11","10","11","10","10","10","10","10","10","10","10","10","10","10","10","11","10","10","11");
			
			var mnoj_izvajdane_vnoski_ES=new Array("0","24","25","23","21","19","19","19","11","10","11","11","12","12","10","10","10","12","10","11");
			var mnoj_izvajdane_vnoski_ES_SPTP=new Array("0","24","25","23","21","19","19","19","11","10","11","11","12","12","10","10","10","12","10","11");
			// otmetka za sisi razsrocheno na 4 vnoski//
			var mnoj_izvajdane_vnoski_BG=new Array("0","24","25","23","21","19","19","19","11","10","11","11","12","12","10","10","10","12","10","11");
	  var mnoj_izvajdane_vnoski_BG_NOPTP=new Array("0","24","25","23","21","19","19","19","11","10","11","11","12","12","10","10","10","12","10","11");
			
			var mnoj_pv='11.40';
			
			var mnoj_namalenie20_BG = new Array("0","26","4","32","35","41","42","43","77","79","111","111","16","21","61","77","10","9","15","29","77","10","9","15","29");
			var mnoj_namalenie20_ES = new Array("0","26","4","32","35","41","42","43","77","79","111","111","16","21","61","77","10","9","15","29","77","10","9","15","29");
			
			var mnoj_namalenie20_BG_NOPTP = new Array("0","26","28","32","35","41","42","43","77","79","111","111","16","21","61","77","10","9","15","29");
			var mnoj_namalenie20_ES_NOPTP = new Array("0","26","28","32","35","41","42","43","77","79","61","61","16","21","61","77","19","10","15","29");
	
			var sPrice;
			oSelectedVehicle = Find("SelectVehicle");
			//oSelectedPeriod = Find("SelectPeriod");
			oSelectedPeriod = Find("Selectgrad");
			oSelectedTarifa = Find("SelectTarifa");
			if((oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent') == '') || (oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('dPrice') == '')){
				sPrice = '';
			}else{
			//alert(nomercheto);
			//alert(oSelectedTarifa.options[oSelectedTarifa.selectedIndex].getAttribute('value'));
			//alert(oSelectedDKN.options[oSelectedDKN.selectedIndex].getAttribute('value'));
				
				if(nomercheto == '2'){
					//Претърпявали ли сте ПТП през последните три години? NE
					if(oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('value') == '4'){
						var tmp_fPrice = eval(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('fPrice'));
						var tmp_ePrice = eval(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('ePrice'));
						var tmp_gPrice = eval(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('gPrice'));
						var tmp_vPrice = eval(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('vPrice'));
						
						var sPrice = (eval((tmp_fPrice) * 0.05) + eval(tmp_fPrice)) / oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent');
					
							if(oSelectedTarifa.options[oSelectedTarifa.selectedIndex].getAttribute('value') == '1'){
								//var sPrice = (eval((tmp_fPrice+eval(mnoj_es[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')])) * 0.05) + eval(tmp_fPrice+eval(mnoj_es[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]))) / oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent');
								
									var sPrice = eval(tmp_gPrice) + eval(mnoj_pv);
									//var sPrice_vnoski = (eval(tmp_gPrice) + eval(mnoj_pv)) - eval(mnoj_izvajdane_vnoski_SA[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);
									var sPrice_vnoski = (eval(tmp_gPrice) + eval(mnoj_pv)) - eval(mnoj_izvajdane_vnoski_BG_NOPTP[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);
																
								
							}
							if(oSelectedTarifa.options[oSelectedTarifa.selectedIndex].getAttribute('value') == '3'){
								//var sPrice = (eval((tmp_fPrice+eval(mnoj_zk[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')])) * 0.05) + eval(tmp_fPrice+eval(mnoj_zk[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]))) / oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent');
								var sPrice = eval(tmp_gPrice) + eval(mnoj_pv) + eval(mnoj_zk[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);
								//var sPrice_vnoski = (eval(tmp_ePrice) + eval(mnoj_pv)) - eval(mnoj_izvajdane_zk[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);
								var sPrice_vnoski = (eval(tmp_gPrice) + eval(mnoj_pv)) - eval(mnoj_izvajdane_vnoski_ES[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);
								
							if(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value') == '18' || oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value') == '19'){
							//var sPrice = eval(sPrice) - 30;
							}
							}
					}
					if(oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('value') == '1'){
						var sPrice = oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('fPrice') * oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent') / 100;		
								/// izchislqva spored tarifa ednokratno za vsichki ostanali gradove ///
							if(oSelectedTarifa.options[oSelectedTarifa.selectedIndex].getAttribute('value') == '1'){								
								// Namalenie		
								var sPrice = (oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('dPrice') * oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent') / 100)-eval(mnoj_namalenie20_BG[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);
								// Bez namalenie
								//var sPrice = (oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('dPrice') * oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent') / 100);
							}
							
							if(oSelectedTarifa.options[oSelectedTarifa.selectedIndex].getAttribute('value') == '3'){
								// Namalenie
								var sPrice = ((oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('dPrice') * oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent') / 100) + eval(mnoj_zk_NOPTP[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]))-eval(mnoj_namalenie20_ES_NOPTP[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);
								// Bez namalenie
								//var sPrice = ((oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('dPrice') * oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent') / 100) + eval(mnoj_zk[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]));
								
							}
								////////////////////////////////
					}
				}
				
				if(nomercheto == '1'){
					//Претърпявали ли сте ПТП през последните три години? DA
					var tmp_ePrice = eval(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('ePrice'));
					var tmp_gPrice = eval(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('gPrice'));
					var tmp_vPrice = eval(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('vPrice'));
					
					if(oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('value') == '4'){
						var tmp_dPrice = eval(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('dPrice'));
						var sPrice = (eval((tmp_dPrice) * 0.05) + eval(tmp_dPrice)) / oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent');
							if(oSelectedTarifa.options[oSelectedTarifa.selectedIndex].getAttribute('value') == '1'){
								//var sPrice = (eval((tmp_dPrice+eval(mnoj_es[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')])) * 0.05) + eval(tmp_dPrice+eval(mnoj_es[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]))) / oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent');
								var sPrice = eval(tmp_ePrice) + eval(mnoj_pv);
								var sPrice_vnoski = (eval(tmp_ePrice) + eval(mnoj_pv)) - eval(mnoj_izvajdane_vnoski_BG[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);

							}
							if(oSelectedTarifa.options[oSelectedTarifa.selectedIndex].getAttribute('value') == '3'){
								//var sPrice = (eval((tmp_dPrice+eval(mnoj_zk[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')])) * 0.05) + eval(tmp_dPrice+eval(mnoj_zk[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]))) / oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent');
								var sPrice = eval(tmp_ePrice) + eval(mnoj_pv) + eval(mnoj_zk[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);
								var sPrice_vnoski = (eval(tmp_ePrice) + eval(mnoj_pv)) - eval(mnoj_izvajdane_vnoski_ES_SPTP[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);
								
							if(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value') == '18' || oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value') == '19'){
							//var sPrice = eval(sPrice) - 30;
							}
							}
					}
					
					if(oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('value') == '1'){
						// Начин на плащане: EDNOKRATNO
						var sPrice = oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('dPrice') * oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent') / 100;
							/// izchislqva spored tarifa ednokratno za Sofiq, Varna, Plovdiv i Burgas ///
							if(oSelectedTarifa.options[oSelectedTarifa.selectedIndex].getAttribute('value') == '1'){
								// Тарифа BG
								// Namalenie
								var sPrice = (oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('dPrice') * oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent') / 100)-eval(mnoj_namalenie20_BG_NOPTP[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);
								// Bez namalenie
								//var sPrice = (oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('dPrice') * oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent') / 100);
						
							}
							if(oSelectedTarifa.options[oSelectedTarifa.selectedIndex].getAttribute('value') == '3'){
								// Тарифа BG I EU
								// Namalenie
								var sPrice = ((oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('dPrice') * oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent') / 100) + eval(mnoj_zk[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]))-eval(mnoj_namalenie20_ES[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]);
								// Bez namalenie
								//var sPrice = ((oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('dPrice') * oSelectedPeriod.options[oSelectedPeriod.selectedIndex].getAttribute('dPercent') / 100) + eval(mnoj_zk[oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value')]));
								
							}
							////////////////////////////////
					}
							// Pribave +10 za do 1500 kub. sm
							if(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value') == '1'){
							//var sPrice = eval(sPrice) + 10;
							}
							// Pribave +10 za do 2000 kub. sm
							if(oSelectedVehicle.options[oSelectedVehicle.selectedIndex].getAttribute('value') == '3'){
							//var sPrice = eval(sPrice) + 15;
							}
				}
				
				
				Find("Price").value = sPrice.toFixed(2);
				Find("Price_vnoski").value = sPrice_vnoski.toFixed(2);
			
			}
		}
		//////////////////////////////////////////////////////////////////////////////////////////////
		function SetDefaultStyle(oThis){
			oThis.style.borderColor = "";
		}
		//////////////////////////////////////////////////////////////////////////////////////////////
		function SetWhiteStyle(oThis){
			oThis.style.borderColor = "#ffffff";
		}
		//////////////////////////////////////////////////////////////////////////////////////////////
		function CheckInput(){
			//if(Find("priceFirst") == null){
			if(document.getElementById('priceFirst').value == ''){	
				alert('Моля, калкулирайте цена!');
				Find("calc_butt").focus();
				Find("calc_butt").style.borderColor ="#fa8072";
				return;
			}
			
			
			
			//alert(document.getElementById('priceFirst').value);
			
			
			
			sErrorMsg = "Моля, попълнете всички полета маркирани със завезда!";
			if(Find("RegFName").value == ''){
				Find("RegFName").focus();
				alert(sErrorMsg);
				Find("RegFName").style.borderColor ="#fa8072";
				return;
			}
			if(Find("RegMName").value == ''){
				Find("RegMName").focus();
				alert(sErrorMsg);
				Find("RegMName").style.borderColor ="#fa8072";
				return;
			}
			if(Find("RegLName").value == ''){
				Find("RegLName").focus();
				alert(sErrorMsg);
				Find("RegLName").style.borderColor ="#fa8072";
				return;
			}
			if(Find("EGN").value == ''){
				Find("EGN").focus();
				alert(sErrorMsg);
				Find("EGN").style.borderColor ="#fa8072";
				return;
			}
			if(Find("RegRegistrationNumber").value == ''){
				Find("RegRegistrationNumber").focus();
				alert(sErrorMsg);
				Find("RegRegistrationNumber").style.borderColor ="#fa8072";
				return;
			}
			if(Find("Brand").value == ''){
				Find("Brand").focus();
				alert(sErrorMsg);
				Find("Brand").style.borderColor ="#fa8072";
				return;
			}
			if(Find("Model").value == ''){
				Find("Model").focus();
				alert(sErrorMsg);
				Find("Model").style.borderColor ="#fa8072";
				return;
			}
			if(Find("Rama").value == ''){
				Find("Rama").focus();
				alert(sErrorMsg);
				Find("Rama").style.borderColor ="#fa8072";
				return;
			}
			if(Find("RecipientFName").value == ''){
				Find("RecipientFName").focus();
				alert(sErrorMsg);
				Find("RecipientFName").style.borderColor ="#fa8072";
				return;
			}
			if(Find("RecipientMName").value == ''){
				Find("RecipientMName").focus();
				alert(sErrorMsg);
				Find("RecipientMName").style.borderColor ="#fa8072";
				return;
			}
			if(Find("RecipientLName").value == ''){
				Find("RecipientLName").focus();
				alert(sErrorMsg);
				Find("RecipientLName").style.borderColor ="#fa8072";
				return;
			}
			if(Find("RecipientCity").value == ''){
				Find("RecipientCity").focus();
				alert(sErrorMsg);
				Find("RecipientCity").style.borderColor ="#fa8072";
				return;
			}
			if(Find("RecipientAddress").value == ''){
				Find("RecipientAddress").focus();
				alert(sErrorMsg);
				Find("RecipientAddress").style.borderColor ="#fa8072";
				return;
			}
			if(Find("RecipientPhoneNum").value == ''){
				Find("RecipientPhoneNum").focus();
				alert(sErrorMsg);
				Find("RecipientPhoneNum").style.borderColor ="#fa8072";
				return;
			}
			
			if(Find("Selectgrad").value != 1){
				alert('През сайта на ЛЕВ ИНС застраховка ГО могат да сключат само физически лица чрез еднократно плащане!');
				return;
			}			
			

			if(!Find("Agree").checked){
				Find("Agree").focus();
				alert(sErrorMsg);
				Find("Agree").style.borderColor = "#fa8072";
				Find("Agree").style.border = "1px solid";
				return;
			}
			Find("frmOnlineInsurance").submit();
			return;			
		}
		/////////////////////////////////////////////////////////////////////////////////////////////
		//document.body.onload = new Function("alert(Find('PaymentMethod'))");
		/////////////////////////////////////////////////////////////////////////////////////////////
		function SetConditions(){
			var oTextArea=Find("Conditions");
			oTextArea.value="Съгласен съм ЗК “ЛЕВ ИНС” АД да обработва мои лични данни при спазване на изискванията на чл. 23 от Закона за защита на личните данни, в качеството си на администратор на лични данни."
			+"								                  "
			+"Уведомен съм, че обработването им ще се осъществи при спазване тайната на застархователното правоотношение по реда на чл. 7 от Закона за застраховането.";
		}
		/////////////////////////////////////////////////////////////////////////////////////////////
		function SetConditions_en(){
			var oTextArea=Find("Conditions");
			oTextArea.value="I agree ZPK Lev Ins AD to handle and store my personal data according to the legal requirements.";
		}
		/////////////////////////////////////////////////////////////////////////////////////////////
		function SetVisibility(oObject, nState){
			var oText = Find("Price");
			if(Find('SelectVehicle').selectedIndex == 0 || Find('Selectgrad').selectedIndex == 0) return;
			if(nState == 1) oObject.style.visibility = "visible";
			if(nState == 0){
				oObject.style.visibility = "hidden"; 
				oText.value ='';
			}
		}
		//////////////////////////////////////////////////////////////////////////////////////////////
		function Dump(oObject){
			//var sResult = "<pre>";
			var sResult = "<table border=0>";
			for (var i in oObject) {
				sResult += '<tr>';
				sResult += '<td width="10"></td>'
				if(typeof(oObject[i]) == "object"){
					//Dump(oObject[i]);
				}
				if(typeof(oObject[i]) != "function"){
					sResult += '<td style="font-family:Tahoma; font-size:11px; color:#000080">'+ typeof(oObject[i])  +'</td>'+
					'<td style="font-family:Tahoma; font-size:11px; color:#800000"> ' + i + '</td>'+
					'<td style="font-family:Tahoma; font-size:11px; color:#000080">' + oObject[i] + '</td>';
				}
				sResult += '</tr>';
			}
			sResult += "</table>";
			if(!Find('DebugDiv')){
				oDiv = document.createElement('DIV');
				oDiv.id = 'DebugDiv';
				oDiv.style.cssText = "font-family: Tahoma; font-size: 11px; color: #000080;";
				//document.body.appendChild(oDiv);
			}
			oDiv.innerHTML += "&lt;DEBUG INFO :: "+ oObject +"&gt;<br>";
			oDiv.innerHTML += sResult;
			oDiv.innerHTML += "&lt;/DEBUG INFO :: "+ oObject +"&gt;<br>";
			//sResult += "</pre>";
			alert(sResult);
			//document.write(sResult);
		}
///////////////////////////////////////////////////////////////////////////

function swapImgRestore() {
  var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function preloadImages() {
  var d=document; if(d.images){ if(!d.p) d.p=new Array();
    var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}

function findObj(n, d) {
  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=findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function swapImage() {
  var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
