function previewMyTamakum(badge) {
var img;
var lines;
var color;
var lang;
var url;
lang = 	document.myTamakumForm.myTmkLang.value;
url = 	document.myTamakumForm.myTmkUrl.value;
color = document.myTamakumForm.myTmkColor.value;
lines = document.myTamakumForm.myTmkLines.value;
img = 	document.myTamakumForm.myTmkImg.value;
badge.SetVariable('urlImg',img);
badge.SetVariable('lang',lang);
badge.SetVariable('lines',lines);
badge.SetVariable('color',color);
badge.SetVariable('url',url);
badge.Play();
}

function generateMyTamakumCode(){
if (document.myTamakumForm.myTmkCode == null) return;
var img;
var lines;
var color;
var lang;
var url;
var swf;
var codeType;
lang = 	document.myTamakumForm.myTmkLang.value;
url = 	document.myTamakumForm.myTmkUrl.value;
color = document.myTamakumForm.myTmkColor.value;
lines = document.myTamakumForm.myTmkLines.value;
img = 	document.myTamakumForm.myTmkImg.value;
swf = 	document.myTamakumForm.myTmkSwf.value;
codeType = 	document.myTamakumForm.myTmkCodeType.value;
//alert (lines+img+color);
//var code = '<div id="myTamakumBadgeDiv" style="width:160px;height:65;border:0px none"><a style="border:0px none" href="'+url+'"></a><script src="http://www.tamakum.com/myTamakum.js" language="javascript"></script><script type="text/javascript">myTamakum('+swf+'?urlImg='+img+'&lang='+lang+'&color='+color+'&lines='+lines+'&url='+url+'","160","65","myTamakumBadge","transparent")</script></div>';
if (codeType==1) var code = '<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="myTamakumBadge" codebase="http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=9,0,0,0" border="0" width="160" height="65">'+'<param name="movie" value="'+swf+'?urlImg='+img+'&lang='+lang+'&color='+color+'&lines='+lines+'&url='+url+'">'+'<param name="quality" value="Best">'+'<param name="loop" value="false">'+'<param name="swliveconnect" value="true">'+'<param name="allowScriptAccess" value="always">'+'<param name="wmode" value="transparent">'+'<embed src="'+swf+'?urlImg='+img+'&lang='+lang+'&color='+color+'&lines='+lines+'&url='+url+'" pluginspage="http:\/\/www.macromedia.com\/go\/getflashplayer" type="application/x-shockwave-flash" name="myTamakumBadge" quality="Best" loop="false" allowscriptaccess="always" swliveconnect="true" wmode="transparent" width="160" height="65"></embed></object>';
if (codeType==2) var code = 'SWF URL: '+swf+'?urlImg='+img+'&lang='+lang+'&color='+color+'&lines='+lines+'&url='+url+'\n'+'WIDTH: 160'+'\n'+'HEIGTH: 65';
if (codeType==3) var code = '<script src="http://www.tamakum.com/myTamakum.js" language="javascript"></script><script type="text/javascript">myTamakum("'+swf+'?urlImg='+img+'&lang='+lang+'&color='+color+'&lines='+lines+'&url='+url+'","160","65","myTamakumBadge","transparent")</script>';
document.myTamakumForm.myTmkCode.value = code;
}

function switchArea(IDorig,IDon,IDoff,contenedor){
var containerLayer = document.getElementById(contenedor);
var alturaOriginal = containerLayer.offsetHeight;
document.getElementById(IDorig).style.display="none";
document.getElementById(IDoff).style.display="none";
document.getElementById(IDon).style.display="block";
//alert(document.getElementById(IDon).offsetWidth+'px');
document.getElementById(IDon).style.width=document.getElementById(IDon).offsetWidth-4+'px';
//containerLayer.style.height=alturaOriginal+50;
//containerLayer.style.height=alturaOriginal-50;
}

function generateGameCode(type){
var img;
var title;
var desc;
var gameUrlMyTmk;
var gameUrlOrig;
img = document.gameCodeForm.gameCodeImgUrl.value;
title = document.gameCodeForm.gameCodeTitle.value;
desc = document.gameCodeForm.gameCodeDesc.value;
gameUrlMyTmk = document.gameCodeForm.gameUrlMyTmk.value;
gameUrlOrig = document.gameCodeForm.gameUrlOrig.value;
var myTmkCode = '<a href="'+gameUrlMyTmk+'" target="_blank"><img src="'+img+'" border="0" width="82" height="64" align="left" style="margin-right:5px;"><strong>'+title+'</strong></a><br />'+desc;
var origCode = '<a href="'+gameUrlOrig+'" target="_blank"><img src="'+img+'" border="0" width="82" height="64" align="left" style="margin-right:5px;"><strong>'+title+'</strong></a><br />'+desc;
if (type==1) document.gameCodeForm.areaOrig.value = origCode ;
if (type==2) document.gameCodeForm.areaTmk.value = myTmkCode ;
}

