//  e = Element
//  f = Form
//  i = item
//  v = Value
//  t = target
// ty = type




// Set Cookie
function setCookie(NameOfCookie, value, expiredays) {
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) + 
	((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString()) + "; path=/;"
}

/*
ActiveX Workaround

License:
activateActiveX is Copyright (C) 2006 Jason Baker (therippa AT gmail.com. It is available as open source code from:
http://therippa.blogspot.com

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details http://www.gnu.org/licenses/gpl.html
*/


/*
window.onload = function () { 
    if (navigator.appName == "Microsoft Internet Explorer") {
    	
	    var arrElements = new Array(3);
	    arrElements[0] = "object";
	    arrElements[1] = "embed";
	    arrElements[2] = "applet";

	    for (n = 0; n < arrElements.length; n++) {
		    replaceObj = document.getElementsByTagName(arrElements[n]);
		    for (i = 0; i < replaceObj.length; i++ ) {
			    parentObj = replaceObj[i].parentNode;
			    newHTML = parentObj.innerHTML;
			    parentObj.removeChild(replaceObj[i]);
			    parentObj.innerHTML = newHTML;
    		
			    }
		    }
	    }

 
	    
	    
}	
*/

function MakeFlashObject(insrc,w,h) {
    document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="' + w + '" height="' + h + '">')
    document.write('<param name="movie" value="' + insrc + '" /><param name="wmode" value="transparent"><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><embed src="' + insrc + '" quality="high" wmode="transparent" bgcolor="#000000" width="' + w + '" height="' + h + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>')
    document.write('</OBJECT>')
}

function MakeQuicktimeObject(insrc,w,h) {

    document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="' + h + '" width="' + w + '">')
    document.write('<param name="src" value="' + insrc + '" >') 
    document.write('<param name="AutoPlay" value="true" >')
    document.write('<param name="Controller" value="true" >')
    document.write('<embed src="' + insrc + '" height="' + h + '" width="' + w + '" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" autoplay="true" />')
    document.write('</object>')
}

function MakeWMVObject(insrc,w,h) {
    document.write('<object id="mediaPlayer" width="' + w + '" height="' + h + '" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject">')
    document.write('<param name="fileName" value="' + insrc + '">')
    document.write('<param name="animationatStart" value="true">')
    document.write('<param name="transparentatStart" value="true">')
    document.write('<param name="autoStart" value="true">')
    document.write('<param name="showControls" value="true">')
    document.write('<oaram name"TransparentAtStart" value="True">')
    document.write('<param name="loop" value="false">')
    document.write('<embed type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" id="mediaPlayer" name="mediaPlayer" displaysize="4" autosize="-1" showcontrols="true" showtracker="-1" showdisplay="0" showstatusbar="-1" videoborder3d="-1" width="' + w + '" height="' + h + '" src="' + insrc + '" autostart="true" designtimesp="5311" loop="false"></embed>')
    document.write('</object>')
}

function MakeYouTubeObject(insrc,w,h) {
    document.write('<object width="' + w + '" height="' + h + '"><param name="movie" value="http://www.youtube.com/v/' + insrc + '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' + insrc + '" type="application/x-shockwave-flash" wmode="transparent" width="' + w + '" height="' + h + '"></embed></object>')

}