


var spacer = "           ";
var pozitie = 0;
function ScrollMessage(msg) {
   document.currentplaying.currentplayingtext.value = msg.substring(pozitie, msg.length) + spacer + msg.substring(0,pozitie);
   pozitie++;
   if (pozitie > msg.length) pozitie = 0;
   var call="ScrollMessage(\""+msg+"\")";
   //document.currentplaying.currentplayingtext.value = call; 
   window.setTimeout(call,150);
}

function image_zoom(img_big, description){
	var temp = new Image();
	//alert(img_big);
	//temp.src=img_big;
	s=img_big;
	s=s.replace("À","%C0");
	s=s.replace("à","%E0");
	s=s.replace("Á","%C1");
	s=s.replace("á","%E1");
	s=s.replace("Â","%C2");
	s=s.replace("â","%E2");
	s=s.replace("Ã","%C3");
	s=s.replace("ã","%E3");
	s=s.replace("Ä","%C4");
	s=s.replace("ä","%E4");
	s=s.replace("Å","%C5");
	s=s.replace("å","%E5");
	s=s.replace("Ç","%C7");
	s=s.replace("ç","%E7");
	s=s.replace("È","%C8");
	s=s.replace("è","%E8");
	s=s.replace("É","%C9");
	s=s.replace("é","%E9");
	s=s.replace("Ê","%CA");
	s=s.replace("ê","%EA");
	s=s.replace("Ë","%CB");
	s=s.replace("ë","%EB");
	s=s.replace("Ì","%CC");
	s=s.replace("ì","%EC");
	s=s.replace("Í","%CD");
	s=s.replace("í","%ED");
	s=s.replace("Ï","%CF");
	s=s.replace("ï","%EF");
	s=s.replace("Ñ","%D1");
	s=s.replace("ñ","%F1");
	s=s.replace("Ò","%D2");
	s=s.replace("ò","%F2");
	s=s.replace("Ó","%D3");
	s=s.replace("ó","%F3");
	s=s.replace("Ô","%D4");
	s=s.replace("ô","%F4");
	s=s.replace("Õ","%D5");
	s=s.replace("õ","%F5");
	s=s.replace("Ö","%D6");
	s=s.replace("ö","%F6");
	s=s.replace("Ù","%D9");
	s=s.replace("ù","%F9");
	s=s.replace("Ú","%DA");
	s=s.replace("ú","%FA");
	s=s.replace("Û","%DB");
	s=s.replace("û","%FB");
	s=s.replace("Ü","%DC");
	s=s.replace("ü","%FC");
	s=s.replace("Ý","%DD");
	s=s.replace("ý","%FD");
	s=s.replace("¡","%A1");
	s=s.replace("¿","%BF");
	temp.src='http://www.mariwel.com/'+s;
	var page = '<html><head><title>Mariwel.com</title><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></head><body bgcolor="#ffffff" rightmargin="5" leftmargin="5" bottommargin="5" topmargin="5">'+
		'<table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%">'+
		'<tr><td height="100%" align="center"><a href=""><img align="middle" src="'+temp.src+'" border=0 onclick="self.close();" onload="self.window.resizeTo((this.width+25),(this.height+110)); if(screen) self.window.moveTo( ((screen.width-this.width)/2), ((screen.height-this.height)/2));" style="border:1px solid #DDE8F7;"></a></td></tr>'+
		'<tr><td align="center" style="font-family:tahoma; font-size:13px; font-weight:normal; color:#333333;">'+description+'</td></tr>'+
		'</table></body></html>';
	var attribs = ',' + "menubar=0,location=0,toolbar=0,status=0,scrollbars=0,resizable=0, width=100,height=100";
	var wind = window.open('','_blank',attribs);

	wind.document.open();
	wind.document.write(page);
	wind.document.close();

}