function editPopup(pagina,w,h){
if (!(window.formWindow==null)) formWindow.close();
formWindow=window.open(pagina,'','width='+w+',height='+h+',status=1,location=1,toolbar=0,menubar=0,directories=0,resizable=0,scrollbars=1');
}

function cambiarDiv(id){
var prueba=document.getElementById(id);
var ht ='<li class="liShare"><a rel="nofollow" href="http:\/\/digg.com\/" onclick="window.open(\'http:\/\/digg.com\/submit?phase=2&amp;url=\'+encodeURIComponent(location.href)+\'&amp;bodytext=&amp;tags=&amp;title=\'+encodeURIComponent(document.title));return false;"> <img align="absmiddle" src="social\/digg.gif" border="0"\/>&nbsp;Diggit<\/a><\/li>'
prueba.innerHTML = ht;
}

function openNotepad(ID,ID2){
var layer = document.getElementById(ID);
var movie = document.getElementById(ID2);
var movieWidth = movie.offsetWidth;
var xPos = layer.offsetLeft;
var yPos = layer.offsetTop;
if (!(window.notepad==null)) notepad.close();
xPos = xPos + movieWidth - 220;
yPos = yPos + 120;
notepad = window.open('popupnotepad.php','','width=300,height=380,screenY='+yPos+',top='+yPos+',left='+xPos+',screeX=0,status=0,location=0,toolbar=0,menubar=0,directories=0,resizable=1');
}


function socialize(){
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/digg.com\/" onclick="window.open(\'http:\/\/digg.com\/submit?phase=2&amp;url=\'+encodeURIComponent(location.href)+\'&amp;bodytext=&amp;tags=&amp;title=\'+encodeURIComponent(document.title));return false;"> <img align="absmiddle" src="social\/digg.gif" border="0"\/>&nbsp;Diggit<\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/www.facebook.com\/" onclick="window.open(\'http:\/\/www.facebook.com\/sharer.php?u=\'+encodeURIComponent(location.href)+\'&amp;t=\'+encodeURIComponent(document.title));return false;" > <img align="absmiddle" src="social\/facebook.gif" border="0"\/>&nbsp;Facebook <\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/www.myspace.com\/" onclick="window.open(\'http:\/\/www.myspace.com\/Modules\/PostTo\/Pages\/?t=\'+encodeURIComponent(document.title)+\'&c=\'+encodeURIComponent(location.href));return false;"> <img align="absmiddle" src="social\/myspace.gif" border="0" \/>&nbsp;My Space<\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/www.google.com\/" onclick="window.open(\'http:\/\/www.google.com\/bookmarks\/mark?op=add&amp;hl=de&amp;bkmk=\'+encodeURIComponent(location.href)+\'&amp;annotation=&amp;labels=&amp;title=\'+encodeURIComponent(document.title));return false;"> <img align="absmiddle" src="social\/google.gif" border="0" \/>&nbsp;Google<\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/del.icio.us\/" onclick="window.open(\'http:\/\/del.icio.us\/post?v=2&amp;url=\'+encodeURIComponent(location.href)+\'&amp;notes=&amp;tags=&amp;title=\'+encodeURIComponent(document.title));return false;"> <img align="absmiddle" src="social\/del.gif" border="0"\/>&nbsp;Del.ici.ous<\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/www.twitter.com\/" onclick="window.open(\'http:\/\/twitter.com\/home?status=\'+encodeURIComponent(location.href));return false;"> <img align="absmiddle" src="social\/twitter.gif" border="0" \/>&nbsp;Twitter<\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="https:\/\/favorites.live.com\/" onclick="window.open(\'https:\/\/favorites.live.com\/quickadd.aspx?marklet=1&mkt=en-us&url=\'+encodeURIComponent(location.href)+\'&title=\'+encodeURIComponent(document.title)+\'&top=1\');return false;"> <img align="absmiddle" src="social\/live.gif" border="0"\/>&nbsp;Live<\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/www.yahoo.com\/" onclick="window.open(\'http:\/\/myweb2.search.yahoo.com\/myresults\/bookmarklet?t=\'+encodeURIComponent(document.title)+\'&amp;d=&amp;tag=&amp;u=\'+encodeURIComponent(location.href));return false;"> <img align="absmiddle" src="social\/yahoo.gif" border="0"\/>&nbsp;Yahoo<\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/www.linkarena.com\/" onclick="window.open(\'http:\/\/linkarena.com\/bookmarks\/addlink\/?url=\'+encodeURIComponent(location.href)+\'&amp;title=\'+encodeURIComponent(document.title)+\'&amp;desc=&amp;tags=\');return false;"> <img align="absmiddle" src="social\/linkarena.gif" border="0" \/>&nbsp;LinkArena<\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/www.folkd.com\/" onclick="window.open(\'http:\/\/www.folkd.com\/submit\/\'+(dokument.location.href));return false;"> <img align="absmiddle" src="social\/folkd.gif" border="0"\/>&nbsp;Folkd<\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/slashdot.org\/" onclick="window.open(\'http:\/\/slashdot.org\/bookmark.pl?url=\'+encodeURIComponent(location.href)+\'&amp;title=\'+encodeURIComponent(document.title));return false;" > <img align="absmiddle" src="social\/slashdot.gif" border="0"\/>&nbsp;Slashdot<\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/www.propeller.com\/" onclick="window.open(\'http:\/\/www.propeller.com\/submit\/?U=\'+encodeURIComponent(location.href)+\'&amp;T=\'+encodeURIComponent(document.title));return false;" > <img align="absmiddle" src="social\/propeller.gif" border="0"\/>&nbsp;Propeller <\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/reddit.com\/" onclick="window.open(\'http:\/\/reddit.com\/submit?url=\'+encodeURIComponent(location.href)+\'&amp;title=\'+encodeURIComponent(document.title));return false;"> <img align="absmiddle" src="social\/reddit.gif" border="0" \/>&nbsp;Reddit<\/a><\/li>');
	document.writeln('<li class="liShare"><a rel="nofollow" href="http:\/\/www.stumbleupon.com\/" onclick="window.open(\'http:\/\/www.stumbleupon.com\/submit?url=\'+encodeURIComponent(location.href)+\'&amp;title=\'+encodeURIComponent(document.title));return false;"> <img align="absmiddle" src="social\/stumbleupon.gif" border="0" \/>&nbsp;StumbleUpon<\/a><\/li>');
}

