var temp="";
layer3d=false;

function preload(imgObj,imgSrc) {
	eval(imgObj+' = new Image()')
	eval(imgObj+'.src = "'+imgSrc+'"')
}

function ci(imgName,imgObj) {
	document.images[imgName].src = eval(imgObj+".src");
}

function cim(a,b){
	if (b==1){
	if (a==1){ci('s1','is_1');ci('mg1','ig1_on');ci('s2','is_2')}
	if (a==2){ci('s2','is_1');ci('mg2','ig2_on');ci('s3','is_2')}
	if (a==3){ci('s3','is_1');ci('mg3','ig3_on');ci('s4','is_2')}
	if (a==4){ci('s4','is_1');ci('mg4','ig4_on');ci('s5','is_2')}
	if (a==5){ci('s5','is_1');ci('mg5','ig5_on');ci('s6','is_2')}
	if (a==6){ci('s6','is_1');ci('mg6','ig6_on');}
	}
	if (b==0){
	if (a==1){ci('s1','is');ci('mg1','ig1');ci('s2','is')}
	if (a==2){ci('s2','is');ci('mg2','ig2');ci('s3','is')}
	if (a==3){ci('s3','is');ci('mg3','ig3');ci('s4','is')}
	if (a==4){ci('s4','is');ci('mg4','ig4');ci('s5','is')}
	if (a==5){ci('s5','is');ci('mg5','ig5');ci('s6','is')}
	if (a==6){ci('s6','is');ci('mg6','ig6');}
	}
}


d=document;

function sub(){
	
	document.search.submit();
}


function go(a){
	if (document.searchstyle.sstyle[document.searchstyle.sstyle.selectedIndex].value=="popup"){
		ablak(a);
	}else{
		document.location.href="/auto_vpage.jsp?id="+a;
	}
}

function go_motor(a){
	if (document.searchstyle.sstyle[document.searchstyle.sstyle.selectedIndex].value=="popup"){
		motorablak(a);
	}else{
		document.location.href="/motor_vpage.jsp?id="+a;
	}
}

function ablakact(a,b){
	x=window.open('/auto_popup_fauto_act.jsp?id='+a,"autoweb","width=700,height=450,resizable=0,status=0,scrollbars=0,left=" + ((screen.width/2)-350) + ",top=" + ((screen.height/2)-225));       
	x.focus();

}



function ablak(a,b){
if (b=='autocity'){
	x=window.open('/auto_popup_fauto_ac.jsp?id='+a,"autoweb","width=700,height=450,resizable=0,status=0,scrollbars=0,left=" + ((screen.width/2)-350) + ",top=" + ((screen.height/2)-225));       
}else{
	x=window.open('/auto_popup_fauto.jsp?id='+a,"autoweb","width=700,height=450,resizable=0,status=0,scrollbars=1,left=" + ((screen.width/2)-350) + ",top=" + ((screen.height/2)-225));       
}
//http://www.autoweb.hu
	x.focus();

}

function motorablak(a){
	y=window.open('/motor_popup_fmotor.jsp?id='+a,"autoweb","width=700,height=450,resizable=0,status=0,scrollbars=0,left=" + ((screen.width/2)-395) + ",top=" + ((screen.height/2)-295));
	y.focus();
 }

function kedvencablak(a){
	y=window.open(a,"favorites","width=350,height=200,resizable=0,status=0,scrollbars=0,left=" + ((screen.width/2)-200) + ",top=" + ((screen.height/2)-125));
	y.focus();
 }

function refresh(){
	window.location.reload();
 }
 
function kedvencpic(a,b){
eval('document.'+a+'.src="/pix/buttons/kedvencek'+b+'"');
//window.alert(a+"  "+b)

}

function l3d(a){
if ((document.layers)||(document.all)){
	//
	z=window.open('/auto_3d.jsp?kod='+a,"autoweb3d","width=415,height=315,resizable=0,status=0,scrollbars=0,left=" + ((screen.width/2)-205) + ",top=" + ((screen.height/2)-155));
	z.focus();
}else{

	if (layer3d==false){
		MM_showHideLayers('3d','','show');layer3d=true;
	} else {
		MM_showHideLayers('3d','','hide');layer3d=false;
	}
}
}

function open3d(a){
	z=window.open('/3d/autoszalon/index.jsp?pic='+a,"autoweb3d","width=415,height=360,resizable=0,status=0,scrollbars=0,left=" + ((screen.width/2)-205) + ",top=" + ((screen.height/2)-180));
	z.focus();
}

function popup_3d(a){
	z=window.open('/3d.jsp?3d='+a,"3d","width=415,height=360,resizable=0,status=0,scrollbars=0,left=" + ((screen.width/2)-205) + ",top=" + ((screen.height/2)-180));
	z.focus();
}


function show(a){
	MM_showHideLayers('akcio','','hide');
	MM_showHideLayers('auto','','show');MM_changeProp('autokep','','src',a,'IMG');
}

function hide(a){
	MM_showHideLayers('akcio','','show');
	MM_showHideLayers('auto','','hide');
}

function MM_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_changeProp(objName,x,theProp,theValue) { //v3.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
}

 
function popup(a){
	x=window.open('/popup/motor.htm',"popup","width=391,height=550,resizable=0,status=0,scrollbars=0,left=0,top=0");       
	x.focus();
} 

function motorfeltolt(){
if (document.motorForm.sorder.value==document.motorForm.marka[document.motorForm.marka.selectedIndex].text){
	document.motorForm.sorder.value=document.motorForm.marka[document.motorForm.marka.selectedIndex].text+' '+document.motorForm.tipus.value;
	}
document.motorForm.submit()
} 

function autofeltolt(){
if (document.autoForm.sorder.value==document.autoForm.marka[document.autoForm.marka.selectedIndex].text){
	document.autoForm.sorder.value=document.autoForm.marka[document.autoForm.marka.selectedIndex].text+' '+document.autoForm.tipus.value;
	}
document.autoForm.submit()
} 


function popupCloser()
{
divel=document.getElementById("popup");
divel.style.visibility = 'hidden';
}


function thumbnail(a){
//        motor_tmb=window.open('http://jpg.motor.hu/thumbnail.php?'+a+'_1.jpg',"thumbnail",  "width=100,height=80,resizable=0,status=0,scrollbars=0, left=" + ((screen.width/2)-200) + ",top=" + ((screen.height/2)-100))
        motor_tmb=window.open('http://www.motor.hu/imageresizemotor.jsp?kod='+a,"thmb", "width=600,height=600,resizable=0,status=0,scrollbars=0, left=" + ((screen.width/2)-200) + ",top=" + ((screen.height/2)-100));
        motor_tmb.focus();
}

function adS(a){
    document.getElementById(a).style.visibility='visible';
}

function adH(a){
    document.getElementById(a).style.visibility='hidden';
}
