// JavaScript Document

function Flash(){
	var params={
		quality:"high"
	};
	var flashvars={
		act:"ru"
	}
	swfobject.embedSWF("/images/autocar.swf", "header", "980", "160", "8.0.0", "/javascripts/swfobject/expressInstall.swf",flashvars,params);
}

function crSelect(str){
	var sel=Elemnt('select',{'id':'model','name':'model'});
	if(str==1) var optn=Elemnt('option','','','Загрузка...');
	else var optn=Elemnt('option','','','Все модели');
	optn.value='0';
	sel.appendChild(optn);
	if(str && str!=1){
		if(isIE()!=0){
			var txt=str.match(/[^>]+(?=<\/option>)/g);
			var val=str.match(/\d+(?=>)/g);
			for(var i=0;i<txt.length;i++){
				optn=Elemnt('option','','',txt[i]);
				optn.value=val[i];
				sel.appendChild(optn);
			}
		} else {
			str='<option value="0">Все модели</option>'+str;
			sel.innerHTML=str;
		}
	}
	return sel;
}
function searcH(){
	if(geBi('trademark').value=='0') blinK(geBi('trademark_f'),0,0);
	else document.forms['search'].submit();
}
function blinK(item,i,a){
	var v,tm;
	if(a<3){
		if(i<20){
			v=(i<10) ? (9-i) : (i-9);
			opaciTy(item,v);
			tm=setTimeout(function(){blinK(item,i+1,a);},30);
		}else{
			a++;
			tm=setTimeout(function(){blinK(item,0,a);},30);
		}
	}else clearTimeout(tm);
}
function reSel(sel){
	geBi('model').parentNode.replaceChild(sel,geBi('model'));
	if(geBi('model').nextSibling) geBi('model').parentNode.removeChild(geBi('model').nextSibling);
	repSel({'model':'model'});
}
function retModels(item){
	if(item.value!='0'){
		var param='producer='+item.value;
		var sel=crSelect(1);
		reSel(sel);
		httpReq('POST','/get-current-models-list.php',param);
	}else{
		var sel=crSelect('');
		reSel(sel);
	}
}

function iniSearch(){
	var sel_1=geBi('trademark');
	//sel_1.firstChild.setAttribute('selected','selected');
	var sel_2=Elemnt('select',{'id':'model','name':'model'});
	geBi('model_cont').replaceChild(sel_2,geBi('model'));
	var optn=Elemnt('option','','','Все модели');
	optn.value='0';
	sel_2.appendChild(optn);
	repSel({'trademark':'trademark','model':'model'},99);
	sel_1.parentNode.nextSibling.style.marginLeft=(isIE()==1)? '119px':'238px';
	geBi('search_submit').style.marginLeft='181px';
}

function obj_clSe(item){
	inVis(item.id+'_child');
	coL(item,'active');
	evnT(item,'reQ(this);');
}

function coLor(el,indx){
	if((indx/2+' ').indexOf('.')==-1){
		tr[el].className='gray';
	}
}

function operaFix(){
	if(navigator.userAgent.match(/Opera/i) != null){
		var sheet=document.styleSheets[0];
		var rules=sheet.cssRules.length;
		sheet.insertRule('table.auto td.object { border-width:1px; }', rules);
		sheet.insertRule('table.auto thead th div { margin:0; }', rules+1);
	}
}

function linK(item){
	evnT(tr[item],'reQ(this);');
	evnT(tr[item],'coL(this,"over");',1);
	evnT(tr[item],'coL(this,"over");',2);
	tr[item].style.cursor='pointer';
}

function reQ(item){
	coL(item,'active');
	if(!geBi(item.id+'_child')){
		crTr(item);
	}else{
		viS(item.id+'_child');
		evnT(item,'obj_clSe(this);');
	}
}

function Style(item,st_arr){
	for(key in st_arr){
		item.style[key]=st_arr[key];
	}
}

function Elemnt(name,attrs,style,text){
    var e=document.createElement(name);
    if(attrs){
        for(key in attrs){
            if(key=='class') e.className=attrs[key];
            else if(key=='id') e.id=attrs[key];
            else e.setAttribute(key, attrs[key]);
        }
    }
    if(style){
        for(key in style){
            e.style[key]=style[key];
        }
    }
    if(text){
        e.appendChild(document.createTextNode(text));
    }
    return e;
}

