/***********************************************
* javaScripts- © illism webolution code library (www.illism.com)
***********************************************/


// Auto Tab (New)
	var isNN = (navigator.appName.indexOf("Netscape")!=-1);

	function autoTab(input, len, e) {
		var keyCode = (isNN) ? e.which : e.keyCode; 
		var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
			if(input.value.length >= len && !containsElement(filter,keyCode)) {
				input.value = input.value.slice(0, len);
				input.form[(getIndex(input)+1) % input.form.length].focus();
	}
	function containsElement(arr, ele) {
		var found = false, index = 0;
		while(!found && index < arr.length)
			if(arr[index] == ele)
				found = true;
			else
				index++;
			return found;
	}
	function getIndex(input) {
		var index = -1, i = 0, found = false;
		while (i < input.form.length && index == -1)
			if (input.form[i] == input)index = i;
				else i++;
			return index;
		}
		return true;
	}


// Currency Format (1,000.00)
	function currency(which){
		currencyValue = which.value;
		currencyValue = currencyValue.replace(",", "");
		decimalPos = currencyValue.lastIndexOf(".");
		if (decimalPos != -1){
				decimalPos = decimalPos + 1;
		}
		if (decimalPos != -1){
				decimal = currencyValue.substring(decimalPos, currencyValue.length);
				if (decimal.length > 2){
						decimal = decimal.substring(0, 2);
				}
				if (decimal.length < 2){
						while(decimal.length < 2){
							 decimal += "0";
						}
				}
		}
		if (decimalPos != -1){
				fullPart = currencyValue.substring(0, decimalPos - 1);
		} else {
				fullPart = currencyValue;
				decimal = "00";
		}
		newStr = "";
		for(i=0; i < fullPart.length; i++){
				newStr = fullPart.substring(fullPart.length-i-1, fullPart.length - i) + newStr;
				if (((i+1) % 3 == 0) & ((i+1) > 0)){
						if ((i+1) < fullPart.length){
							 newStr = "," + newStr;
						}
				}
		}
		which.value = newStr + "." + decimal;
	}

	function normalize(which){
		alert("Normal");
		val = which.value;
		val = val.replace(",", "");
		which.value = val;
	}


// Credit Card Validation
	function Mod10(ccNumb) {
	var valid = "0123456789" 
	var len = ccNumb.length; 
	var iCCN = parseInt(ccNumb); 
	var sCCN = ccNumb.toString(); 
	sCCN = sCCN.replace (/^\s+|\s+$/g,''); 
	var iTotal = 0; 
	var bNum = true; 
	var bResult = false; 
	var temp; 
	var calc; 

	for (var j=0; j<len; j++) {
		temp = "" + sCCN.substring(j, j+1);
		if (valid.indexOf(temp) == "-1"){bNum = false;}
	}

	if(!bNum){
		/*alert("Not a Number");*/bResult = false;
	}

	if((len == 0)&&(bResult)){ 
		bResult = false;
	} else { 
	if(len >= 15){ 
	    for(var i=len;i>0;i--){ 
	      calc = parseInt(iCCN) % 10; 
	      calc = parseInt(calc); 
	      iTotal += calc; 
	      i--; 
	      iCCN = iCCN / 10; 
	      calc = parseInt(iCCN) % 10 ; 
	      calc = calc *2; 

	      switch(calc){
	        case 10: calc = 1; break;       //5*2=10 & 1+0 = 1
	        case 12: calc = 3; break;       //6*2=12 & 1+2 = 3
	        case 14: calc = 5; break;       //7*2=14 & 1+4 = 5
	        case 16: calc = 7; break;       //8*2=16 & 1+6 = 7
	        case 18: calc = 9; break;       //9*2=18 & 1+8 = 9
	        default: calc = calc;           //4*2= 8 &   8 = 8  -same for all lower numbers
	      }                                               
	    iCCN = iCCN / 10; 
	    iTotal += calc; 
	  }
	  if ((iTotal%10)==0){ 
	    bResult = true; 
	  } else { 
	    bResult = false; 
	    }
	  }
	}
	// change alert to on-page display or other indication as needed.
	if(!bResult){alert("This is NOT a valid credit card number!");}
	return bResult; 
	}