function updatePubli(){
	if (window.parent.banner1){window.parent.banner1.location=window.parent.banner1.location}
	if (window.parent.banner2){window.parent.banner2.location=window.parent.banner2.location}
	if (window.parent.banner3){window.parent.banner3.location=window.parent.banner3.location}
	if (window.parent.banner4){window.parent.banner4.location=window.parent.banner4.location}
	if (window.parent.banner5){window.parent.banner5.location=window.parent.banner5.location}
	}

function panic(){
resizeTo(5,5);
moveTo(screen.width*3,screen.height*3);
if (window.opener) {
window.opener.resizeTo(5,5);
window.opener.moveTo(screen.width*3,screen.height*3)}
}

function addSite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
} 
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}

startList = function(menu) {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById(menu);
		if (navRoot == null) return
		else {
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI" || node.nodeName=="UL") {
				node.onmouseover=function() { this.className+=" over";	} 				
				node.onmouseout=function() { this.className=this.className.replace(" over", "");
				} 
				}
			}
		}
	}
}

function returnObjById( id ) 
{ 
    if (document.getElementById) 
        var returnVar = document.getElementById(id); 
    else if (document.all) 
        var returnVar = document.all[id]; 
    else if (document.layers) 
        var returnVar = document.layers[id]; 
    return returnVar; 
}

function disableSelection(ID){
var target = document.getElementById(ID);
if (target==null) return;
//if (document.getElementById(target)==null) return;
if (typeof target.onselectstart!="undefined") //IE route
	target.onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
	target.style.MozUserSelect="none"
else //All other route (ie: Opera)
	target.onmousedown=function(){return false}
//target.style.cursor = "default";
}

function hidePointer(ID){
var target = document.getElementById(ID);
if (target==null) return;
target.style.cursor = "default"
}

function toggleCollapseOriginal(id,clase1,clase2){
    if (document.getElementById) 
        var returnVar = document.getElementById(id); 
    else if (document.all) 
        var returnVar = document.all[id]; 
    else if (document.layers) 
        var returnVar = document.layers[id]; 
if (returnVar.className == clase1)
	returnVar.className = clase2;
else returnVar.className = clase1;
}

function toggleCollapse2(obj,clase1,clase2){
var ident=obj.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.id;
    if (document.getElementById) 
        var returnVar = document.getElementById(ident); 
    else if (document.all) 
        var returnVar = document.all[ident]; 
    else if (document.layers) 
        var returnVar = document.layers[ident]; 
if (returnVar.className == clase1)
	returnVar.className = clase2;
else returnVar.className = clase1;
}

function toggleCollapseX(obj,clase1,clase2){
var ident=obj.parentNode.parentNode.parentNode.parentNode.id;
    if (document.getElementById) 
        var returnVar = document.getElementById(ident); 
    else if (document.all) 
        var returnVar = document.all[ident]; 
    else if (document.layers) 
        var returnVar = document.layers[ident]; 
if (returnVar.className == clase1)
	returnVar.className = clase2;
else returnVar.className = clase1;
}

function cClass(clase){
event.srcElement.className = clase;
}

function cId(ide){
event.srcElement.id = ide;
}

function inclFlash(url,w,h,id,wmode){
	if (wmode == null) wmode= "transparent";
	document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="');
	document.write(id);	
	document.write('" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" border="0" width="');
	document.write(w);
	document.write('" height="');
	document.write(h);
	document.write('" >\n');
	document.write('<param name="movie" value="');
	document.write(url);
	document.write('">\n');
	document.write('<param name="quality" value="Best">\n');
	document.write('<param name="loop" value="false">\n');
	document.write('<param name="swliveconnect" value="true">\n');
	document.write('<param name="allowScriptAccess" value="always">\n');
	document.write('<param name="wmode" value="');
	document.write(wmode);
	document.write('">\n');
	document.write('<embed src="');
	document.write(url);
	document.write('" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="');
	document.write(id);	
	document.write('" width="');
	document.write(w);
	document.write('" height="');
	document.write(h);
	document.write('" quality="Best" loop="false" allowScriptAccess="always" swliveconnect="true" wmode="');
	document.write(wmode);
	document.write('"></object>\n');
	}

