function ajaxUpdateDiv(div, url, t)
{
	$.ajax({ url: url, success: function(resu){
        	$("#"+div).html(resu);
		alert(t);
	}});
	return false;
}

function toBasket(url)
{
	$.ajax({ url: url, success: function(resu){
        	$("#basket").html(resu);
		$.fancybox.close()
	}});
	return false;
}


function ajaxUpdateDivList(div, url, t)
{

	var myAjax = new Ajax.Updater('coll', url, {onComplete: function () { setTimeout("Effect.SlideUp('loading');Effect.Grow('coll', {duration:1});", 3000); }, evalScripts:true});

}


function preLoad() 
{ 
	if(document.images) 
	{ 
		var argLen = arguments.length; 
		for(var i = 0; i < argLen; i++) 
		{ 
			var arg = arguments[i]; 
			var sufLen = suffix.length; 	 
			for(j = 0; j > sufLen; j++) 
			{ 
				var suf = suffix[j] 
				self[arg + '_' + suf] = new Image(); 
				self[arg + '_' + suf].src = iPath + arg + '_' + suf + '.' + iExt; 
			} 
		} 
		loaded = true; 
	} 
}


function ajaxUpDiv(div, url)
{
	new Ajax.Request(url, {
  method: 'get',
  onSuccess: function(transport) {
	$('coll').innerHTML = transport.responseText;    
  }
});

}

function listPhoto(div, url)
{
	var pars = '';
	var myAjax = new Ajax.Updater(div, url, {method: 'get', parameters: pars});
	return false;
}

function listPlates(id, type)
{
	var f = new Array();
	var cur;
	var next;

	if($('ph_'+id+'_0') != null ) f[0] = $('ph_'+id+'_0');
	if($('ph_'+id+'_1') != null ) f[1] = $('ph_'+id+'_1');
	if($('ph_'+id+'_2') != null ) f[2] = $('ph_'+id+'_2');
	if($('ph_'+id+'_3') != null ) f[3] = $('ph_'+id+'_3');

	for (var x in f)
	{
		if(x >= 0 && x < 4)
		{
			if(f[x].style.display != 'none') cur = x;
		}
	}

	if(type == 'up')
	{
		if(cur == 0) next = f.length-1;
		else next = parseInt(cur) - 1;
		Effect.SlideUp('ph_'+id+'_'+cur,{duration:0.5});
		setTimeout("Effect.SlideDown('ph_"+id+"_"+next+"',{duration:0.5});$('ph_"+id+"_"+next+"').appear();", 500);
	}
	else if(type == 'down')
	{
		if (cur == f.length-1) next = 0;
		else next = parseInt(cur) + 1;
		Effect.SlideUp('ph_'+id+'_'+cur,{duration:0.5});
		setTimeout("Effect.SlideDown('ph_"+id+"_"+next+"',{duration:0.5});$('ph_"+id+"_"+next+"').appear();", 500);
	}
}


function scrollRight(id, idn, rid)
{
	alert(id);
	alert(document.getElementById('img_'+id).width);
	alert(document.getElementById('img_'+id).height);
	
	document.getElementById('td_'+id).style.width=220;
	document.getElementById('td_'+id).style.height=330;
	document.getElementById('img_'+id).width=220;
	document.getElementById('img_'+id).height=330;
	document.getElementById('img_'+idn).style.magrin="23px 0px 0px 0px";
	document.getElementById('colDesc').scrollLeft += 220;
	
	document.getElementById('td_'+idn).style.width=250;
	document.getElementById('td_'+idn).style.height=375;
	document.getElementById('img_'+idn).width=250;
	document.getElementById('img_'+idn).height=375;
	document.getElementById('img_'+idn).style.magrin="0px";
	
	alert(document.getElementById('img_'+id).width);
	alert(document.getElementById('img_'+id).height);
	return false;
}

function scrollLeft(id)
{
	document.getElementById('colDesc').scrollLeft -= 220;
	return false;
}