function changeAction(formul,limba)
{
	
	
	
	for (i=0;i<document.forms[formul].sitesearch.length;i++) {
	if (document.forms[formul].sitesearch[i].checked) {
		user_input = document.forms[formul].sitesearch[i].value;
	}
}
	//var radio = document.forms[formul].sitesearch[0].value;
	//alert(user_input);
	if(user_input=='2')
	{
		document.forms[formul].action = 'http://www.mariwel.com/index.php?language='+limba+'&pag=200';
		document.forms[formul].target = '';
		document.forms[formul].method = 'post';
	}
	else
	{
		document.forms[formul].action = 'http://www.google.com/custom';
		document.forms[formul].target = 'google_window';
		document.forms[formul].method = 'get';
	}
	
	
}


function populate(formul)
{
	var box = document.forms[formul].tara;
	
	var number = box.options[box.selectedIndex].value;
	
	if (!number) return;
	if(number=='Spain' || number=='España'){
	var list = new Array(
	'Álava','Álava','Albacete','Albacete','Alicante','Alicante','Almería','Almería','Asturias','Asturias','Ávila','Ávila','Badajoz','Badajoz',
    'Barcelona','Barcelona','Burgos','Burgos','Cáceres','Cáceres','Cádiz','Cádiz','Cantabria','Cantabria','Castellón','Castellón','Ceuta','Ceuta',
	'Ciudad Real','Ciudad Real','Córdoba','Córdoba','Cuenca','Cuenca','Gerona','Gerona','Granada','Granada',                         
    'Guadalajara','Guadalajara','Guipúzcoa','Guipúzcoa','Huelva','Huelva','Huesca','Huesca','Islas Baleares','Islas Baleares','Jaén','Jaén',
	'La Coruña','La Coruña','La Rioja','La Rioja','Las Palmas','Las Palmas','León','León','Lérida','Lérida','Lugo','Lugo','Madrid','Madrid','Málaga','Málaga',       	    'Melilla','Melilla','Murcia','Murcia','Navarra','Navarra','Orense','Orense','Palencia','Palencia','Pontevedra','Pontevedra','Salamanca','Salamanca',               
    'Segovia','Segovia','Sevilla','Sevilla','Soria','Soria','Tarragona','Tarragona','Tenerife','Tenerife','Teruel','Teruel','Toledo','Toledo',                        
    'Valencia','Valencia','Valladolid','Valladolid','Vizcaya','Vizcaya','Zamora','Zamora','Zaragoza','Zaragoza');
	}
	else
	{
	var list = new Array(
	'Bedfordshire','Bedfordshire','Berkshire','Berkshire','Buckinghamshire','Buckinghamshire','Cambridgeshire','Cambridgeshire',
	'Cheshire','Cheshire','Cornwall','Cornwall','Cumberland','Cumberland','Derbyshire','Derbyshire','Devon','Devon',
	'Dorset','Dorset','Durham','Durham','Essex','Essex','Gloucestershire','Gloucestershire','Hampshire','Hampshire',
	'Herefordshire','Herefordshire','Hertfordshire','Hertfordshire','Huntingdonshire','Huntingdonshire','Kent','Kent',
	'Lancashire','Lancashire','Leicestershire','Leicestershire','Lincolnshire','Lincolnshire','London','London',
	'Middlesex','Middlesex','Norfolk','Norfolk','Northamptonshire','Northamptonshire','Northumberland','Northumberland',
	'Nottinghamshire','Nottinghamshire','Oxfordshire','Oxfordshire','Rutland','Rutland','Shropshire','Shropshire',
	'Somerset','Somerset','Staffordshire','Staffordshire','Suffolk','Suffolk','Surrey','Surrey','Sussex','Sussex',
	'Warwickshire','Warwickshire','Westmoreland','Westmoreland','Wiltshire','Wiltshire','Worcestershire','Worcestershire','Yorkshire','Yorkshire' );
	}
	
	var box2 = document.forms[formul].stat;
	//alert(box2);
	box2.options.length = 0;
	
	for(i=0;i<list.length;i+=2)
	{	
		box2.options[i/2] = new Option(list[i],list[i+1]);
	}
}
// nbti = newsbox tab ids
var nbti = Array('blog', 'friends', 'comments');	

