
function open_print(date_reg, user_name, user_email)
{
	var MyURL = "includes/print_dcenter.php?date="+date_reg+"&user="+user_name+"&email="+user_email;
	var Opt = "fullscreen=no,type=fullWindow,location=no,menubar=yes,titlebar=no,width=650,height=400,scrollbars=yes";
	neww = window.open (MyURL, "print", Opt);
	neww.focus();
	
}


function OpenC(theURL,winName,features)
  {
     var Win=window.open(theURL,winName,features);
     Win.focus();
     return false;
  }

function isEmpty(str) {

   for (var i = 0; i < str.length; i++)

      if (" " != str.charAt(i))

          return false;

	return true;

}  

function selmark(curSel)
{
	markURL = "index.php?pageId=9&car_mark=";
	
	mark = curSel.options[curSel.selectedIndex].value;
	
	if(mark != "")
	{
		window.location = markURL+mark;	
	} else {
		window.locaton = "index.php?pageId=1";
	}
}

function selmod(curSel)
{
	modelURL = "index.php?pageId=9&model=";
	
	mod = curSel.options[curSel.selectedIndex].value;
	
	if(mod != "")
	{
		window.location = modelURL+mod;	
	} else {
		window.locaton = "index.php?pageId=1";
	}
}

function selmodif(curSel)
{
	modelURL = "index.php?pageId=9&modif=";
	
	modif = curSel.options[curSel.selectedIndex].value;	
	
	if(modif != "")
	{
		window.location = modelURL+modif;	
	} else {
		window.locaton = "index.php?pageId=1";
	}
}


function reload(comp)
{
	for(var i=0; i < document.form_seas.seas.length; i++)
	{
		if(document.form_seas.seas[i].checked)
		var val=document.form_seas.seas[i].value;
	}

	self.location='index.php?pageId=5&comp=' + comp + '&seas=' + val;
}


off1 = new Image;
off1.src = ('images/foto/off_1.gif');

offsm1 = new Image;
offsm1.src = ('images/foto/off_1_sm.gif');

off2 = new Image;
off2.src = ('images/foto/off_2.gif');

offsm2 = new Image;
offsm2.src = ('images/foto/off_2_sm.gif');

off3 = new Image;
off3.src = ('images/foto/off_3.gif');

offsm3 = new Image;
offsm3.src = ('images/foto/off_3_sm.gif');

off4 = new Image;
off4.src = ('images/foto/off_4.gif');

offsm4 = new Image;
offsm4.src = ('images/foto/off_4_sm.gif');


 function change_pic(imgName)
 {

	imgBig = eval("off" + imgName + ".src");
	document["off1"].src = imgBig;	
	
	imgSmall = eval("offsm" + imgName + ".src");
    document["offsm"+imgName].src = imgSmall;
 
 }
 
 		$(document).ready(function() {
			$("a.zoom").fancybox();

			$("a.zoom1").fancybox({
				'overlayOpacity'	:	0.7,
				'overlayColor'		:	'#FFF'
			});

			$("a.zoom2").fancybox({
				'zoomSpeedIn'		:	500,
				'zoomSpeedOut'		:	500
			});

			$("a#chernoe").fancybox({
			  'itemLoadCallback': getGroupItems
			});
			
			var imageList = [
			  {url: "/images/photo/chern_of1.jpg", title: "Первая картинка"},
			  {url: "/images/photo/chern_of2.jpg", title: "Вторая картинка"},
			  {url: "/images/photo/chern_of3.jpg", title: "Третья картинка"}
			];
			
			function getGroupItems(opts) {
			  jQuery.each(imageList, function(i, val) {
				opts.itemArray.push(val);
			  });
			}
			
			$("i.kupit[title]").each(function(){
				$(this).replaceWith("<a href='" + $(this).attr("title") + "'><img src='images/buy.gif' width='79' height='20' border='0'/></a>");

			});		
			
			$("div.im[title]").each(function(){
				$(this).replaceWith("<a class='zoom2' href='" + $(this).attr("title") + "'>" + $(this).html() + "</a>");

			});
			
			
			
		});


