﻿/* vin dialog script */

(function(){var 
$=function(a){return(a.nodeName)?a:D.getElementById(a)},
$$=function(a,b){return(b||D).getElementsByTagName(a)},
D=document,F=false,L=function(a){return a.length},N,T=true,W=window,
G={
init:function(){for(var n in G)if(G[n].init)G[n].init()},
set:function(a,b,c){var o;for(o in b)a[o]=b[o];for(o in c)a.style[o]=c[o];return a},
mid:function(o,a,b){o=o.split(a);return(L(o)<2)?'':o[1].split(b)[0]},
create:function(a,b,c,d){var o=(d||D).createElement(a);G.set(o,b);G.set(o.style,c);return o},
append:function(a,b,c,d){var o=b.tagName?b:G.create(b,c,d,a.ownerDocument);a.appendChild(o);return o}
};G.set(W,{G:G,$:$,$$:$$,onload:G.init})})()

G.form={
close:function(){try{window.top.G.cta.close()}catch(e){window.close()}},
init:function(){
if(location.search.indexOf('ui=blankpage')>-1)return
//if(window.top.location==location)location.replace('/index.aspx?form='+location.href)
}
}

G.vin={status:1,n:' AJ BKS CLT DMU ENV FW GPX HY RZ'.split(' '),w:'8765432T098765432',
init:function(){
	var m=this
	if($('vin-bigimg'))$('vin-bigimg').onclick=m.fullImage
	if(navigator.userAgent.indexOf('Opera')==0){
		var o=$('frm-ac');if(o)o.className='opera'
		o=$('frm-ac2');if(o)o.className='opera'
	}
},
doCancel:function(){G.form.close()},
doAccept:function(){
	$('frm-main').style.display='none'
	$('acc0').style.display='none'
	$('frm-second').style.display='block'
	return false
},
doResult:function(){
	$('frm-main').style.display='none'
	$('frm-second').style.display='none'
	$('acc0').style.display='none'
	$('frm-result').style.display='block'
},
fullImage:function(){$('img-full-div').style.display='block';return false},
closeImage:function(){$('img-full-div').style.display='none'}
}

