var num_img = 0;
var imgs_array = new Array;

function initEmployees(){
	$('img','.employee_imgs').eq(0).css('display','block');
	$('span','.employee_name').eq(0).css('display','block');
	$('.employee','.employee_datas').eq(0).css('display','block');
}

function preloadImgs(){
	$('img').each(function(index){
		num_img++;
		imgs_array[num_img] = new Image();
		imgs_array[num_img].src = $(this).attr('src');
		/*imgcode = '<img src="'+$(this).attr('src')+'" alt="" />'
		$('.imgCache').append(imgcode);*/
	});

	$('div').each(function(index){
		if($(this).css('backgroundImage') != 'none'){
			num_img++;
			urlimg = $(this).css('backgroundImage').match(/url\((['"])(.+?)\1\)/);
			imgs_array[num_img] = new Image();
			if(urlimg != null){
				imgs_array[num_img].src = urlimg[2];
			}
		}
	});
}

function preloadTxt(){
	curtxt = $('#preloader_content .center_container span').text();
	if(curtxt == 'Se están cargando los Kekos...'){
		$('#preloader_content .center_container span').text('los niñ@s de SrBurns...');
	} else if(curtxt == 'los niñ@s de SrBurns...'){
		$('#preloader_content .center_container span').text('las cuentas...');
	} else if(curtxt == 'las cuentas...'){
		$('#preloader_content .center_container span').text("y alguna cosilla más! Cachoe' perr@s");
	} else if(curtxt == "y alguna cosilla más! Cachoe' perr@s"){
		$('#preloader_content .center_container span').text('Se están cargando los Kekos...');
	}
}

setInterval("preloadTxt()",2500);

function replaceEmails(){
	/*
	// Se buscando los tag de tipo SPAN y de class CHANGE, que contienen los emails a reemplazar
	$('span.mail').each(function() {
		//itemClass = $(this).attr('title');
		itemMail = $(this).text();
		// Reemplaza " at " por la "@"
		address = itemMail.replace(/ at /g,'@');
		// Reemplaza " dot " por el "."
		address = address.replace(/ dot /g,'.');

		prevItem = $(this).prev();
		$(this).remove();
		// Creacion del nuevo objeto de tipo A con la direccion de correo apropiada
		newItem = '<a href="mailto:'+address+'">'+address+'</a>';
		$(prevItem).after(newItem);
	});
	*/
}

function fancyBoxes(){
	// Fancybox Cases
	$(".case_imgzoom a").fancybox({
		'padding'			: 0,
		'autoDimensions'	: true,
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade'
	});
}


function handleSliderChange(e, ui){
	var maxScroll = $(".expanded_container",$(this).parent()).attr("scrollHeight") - $(".expanded_container",$(this).parent()).height();
	$(".expanded_container",$(this).parent()).animate({scrollTop: (100-ui.value) * (maxScroll / 100) }, 1000);
}

function handleSliderSlide(e, ui){
	var maxScroll = $(".expanded_container",$(this).parent()).attr("scrollHeight") - $(".expanded_container",$(this).parent()).height();
	$(".expanded_container",$(this).parent()).attr({scrollTop: (100-ui.value) * (maxScroll / 100) });
}


var case_pos = 1;
var cur_case;

function imgChanger(imgch){
	total = imgch.size();

	imgch.each(function(index){
		if($(this).css('display') != 'none'){
			curimg = $(this);
		}
	});
	if(curimg != false){
		pos = $('img',curimg.parent()).index(curimg);
		next = pos+1;
		if(next == total){
			next = 0;
		}
		curimg.css('display','none');
		$('img', curimg.parent()).eq(next).css('display','block');
	}
}

function fadeImgChanger(imgch,sametime,backwards,type){
	imgch.each(function(index){
		if($(this).css('display') != 'none'){
			curimg = $(this);
		}
	});

	if(curimg != false){
		if(!sametime){
			curimg.fadeOut(350,function(){
				total = imgch.size();
				pos = $(type,$(this).parent()).index($(this));
				next = (!backwards) ? pos+1 : pos-1;
				if(backwards){
					if(next < 0){
						next = (total-1);
					}
				} else {
					if(next == total){
						next = 0;
					}
				}
				$(type, $(this).parent()).eq(next).fadeIn(350);
			});
		} else {
			total = imgch.size();
			pos = $(type,curimg.parent()).index(curimg);
			next = (!backwards) ? pos+1 : pos-1;
			if(backwards){
				if(next < 0){
					next = (total-1);
				}
			} else {
				if(next == total){
					next = 0;
				}
			}
			curimg.fadeOut(1500);
			$(type, curimg.parent()).eq(next).fadeIn(1500);
		}
	}
}
// Scrollbars
function initScrollBar(parentItem){
	scrollbar = $(".expanded_scrollbar",parentItem);
	scrollcontainer = $(".expanded_container",parentItem);

	contheight = scrollcontainer.height();
	txtheight = $(".expanded_content",scrollcontainer).height();
	if(txtheight > contheight){
		scrollbar.css('display','block');
		scrollbar.slider({
			orientation: "vertical",
			animate: true,
			change: handleSliderChange,
			slide: handleSliderSlide,
			value: 100
		});
	} else {
		scrollbar.css('display','none');
	}
}

function openService(thisItem){
	$('.separator_vertical',thisItem.parent()).css('display','none');
	$('.service').each(function(index){
		$(this).css('position','absolute');
		if($('#cases_toggler').css('display') == 'block'){
			if(curtop[index] < 1000){
				$(this).css('top',curtop[index]+580);
			} else {
				$(this).css('top',curtop[index]);
			}
		} else {
			if(curtop[index] > 1000){
				$(this).css('top',curtop[index]-580);
			} else {
				$(this).css('top',curtop[index]);
			}
		}
		$(this).css('left',curleft[index]);
	});
	parentItem = thisItem.parent();
	itempos = $('.service').index(thisItem);
	$('.service').each(function(index){
		if(index != itempos){
			$(this).fadeOut(800);
		}
	});
	if(thisItem.css('left') != curleft[0]){
		thisItem.animate({
			left: curleft[0]
		}, {
			duration: 200*(itempos+1),
			easing: 'easeOutBack',
			complete: function() {
				$('.right',$(this)).fadeIn(600,function(){
					// Hacer elemento estatico
					curexpanded = $(this).parent();
					curexpanded.css('position','static');
					curexpanded.css('top','auto');
					curexpanded.css('left','auto');
				});
				// Scrollbar
				initScrollBar($(this));
			}
		});
	}
}

function closeService(thisItem){
	// Hacer elemento dinamico
	thisItem.css('position','absolute');
	if($('#cases_toggler').css('display') == 'block'){
		if(curtop[0] < 1000){
			thisItem.css('top',curtop[0]+580);
		} else {
			thisItem.css('top',curtop[0]);
		}
	} else {
		if(curtop[0] > 1000){
			thisItem.css('top',curtop[0]-580);
		} else {
			thisItem.css('top',curtop[0]);
		}
	}
	thisItem.css('left',curleft[0]);
	$('.right',thisItem).fadeOut(200,function(){
		parentItem = $(this).parent().parent();
		itempos = $('.service',parentItem).index($(this).parent());
		if($(this).parent().css('left') != curleft[itempos]){
			$(this).parent().animate({
				left: curleft[itempos]
			}, {
				duration: 200*(itempos+1),
				easing: 'easeOutBack',
				complete: function() {
					$('.service').each(function(index){
						if(index != itempos){
							$(this).fadeIn(700);
						}
					});
					$('.separator_vertical',$('#services_list')).fadeIn(700);
					$('.service').each(function(index){
						$(this).css('position','static');
						$(this).css('top','auto');
						$(this).css('left','auto');
					});
				}
			});
		} else {
			$('.service').each(function(index){
				if(index != itempos){
					$(this).fadeIn(800);
				}
			});
			$('.separator_vertical',$('#services_list')).fadeIn(800);
			$('.service').each(function(index){
				$(this).css('position','static');
				$(this).css('top','auto');
				$(this).css('left','auto');
			});
		}
	});
}

function changeThumbCase(curitem,newpos,pos){
	parentItem = curitem.parent().parent();
	imgsParent = curitem.parent();
	$('.switcher_counter', parentItem).text(newpos+' de '+totalimgs);
	$('.img_case', imgsParent).eq(pos).fadeIn('fast');
	tmpname = 'big'+newpos;

	thiscase = parentItem.parent();
	curcase = $('.case_content').index(thiscase);
	newhref = 'imgs/cases/case'+(curcase+1)+'_'+tmpname+'.jpg';
	$('.case_imgzoom a', parentItem).attr('href',newhref);

	fancyBoxes();
}

var jobitem;
var newImage = new Image();
newImage.src = 'imgs/jobs_title_long.png';

function enableJobsSelect(){
	$('.jobs_list a').click(function(){
		$('.jobs_list a').each(function(index){
			$(this).unbind('click');
		});
		pos = $('.jobs_list a').index($(this));
		jobitem = $('.jobs_text .job_data').eq(pos);
		// Fade title
		$('.jobs_title').fadeOut(200, function(){
			$('.jobs_title').css('backgroundImage','url("imgs/jobs_title_long.png")');
			$('.jobs_title .back_btn_jobs').css('display','block');
			$('.jobs_title span').text('Volver');
			$('.jobs_title').fadeIn(200);
		});
		$('.jobs_list').fadeOut(200, function(){
			jobitem.fadeIn(200, function(){
				initScrollBar(jobitem);
				enableJobsBack();
			});
		});

		return false;
	});
}

function enableJobsBack(){
	$('.jobs_title .back_btn_jobs').click(function(){
		$('.jobs_title .back_btn_jobs').unbind('click');
		$('.jobs_text .job_data').each(function(index){
			if($(this).css('display') != 'none'){
				$(this).fadeOut(200);
			}
		});
		$('.jobs_title').fadeOut(200, function(){
			$('.jobs_title').css('backgroundImage','url("imgs/jobs_title_short.png")');
			$('.jobs_title .back_btn_jobs').css('display','none');
			$('.jobs_title span').text('Estamos buscando:');
			$('.jobs_list').fadeIn(200);
			$('.jobs_title').fadeIn(200, function(){
				enableJobsSelect();
			});
		});
		
		return false;
	});
}

function changeHash(newhash){
	window.location.hash = newhash.replace('sec_','');
}

var OcurItem = '';
var OparentItem = '';
//var inicio = 0;

function openToggler(curItem, parentItem, fecha){
	
	if(OcurItem != '' && OparentItem != '' && fecha != 'na')
	closeToggler(OcurItem, OparentItem);
	
	OcurItem = curItem;
	OparentItem = parentItem;
	$('h2 .title',curItem).css('fontStyle','italic');
	$('.toggler_img',curItem).attr('src','imgs/btn_cerrar.png');
	if(parentItem.attr('id') == 'cases_toggler'){
		parentItem.slideDown({
			duration: 900,
			easing: 'easeInOutCubic',
			complete: function(){
				
				// Scroll To
				scrollTarget = '#'+$(this).parent().attr('id');
				if(scrollTarget == '#sec_destaques')
				changeHash(scrollTarget);
				if(scrollTarget != '#sec_destaques')
				$.scrollTo(scrollTarget, 1000, { onAfter:changeHash(scrollTarget) } );
				// Scrollbar
				initScrollBar($(this));
				$('.case_imgswitcher',$(this)).css('display','block');
			}
		});
	} else {
		
		parentItem.slideDown({
			duration: 900,
			easing: 'easeInOutCubic',
			complete: function(){
				// Scroll To
				scrollTarget = '#'+$(this).parent().attr('id');
				$.scrollTo(scrollTarget, 1000, { onAfter:changeHash(scrollTarget) } );

				if($(this).attr('id') == 'services_toggler'){
					expanded = false;
					curexpanded = null;
					$('.right',parentItem).each(function(index){
						if($(this).css('display') != 'none'){
							expanded = true;
							curexpanded = $(this).parent();
						}
					});
					$('.service').each(function(index){
						curpos = $(this).position();
						if(curleft.length < (index+1)){
							curtop[index] = curpos.top;
							curleft[index] = curpos.left;
						}
					});
				}
			}
		});
	}
	
	if(parentItem.attr('id') == 'toggler_port' && portfolio_on == 0){
		menu_portfolio(first_portfolio_fam);
		portfolio_on = 1;
		}
		
		if(parentItem.attr('id') == 'toggler_contactos' && map_on == 0){
			setTimeout(function(){show_map()}, 1500);
			}
			
		if(parentItem.attr('id') == 'toggler_face' && like_fb_on == 0){
			setTimeout(function(){like()}, 1500);
			}	
}

function closeToggler(curItem, parentItem){
	$('h2 .title',curItem).css('fontStyle','normal');
	$('.toggler_img',curItem).attr('src','imgs/btn_expandir.png');
	if(parentItem.attr('id') == 'cases_toggler'){
		$('.case_imgswitcher',parentItem).css('display','none');
	}
	else if(parentItem.attr('id') == 'services_toggler'){
		expanded = false;
		curexpanded = null;
		$('.right',parentItem).each(function(index){
			if($(this).css('display') != 'none'){
				expanded = true;
				curexpanded = $(this).parent();
			}
		});
		if(expanded){
			curexpanded.css('position','static');
			curexpanded.css('top','auto');
			curexpanded.css('left','auto');
		}
	}
	parentItem.slideUp({
		duration: 1200,
		easing: 'easeOutCubic'
	});
}

$(document).ready(function(){
	$('.toggler').each(function(index){
						
		$(this).click(function(){
			parentItem = $('.toggler_content',$(this).parent());
			if($('.toggler_img',$(this)).attr('src') == 'imgs/btn_expandir.png'){
				openToggler($(this), parentItem);
			} else {
				closeToggler($(this), parentItem);
			}

			return false;
		});
		$(this).mouseenter(function(){
			$(this).animate({opacity: 0.80},{queue:false, duration:200});
		});
		$(this).mouseleave(function(){
			$(this).animate({opacity: 1},{queue:false, duration:200});
		});
	});
	
	/*-------------------------   Abre a seccção desejada por defeito (ver também no site constructor para manter aberta a secção) ------------------*/
	
	if(window.location.hash == '#destaques' || window.location.hash == ''){
	$('.toggler_destaques').each(function(index){
		parentItem = $('.toggler_content',$(this).parent());
		openToggler($(this), parentItem);
	});
	}
	
	if(window.location.hash == '#portfolio'){
		$('.toggler_port').each(function(index){
		parentItem = $('.toggler_content',$(this).parent());
		openToggler($(this), parentItem);
	});
	}
	
	if(window.location.hash == '#quemsomos'){
		$('.toggler_quemsomos').each(function(index){
		parentItem = $('.toggler_content',$(this).parent());
		openToggler($(this), parentItem);
	});
	}
	
	if(window.location.hash == '#servicos'){
		$('.toggler_servicos').each(function(index){
		parentItem = $('.toggler_content',$(this).parent());
		openToggler($(this), parentItem);
	});
	}
	
	if(window.location.hash == '#clipping'){
		$('.toggler_clipping').each(function(index){
		parentItem = $('.toggler_content',$(this).parent());
		openToggler($(this), parentItem);
	});
	}
	
	if(window.location.hash == '#contactos'){
		$('.toggler_contact').each(function(index){
		parentItem = $('.toggler_content',$(this).parent());
		openToggler($(this), parentItem);
	});
	}
	
	if(window.location.hash == '#face'){
		$('.toggler_face').each(function(index){
		parentItem = $('.toggler_content',$(this).parent());
		openToggler($(this), parentItem);
	});
	}
	
	/*-------------------------   EO Abre a seccção desejada por defeito (ver também no site constructor para manter aberta a secção) ------------------*/

	// Click esquerdo em cases
	$('#btn_case_dcha').click(function(){
		// Listado de cases
		totalCases = $('.case_item').size();
		if(case_pos*5 < totalCases){
			if(totalCases < ((case_pos+1)*5)){
				desp = (totalCases-(case_pos*5))*173;
			} else {
				desp = 865;
			}
			$('#case_list').animate({marginLeft: '-='+desp},{duration: 900, easing: 'easeOutBack'});
			case_pos++;
		}
		return false;
	});
	// Click direito em cases
	$('#btn_case_izq').click(function(){
		if(case_pos > 1){
			cur_left = parseInt($('#case_list').css('marginLeft'));
			if((cur_left + 865) > 0){
				desp = 0;
			} else {
				desp = '+=865';
			}
			$('#case_list').animate({marginLeft: desp},{duration: 1000, easing: 'easeOutBack'});
			case_pos--;
		}
		return false;
	});
	// Click em Case
	$('.case_item a').each(function(index){
		$(this).click(function(){
			cur_case = $('li',$(this).parent().parent()).index($(this).parent());
			$('.case_content').each(function(index){
				if($(this).css('display') != 'none'){
					$(this).fadeOut(350, function(){
						pos = cur_case;
						totalimgs = $('.img_case',$('.case_content:eq('+pos+')')).size();
						if(totalimgs <= 1)						{
							$('div.case_imgswitcher', $('div.case_content:eq('+pos+')') ).hide();
						}
						$('.switcher_counter', $('.case_content:eq('+pos+')')).text('1 de '+totalimgs);
						$('.img_case',$('.case_content:eq('+pos+')')).css('display','none');
						$('.img_case:first',$('.case_content:eq('+pos+')')).css('display','block');
						$('.case_content:eq('+pos+')').fadeIn(250);
					});
				}
			});

			return false;
		});
	});

	// Click en anterior/siguiente para imgs de cases
	$('.case_imgswitcher_btns a').each(function(index){
		$(this).click(function(){
			parentItem = $(this).parents('div').eq(2);

			curimg = false;
			$('.img_case', parentItem).each(function(index){
				if($(this).css('display') != 'none'){
					curimg = $(this);
				}
			});

			if(curimg != false){
				pos = $('.img_case',parentItem).index(curimg);
				totalimgs = $('.img_case',parentItem).size();
				if((pos > 0) && ($(this).attr('class') == 'btn_imgant')){
					curimg.fadeOut('fast',function(){
						totalimgs = $('.img_case',$(this).parent()).size();
						pos = $('.img_case',$(this).parent()).index($(this));
						changeThumbCase($(this),pos,(pos-1));
					});
				} else if($(this).attr('class') == 'btn_imgant'){
					curimg.fadeOut('fast',function(){
						totalimgs = $('.img_case',$(this).parent()).size();
						pos = $('.img_case',$(this).parent()).index($(this));
						changeThumbCase($(this),totalimgs,(totalimgs-1));
					});
				} else if(($(this).attr('class') == 'btn_imgsig') && (pos < (totalimgs-1))) {
					curimg.fadeOut('fast',function(){
						totalimgs = $('.img_case',$(this).parent()).size();
						pos = $('.img_case',$(this).parent()).index($(this));
						changeThumbCase($(this),(pos+2),(pos+1));
					});
				} else if($(this).attr('class') == 'btn_imgsig') {
					curimg.fadeOut('fast',function(){
						totalimgs = $('.img_case',$(this).parent()).size();
						pos = $('.img_case',$(this).parent()).index($(this));
						changeThumbCase($(this),1,0);
					});
				}
			}

			return false;
		});
	});
/*
	// Social
	$('#social_buttons a').each(function(index){
		$(this).mouseenter(function(){
			$('img',$(this)).animate({width:20, height:20},{queue:false, duration:300});
		});
		$(this).mouseleave(function(){
			$('img',$(this)).animate({width:26, height:26},{queue:false, duration:300});
		});
	});
	*/

	// Inicializacion imagen del primer case
	$('.img_case:first',$('.case_content:eq(0)')).css('display','block');
	totalimgs = $('.img_case',$('.case_content:eq(0)')).size();
	$('.switcher_counter', $('.case_content:eq(0)')).text('1 de '+totalimgs);

	replaceEmails();
	
	// Parties
	$('.btn_vermas').each(function(index){
		$(this).mouseenter(function(){
			$(this).animate({opacity: 0.70},{queue:false, duration:200});
		});
		$(this).mouseleave(function(){
			$(this).animate({opacity: 1},{queue:false, duration:200});
		});
	});

	// Servicios
	$('.service_expander').click(function(){
		thisItem = $(this).parents().eq(2);
		// NO se ha pulsado ningun servicio
		if($('.right',thisItem).css('display') == 'none'){
			$('img',$(this)).attr('src','imgs/services_back.png');
			openService(thisItem);
		}
		// Ya esta activo uno de ellos
		else {
			$('img',$(this)).attr('src','imgs/services_expand.png');
			closeService(thisItem);
		}
		
		return false;
	});

	$('.closer a').click(function(){
		thisItem = $(this).parents().eq(2);
		$('.service_expander img',thisItem).attr('src','imgs/services_expand.png');
		closeService(thisItem);
		
		return false;
	});

	// Jobs
	enableJobsSelect();
	
	// ---- //
	$('.employee_names .employee_prev').click(function(){
		parentitem = $(this).parent();
		$('.employee_name span',parentitem).each(function(index){
			if($(this).css('display') != 'none'){
				grandparent = $(this).parents().eq(3);
				fadeImgChanger($('.employee_name span',grandparent),false,true,'span');
				fadeImgChanger($('.employee_imgs img',grandparent),false,true,'img');
				fadeImgChanger($('.employee_datas .employee',grandparent),false,true,'.employee');
			}
		});

		return false;
	});

	$('.employee_names .employee_next').click(function(){
		parentitem = $(this).parent();
		$('.employee_name span',parentitem).each(function(index){
			if($(this).css('display') != 'none'){
				grandparent = $(this).parents().eq(3);
				fadeImgChanger($('.employee_name span',grandparent),false,false,'span');
				fadeImgChanger($('.employee_imgs img',grandparent),false,false,'img');
				fadeImgChanger($('.employee_datas .employee',grandparent),false,false,'.employee');
			}
		});
		return false;
	});
	// ---- //
	
	// Fancybox de Aviso Legal
	
	$("#inline").fancybox({
		'padding'			: 0,
		'autoDimensions'	: true,
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade'
	});
	// Fancyboxes para Cases
	fancyBoxes();

	// Preload
	preloadImgs();
	
	// Employee
	initEmployees();
});

var curtop = new Array;
var curleft = new Array;
var itempos;

function open_portfolio(fam, port){
	$('.toggler_port').each(function(index){
		parentItem = $('.toggler_content',$(this).parent());
		openToggler($(this), parentItem);
	});
	
	menu_portfolio(fam);
	
	/*
	var portfolio = port_pos[port];
	if(portfolio == 0) portfolio = 'index';
	$("#accordion_pf" + fam).accordion({active: portfolio, collapsible: true});
	*/
}

function scrTo(){
	
	$('.toggler_port').each(function(index){
		parentItem = $('.toggler_content',$(this).parent());
		openToggler($(this), parentItem, 'na');
	});
}

$(document).ready(function() {
	$('#backtotop').click(function(){
		$('html, body').animate({scrollTop:0}, 'slow');
	});
});

window.onscroll = scrollEvent;
function scrollEvent() {
	var vscroll = (document.all ? document.scrollTop : window.pageYOffset);
   if(vscroll < 160)
   document.getElementById('backtotop').style.display = 'none';
   else
   document.getElementById('backtotop').style.display = 'block';
}

var map_on = 0;
var like_fb_on = 0;

function show_map(){
	if(lang == 'EN'){
		var ver = 'Show bigger map';
		var lan = 'en-EN';
	}
	else{
		var ver = 'Ver mapa maior';
		var lan = 'pt-PT';
	}
	
	map_on = 1;
	document.getElementById('mapa').innerHTML = '<iframe width="600" height="250" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"  style="background-color:black" src="http://maps.google.pt/maps?f=q&amp;source=embed&amp;hl=' + lan + '&amp;geocode=&amp;q=Rua+de+T%C3%A2nger+1441,+Porto&amp;aq=0&amp;sll=41.161767,-8.659512&amp;sspn=0.005396,0.013937&amp;ie=UTF8&amp;hq=&amp;hnear=R.+de+T%C3%A2nger+1441,+Porto&amp;view=map&amp;ll=41.16612,-8.660316&amp;spn=0.016153,0.051413&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="http://maps.google.pt/maps?f=q&amp;source=embed&amp;hl=pt-PT&amp;geocode=&amp;q=Rua+de+T%C3%A2nger+1441,+Porto&amp;aq=0&amp;sll=41.161767,-8.659512&amp;sspn=0.005396,0.013937&amp;ie=UTF8&amp;hq=&amp;hnear=R.+de+T%C3%A2nger+1441,+Porto&amp;view=map&amp;ll=41.16612,-8.660316&amp;spn=0.016153,0.051413&amp;z=14&amp;iwloc=A" style="color:#FFFFFF;text-align:left">' + ver + '</a></small>';
}

function like(){
	document.getElementById('like_fb').innerHTML = '<iframe 		src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.qriaideias.com&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>';
	
	like_fb_on = 1;
}



	



