function addBookmark(title,url)
{
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	} else if( document.all ) {
		window.external.AddFavorite( url, title);
	} else if( window.opera && window.print ) {
		return true;
	}
}

function submitq()
{
	document.getElementById("qform").submit();
}

function checkTDForm()
{
	var cheking = true;
	var phone = document.getElementById("phone").value.toString();
	var email = document.getElementById("email").value.toString();
	
	if ( !document.getElementById("car").value )
	{
		cheking = false;
	}
	if ( phone == "" )
	{
		cheking = false;
	}
	if ( email == "")
	{
		cheking = false;
	}

	return cheking;
}

function ViewPhoto(url, width, height)
{
	var xMax = screen.width, yMax = screen.height;
	var xOffset = (xMax - width)/2, yOffset = (yMax - height)/2-25;

	window.open(url,"","scrollbars=0,statusbar=no,resizable=no,minimizable=1,width="+(width+20)+",height="+(height+25)+",top=" + yOffset + ",left=" + xOffset);
}

function ImgShw(ID, width, height, alt)
{
	var scroll = "no";
	var top=0, left=0;

	if ( width > screen.width-10 || height > screen.height-28 ) scroll = "yes";
	if ( height < screen.height-28 ) top = Math.floor((screen.height - height)/2-14);
	if ( width < screen.width-10 ) left = Math.floor((screen.width - width)/2-5);
	width = Math.min(width, screen.width-10);
	height = Math.min(height, screen.height-28);
	var wnd = window.open("","","scrollbars="+scroll+",resizable=yes,width="+width+",height="+height+",left="+left+",top="+top);
	wnd.document.write("<html><head>\n");
	wnd.document.write("<"+"script language='JavaScript'>\n");
	wnd.document.write("<!--\n");
	wnd.document.write("function KeyPress()\n");
	wnd.document.write("{\n");
	wnd.document.write("	if(window.event.keyCode == 27)\n");
	wnd.document.write("		window.close();\n");
	wnd.document.write("}\n");
	wnd.document.write("//-->\n");
	wnd.document.write("</"+"script>\n");
	wnd.document.write("<title>"+(alt == ""? "���⨭��":alt)+"</title></head>\n");
	wnd.document.write("<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onKeyPress=\"KeyPress()\">\n");
	wnd.document.write("<img src=\""+ID+"\" border=\"0\" alt=\""+alt+"\">");
	wnd.document.write("</body>");
	wnd.document.write("</html>");
	wnd.document.close();
}

function bg_over(obj) {
	obj.style.backgroundColor='#F2F9FF';
	}
function bg_out(obj) {
	obj.style.backgroundColor='#ffffff';
	}

function swap_color_img(id, image_id, url)
{
	var img = document.getElementById(id);
	img.src = url;
	
	if( selected_color )
	{
		document.getElementById("color_"+selected_color).className = 'color_box';
		document.getElementById("link_"+selected_color).className = '';
	}
	document.getElementById("color_"+image_id).className = 'color_box selected';
	document.getElementById("link_"+image_id).className = 'active';
	selected_color = image_id;
}

function swap_car_img(id, page_id, url)
{
	var img = document.getElementById(id);
	img.src = url;
	
	if( selected_page )
	{
		document.getElementById("link_"+selected_page).className = '';
	}
	document.getElementById("link_"+page_id).className = 'active';
	selected_page = page_id;
}