// "Show Hidden Layers" (Apply.php) Script
	function show_hideApAdd(val) {
		if ((val == "0") || (val == "1")) document.getElementById('ap_preAddress').style.display = "";
		else document.getElementById('ap_preAddress').style.display = "none";
	}
	function show_hideApWrk(val) {
		if ((val == "0") || (val == "1")) document.getElementById('ap_preWork').style.display = "";
		else document.getElementById('ap_preWork').style.display = "none";
	}
	function show_hideCoAdd(val) {
		if ((val == "0") || (val == "1")) document.getElementById('co_preAddress').style.display = "";
		else document.getElementById('co_preAddress').style.display = "none";
	}
	function show_hideCoWrk(val) {
		if ((val == "0") || (val == "1")) document.getElementById('co_preWork').style.display = "";
		else document.getElementById('co_preWork').style.display = "none";
	}
	function show_hidePrevious(val) {
		if ((val == "Yes")) document.getElementById('bnk_pre').style.display = "";
		else document.getElementById('bnk_pre').style.display = "none";
	}
	function show_hidePrvFin(val) {
		if	((val == "") || (val == "Never")) document.getElementById('prvFin').style.display = "none";
		else document.getElementById('prvFin').style.display = "";
	}
	function show_hidePrvRepo(val) {
		if ((val == "Less than a year ago") || (val == "1 - 3 years") || (val == "More than 3 years ago")) document.getElementById('prvRepo').style.display = "";
		else document.getElementById('prvRepo').style.display = "none";
	}
	function show_hideBankrupt(val) {
		if ((val == "Discharged")) document.getElementById('bankDischrgd').style.display = "";
		else document.getElementById('bankDischrgd').style.display = "none";
	}
	function show_hideTrade(val) {
		if ((val == "Yes")) document.getElementById('tradeIn').style.display = "";
		else document.getElementById('tradeIn').style.display = "none";
	}
	function show_hide(theID, val) {
	    if ((val == "") || (val== "0") || (val == "1")) {
             document.all(theID).style.display = "";
	    }  else {
             document.all(theID).style.display = "none";
	    }
	}


// Add to Favorites
	var bookmarkurl="http://www.carcityofdanbury.com"
	var bookmarktitle="CarCityofDanbury.com - Quality Used Vehicles"
	function addbookmark(){window.external.AddFavorite(bookmarkurl,bookmarktitle)}


// Icon Swap
	image1 = "images/Common/Header/themeOff.gif"  
	image2 = "images/Common/Header/themeOn.gif"
	function imgover(imgname){imgname.src = image2}
	function imgout(imgname){imgname.src = image1}

	image3 = "images/Common/KBB/bulletOff.gif"  
	image4 = "images/Common/KBB/bulletOn.gif"
	function img2over(img2name){img2name.src = image4}
	function img2out(img2name){img2name.src = image3}

	image5 = "images/Common/Icons/topOff.gif"  
	image6 = "images/Common/Icons/topOn.gif"
	function img3over(img3name){img3name.src = image6}
	function img3out(img3name){img3name.src = image5}

	image7 = "images/Common/Icons/backOff.gif"  
	image8 = "images/Common/Icons/backOn.gif"
	function img4over(img4name){img4name.src = image8}
	function img4out(img4name){img4name.src = image7}


