// JavaScript Document
function ShowVideo(Video,Splash,Width,Height)
{ 
 	sm('box',Width + 10,Height + 40);	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	var url="/show-video.php";
	url=url+"?w="+Width+"&h="+Height+"&v="+Video+"&s="+Splash;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function(){stateChanged("ShowVideo")};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
	document.getElementById('ShowVideo').style.display = 'block';	
	
}

function PlayVideo(video,splash,width,height)
{
   document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + width + '" height="' + height + '"> \n');
   document.write('<param name="movie" value="http://www.cabdevmontessori.com/media/' + video + '" />\n');
   document.write('<param name="flashvars" value="playerOpts=thumbNail*/media/' + splash + '*s" />\n'); 
   document.write('<param name="quality" value="high" />\n');
   document.write('<embed src="http://www.cabdevmontessori.com/media/' + video + '" flashvars="playerOpts=thumbNail*/media/' + splash + '*s" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"> \n');
   document.write('</object>\n');  
}

function showSignUpForm(imageWidth,imageHeight)
{ 
 	sm('box',imageWidth + 10,imageHeight + 40);	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	var url="/sign-up-form.php";
	url=url+"?w="+imageWidth+"&h="+imageHeight;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function(){stateChanged("ShowVideo")};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
	loadcssfile("/skin1/sign-up-form.css");	
	document.getElementById('ShowVideo').style.display = 'block';	
}

function loadcssfile(filename)
{						
	var fileref=document.createElement("link")
	fileref.setAttribute("rel", "stylesheet")
	fileref.setAttribute("type", "text/css")
	fileref.setAttribute("href", filename)
					 	
	if (typeof fileref!="undefined")
  		document.getElementsByTagName("head")[0].appendChild(fileref)
}

function ShowContent(URL,Title,Width,Height)
{ 
 	sm('box',Width + 10,Height + 40);	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	var url= "/"+URL;
	url=url+"?w="+Width+"&h="+Height+"&t="+Title;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function(){stateChanged("ShowVideo")};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
	
	document.getElementById('ShowVideo').style.display = 'block';	
}