function findCh(par,name,num){
	par=par.childNodes;
	var str=new RegExp(name.toUpperCase());
	var n=[];
	for(var i=0;i<par.length;i++){
		if(str.test(par[i].nodeName.toString())!=false)
		n.push(par[i]);
	}
	if(!num) num=0;
	if(n[num]) return n[num];
	else return false;
}
	
function crTr(item){
	var cont=document.createElement('tr');
	cont.id=item.id+'_child';
	var elm=document.createElement('td');
	elm.className='object load';
	evnT(item,'obj_clSe(this);');
	item.parentNode.insertBefore(cont, item.nextSibling);
	cont.appendChild(elm);
	elm.setAttribute('colSpan','6');
	var str=findCh(findCh(item,'td'),'a').href+'-ajax.html';
	httpReq('GET',str,'auto='+item.id,elm);
}

function coL(item,clss){
	item.className = item.className.indexOf(clss)==-1 ? item.className+' '+clss : item.className.replace(clss,'','g');
}

function evnT(elm,str,flag){
	var evnt='onclick';
	if(flag==1){ evnt='onmouseover'; }
	else if(flag==2){ evnt='onmouseout'; }
	if(isIE()==0){ elm.setAttribute(evnt,str); }
	else{ eval('elm.'+evnt+'= function (){ '+str+' };'); }
}

function bookmark(){
	var ztitle=document.title;
	var url=document.URL;
	if(window.opera && window.print){
		alert("Ваш браузер Opera не поддерживает автоматическое добавление в Закладки.\n Чтобы добавить эту страницу самостоятельно, нажмите OK, а потом клавиши Ctrl+D.");
	}else if(navigator.userAgent.indexOf('Chrome')!=-1){
		alert("Ваш браузер Google Chrome не поддерживает автоматическое добавление в Закладки.\n Чтобы добавить эту страницу самостоятельно, нажмите OK, а потом клавиши Ctrl+D.");
	}else if(navigator.userAgent.indexOf('Safari')!=-1){
		alert("Ваш браузер Safari не поддерживает автоматическое добавление в Закладки.\n Чтобы добавить эту страницу самостоятельно, нажмите OK, а потом клавиши Ctrl+D.");
	}else if(document.all){
		window.external.AddFavorite(url, ztitle);
	}else if (window.sidebar){
		if(window.sidebar!=geBi('sidebar')) window.sidebar.addPanel(ztitle, url, ztitle);
	}
}

function geBi(item){
	return document.getElementById(item);
}

function inVis(item){
	geBi(item).style.display='none';

}

function viS(item){
	geBi(item).style.display='';
}

function viSi(item){
	geBi(item).style.display='block';
}

function aniB(item){
	item.style.backgroundPosition='left bottom';
}

function deaniB(item){
	item.style.backgroundPosition='left top';
}

function deaniBa(item){
	item.style.cursor='pointer';
	item.style.backgroundPosition='left -44px';
}

function deOp(item){
	item.style.opacity='1';
	item.style.filter='alpha(opacity=100, style=0)';
}

function opaciTy(item,val){
	item.style.opacity=val/10;
	item.style.filter='alpha(opacity='+val*10+', style=0)';
}

function isIE(){
	if (navigator.userAgent.match(/MSIE 7/i) != null) return 2;
	else if (navigator.userAgent.match(/MSIE 6/i) != null) return 1;
	else return 0;
}

function chCSS(stnum,obj,rule){
	var mysheet=document.styleSheets[stnum];
	if(isIE()!=0){ mysheet.addRule(obj,rule); }
	else { mysheet.insertRule(obj+' { '+rule+'; }', 1); }
}

