<!--

function getSize() {
	
	var myWidth = 0, myHeight = 0;
  	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
	  
	  	  
	  document.getElementById('swirl_wrapper').style.minHeight = myHeight + 'px';
	
}


function share() {
		
	document.getElementById('video').style.display = 'none';
	document.getElementById('share').style.display = 'block';
	document.getElementById('share_box1').style.display = 'block';
	document.getElementById('share_box2').style.display = 'none';
	document.getElementById('share_box3').style.display = 'none';
	document.body.style.overflow = 'hidden';
	
	/*window.innerHeight/Width
		Provided by most browsers, but importantly, not Internet Explorer.
	document.body.clientHeight/Width
		Provided by many browsers, including Internet Explorer.
	document.documentElement.­clientHeight/Width
		Provided by most DOM browsers, including Internet Explorer. 
	
	if (parseInt(navigator.appVersion)>3) {
		if (navigator.appName=="Netscape") {
	  		winW = window.innerWidth;
	  		winH = window.innerHeight;
	 	}
		
		if (navigator.appName.indexOf("Microsoft")!=-1) {
	  		winW = document.body.offsetWidth;
	  		winH = document.body.offsetHeight;
	 	}
	}
	*/	
	
	var myWidth = 0, myHeight = 0;
  	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }



	
	
	if (myHeight < 600) {
		document.getElementById('top_space').style.height = '0';		
	}
	
	else {
		var position = (myHeight - 600) / 2;
		var position = Math.round(position);

		var position = position - 100;
		document.getElementById('top_space').style.height = position + 'px';
	}
	
	
	
	document.forms.share_form.your_name.focus();

}

function closeShare() {
	document.getElementById('share').style.display = 'none';
	
	document.getElementById('share_box1').style.display = 'none';
	document.getElementById('share_box2').style.display = 'none';
	document.getElementById('share_box3').style.display = 'none';

	document.body.style.overflow = 'visible';
	
	document.getElementById('video').style.display = 'block';
}



function validate_email(field,alerttxt) {
	with (field) {
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		
		if (apos<1||dotpos-apos<2) {
			alert(alerttxt);return false;
			}
		else {
			return true;
			}
			
	}
}

function validate_required(field,alerttxt) {
	with (field) {
		if (value==null||value=="") {
			alert(alerttxt);return false;
			}
		else {
			return true
			}
	}
}

function validate_form(thisform) {
	with (thisform) {
		
		var count = 0;
		
		if (validate_required(your_name,"Your name must be included")==false) {
			your_name.focus();return false;
			}
		else {
			var count = count + 1;
			}
		
		if (validate_required(your_email_address,"Your e-mail address must be included")==false) {
			your_email_address.focus();return false;
			}
		else
			var count = count + 1;
			
		if (validate_email(your_email_address,"Your e-mail address is not valid")==false) {
			your_email_address.focus();return false;
		}	
		else {
			var count = count + 1;
			}
		
		if (validate_required(friend_name,"Your friend's name must be included")==false) {
			friend_name.focus();return false;
			}
		else {
			var count = count + 1;
			}
			
		if (validate_required(friend_email_address,"Your friend's e-mail address must be included")==false) {
			friend_email_address.focus();return false;
			}
		else
			var count = count + 1;
			
		if (validate_email(friend_email_address,"Your friend's e-mail address is not valid")==false) {
			friend_email_address.focus();return false;
			}
		else {
			var count = count + 1;
			}
		
		if (validate_required(subject,"The subject must be included")==false) {
			subject.focus();return false;
			}
		else {
			var count = count + 1;
			}
	
		if (count == 7) {
			/*document.getElementById('share_box').innerHTML = 'test';*/
			var url = 'send_email.php?video=' + videoID.value + '&your_name=' + your_name.value + '&your_email_address=' + your_email_address.value + '&friend_name=' + friend_name.value + '&friend_email_address=' + friend_email_address.value + '&subject=' + subject.value;
			
			
				var new_message = message.value;
				new_message = new_message.replace("#","No. ")
				url = url + '&message=' + new_message;
			
			
			url = url + '&window=1';
			
			newwindow=window.open(url,'popup','width=200,height=75,left=100,top=100,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0');
			newwindow.focus();
			return false;
		}
		
	}
}


//-->