function register(){
	env = true;
	if (document.regForm.nick.value == "") 
	{ 
	  alert("please, enter your PUBLICK NICK");
	  env = false;
	} 
	else    {
		if (document.regForm.email.value == "") 
		{ 
		  alert("please, enter your E-MAIL");
		  env = false;
		}	
		else	{
			if (document.regForm.password.value == "") 
			{ 
				  alert("please, enter your PASSWORD");
				  env = false;	
			}	
			else	{	
					if (env) {document.regForm.submit()}}}}
}

function login(){
	env = true;
		if (document.loginForm.email.value == "") 
		{ 
		  alert("please, enter your E-MAIL");
		  env = false;
		}	
		else	{
			if (document.loginForm.password.value == "") 
			{ 
				  alert("please, enter your PASSWORD");
				  env = false;	
			}	
			else	{	
					if (env) {document.loginForm.submit()}}}
}

function sendMsg(){
	env = true;
	var radioLength = - 1;
    for (var i=document.contacForm.subject.length-1; i > -1; i--) 
    {
        if (document.contacForm.subject[i].checked) {radioLength = i; i = -1;}
    }
		if (document.contacForm.email.value == "") 
		{ 
		  alert("please, enter your E-MAIL");
		  env = false;
		}	
		else if (radioLength == -1) 
			{ 
				  alert("please, select the SUBJECT");
				  env = false;	
			}	
		else if (env) {document.contacForm.submit()}
}

function validateNewStyle(lang){
	var env = true;
  	var checked = false;
  	var radiobuttons = document.styleForm.styleTemplate;
  	for (var i=0; i<radiobuttons.length; i++)    
  	{      if (radiobuttons[i].checked) {
  	        checked = true;
  	        break; 
  	        }
  	} 
	if (document.styleForm.styleName.value == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir el nombre de tu estilo visual");
		  else if (lang == "cat") alert("oops! has oblidat escriure el nom del teu estil visual");
		  else alert("oops! you forgot to enter the name of your visual style");
		  document.styleForm.styleName.focus();
		  env = false;
		}	
	else if (!checked)
		{ 
		  if (lang == "es") alert("oops! te olvidaste de seleccionar una plantilla base");
		  else if (lang == "cat") alert("oops! has oblidat seleccionar una plantilla base");
		  else alert("oops! you forgot to select a base template");
		  //document.styleForm.styleTemplate.focus();
		  env = false;
		}	
	else if (env) {document.styleForm.submit()}
}

function validateNewStyle2(lang){
	var env = true;
	if (document.styleForm.styleName.value == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir el nombre de tu estilo visual");
		  else if (lang == "cat") alert("oops! has oblidat escriure el nom del teu estil visual");
		  else alert("oops! you forgot to enter the name of your visual style");
		  document.styleForm.styleName.focus();
		  env = false;
		}	
	else if (env) {document.styleForm.submit()}
}

function deleteAcc(lang){
		  if (lang == "es") confirm("ŋEst"+String.fromCharCode(225)+"s seguro que deseas borrar permanentemente tu cuenta en tamakum!? (esta operaci"+String.fromCharCode(243)+"n no se puede revertir)");
		  else if (lang == "cat") alert("ŋEst"+String.fromCharCode(224)+"s segur que vols borrar permanentment el teu compte a tamakum!? (aquesta operaci"+String.fromCharCode(243)+" no es pot revertir)");
		  else confirm("Are you sure you want to premanently delete your tamakum! account? (this operation can not be undone)");
}

function validateRecommend(lang){
	env = true;
	if (document.recomendar.tuNombre.value == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir tu nombre");
		  else if (lang == "cat") alert("oops! has oblidat escriure el teu nom");
		  else alert("oops! you forgot to enter your name");
		  document.recomendar.tuNombre.focus();
		  env = false;
		}	
			else	{	
						if (document.recomendar.tuEmail.value == "") 
							{ 
							  if (lang == "es") alert("oops! te olvidaste de escribir tu e-mail");
							  else if (lang == "cat") alert("oops! has oblidat escriure el teu e-mail");
							  else alert("oops! you forgot to enter your e-mail");
							  document.recomendar.tuEmail.focus();
							  env = false;
							}	
								else	{	
											if (document.recomendar.suNombre.value == "") 
												{ 
												  if (lang == "es") alert("oops! te olvidaste de escribir el nombre de tu amigo/a");
												  else if (lang == "cat") alert("oops! has oblidat escriure el nom del teu amic/amiga");
												  else alert("oops! you forgot to enter your friendīs name");
												  document.recomendar.suNombre.focus();
												  env = false;
												}	
													else	{	
																if (document.recomendar.suEmail.value == "") 
																	{ 
																	  if (lang == "es") alert("oops! te olvidaste de escribir el e-mail de tu amigo/a");
																	  else if (lang == "cat") alert("oops! has oblidat escriure el e-mail del teu amic/amiga");
																	  else alert("oops! you forgot to enter your friendīs e-mail");
																	  document.recomendar.suEmail.focus();
																	  env = false;
																	}	
																		else	{	
																				if (env) {document.recomendar.submit()}}}}}
}