// "Show Hidden Layers" (Left Nav)
	var origWidth, origHeight;
		if (document.layers) {
			origWidth = window.innerWidth; origHeight = window.innerHeight;
			window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
		}
	var cur_lyr; // holds id of currently visible layer
	function swapLayers(id) {
	  if (cur_lyr) hideLayer(cur_lyr);
		  showLayer(id);
		  cur_lyr = id;
		}
	function showLayer(id) {
		var lyr = getElemRefs(id);
		if (lyr && lyr.css) lyr.css.visibility = "visible";
	}
	function hideLayer(id) {
		var lyr = getElemRefs(id); 
  if (lyr && lyr.css) lyr.css.visibility = "hidden";
}
function getElemRefs(id) {
 var el = (document.getElementById)? document.getElementById(id): (document.all)? document.all[id]: (document.layers)? getLyrRef(id,document): null;
 if (el) el.css = (el.style)? el.style: el;
 return el;
}
// get reference to nested layer for ns4
function getLyrRef(lyr,doc) {
 if (document.layers) {
  var theLyr;
  for (var i=0; i<doc.layers.length; i++) {
    theLyr = doc.layers[i];
   if (theLyr.name == lyr) return theLyr;
   else if (theLyr.document.layers.length > 0) 
      if ((theLyr = getLyrRef(lyr,theLyr.document)) != null)
     return theLyr;
   }
  return null;
  }
}
swapLayers('LinkHide');


// Textbox Comment Limit
	var ns6=document.getElementById&&!document.all

	function restrictinput(maxlength,e,placeholder){
		if (window.event&&event.srcElement.value.length>=maxlength) 
		return false
		else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
		var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
		if (pressedkey.test(String.fromCharCode(e.which)))
			e.stopPropagation()
		}
	}
	function countlimit(maxlength,e,placeholder){
		var theform=eval(placeholder)
		var lengthleft=maxlength-theform.value.length
		var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
		if (window.event||e.target&&e.target==eval(placeholder)){
		if (lengthleft<0)
			theform.value=theform.value.substring(0,maxlength)
			placeholderobj.innerHTML=lengthleft
		}
	}
	function displaylimit(theform,thelimit){
		var limit_text='<span id="'+theform.toString()+'">'+thelimit+'</span> characters remaining.'
		if (document.all||ns6)
			document.write(limit_text)
		if (document.all){
			eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
			eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
		}
		else if (ns6){
			document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
			document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
		}
	}


// Input Character Count
	function textCounter(field, countfield, maxlimit) {
		if (field.value.length > maxlimit)
		
		// if too long...trim it!
			field.value = field.value.substring(0, maxlimit);

		// otherwise, update 'characters left' counter
		else 
			countfield.value = maxlimit - field.value.length;
	}


// 'Agree To Terms' Checkbox
	function checkme() {
		missinginfo = "";
		if (!document.ContactForm.agree.checked) {missinginfo += "You must read and agree to the terms!\n Please check \"I Agree\" to continue.";
		alert(missinginfo);	return false;} else {return true;}
	}