function aniMe(node,flag){
	if(flag){ 
		if(node.className.indexOf('active')==-1){ node.style.backgroundPosition='left -'+node.clientHeight+'px'; }
		else{ node.style.cursor='pointer'; }
		if(node.firstChild){ 
			if(node.firstChild.nodeName=='A'){ node.firstChild.style.color='#00FF00'; } 
		}
	}else{
		if(node.className.indexOf('active')==-1){ node.style.backgroundPosition='left top'; }
		if(node.firstChild){ 
			if(node.firstChild.nodeName=='A'){ node.firstChild.style.color='#CCCCCC'; }
		}
	}
}

function setAt(nodes){
	for(var i=0;i<nodes.length;i++){
		var str=/active/g;
		if(nodes[i].nodeName=='LI' && nodes[i].firstChild.nodeName=='A'){
			evnT(nodes[i],'aniMe(this,1);',1);
			evnT(nodes[i],'aniMe(this);',2);
			evnT(nodes[i],'document.location="'+nodes[i].firstChild.getAttribute('href')+'"');
		}
	}
}

function weRe(){
	geBi('where_ul').className = geBi('where_ul').className=='inv' ? 'vis' : 'inv';
}

function selecT(item, val){
	geBi('where_is').setAttribute('value',item.firstChild.nodeValue);
	var nodes=item.parentNode.childNodes;
	for(var i=0;i<nodes.length;i++){
		if(nodes[i].nodeName=='LI'){
			if(nodes[i].className.indexOf('select')!=-1){
				nodes[i].className=nodes[i].className.replace('select','','g');
			}
		}
	}
	item.className+=' select';
	geBi('where').setAttribute('value', val);
	weRe();
}

function initObj(){
	var td=document.getElementsByTagName('td');
	for(var i=0;i<td.length;i++){
		if(td[i].className=='object'){
			operaFix();
			var dh=td[i].clientHeight;
		}else if(td[i].className=='gallery'){
			var fix=0;
			if(navigator.userAgent.match(/Gecko/i)!= null) fix=1;
			var div=td[i].firstChild.firstChild;
			var divh=div.clientHeight*1+12+fix;
			if(divh<dh*1){
				div.style.height=dh-12+fix+'px';
			}
		}
	}
}


