function go(v){
	document.location=v;
}

function setView(e){
	
	var publicUrl = $(e).text();
	
	$('#menuForm').attr('action',publicUrl);
	$('#menuForm').submit();
}

function showColor(cid){
	
	$.getJSON('GetColorDetails.do?id='+cid,function(data) {
		var colorName = data.name;
		var colorSymbol = data.symbol;
		if(colorSymbol != ''){
			colorName += ' ('+colorSymbol+')';
		}
		$('#colorStr').text(colorName);
		$('#colorImage').attr('src','blank.gif');
		$('#colorImage').attr('src','res/media/colors/'+data.filename);
	});
}

function carouselInitCallback(c) {
    carousel = c;
}

function sendContactUs(){
	
	var frmSer = $('#contactUsFrm').serialize();
	if($('#fieldName').val()=='' || $('#fieldPhone').val()==''){
	   	$('#contactUsMsg').css('color','red');
		$('#contactUsMsg').text('יש למלא לפחות את שדות החובה');
		return;
	}

	ret = $.ajax({
      url: $('#contactUsFrm').attr('action'),
      global: false,
      type: 'POST',
      data: frmSer,
      dataType: 'html',
      async: false
   	}).responseText;
   	
   	$('#contactUsMsg').css('color','green');
	$('#contactUsMsg').text('בקשתך התקבלה, תודה.');
}

function setInfoForm(subj){
	$('#itemTxt').text(subj);
	$('#item').val(subj);
}

function countLines(e) {
    var divHeight = e.offsetHeight;
    var lineHeight = parseInt(e.style.lineHeight);
    var lines = divHeight / lineHeight;
    alert("Lines: " + lines);
}

function loadHomepageImages(){
	
	var ar = new Array(
	  'res/media/home/p2.gif',
      'res/media/home/p3.gif',
      'res/media/home/p1.gif',
      'res/media/home/p5.gif',
      'res/media/home/p6.gif',
      'res/media/home/p7.gif',
      'res/media/home/p8.gif',
      'res/media/home/p9.gif',
      'res/media/home/p10.gif',
      'res/media/home/p11.gif'
    );
	$.preLoadImages(ar,function(){
          for(var ii=0;ii<ar.length;ii++){
        	  var r = '<img style="margin-left:60px; margin-top: 8px;" alt="" src="'+ar[ii]+'" />';
        	  $('#slideshow1').append(r);
          }
          $('#slideshow1').cycle({delay: -1000,timeout: 3000});
	    }
	);
}

function showBanner(){

}
