
/**************************************************************

	Script		: Restaurante Babylon
	Version		: 1.0
	Author		: Rodolfo Buaiz
	Desc		: special site functions
	Licence		: use as u wish

**************************************************************/
// the <div id="page"> contains the <div id="flashcontent">
var theHeight;


function newSize(h) 
{
	var the_layer;
	if(document.all && !document.getElementById) {
		the_layer = document.all['page'].style;
		the_layer.pixelHeight = h;
		// alert("pixelHeight: "+the_layer.pixelHeight)
	}else{
		the_layer = document.getElementById('page').style;
		the_layer.height = h;
		// alert("height: "+the_layer)
	}
}


function locacion(c) 
{
	document.location.href = c;
}	


function www(loc,extras)
{ 
	w = 900;
	h = 600;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	options = 'width='+w+ ',height='+h+ ',top='+TopPosition+',left='+LeftPosition+',resizable=1,menubar='+extras+',toolbar='+extras+',location='+extras+',directories=0,scrollbars=1';
	newWin=window.open(loc, 'Babylon', options); 
} 


function getViewportSize() 
{ 
	var size = [0, 0]; 
	if (typeof window.innerWidth != "undefined") 
	{ 
		size = [window.innerWidth, window.innerHeight];
	} 
	else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) 
	{
		size = [document.documentElement.clientWidth, document.documentElement.clientHeight]; 
	}
	else 
	{
		size = [document.getElementsByTagName("body")[0].clientWidth, document.getElementsByTagName("body")[0].clientHeight]; 
	}
	return size[1]; 
}


function populateTube(id)
{
	var the_layer;
	if(document.all && !document.getElementById) {
		the_layer = document.all['page'].style;
		theHeight = the_layer.pixelHeight;
	}else{
		the_layer = document.getElementById('page').style;
		theHeight = the_layer.height;
	}
	/*newSize('0px');*/
	
	var newHTML = "<iframe width='100%' height='600px' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='youtube.php?id="+id+"'></iframe>";
	document.getElementById('myIframe').innerHTML = newHTML;
	//window.scroll(0,5550);
}

function populateMap()
{
	var the_layer;
	if(document.all && !document.getElementById) {
		the_layer = document.all['page'].style;
		theHeight = the_layer.pixelHeight;
	}else{
		the_layer = document.getElementById('page').style;
		theHeight = the_layer.height;
	}
	newSize('105px');
	
	var newHTML = "<iframe width='100%' height='550' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=restaurante+babylon&amp;sll=39.470239,-0.376805&amp;sspn=0.666809,1.234589&amp;ie=UTF8&amp;hq=restaurante+babylon&amp;hnear=&amp;ll=39.486423,-0.381088&amp;spn=0.010418,0.01929&amp;t=h&amp;z=14&amp;iwloc=A&amp;cid=13229859727954723214&amp;output=embed'></iframe>";
	document.getElementById('myIframe').innerHTML = newHTML;
	window.scroll(0,5550);
}


function unpopulateIframe(){
	newSize('100%');
	var newHTML = "<div style='height:0px; display:block; margin-top:1200px;'></div>";
	document.getElementById('myIframe').innerHTML = newHTML;
}


function openNewWindow(e) {
	var newWindow = window.open(e, '_blank');
	if (newWindow) {
		if (newWindow.focus) {
			newWindow.focus();
		}
	}
}