// JavaScript Document
function embedVimeo(videoID, vidWidth, vidHeight, divID){
	//alert(videoID);
	var agent=navigator.userAgent.toLowerCase();
	var is_iphone = (agent.indexOf('iphone')!='-1');
	var is_ipad = (agent.indexOf('ipad')!='-1');
	
	
	if(vidWidth === undefined || vidWidth == ''){
		vidWidth = 590;
	}
	
	
	if(vidHeight === undefined || vidHeight == ''){
		vidHeight = Math.round((parseInt(vidWidth) * 9) / 16);
	}
	
	if(parseInt(vidWidth) > 590){
		vidWidth = 590;
		vidHeight = 332;
	}
	
	if(divID === undefined){
		container = document.getElementById('vimeo');
	}else{
		container = document.getElementById(divID);
	}
	
	var theVideo = document.createElement('iframe');
	theVideo.setAttribute('src', 'http://player.vimeo.com/video/'+videoID+'?title=0&amp;byline=0&amp;portrait=0');
	theVideo.setAttribute('width', vidWidth);
	theVideo.setAttribute('height', vidHeight);
	theVideo.setAttribute('frameborder', '0');
	
	container.appendChild(theVideo);
	
}