function validateRecommendLog(lang){
	env = true;
	if (document.recomendar.suNombre.value == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir el nombre de tu amigo/a");
		  else if (lang == "cat") alert("oops! has oblidat escriure el nom del teu amic/amiga");
		  else alert("oops! you forgot to enter your friendīs name");
		  document.recomendar.suNombre.focus();
		  env = false;
		}	
	else if (document.recomendar.suEmail.value == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir el e-mail de tu amigo/a");
		  else if (lang == "cat") alert("oops! has oblidat escriure el e-mail del teu amic/amiga");
		  else alert("oops! you forgot to enter your friendīs e-mail");
		  document.recomendar.suEmail.focus();
		  env = false;
		}	
	else if (env) {document.recomendar.submit()}
}

function validateDiary(lang){
	env = true;
	if (document.diaryForm.entry.value == "") 
		{ 
		  if (lang == "es") alert("oops! no has escrito nada");
		  else if (lang == "cat") alert("oops! no has escrit res");
		  else alert("oops! you forgot to write anything");
		  document.diaryForm.entry.focus();
		  env = false;
		}	
			else	{	
					if (env) {document.diaryForm.submit()}}
}

function validateNote(lang){
	env = true;
	if (document.noteForm.note.value == "") 
		{ 
		  if (lang == "es") alert("oops! no has escrito nada");
		  else if (lang == "cat") alert("oops! no has escrit res");
		  else alert("oops! you forgot to write anything");
		  document.noteForm.note.focus();
		  env = false;
		}	
			else	{	
					if (env) {document.noteForm.submit()}}
}

function validateComments(lang){
	env = true;
	if (document.comentarios.coments.value == "") 
		{ 
		  if (lang == "es") alert("oops! no has escrito nada");
		  else if (lang == "cat") alert("oops! no has escrit res");
		  else alert("oops! you forgot to write anything");
		  document.comentarios.coments.focus();
		  env = false;
		}	
			else	{	
					if (env) {document.comentarios.submit()}}
}

function validateReport(lang){
	env = true;
	if (document.reportForm.report.value == "") 
		{ 
		  if (lang == "es") alert("oops! no has escrito nada");
		  else if (lang == "cat") alert("oops! no has escrit res");
		  else alert("oops! you forgot to write anything");
		  document.reportForm.report.focus();
		  env = false;
		}	
			else	{	
					if (env) {document.reportForm.submit()}}
}

function validateRecover(lang){
	env = true;

	if (document.formRecover.recoverEmailUsername.value == "") 
		{ 
		  if (lang == "es") alert("oops! no has escrito nada");
		  else if (lang == "cat") alert("oops! no has escrit res");
		  else alert("oops! you forgot to write anything");
		  document.formRecover.recoverEmailUsername.focus();
		  env = false;
		}	

			else	{	
					if (env) {document.formRecover.submit()}}
}

function validateBlog(lang){
	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	if(is_chrome != true) WYSIWYG.updateTextArea('message');

	env = true;
	if (document.blogForm.title.value == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir el t"+String.fromCharCode(237)+"tulo");
		  else if (lang == "cat") alert("oops! has oblidat escriure el t"+String.fromCharCode(237)+"tol");
		  else alert("oops! you forgot to write the title");
		  document.blogForm.title.focus();
		  env = false;
		}
/*	
	else if (document.blogForm.message.value == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir el texto de la entrada");
		  else if (lang == "cat") alert("oops! has oblidat escriure el text de l'entrada");
		  else alert("oops! you forgot to write the entry text");
		  document.blogForm.message.focus();
		  env = false;	
		}
*/	
	else if (env) {document.blogForm.submit()}
}

function validateMsg(lang){
	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	if(is_chrome != true) WYSIWYG.updateTextArea('message');

	index = document.msgForm.to.selectedIndex;
	env = true;
		if (document.msgForm.to.options[index].text  == "...") 
		{ 
		  if (lang == "es") alert("oops! olvidaste seleccionar el destinatario");
		  else if (lang == "cat") alert("oops! has oblidat seleccionar el destinatari");
		  else alert("oops! you forgot to select the friend to whom you are sending the message");
		  document.msgForm.to.focus();
		  env = false;
		}	
		else if (document.msgForm.subject.value == "") 
			{ 
			  if (lang == "es") alert("oops! te olvidaste de escribir el asunto");
			  else if (lang == "cat") alert("oops! has oblidat escriure l'assumpte");
			  else alert("oops! you forgot to write the subject");
			  document.msgForm.subject.focus();
			  env = false;
			}
/*
		else if (document.msgForm.message.value == "") 
			{ 
			  if (lang == "es") alert("oops! te olvidaste de escribir el mensaje");
			  else if (lang == "cat") alert("oops! has oblidat escriure el missatge");
			  else alert("oops! you forgot to write the message");
			  document.msgForm.message.focus();
			  env = false;	
			}
*/	
		else if (env) {document.msgForm.submit()}
}

