function EmbedFlash(URL, width, height, menu, quality, bg, bg2){

	//Checks if the menu constance is entered (correctly)
	if(menu != true && menu != false && menu != "true" && menu != "false"){
		menu = true; //Replace with default. Default = true.
	}
	
	//Checks if the quality constance is entered (correctly)
	if(quality != "high" && quality != "normal" && quality != "low"){
		quality = "high";	//Replace with default. Defautl = high.
	}
	
	//See if we can continue.	
	if(URL == null || width == null || height == null){
		//Nope, we can't.
		document.writeln("No URL, width or height entered");
	}else{
		//Add the code to the document.
		document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="6,0,0,0" width="' +  width + '" height="' + height + '">');
		document.writeln('<param name="movie" value="' + URL + '" />');
		document.writeln('<param name="quality" value="' + quality + '" />');
		document.writeln('<param name="menu" value="' + menu + '" />');
		document.writeln('<param name="bgcolor" value="' + bg + '" />');
		document.writeln('<param name="play" value="true" />');
		document.writeln('<embed bgcolor="'+ bg2 +'" width="' +  width + '" height="' + height + '" src="' + URL + '" menu="' + menu + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="best" play="true"></embed></object>');
	}
}


function EmbedQuicktime(URL, width, height, autoplay){
	if(autoplay != true && autoplay != false && autoplay != "true" && autoplay != "false"){
		autoplay = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null || width == null || height == null){
		//Nope, we can't.
		document.writeln("No URL, width or height entered");
	}else{
		//Add the code to the document.
		document.writeln('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" TYPE="video/quicktime" width="' +  width + '" height="' + height + '">');
		document.writeln('<param name="src" value="' + URL + '" />');
		document.writeln('<param name="volume" value="25" />');
		document.writeln('<param name="autoplay" value="'+ autoplay +'" />');
		document.writeln('<param name="autohref" value="'+ autoplay +'" />');
		document.writeln('<param name="cache" value="true" />');
		document.writeln('<param name="scale" value="aspect" />');
		document.writeln('<embed width="' +  width + '" height="' + height + '" src="' + URL + '" pluginspage="http://www.apple.com/quicktime/download/" type="video/quicktime" cahce="true" scale="aspect" autohref="' + autoplay + '" AUTOPLAY="' + autoplay + '" volume="25"></embed></object>');
	}
}

function EmbedWMAudio(URL, autostart){
	if(autostart != true && autostart != false && autostart != "true" && autostart != "false"){
		autostart = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null){
		//Nope, we can't.
		document.writeln("No URL entered");
	}else{
		//Add the code to the document.
		document.writeln('<OBJECT ID="MediaPlayer" WIDTH="360" HEIGHT="70" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
		document.writeln('STANDBY="Please wait while the Windows Media Player components load" TYPE="application/x-oleobject" />');
		document.writeln('<PARAM NAME="FileName" VALUE="' + URL + '" />');
		document.writeln('<PARAM name="autostart" VALUE="'+ autostart +'" />');
		document.writeln('<PARAM name="ShowControls" VALUE="true" />');
		document.writeln('<PARAM name="volume" VALUE="50" />');
		document.writeln('<param name="SHOWTRACKER" value="true" />');
		document.writeln('<param name="ShowStatusBar" value="true" />');
		document.writeln('<PARAM name="ShowDisplay" VALUE="false" />');
		document.writeln('<embed width="360" height="70" src="' + URL + '" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" type="application/x-mplayer2" autostart="'+ autostart +'" transparentstart="1" loop="0" controller="true" showstatusbar=1 showdisplay=0></embed></object>');
	}
}

function EmbedWMVideo(URL, width, height, autostart){
	if(autostart != true && autostart != false && autostart != "true" && autostart != "false"){
	autostart = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null){
		//Nope, we can't.
		document.writeln("No URL entered");
	}else{
		//Add the code to the document.
		document.writeln('<OBJECT ID="MediaPlayer" WIDTH="' +  width + '" HEIGHT="' +  height + '" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
		document.writeln('STANDBY="Please wait while the Windows Media Player components load" TYPE="application/x-oleobject" />');
		document.writeln('<PARAM NAME="FileName" VALUE="' + URL + '" />');
		document.writeln('<PARAM name="autostart" VALUE="'+ autostart +'" />');
		document.writeln('<PARAM name="volume" VALUE="50" />');
		document.writeln('<PARAM name="ShowControls" VALUE="true" />');
		document.writeln('<param name="ShowStatusBar" value="true" />');
		document.writeln('<param name="SHOWTRACKER" value="true" />');
		document.writeln('<PARAM name="ShowDisplay" VALUE="false" />');
		document.writeln('<embed width="' +  width + '" height="' +  height + '" src="' + URL + '" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" type="application/x-mplayer2" autostart="'+ autostart +'" transparentstart="1" loop="0" ShowControls=1 controller="true" SHOWTRACKER=1 showstatusbar=1 showdisplay=0></embed></object>');
	}
}

function EmbedFlashT(URL, width, height, menu, quality, bg, bg2){

	//Checks if the menu constance is entered (correctly)
	if(menu != true && menu != false && menu != "true" && menu != "false"){
		menu = true; //Replace with default. Default = true.
	}
	
	//Checks if the quality constance is entered (correctly)
	if(quality != "high" && quality != "normal" && quality != "low"){
		quality = "high";	//Replace with default. Defautl = high.
	}
	
	//See if we can continue.	
	if(URL == null || URL == "illegal" || width == null || height == null){
		//Nope, we can't.
		document.writeln("&nbsp;error: illegal use of flash tag!&nbsp;");
	}else{
		//Add the code to the document.
		document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="6,0,0,0" width="' +  width + '" height="' + height + '">');
		document.writeln('<param name="movie" value="' + URL + '" />');
		document.writeln('<param name="quality" value="' + quality + '" />');
		document.writeln('<param name="menu" value="' + menu + '" />');
		document.writeln('<param name="bgcolor" value="' + bg + '" />');
		document.writeln('<param name="play" value="true" />');
		document.writeln('<embed bgcolor="'+ bg2 +'" width="' +  width + '" height="' + height + '" src="' + URL + '" menu="' + menu + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" quality="best" play="true"></embed></object>');
	}
}


function EmbedQuicktimeT(URL, width, height, autoplay){
	if(autoplay != true && autoplay != false && autoplay != "true" && autoplay != "false"){
		autoplay = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null || URL == "illegal"){
		//Nope, we can't.
		document.writeln("&nbsp;error: illegal use of quicktime tag!&nbsp;");
	}else{
		//Add the code to the document.
		document.writeln('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" TYPE="video/quicktime" width="' +  width + '" height="' + height + '">');
		document.writeln('<param name="src" value="qtposter.jpg" />');
		document.writeln('<param name="href" value="' + URL + '" />');
		document.writeln('<param name="volume" value="25" />');
		document.writeln('<param name="autoplay" value="'+ autoplay +'" />');
		document.writeln('<param name="autohref" value="false" />');
		document.writeln('<param name="cache" value="true" />');
		document.writeln('<param name="scale" value="aspect" />');
		document.writeln('<param name="target" value="myself" />');
		document.writeln('<embed width="' +  width + '" height="' + height + '" src="qtposter.jpg" href="' + URL + '" pluginspage="http://www.apple.com/quicktime/download/" type="video/quicktime" cache="true" scale="aspect" autohref="false" AUTOPLAY="' + autoplay + '" volume="25" TARGET="myself"></embed></object>');
	}
}

function EmbedWMAudioT(URL, autostart){
	if(autostart != true && autostart != false && autostart != "true" && autostart != "false"){
		autostart = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null || URL == "illegal"){
		//Nope, we can't.
		document.writeln("&nbsp;error: illegal uso de video tag!&nbsp;");
	}else{
		//Add the code to the document.
		document.writeln('<OBJECT ID="MediaPlayer" WIDTH="360" HEIGHT="70" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
		document.writeln('STANDBY="Please wait while the Windows Media Player components load" TYPE="application/x-oleobject" />');
		document.writeln('<PARAM NAME="FileName" VALUE="' + URL + '" />');
		document.writeln('<PARAM name="autostart" VALUE="'+ autostart +'" />');
		document.writeln('<PARAM name="ShowControls" VALUE="true" />');
		document.writeln('<PARAM name="volume" VALUE="50" />');
		document.writeln('<param name="SHOWTRACKER" value="true" />');
		document.writeln('<param name="ShowStatusBar" value="true" />');
		document.writeln('<PARAM name="ShowDisplay" VALUE="false" />');
		document.writeln('<embed width="360" height="74" src="' + URL + '" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" type="application/x-mplayer2" autostart="'+ autostart +'" transparentstart="1" loop="0" controller="true" showstatusbar=1 showdisplay=0></embed></object>');
	}
}

function EmbedWMVideoT(URL, width, height, autostart){
	if(autostart != true && autostart != false && autostart != "true" && autostart != "false"){
	autostart = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(URL == null || URL == "illegal"){
		//Nope, we can't.
		document.writeln("&nbsp;error: illegal uso de video tag!&nbsp;");
	}else{
		//Add the code to the document.
		document.writeln('<OBJECT ID="MediaPlayer" WIDTH="' +  width + '" HEIGHT="' +  height + '" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ');
		document.writeln('STANDBY="Please wait while the Windows Media Player components load" TYPE="application/x-oleobject" />');
		document.writeln('<PARAM NAME="FileName" VALUE="' + URL + '" />');
		document.writeln('<PARAM name="autostart" VALUE="'+ autostart +'" />');
		document.writeln('<PARAM name="volume" VALUE="50" />');
		document.writeln('<PARAM name="ShowControls" VALUE="true" />');
		document.writeln('<param name="ShowStatusBar" value="true" />');
		document.writeln('<param name="stretchToFit" value="true" />');
		document.writeln('<param name="SHOWTRACKER" value="true" />');
		document.writeln('<PARAM name="ShowDisplay" VALUE="false" />');
		document.writeln('<embed width="' +  width + '" height="' +  height + '" src="' + URL + '" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" type="application/x-mplayer2" autostart="'+ autostart +'" transparentstart="1" loop="0" ShowControls=1 controller="true" SHOWTRACKER=1 showstatusbar=1 autosize="true" showdisplay=0></embed></object>');
	}
}

function EmbedTubeVideoT(YTPermalink, width, height, autostart) {   
	if(autostart != true && autostart != false && autostart != "true" && autostart != "false"){
	autostart = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(YTPermalink == null || YTPermalink == "illegal"){
		//Nope, we can't.
		document.writeln(" error: illegal uso de video tag! ");
	}else{
		//Add the code to the document.
		genCode = YTPermalink.replace(new RegExp(/http\:\/\/www\.youtube\.com\/\?v\=/g), ""); 
		//document.writeln("gencode-"+genCode);

		document.writeln('<object width="' + width + '" height="' + height + '"><param name="movie" value="http://www.youtube.com/v/' + genCode + '"></param>');
		document.writeln('<embed src="http://www.youtube.com/v/' + genCode + '" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed></object>');
	}
}

function EmbedTubeVideo(YTPermalink, width, height, autostart) {   
	if(autostart != true && autostart != false && autostart != "true" && autostart != "false"){
	autostart = false; //Replace with default. Default = false.
	}//See if we can continue.	
	if(YTPermalink == null || YTPermalink == "illegal"){
		//Nope, we can't.
		document.writeln(" error: illegal uso de video tag! ");
	}else{
		//Add the code to the document.
		genCode = YTPermalink.replace(new RegExp(/http\:\/\/www\.youtube\.com\/\?v\=/g), ""); 
		//document.writeln("gencode-"+genCode);

		document.writeln('<object width="' + width + '" height="' + height + '"><param name="movie" value="http://www.youtube.com/v/' + genCode + '"></param>');
		document.writeln('<embed src="http://www.youtube.com/v/' + genCode + '" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed></object>');
	}
}


// ###############  resize functions:

function resizeImage(thisimage) {
	if (thisimage.width > 750) {
		thisimage.width = 750;
		thisimage.style.cursor='hand';
	}
}

//Thumbnail image viewer-
//© Dynamic Drive (www.dynamicdrive.com)
//For full source code, usage terms, and 100's more DHTML scripts, visit http://www.dynamicdrive.com

var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all

function enlargeuserimage(which,e){
	if (which.width < 750) {return false;}

	//Render image code for IE 4+ and NS6
	if (ie||ns6){
	crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
	if (crossobj.style.visibility=="hidden"){
		crossobj.style.left=ns6? pageXOffset+e.clientX : document.body.scrollLeft+event.clientX
		crossobj.style.top=ns6? pageYOffset+e.clientY : document.body.scrollTop+event.clientY
		crossobj.innerHTML='<div class=tvhead align=right id=drag><span class=tvclose onClick=closepreview()>Presiona para Cerrar</span>&nbsp;<span class=tvclosex onClick=closepreview()> X </span></div><img src="'+which.src+'">'
		crossobj.style.visibility="visible"
	}
	else
	crossobj.style.visibility="hidden"
	return false
	}
	//Render image code for NS 4
	else if (document.layers){
	if (document.showimage.visibility=="hide"){
		document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which.src+'" border=0></a>')
		document.showimage.document.close()
		document.showimage.left=e.x
		document.showimage.top=e.y
		document.showimage.visibility="show"
	}
	else
	document.showimage.visibility="hide"
	return false
	}
	//if NOT IE 4+ or NS 4, simply display image in full browser window
	else
	return true
}

function closepreview(){
	crossobj.style.visibility="hidden"
}


//By Dynamicdrive.com

//drag drop function for NS 4////
/////////////////////////////////

var nsx,nsy,nstemp

function drag_dropns(name){
	temp=eval(name)
	temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
	temp.onmousedown=gons
	temp.onmousemove=dragns
	temp.onmouseup=stopns
}

function gons(e){
	temp.captureEvents(Event.MOUSEMOVE)
	nsx=e.x
	nsy=e.y
}
function dragns(e){
	temp.moveBy(e.x-nsx,e.y-nsy)
	return false
}

function stopns(){
	temp.releaseEvents(Event.MOUSEMOVE)
}

//drag drop function for IE 4+ and NS6////
/////////////////////////////////

function drag_drop(e){
	if (ie&&dragapproved){
	crossobj.style.left=tempx+event.clientX-offsetx
	crossobj.style.top=tempy+event.clientY-offsety
	}
	else if (ns6&&dragapproved){
	crossobj.style.left=tempx+e.clientX-offsetx
	crossobj.style.top=tempy+e.clientY-offsety
	}
	return false
}

function initializedrag(e){
	if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id=="drag"){
	offsetx=ie? event.clientX : e.clientX
	offsety=ie? event.clientY : e.clientY

	tempx=parseInt(crossobj.style.left)
	tempy=parseInt(crossobj.style.top)

	dragapproved=true
	document.onmousemove=drag_drop
	}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")