// Warranty Diagrams
	Image1 = new Image()
	Image1.src = "images/Common/Warranty/Diagram/01.jpg"
	Image1a = new Image()
	Image1a.src = "images/quote_sell.jpg"

	Image2 = new Image()
	Image2.src = "images/Common/Warranty/Diagram/02.jpg"
	Image2a = new Image()
	Image2a.src = "images/quote_sell.jpg"

	Image3 = new Image()
	Image3.src = "images/Common/Warranty/Diagram/03.jpg"
	Image3a = new Image()
	Image3a.src = "images/quote_sell.jpg"

	Image4 = new Image()
	Image4.src = "images/Common/Warranty/Diagram/04.jpg"
	Image4a = new Image()
	Image4a.src = "images/quote_sell.jpg"

	Image5 = new Image()
	Image5.src = "images/Common/Warranty/Diagram/05.jpg"
	Image5a = new Image()
	Image5a.src = "images/quote_sell.jpg"

	Image6 = new Image()
	Image6.src = "images/Common/Warranty/Diagram/06.jpg"
	Image6a = new Image()
	Image6a.src = "images/quote_sell.jpg"

	Image7 = new Image()
	Image7.src = "images/Common/Warranty/Diagram/07.jpg"
	Image7a = new Image()
	Image7a.src = "images/quote_sell.jpg"

	Image8 = new Image()
	Image8.src = "images/Common/Warranty/Diagram/08.jpg"
	Image8a = new Image()
	Image8a.src = "images/quote_sell.jpg"

	Image9 = new Image()
	Image9.src = "images/Common/Warranty/Diagram/09.jpg"
	Image9a = new Image()
	Image9a.src = "images/quote_sell.jpg"

	Image10 = new Image()
	Image10.src = "images/Common/Warranty/Diagram/10.jpg"
	Image10a = new Image()
	Image10a.src = "images/quote_sell.jpg"

	Image11 = new Image()
	Image11.src = "images/Common/Warranty/Diagram/11.jpg"
	Image11a = new Image()
	Image11a.src = "images/quote_sell.jpg"

	Image12 = new Image()
	Image12.src = "images/Common/Warranty/Diagram/12.jpg"
	Image12a = new Image()
	Image12a.src = "images/quote_sell.jpg"

	Image13 = new Image()
	Image13.src = "images/Common/Warranty/Diagram/13.jpg"
	Image13a = new Image()
	Image13a.src = "images/quote_sell.jpg"

	Image14 = new Image()
	Image14.src = "images/Common/Warranty/Diagram/14.jpg"
	Image14a = new Image()
	Image14a.src = "images/quote_sell.jpg"

	Image15 = new Image()
	Image15.src = "images/Common/Warranty/Diagram/15.jpg"
	Image15a = new Image()
	Image15a.src = "images/quote_sell.jpg"

	Image16 = new Image()
	Image16.src = "images/Common/Warranty/Diagram/16.jpg"
	Image16a = new Image()
	Image16a.src = "images/quote_sell.jpg"

	Image17 = new Image()
	Image17.src = "images/Common/Warranty/Diagram/17.jpg"
	Image17a = new Image()
	Image17a.src = "images/quote_sell.jpg"

	Image18 = new Image()
	Image18.src = "images/Common/Warranty/Diagram/18.jpg"
	Image18a = new Image()
	Image18a.src = "images/quote_sell.jpg"

	Image19 = new Image()
	Image19.src = "images/Common/Warranty/Diagram/19.jpg"
	Image19a = new Image()
	Image19a.src = "images/quote_sell.jpg"

	Image20 = new Image()
	Image20.src = "images/Common/Warranty/Diagram/20.jpg"
	Image20a = new Image()
	Image20a.src = "images/quote_sell.jpg"

	Image21 = new Image()
	Image21.src = "images/Common/Warranty/Diagram/21.jpg"
	Image21a = new Image()
	Image21a.src = "images/quote_sell.jpg"

	Image22 = new Image()
	Image22.src = "images/Common/Warranty/Diagram/00.jpg" 
	Image22a = new Image()
	Image22a.src = "images/quote_main.jpg" 

	function rolllog1() {document.diagram.src = Image1.src; return true}
	function rolllog2() {document.diagram.src = Image2.src; return true}
	function rolllog3() {document.diagram.src = Image3.src; return true}
	function rolllog4() {document.diagram.src = Image4.src; return true}
	function rolllog5() {document.diagram.src = Image5.src; return true}
	function rolllog6() {document.diagram.src = Image6.src; return true}
	function rolllog7() {document.diagram.src = Image7.src; return true}
	function rolllog8() {document.diagram.src = Image8.src; return true}
	function rolllog9() {document.diagram.src = Image9.src; return true}
	function rolllog10() {document.diagram.src = Image10.src; return true}
	function rolllog11() {document.diagram.src = Image11.src; return true}
	function rolllog12() {document.diagram.src = Image12.src; return true}
	function rolllog13() {document.diagram.src = Image13.src; return true}
	function rolllog14() {document.diagram.src = Image14.src; return true}
	function rolllog15() {document.diagram.src = Image15.src; return true}
	function rolllog16() {document.diagram.src = Image16.src; return true}
	function rolllog17() {document.diagram.src = Image17.src; return true}
	function rolllog18() {document.diagram.src = Image18.src; return true}
	function rolllog19() {document.diagram.src = Image19.src; return true}
	function rolllog20() {document.diagram.src = Image20.src; return true}
	function rolllog21() {document.diagram.src = Image21.src; return true}
	function originallog() {document.diagram.src = Image22.src; document.quote.src = Image22a.src; return true; 
	}
	adImages = new Array("images/Common/Warranty/Diagram/00.jpg", "images/Common/Warranty/Diagram/01.jpg", "images/Common/Warranty/Diagram/02.jpg", "images/Common/Warranty/Diagram/03.jpg", "images/Common/Warranty/Diagram/04.jpg", "images/Common/Warranty/Diagram/05.jpg", "images/Common/Warranty/Diagram/06.jpg", "images/Common/Warranty/Diagram/07.jpg", "images/Common/Warranty/Diagram/08.jpg", "images/Common/Warranty/Diagram/09.jpg", "images/Common/Warranty/Diagram/10.jpg", "images/Common/Warranty/Diagram/11.jpg", "images/Common/Warranty/Diagram/12.jpg", "images/Common/Warranty/Diagram/13.jpg", "images/Common/Warranty/Diagram/14.jpg", "images/Common/Warranty/Diagram/15.jpg", "images/Common/Warranty/Diagram/16.jpg", "images/Common/Warranty/Diagram/17.jpg", "images/Common/Warranty/Diagram/18.jpg", "images/Common/Warranty/Diagram/19.jpg", "images/Common/Warranty/Diagram/20.jpg", "images/Common/Warranty/Diagram/21.jpg")


