/*
Author: Sumit Thomas
Dated: 5th June 2007
*/
<!--
if(typeof Sherston =="undefined"){var Sherston = new Object();}
if(typeof Sherston.SWUtilObject=="undefined"){Sherston.SWUtilObject=new Object();}
var swVersion="0";
Sherston.SWObject = function(src,id,majorVer, minorVer, w, h){
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
this.majorVer = majorVer;
this.minorVer = minorVer;
this.installedVer=this.getPlayerVersion();
if (src) {this.setAttribute("src", src);}
if (id) {this.setAttribute("id", id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
};Sherston.SWObject.prototype = {setAttribute:function(akey,aval){
this.attributes[akey]=aval;
},getAttribute:function(attr){
return this.attributes[attr];
},addParam:function(key,val){
this.params[key]=val;
},getParams:function(){
return this.params;
},addVariable:function(vkey,vval){
this.variables[vkey]=vval;
},getVariable:function(v){
return this.variables[v];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var vpairs=new Array();
var key;
var vars=this.getVariables();
for(key in vars){vpairs.push(key+"="+vars[key]);}
return vpairs;},getEmbedHTML:function(){
 html = '<OBJECT classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"';
 html += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,1,0,11"';
 html += '  WIDTH="' + this.getAttribute("width") + '" HEIGHT="' + this.getAttribute("height") + '">';
 html += ' <PARAM NAME="SRC" VALUE="' + this.getAttribute("src") + '">';
 var prms=this.getParams();
 for(key in prms){html+="<param name=\""+key+"\" value=\""+prms[key]+"\" />";}
 var fvars=this.getVariablePairs().join("&");
 if(fvars.length>0){html+="<param name=\"flashvars\" value=\""+fvars+"\" />";}
 html += ' <EMBED SRC="' + this.getAttribute("src") + '"';
 html += ' WIDTH="' + this.getAttribute("width") + '" HEIGHT="' + this.getAttribute("height") + '" ';
 for(var key in prms){html+=[key]+"=\""+prms[key]+"\" ";}
 if(fvars.length>0){html+="flashvars=\""+fvars+"\"";}
 html += ' TYPE="application/x-director" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveDirector">';
 html += ' </EMBED>';
 html += ' </OBJECT>';
 return html;
},write:function(div){
if(this.isValidSWVersion()){
var n=(typeof div=="string")?document.getElementById(div):div;
n.innerHTML=this.getEmbedHTML();
}else if (!(navigator.appName && navigator.appName.indexOf("Netscape")>=0 && navigator.appVersion.indexOf("2.")>=0)){
//document.write('A newer version of Shockwave must be installed to display this content. Please update your Shockwave installation.');
return false;}return true;
},isValidSWVersion:function(){ return this.detectSWVersion();},
getPlayerVersion:function(){
var tVersionString="0";
if (navigator.mimeTypes && navigator.mimeTypes["application/x-director"] && navigator.mimeTypes["application/x-director"].enabledPlugin) {
if (navigator.plugins && navigator.plugins["Shockwave for Director"] && (tVersionIndex = navigator.plugins["Shockwave for Director"].description.indexOf(".")) != - 1) {	
var tVersionString = navigator.plugins["Shockwave for Director"].description.substring(tVersionIndex-2, tVersionIndex+2);
return tVersionString;
}} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
document.write('<SCRIPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('set tSWControl = CreateObject("SWCtl.SWCtl") \n');
document.write('if IsObject(tSWControl) then \n');
document.write('tVersionString = tSWControl.ShockwaveVersion("") \n');
document.write('FromVBGetVersion(tVersionString) \n');
document.write('end if \n');
document.write('</SCRIPT\> \n');
}return swVersion;
},detectSWVersion:function()
{var tMajorVersion = this.majorVer;var tMinorVersion = this.minorVer;var tShockwaveFound = 0;
if (navigator.mimeTypes && navigator.mimeTypes["application/x-director"] && navigator.mimeTypes["application/x-director"].enabledPlugin) {
if (navigator.plugins && navigator.plugins["Shockwave for Director"] && (tVersionIndex = navigator.plugins["Shockwave for Director"].description.indexOf(".")) != - 1) {
var tMajorVersionString = navigator.plugins["Shockwave for Director"].description.substring(tVersionIndex-2, tVersionIndex);
var tMinorVersionString = navigator.plugins["Shockwave for Director"].description.substring(tVersionIndex+1, tVersionIndex+2);
}} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
var tVersionString = this.getPlayerVersion();
if (tVersionString != "") { 
tVersionIndex = tVersionString.indexOf(".")
var tMajorVersionString = tVersionString.substring(tVersionIndex-2, tVersionIndex);
var tMinorVersionString = tVersionString.substring(tVersionIndex+1, tVersionIndex+2);
}}this.major=parseInt(tMajorVersionString);this.minor=parseInt(tMinorVersionString);
if (parseInt(tMajorVersionString) >= tMajorVersion) {
if (tMinorVersion > 0) {
if (parseInt(tMinorVersionString) >= tMinorVersion) {
tShockwaveFound = 1;
}} else {
tShockwaveFound = 1;
}}
return tShockwaveFound;
}};function FromVBGetVersion(v)
{swVersion = v;}
var SWObject=Sherston.SWObject;
//-->