function validateContact(lang,sugerencias){
	env = true;
		if (document.contactForm.fullname.value  == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir tu nombre y apellidos");
		  else if (lang == "cat") alert("oops! has oblidar escriure el teu nom i cognoms");
		  else alert("oops! you forgot to enter your name");
		  document.contactForm.fullname.focus();
		  env = false;
		}	
		else if (document.contactForm.email.value == "") 
			{ 
			  if (lang == "es") alert("oops! te olvidaste de escribir tu e-mail");
			  else if (lang == "cat") alert("oops! has oblidat escriure el teu e-mail");
			  else alert("oops! you forgot to enter your e-mail");
			  document.contactForm.email.focus();
			  env = false;
			}	
		else if (sugerencias==null&&document.contactForm.subject.value == "") 
			{ 
			  if (lang == "es") alert("oops! te olvidaste de escribir el asunto");
			  else if (lang == "cat") alert("oops! has oblidat escriure l'assumpte");
			  else alert("oops! you forgot to write the subject");
			  document.contactForm.subject.focus();
			  env = false;
			}	
		else if (document.contactForm.message.value == "") 
			{ 
			  if (lang == "es") alert("oops! te olvidaste de escribir el mensaje");
			  else if (lang == "cat") alert("oops! has oblidat escriure el missatge");
			  else alert("oops! you forgot to write the message");
			  document.contactForm.message.focus();
			  env = false;	
			}	
		else if (env) {document.contactForm.submit()}
}


