function openWin1(url)
{
	var j=window.open(url,"jj","left=20, top=20, width=950,height=445,scrollbars=1") 
}

function openWin2(url)
{
	var j=window.open(url,"jj","left=20, top=20, width=300,height=320,scrollbars=no") 
}
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_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_showHideLayers() { //v6.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 spawnWindow(URL,Name,features)
{
		window.open(URL,Name,features);
}

function FuncBack()
{
	history.back();
	return true;
}

function ImageClick(car_color,car_name)
{
	document.getElementById("id_sel_car_image").innerHTML = "<img src=images/images/"+car_name+"_car_1_"+car_color+".gif alt="+car_name+" border=0 title="+car_name+" width=291 height=229>";
	document.getElementById("idhidn_car_color").value = car_color;
}

function ImageFocus(car_color,car_name)
{
	document.getElementById("id_sel_car_image").innerHTML = "<img src=images/images/"+car_name+"_car_1_"+car_color+".gif alt="+car_name+" border=0 title="+car_name+" width=291 height=229>";
}

function SetImage(car_name, car_color )
{
	hidn_color = document.getElementById("idhidn_car_color").value;
	if( !hidn_color )
	{
		if( !car_name )
		{
			document.getElementById("id_sel_car_image").innerHTML = "<img src=images/images/magnus_car_1_yellow.gif alt=vertex border=0 title=vertex width=291 height=229>";
		}
		else
		{
			if( car_name != "magnus" )
			{
				car_color = "";
			}
			else
			{
				if( !car_color )
					car_color = "_yellow";
				else
					car_color = "_"+car_color;
			}
			document.getElementById("id_sel_car_image").innerHTML = "<img src=images/images/"+car_name+"_car_1"+car_color+".gif alt="+car_name+" border=0 title="+car_name+" width=291 height=229>";
		}
	}
	else
	{
		if( !car_name )
		{
			document.getElementById("id_sel_car_image").innerHTML = "<img src=images/images/magnus_car_1_"+hidn_color+".gif alt=vertex border=0 title=vertex width=291 height=229>";
		}
		else
		{
			document.getElementById("id_sel_car_image").innerHTML = "<img src=images/images/"+car_name+"_car_1_"+hidn_color+".gif alt="+car_name+" border=0 title="+car_name+" width=291 height=229>";
		}
	}
}


function FuncGoHome()
{
	/*
	var confirmwindow = dhtmlmodal.open('ConfirmBox', 'iframe', 'modalfiles/confirm_page.htm','Confirmation Window','width=300px,height=150px,center=1,resize=0,scrolling=0');
	confirmwindow.onclose = function()
	{
		var theform = this.contentDoc.getElementById("frm_confirm"); //Access first form inside iframe just for your reference
		var btnok = this.theform.getElementById("id_btn_ok"); //Access form field with id="emailfield" inside iframe
	}
	*/
	
	if( confirm( "It will close the current page and redirect you to the home page" ) )
	{
		window.location = "logout.php";
		return true;
	}
	else
	{
		return false;
	}
}

function FuncReloadCaptcha()
{
	document.getElementById("captcha").src = 'captcha.php?'+Math.random();
}