// "Same Address / Phone As Primary Applicant" Script
	var co_ph1 = "";
	var co_ph2 = "";
	var co_ph3 = "";

	var co_add1 = "";
	var co_add2 = "";
	var co_add3 = 0;
	var co_add4 = "";
	var co_add5 = 0;
	var co_add6 = 0;
	var co_add7 = 0;
	var co_add8 = "";

	function InitSaveVariables(form) {
		co_add1 = form.co_add1.value; 
		co_add2 = form.co_add2.value; 
		co_add3Index = form.co_add3.selectedIndex; 
		co_add4 = form.co_add4.value; 
		co_add5Index = form.co_add5.selectedIndex; 
		co_add6Index = form.co_add6.selectedIndex; 
		co_add7Index = form.co_add7.selectedIndex; 
		co_add8 = form.co_add8.value;
	}

	function SamePhone(form) {
	if (form.copy.checked) {InitSaveVariables(form);
		form.co_ph1.value = form.ap_ph1.value; 
		form.co_ph2.value = form.ap_ph2.value; 
		form.co_ph3.value = form.ap_ph3.value; 
	}
	else {
		form.co_ph1.value = co_ph1; 
		form.co_ph2.value = co_ph2; 
		form.co_ph3.value = co_ph3; 
	}
}

	function SameAddress(form) {
	if (form.copy.checked) {InitSaveVariables(form);
		form.co_add1.value = form.ap_add1.value; 
		form.co_add2.value = form.ap_add2.value; 
		form.co_add3.selectedIndex = form.ap_add3.selectedIndex; 
		form.co_add4.value = form.ap_add4.value; 
		form.co_add5.selectedIndex = form.ap_add5.selectedIndex; 
		form.co_add6.selectedIndex = form.ap_add6.selectedIndex; 
		form.co_add7.selectedIndex = form.ap_add7.selectedIndex; 
		form.co_add8.value = form.ap_add8.value;
	}
	else {
		form.co_add1.value = co_add1; 
		form.co_add2.value = co_add2; 
		form.co_add3.selectedIndex = co_add3Index; 
		form.co_add4.value = co_add4; 
		form.co_add5.selectedIndex = co_add5Index; 
		form.co_add6.selectedIndex = co_add6Index; 
		form.co_add7.selectedIndex = co_add7Index; 
		form.co_add8.value = co_add8;
	}
}