function validateRegistration(lang){
	var date = new Date();
	var d  = date.getDate();
	var day = (d < 10) ? '' + d : d;
	var m = date.getMonth() + 1;
	var month = (m < 10) ? '0' + m : m;
	var yy = date.getYear();
	var year = (yy < 1000) ? yy + 1900 : yy;

	indexDay = document.regForm.regDay.selectedIndex;
	indexMonth = document.regForm.regMonth.selectedIndex;
	indexYear = document.regForm.regYear.selectedIndex;
	indexCountry = document.regForm.regCountry.selectedIndex;			
  	var checkedDev = false;
  	var radiobuttons = document.regForm.regDeveloper;
  	for (var i=0; i<radiobuttons.length; i++)    
  	{      if (radiobuttons[i].checked) {
  	        checkedDev = true;
  	        break; 
  	        }
  	} 
  	var checkedGender = false;
  	var radiobuttons = document.regForm.regGender;
  	for (var i=0; i<radiobuttons.length; i++)    
  	{      if (radiobuttons[i].checked) {
  	        checkedGender = true;
  	        break; 
  	        }
  	} 
	env = true;
	if (document.regForm.regEmail.value  == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir tu direcci"+String.fromCharCode(243)+"n de e-mail");
		  else if (lang == "cat") alert("oops! has oblidat escriure la teua direcci"+String.fromCharCode(243)+" d'e-mail");
		  else alert("oops! you forgot to enter your e-mail address");
		  document.regForm.regEmail.focus();
		  env = false;
		}	
	else if (document.regForm.regPassword1.value  == "")
			{
			  if (lang == "es") alert("oops! te olvidaste de escribir la contrase"+String.fromCharCode(241)+"a");
			  else if (lang == "cat") alert("oops! has oblidat esciure la contrasenya");
			  else alert("oops! you forgot to enter the password");
			  document.regForm.regPassword1.focus();
			  env = false;
			}
	else if (document.regForm.regPassword2.value  == "")
			{
			  if (lang == "es") alert("oops! te olvidaste de repetir la contrase"+String.fromCharCode(241)+"a");
			  else if (lang == "cat") alert("oops! has oblidat repetir la contrasenya");
			  else alert("oops! you forgot to repeat the password");
			  document.regForm.regPassword2.focus();
			  env = false;
			}	
	else if (!(document.regForm.regPassword1.value  == document.regForm.regPassword2.value))
			{
			  if (lang == "es") alert("oops! las contrase"+String.fromCharCode(241)+"as no coinciden");
			  else if (lang == "cat") alert("oops! les contrasenyes no coindideixen");
			  else alert("oops! the passwords donīt match");
			  document.regForm.regPassword2.focus();
			  env = false;
			}
	else if (document.regForm.regUsername.value  == "")
			{
			  if (lang == "es") alert("oops! te olvidaste de escribir tu nombre de usuario");
			  else if (lang == "cat") alert("oops! has oblidat escriure el teu nom d'usuari");
			  else alert("oops! you forgot to enter your username");
			  document.regForm.regUsername.focus();
			  env = false;
			}
	else if (checkedDev  == false)
			{
			  if (lang == "es") alert("oops! te olvidaste de seleccionar si eres desarrollador o no");
			  else if (lang == "cat") alert("oops! has oblidat seleccionar si eres programador o no");
			  else alert("oops! you forgot to select wether you are a developer or not");
			  env = false;
			}
	else if (document.regForm.regDay.options[indexDay].text  == "--") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de seleccionar el d"+String.fromCharCode(237)+"a de tu cumplea"+String.fromCharCode(241)+"os");
		  else if (lang == "cat") alert("oops! has oblidat seleccionar el dia del teu aniversari");
		  else alert("oops! you forgot to enter your birthday day");
		  document.regForm.regDay.focus();
		  env = false;
		}	
	else if (document.regForm.regMonth.options[indexMonth].text  == "--") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de seleccionar el mes de tu cumplea"+String.fromCharCode(241)+"os");
		  else if (lang == "cat") alert("oops! has oblidat seleccionar el mes del teu aniversari");
		  else alert("oops! you forgot to enter your birthday month");
		  document.regForm.regMonth.focus();
		  env = false;
		}	
	else if (document.regForm.regYear.options[indexYear].text  == "----") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de seleccionar el a"+String.fromCharCode(241)+"o de tu cumplea"+String.fromCharCode(241)+"os");
		  else if (lang == "cat") alert("oops! has oblidat seleccionar l'any del teu aniversari");
		  else alert("oops! you forgot to enter your birthday year");
		  document.regForm.regYear.focus();
		  env = false;
		}	


	else if (document.regForm.regYear.options[indexYear].text > (year-14))
		{
		  if (lang == "es") alert("oops! debes tener al menos 14 a"+String.fromCharCode(241)+"os de edad para poderte registrar en Tamakum!");
		  else if (lang == "cat") alert("oops! has de tenir com a m"+String.fromCharCode(237)+"nim 14 anys d'edat per poder-te registrar en Tamakum!");
		  else alert("oops! you must be at least 14 years old to register in Tamakum!");
		  document.regForm.regYear.focus();
		  env = false;
		}
	else if ((document.regForm.regMonth.options[indexMonth].text > month) && (document.regForm.regYear.options[indexYear].text == year-14))
		{
		  if (lang == "es") alert("oops! debes tener al menos 14 a"+String.fromCharCode(241)+"os de edad para poderte registrar en Tamakum!");
		  else if (lang == "cat") alert("oops! has de tenir com a m"+String.fromCharCode(237)+"nim 14 anys d'edat per poder-te registrar en Tamakum!");
		  else alert("oops! you must be at least 14 years old to register in Tamakum!");
		  document.regForm.regYear.focus();
		  env = false;
		}
	else if ((document.regForm.regDay.options[indexDay].text > day) && (document.regForm.regMonth.options[indexMonth].text == month) && (document.regForm.regYear.options[indexYear].text == year-14))
		{
		  if (lang == "es") alert("oops! debes tener al menos 14 a"+String.fromCharCode(241)+"os de edad para poderte registrar en Tamakum!");
		  else if (lang == "cat") alert("oops! has de tenir com a m"+String.fromCharCode(237)+"nim 14 anys d'edat per poder-te registrar en Tamakum!");
		  else alert("oops! you must be at least 14 years old to register in Tamakum!");
		  document.regForm.regYear.focus();
		  env = false;
		}


	else if (checkedGender  == false)
			{
			  if (lang == "es") alert("oops! te olvidaste de seleccionar tu sexo");
			  else if (lang == "cat") alert("oops! has oblidat seleccionar el teu sexe");
			  else alert("oops! you forgot to select your gender");
			  env = false;
			}
	else if (document.regForm.regCountry.options[indexCountry].text  == "--------") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de seleccionar tu pa"+String.fromCharCode(237)+"s");
		  else if (lang == "cat") alert("oops! has oblidat seleccionar el teu pais");
		  else alert("oops! you forgot to select your country");
		  document.regForm.regCountry.focus();
		  env = false;
		}	
	/*
	else if (document.regForm.regZip.value  == "")
			{
			  if (lang == "es") alert("oops! te olvidaste de escribir tu c"+String.fromCharCode(243)+"digo postal");
			  else if (lang == "cat") alert("oops! has oblidat seleccionar el teu codi postal");
			  else alert("oops! you forgot to enter your zip code");
			  document.regForm.regZip.focus();
			  env = false;
			}
	*/
	else if (document.regForm.regAccept.checked  == false)
			{
			  if (lang == "es") alert("oops! te olvidaste de aceptar las condiciones de uso y la pol"+String.fromCharCode(237)+"tica de privacidad");
			  else if (lang == "cat") alert("oops! has oblidat acceptar les condicions d'us i la pol"+String.fromCharCode(237)+"tica de privacitat");
			  else alert("oops! you forgot to accept the terms and conditions and privacy policy");
			  env = false;
			}
	else if (env) {document.regForm.submit()}
}

function validateUsernameLength(){
var usernameLength = document.regForm.regUsername.value.length;
if (usernameLength > 20) {document.regForm.regUsername.value=document.regForm.regUsername.value.substring(0, 20)}
usernameLength = document.regForm.regUsername.value.length;
document.regForm.regUsernameLength.value=usernameLength;
}