function newsbox_switch(tab_name) {
	
	var nbti_length = nbti.length;
	
	for(i = 0; i < nbti_length; i++) {
		//alert(i);
		document.getElementById('newsbox_' + nbti[i]).style.display = 'none';
		document.getElementById('switch_nba_' + nbti[i]).style.display = 'none';
//		$('switch_nb_' + nbti[i]).style.backgroundImage = "url('img/home/bg-blue-tab.gif')";	
		document.getElementById('switch_nb_' + nbti[i]).style.background = "#063b85";
		document.getElementById('switch_nb_a_' + nbti[i]).style.color = "#FFFFFF";
	}
	
	document.getElementById('newsbox_' + tab_name).style.display = '';
	document.getElementById('switch_nba_' + tab_name).style.display = '';
//	$('switch_nb_' + tab_name).style.backgroundImage = "url('img/home/bg-blue-h-tab-hover.gif')";
	document.getElementById('switch_nb_' + tab_name).style.background = "#DDE8F7";
	document.getElementById('switch_nb_a_' + tab_name).style.color = "#063b85";
}





function submitform()
{
  document.myform.submit();
}
    
	function pollwin(pollobj,poll_path){
		var p_vot = 0;
		var p_opt = 0;
		for(i=0; i < pollobj.length; i++){
			p_obj = pollobj.elements[i];
			if(p_obj.name =='vote'){
				p_opt++;
				if(p_obj.checked){
					p_vot = 1;				
		}	}	}
		if(p_vot){
			p_width = 424;
			p_height = 230;/*(p_opt * 45) + 54;	*/
			p_opt = 'scrollBars=1,resizable=0,width='+ p_width +',height='+p_height;
			p_wnd = window.open(poll_path,'poll_win',p_opt);
			p_wnd.focus();
			return true;
		} else alert('You must select an option in order to vote.');
		return false;
	}		


function openWin( windowURL, windowName, windowFeatures ) {
	window.open( windowURL, windowName, windowFeatures ) ;
		}

function PopupPic(sPicURL) {
     window.open( "popup.html?"+sPicURL, "Mariwel.com","resizable=1,HEIGHT=200,WIDTH=200");
   }
  function PopupFact(id) {
     window.open( "popfact.php?fact="+id, "_blank");
   }   
function popitup(url,argum)
{
	newwindow=window.open(url,'name',argum);
	if (window.focus) {newwindow.focus()}
	return false;
}

function HideShow() {
if (document.getElementById("one") != null){
if(document.getElementById("one").style.display=="none") {
   document.getElementById("one").style.display="";
 }
else {
   document.getElementById("one").style.display="none";
   }
}

if (document.getElementById("two") != null){
if(document.getElementById("two").style.display=="none") {
   document.getElementById("two").style.display="";
 }

else {
   document.getElementById("two").style.display="none";
   }
}


if (document.getElementById("three") != null){ 
if(document.getElementById("three").style.display=="none") {
   document.getElementById("three").style.display="";
 }

else {
   document.getElementById("three").style.display="none";
   }
}   

if (document.getElementById("four") != null){  
if(document.getElementById("four").style.display=="none") {
   document.getElementById("four").style.display="";
 }

else {
   document.getElementById("four").style.display="none";
   }
}

if (document.getElementById("five") != null){
if(document.getElementById("five").style.display=="none") {
   document.getElementById("five").style.display="";
 }
else {
   document.getElementById("five").style.display="none";
   }
}

if (document.getElementById("six") != null){  
if(document.getElementById("six").style.display=="none") {
   document.getElementById("six").style.display="";
 }
else {
   document.getElementById("six").style.display="none";
   }
}

}