// Dropdown Redirect
	function faqRedirect(selectBox) {
		var faqURL = selectBox.options[selectBox.selectedIndex].value
			if (faqURL != "")
		{
			if (faqURL.substr(0, 4) != "http")
				faqURL = "../" + faqURL
			location.href = faqURL
		}
	}


// Image Swap/ Restore/ Preload Script
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];}
}

function imageholderclass(){
	this.over=new Array();
	this.down=new Array();
	this.src=new Array();
	this.store=store;
	
	function store(src, down, over){
		var AL=this.src.length;
		this.src[AL]=new Image(); this.src[AL].src=src;
		this.over[AL]=new Image(); this.over[AL].src=over;
		this.down[AL]=new Image(); this.down[AL].src=down;
	}
}

var ih = new imageholderclass();
var mouseisdown=0;

function preloader(t){
	for(i=0;i<t.length;i++){
		if(t[i].getAttribute('srcover')||t[i].getAttribute('srcdown')){
			
			storeimages(t[i]);
			var checker='';
			checker=(t[i].getAttribute('srcover'))?checker+'A':checker+'';
			checker=(t[i].getAttribute('srcdown'))?checker+'B':checker+'';
			
			switch(checker){
			case 'A' : mouseover(t[i]);mouseout(t[i]); break;
			case 'B' : mousedown(t[i]); mouseup2(t[i]); break;
			case 'AB' : mouseover(t[i]);mouseout(t[i]); mousedown(t[i]); mouseup(t[i]); break;
			default : return;			
			}
			
			if(t[i].src){t[i].setAttribute("oldsrc",t[i].src);}
		}
	}
}
function mouseup(t){
	var newmouseup;
	if(t.onmouseup){
		t.oldmouseup=t.onmouseup;
		newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");this.oldmouseup();}

	}
	else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("srcover");}}
	t.onmouseup=newmouseup;
}

function mouseup2(t){
	var newmouseup;
	if(t.onmouseup){
		t.oldmouseup=t.onmouseup;
		newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");this.oldmouseup();}
		}
	else{newmouseup=function(){mouseisdown=0;this.src=this.getAttribute("oldsrc");}}
	t.onmouseup = newmouseup;
}

function mousedown(t){
	var newmousedown;
	if(t.onmousedown){
		t.oldmousedown=t.onmousedown;
		newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");this.oldmousedown();}}
	}
	else{newmousedown=function(){if(mouseisdown==0){this.src=this.getAttribute("srcdown");}}}
	t.onmousedown=newmousedown;
}

function mouseover(t){
	var newmouseover;
	if(t.onmouseover){
		t.oldmouseover=t.onmouseover;
		newmouseover=function(){this.src=this.getAttribute("srcover");this.oldmouseover();}
	}
	else{newmouseover=function(){this.src=this.getAttribute("srcover");}}
	t.onmouseover=newmouseover;
}

function mouseout(t){
	var newmouseout;
	if(t.onmouseout){
		t.oldmouseout=t.onmouseout;
		newmouseout=function(){this.src=this.getAttribute("oldsrc");this.oldmouseout();}
	}
	else{newmouseout=function(){this.src=this.getAttribute("oldsrc");}}
	t.onmouseout=newmouseout;
}

function storeimages(t){
	var s=(t.getAttribute('src'))?t.getAttribute('src'):'';
	var d=(t.getAttribute('srcdown'))?t.getAttribute('srcdown'):'';
	var o=(t.getAttribute('srcover'))?t.getAttribute('srcover'):'';
	ih.store(s,d,o);
}

function preloadimgsrc(){
	if(!document.getElementById) return;
	var it=document.getElementsByTagName('IMG');
	var it2=document.getElementsByTagName('INPUT');
	preloader(it);
	preloader(it2);
}

if(window.addEventListener){window.addEventListener("load", preloadimgsrc, false);} 
else{
	if(window.attachEvent){window.attachEvent("onload", preloadimgsrc);}
	else{if(document.getElementById){window.onload=preloadimgsrc;}}
}