function validateAddSite(lang){
	indexCountry = document.addSiteForm.country.selectedIndex;			
	indexCategory = document.addSiteForm.category.selectedIndex;			
	env = true;
	if (document.addSiteForm.title.value  == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir el t"+String.fromCharCode(237)+"tulo de tu web");
		  else if (lang == "cat") alert("oops! has oblidat escriure el t"+String.fromCharCode(237)+"tol de la teua web");
		  else alert("oops! you forgot to enter your website title");
		  document.addSiteForm.title.focus();
		  env = false;
		}	
	else if (document.addSiteForm.url.value  == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir la URL de tu web");
		  else if (lang == "cat") alert("oops! has oblidat escriure la URL de la teua web");
		  else alert("oops! you forgot to enter your website URL");
		  document.addSiteForm.url.focus();
		  env = false;
		}	
	else if (document.addSiteForm.description.value  == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir la descripci"+String.fromCharCode(243)+"n de tu web");
		  else if (lang == "cat") alert("oops! has oblidat escriure la descripci"+String.fromCharCode(243)+" de la teua web");
		  else alert("oops! you forgot to enter your website description");
		  document.addSiteForm.description.focus();
		  env = false;
		}	
	else if (document.addSiteForm.category.options[indexCategory].text  == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de seleccionar una categor"+String.fromCharCode(237)+"a");
		  else if (lang == "cat") alert("oops! has oblidat seleccionar una categoria");
		  else alert("oops! you forgot to select a category");
		  document.addSiteForm.category.focus();
		  env = false;
		}	
	else if (document.addSiteForm.country.options[indexCountry].text  == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de seleccionar el pa"+String.fromCharCode(237)+"s");
		  else if (lang == "cat") alert("oops! has oblidat seleccionar el teu pais");
		  else alert("oops! you forgot to select your country");
		  document.addSiteForm.country.focus();
		  env = false;
		}	
	else if (document.addSiteForm.urlTamakum.value  == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir la url donde podemos encontrar el enlace a www.tamakum.com");
		  else if (lang == "cat") alert("oops! has oblidat escriure la url on podem trobar el enllaį a www.tamakum.com");
		  else alert("oops! you forgot to enter the URL where we can find the link to www.tamakum.com");
		  document.addSiteForm.urlTamakum.focus();
		  env = false;
		}	
	else if (document.addSiteForm.contactEmail.value  == "") 
		{ 
		  if (lang == "es") alert("oops! te olvidaste de escribir tu direcci"+String.fromCharCode(243)+"n de e-mail");
		  else if (lang == "cat") alert("oops! has oblidat escriure la teua direcci"+String.fromCharCode(243)+" d'e-mail");
		  else alert("oops! you forgot to enter your e-mail address");
		  document.addSiteForm.contactEmail.focus();
		  env = false;
		}	
	else if (env) {document.addSiteForm.submit()}
}

function validateSiteDescriptionLength(){
var descriptionLength= document.addSiteForm.description.value.length;
if (descriptionLength > 110) {document.addSiteForm.description.value=document.addSiteForm.description.value.substring(0, 110)}
descriptionLength = document.addSiteForm.description.value.length;
document.addSiteForm.siteDescriptionLength.value=descriptionLength+"/110" ;
}

function getCookie(name){
  var cname = name + "=";               
  var dc = document.cookie;             
  if (dc.length > 0) {              
    begin = dc.indexOf(cname);       
    if (begin != -1) {           
      begin += cname.length;       
      end = dc.indexOf(";", begin);
      if (end == -1) end = dc.length;
        return unescape(dc.substring(begin, end));
    } 
  }
  return null;
}

function setCookie(name, value, expires, path, domain, secure) {
  document.cookie = name + "=" + escape(value) + 
  ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
  ((path == null) ? "" : "; path=" + path) +
  ((domain == null) ? "" : "; domain=" + domain) +
  ((secure == null) ? "" : "; secure");
}

function detectBrowser(){	// detecta la versión del explorer y la devuelve de manera amigable
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 if (ieversion>=8)
  return("ok");
 else if (ieversion>=7)
    return("ie7");
 else if (ieversion>=6)
  return("ie6");
 else if (ieversion>=5)
  return("no");
}
else 
  return("ok");
}

function tmkToolbarInit(){
var tmkToolbar = document.getElementById('tmkToolbar');
if (detectBrowser()=="ie6") {
	tmkToolbar.style.position='absolute';
	}
tmkToolbar .style.display="block";
}
	
function tmkToolbarStick(){
//var tmkToolbar = document.getElementById('tmkToolbar');
if (detectBrowser()=="ie6") {
	document.getElementById('tmkToolbar').style.position='absolute';
	//window.status= document.documentElement.scrollTop;
	document.getElementById('tmkToolbar').style.top=getViewportHeight()+document.documentElement.scrollTop-document.getElementById('tmkToolbar').offsetHeight+'px';
	}
}	