function  getPageSize(){
	var xScroll,yScroll,yScrPos,xScrPos;
	yScrPos=0;
	xScrPos=0;
	if (document.body && typeof document.body.scrollTop != 'undefined') {
		yScrPos+= document.body.scrollTop;
		xScrPos+= document.body.scrollLeft;
		if(document.body.parentNode && typeof document.body.parentNode.scrollTop!= 'undefined'){
			yScrPos+= document.body.parentNode.scrollTop;
			xScrPos+= document.body.parentNode.scrollLeft;
		}
	}else if (typeof window.pageXOffset != 'undefined'){
			yScrPos+= window.pageYOffset;
			xScrPos+= window.pageXOffset;
	}
	if(window.innerHeight && window.scrollMaxY){
		xScroll=document.width;
		yScroll=window.innerHeight+window.scrollMaxY;
	}else if(document.body.scrollHeight>document.body.offsetHeight){ // all but Explorer Mac
		xScroll=document.body.scrollWidth;
		yScroll=document.body.scrollHeight;
	}else if(document.documentElement && document.documentElement.scrollHeight>document.documentElement.offsetHeight){ // Explorer 6 strict mode
		xScroll=document.documentElement.scrollWidth;
		yScroll=document.documentElement.scrollHeight;
	}else{ // Explorer Mac...would also work in Mozilla and Safari
		xScroll=document.body.offsetWidth;
		yScroll=document.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if(self.innerHeight){ // all except Explorer
		windowWidth=self.innerWidth;
		windowHeight=self.innerHeight;
	}else if(document.documentElement && document.documentElement.clientHeight){ // Explorer 6 Strict Mode
		windowWidth=document.documentElement.clientWidth;
		windowHeight=document.documentElement.clientHeight;
	}else if(document.body){ // other Explorers
		windowWidth=document.body.clientWidth;
		windowHeight=document.body.clientHeight;
	}
	// for small pages with total height less then height of the viewport
	if(yScroll<windowHeight){
		pageHeight=windowHeight;
	}else{
		pageHeight=yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll<windowWidth){
		pageWidth=windowWidth;
	}else{
		pageWidth=xScroll;
	}
	return [pageWidth,pageHeight,windowWidth,windowHeight,xScrPos,yScrPos];
}

function popUp(item,width,height,to){
	var itnode=document.getElementsByTagName('body')[0];
	var sizes=getPageSize().toString().split(',');
	var bgr=geBi('backgr');
	var top=Math.round(sizes[3]/2+sizes[5]*1-40);
	var left=Math.round(sizes[2]/2+sizes[4]*1-110);
	bgr.style.height=sizes[1]+'px';
	if(navigator.userAgent.match(/Gecko/i)!= null) { bgr.style.width=sizes[0]*1+sizes[4]*1+'px'; }
	else{ bgr.style.width=sizes[0]+'px'; }
	opaciTy(bgr,8);
	bgr.style.backgroundPosition=left+'px '+top+'px';
	var popup=geBi('popup');
	var npopup=popup.cloneNode(true);
	itnode.insertBefore(npopup,itnode.firstChild);
	popup.parentNode.removeChild(popup);
	viSi('popup');
	var frame=geBi('photo_frame');
	if(item.firstChild.nodeName=='IMG'){
		var pathr=item.getAttribute('href');
		var tmp=pathr.split('/');
		var img_id=(tmp[tmp.length-2]+tmp[tmp.length-1]).replace('.','_');
		if(geBi(img_id)!=null){
			var img=geBi(img_id);
			geBi('footer').removeChild(img);
			frame.appendChild(img);
			img.style.display='block';
			width=parseInt(img.offsetWidth);
			height=parseInt(img.offsetHeight);
			img.onclick=function() { cloSe(this); }
			fraMe(frame,img,sizes,width,height);
		}else{
			var img=new Image();
			img.onload=function(){
				img.onclick=function() { cloSe(this); }
				var frame=geBi('photo_frame');
				frame.appendChild(img);
				height=img.offsetHeight;
				width=img.offsetWidth;
				sizes=getPageSize().toString().split(',');
				fraMe(frame,img,sizes,width,height);
			}
			img.src = pathr;
		}
	}else if(item.id=='calculator_popup'){
		var message=item.cloneNode(true);
		item.parentNode.removeChild(item);
		frame.appendChild(message);
		geBi('pay_summ').value=to;
		iniCalc();
		repSel({'pay_type':'class_1','month':'class_2'},999);
		if(/Webkit/i.exec(navigator.userAgent) != null) geBi('pay_type_f').style.marginTop='-3px';
		geBi('popup_c').innerHTML='рассчет кредита:';
		message.style.display='block';
		fraMe(frame,'',sizes,width,height);
	}else{
		var message=item.cloneNode(true);
		item.parentNode.removeChild(item);
		frame.appendChild(message);
		reLoad();
		geBi('popup_c').innerHTML='пишите нам:';
		if(to){
			var tr=to.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling;
			var td=[];
			for(var i=0;i<tr.childNodes.length;i++){
				if(tr.childNodes[i].nodeName=='TD') td.push(tr.childNodes[i]);
			}
			geBi('auto_name').value=td[0].firstChild.innerHTML+' '+td[1].innerHTML+', '+td[2].innerHTML+'.  ID: '+tr.id;
			geBi('auto_w').style.display='block';
		}
		message.style.display='block';
		fraMe(frame,'',sizes,width,height);
	}
}

function fraMe(frame,img,sizes,width,height){
	var top,left;
	var maxh=32+height;
	if(img){
			if(maxh>sizes[3] || width>sizes[2]){
				if(maxh/sizes[3]>width/sizes[2]){
					var old=height;
					height=(sizes[3]-30);
					img.style.height=height+'px';
					top=sizes[3]/2+sizes[5]*1-Math.round(height/2)-15;
					width=Math.round(width*height/old);
					img.style.width=width+'px';
					left=sizes[2]/2-Math.round(width/2);
				}else{
					var old=width;
					width=sizes[2];
					img.style.width=width+'px';
					left=sizes[2]/2-Math.round(width/2);
					height=Math.round(height*width/old);
					img.style.height=height+'px';
					top=sizes[3]/2+sizes[5]*1-Math.round(height/2)-15;
				}
			}else{
				top=sizes[3]/2+sizes[5]*1-Math.round(height/2)-15;
				left=sizes[2]/2-Math.round(width/2);
			}
	}else{
		top=sizes[3]/2+sizes[5]*1-Math.round(height/2)-15;
		left=sizes[2]/2-Math.round(width/2);
	}	
	frame.style.top=top+'px';
	frame.style.left=(left*1+sizes[4]*1)+'px';
	frame.style.width=width+'px';
	geBi('popup_c').style.width=(width-132)+'px';
	if(navigator.userAgent.match(/Gecko/i)!= null) { document.getElementsByTagName('body')[0].style.overflow='hidden'; }
}

function cloSe(item){
	if(geBi('photo_frame').lastChild.id=='calculator_popup'){
		document.forms['calculator'].reset();
		var sel=['pay_type','month'];
		for(var i=0;i<sel.length;i++){
			var selct=geBi(sel[i]);
			selct.className=selct.className.replace(/[\s]?rep_select/,'');
			selct.parentNode.removeChild(selct.nextSibling);
		}
	}
	var frame=geBi('photo_frame');
	var img_b=frame.lastChild.cloneNode(true);
	frame.style.top='-2000px';
	img_b.style.display='none';
	geBi('footer').appendChild(img_b);
	if(frame.lastChild.nodeName=='IMG'){
		var tmp=img_b.getAttribute('src').split('/');
		img_b.id=(tmp[tmp.length-2]+tmp[tmp.length-1]).replace('.','_');
	}else{ geBi('popup_c').innerHTML='&nbsp;'; }
	frame.removeChild(frame.lastChild);
	inVis('popup');
	if(navigator.userAgent.match(/Gecko/i)!= null) { document.getElementsByTagName('body')[0].style.overflow='auto'; }
}

function autoM(item){
	popUp(geBi('webmail_popup'),530,335,item);
}

function creD(sum){
	popUp(geBi('calculator_popup'),530,335,sum);
}

function httpReq(meth,pathr,params,elm){
	var xmlhttp=false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	 try {
	  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
	  try {
	   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
	   xmlhttp = false;
	  }
	 }
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	if (!xmlhttp && window.createRequest) {
		try {
			xmlhttp = window.createRequest();
		} catch (e) {
			xmlhttp=false;
		}
	}
	xmlhttp.open(meth,pathr,true);
	//Send the proper header information along with the request
	xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlhttp.setRequestHeader("Content-length", params.length);
	xmlhttp.setRequestHeader("Connection", "close");	
	xmlhttp.onreadystatechange=function () {
		if (xmlhttp.readyState==4) {
			var txt=xmlhttp.responseText;
			if(elm) Obj(txt,elm);
			else{
				var sel=crSelect(txt);
				reSel(sel);
			}
		}
	}
 	xmlhttp.send(params);
}

function Obj(txt,elm){
	elm.className=elm.className.replace(' load','','g');
	elm.innerHTML=txt;
	if (navigator.userAgent.match(/Opera/i) != null) var hght=elm.clientHeight-2;
	else var hght=elm.clientHeight-4;
	var gal=elm.firstChild.firstChild.firstChild.firstChild.firstChild;
	var div=gal.firstChild;
	div.style.display='block';
	var imgs=0;
	for(var i=0;i<div.childNodes.length;i++) if(div.childNodes[i].nodeName=='A') imgs++;
	var divh=imgs*99+6;
	gal.style.height=hght+'px';
	gal.nextSibling.style.height=hght+'px';
	gal.nextSibling.childNodes[2].style.height=(hght-64)+'px';
	var scr=gal.nextSibling.firstChild;
	scr.style.position='absolute';
	var scr_c=gal.nextSibling.firstChild.childNodes[1];
	if(divh>hght){
		if((2*hght-divh-76)>53){
			var maxscr=divh-hght;
			scr.setAttribute('alt',maxscr);
			scr.onmousedown = drag;
			window.document.onmousemove = move;
			window.document.onmouseup = drop;
			scr.nextSibling.onclick= function(){ moveGal(this.parentNode.previousSibling,-1); return false; }
			scr.nextSibling.nextSibling.nextSibling.onclick= function(){ moveGal(this.parentNode.previousSibling,1); return false; }
			scr_c.style.height=(2*hght-divh-76)+'px';
			scr_c.firstChild.style.marginTop=((Math.round(2*hght-divh-76)/2)-9)+'px';
			if (gal.addEventListener){
				gal.addEventListener('DOMMouseScroll', wheel, false);
			}
			gal.onmousewheel = wheel;
		}
	}else{
		div.style.height=hght-6+'px';
		gal.nextSibling.firstChild.style.display='none';
	}
}

// Gallery's scrollbar

var canDrag = false;
var minscr;
if(isIE()==2) minscr=-12;
else if(isIE()==1) minscr=-6;
else  minscr=20;
var mouseY,maxscr,nowpos,scroller,menu;

function drag(event){
    if(!event){ event=window.event; }
    canDrag=true;
	if(!this.style.marginTop) this.style.marginTop=minscr+'px';
	nowpos=parseInt(this.style.marginTop);
	maxscr=this.getAttribute('alt')*1+minscr;
	if(this.className=='scroll_c'){
		scroller=this.parentNode.firstChild;
		menu=this.parentNode.parentNode.previousSibling.firstChild;
	}else{ 
		scroller=this;
		menu=this.parentNode.previousSibling.firstChild;
	}
	// alert(event.srcElement.className);
	mouseY=event.clientY;
    blockEvent(event);
    return false;
}

function move(event){
    if(!event) event=window.event;
    if(canDrag){
	setPosition(event.clientY - mouseY);
        blockEvent(event);
    }
    return false;
}

function drop(){
    canDrag=false;
}

function setPosition(newPosition){
    if (newPosition+nowpos<=maxscr){
		if(newPosition+nowpos<=minscr){
			scroller.style.marginTop=minscr+'px';
			menu.style.marginTop=0+'px';
		}else{
			scroller.style.marginTop=(newPosition+nowpos) + 'px';
			menu.style.marginTop=((newPosition+nowpos-minscr)*(-1))+"px";
		}
    }else{
		scroller.style.marginTop=maxscr+'px';
		menu.style.marginTop=(maxscr-minscr)*(-1)+'px';
	}
	if(scroller.style.marginTop==minscr+'px'){
		menu.style.marginTop=0+'px';
	}
    return false;
}

function blockEvent(event){
    if(!event) event = window.event; 
    if(event.stopPropagation) event.stopPropagation();
    else event.cancelBubble = true;
    if (event.preventDefault) event.preventDefault();
    event.returnValue = false;
}

function wheel(event){
    var wheelDelta=0;
    if(!event) event = window.event;
    if(event.wheelDelta){
        wheelDelta = event.wheelDelta/120;
        if(window.opera)wheelDelta = event.wheelDelta/40;
    }else if(event.detail) wheelDelta = -event.detail;
    if(wheelDelta){
        var i=(wheelDelta<0) ? 1 : -1;
		moveGal(this,i);
    }
    blockEvent(event);
}

function moveGal(item,i){
	scroller=item.parentNode.childNodes[1].firstChild;
	menu=item.firstChild;
	maxscr=scroller.getAttribute('alt')*1+minscr;
    var step=99;
    nowpos=parseInt(scroller.style.marginTop);
    var newPosition=i*step;
    setPosition(newPosition);
}

function getElStyle(elem, prop){
	if(typeof elem!="object") elem=document.getElementById(elem);// external stylesheet for Mozilla, Opera 7+ and Safari 1.3+
	if(document.defaultView && document.defaultView.getComputedStyle){
		if(prop.match(/[A-Z]/)) prop=prop.replace(/([A-Z])/g, "-$1").toLowerCase();
		return document.defaultView.getComputedStyle(elem, "").getPropertyValue(prop);
	}// external stylesheet for Explorer and Opera 9
	if(elem.currentStyle){
		var i;
		while((i=prop.indexOf("-"))!=-1) prop=prop.substr(0, i)+prop.substr(i+1,1).toUpperCase()+ prop.substr(i+2);
		return elem.currentStyle[prop];
	}
	return "";
}
window.onload=function(){ iniSearch(); Flash(); }
