
var errorEmailTimeout;
// testing
function getSportplan2011ReadyStateHandlerResponse(req,param,responseXmlHandler,spAction){
		return function(){if(req.readyState==4){
				if(req.status==200){
					clearTimeout(errorEmailTimeout);
					responseXmlHandler(req,param,spAction);
					}
				else if (req.status !== 0) {
					var spHandlerString = responseXmlHandler + '';
					spHandlerString = spHandlerString.substring(spHandlerString.indexOf('function ') + 9, spHandlerString.indexOf('('));
					var whatNext=decideErrorResponce(parseInt(req.status), spHandlerString,req.statusText,spAction);
					if (whatNext=='error') {
					alert("HTTP error: '" + req.status + "'\n'" + req.statusText + "'\n'An Error Message has been sent\n to Sportplan to Investigate.\nThank you for your patience.'");
					} else if(whatNext == 'reload'){
						//window.location.reload();
					} else if(whatNext == 'redirect'){
						window.location.href='http://'+sphost+'/index.jsp';
					} else if(whatNext == 'reload'){
						spAjaxRequestWithId(spHandlerString, 'http://'+sphost+''+spAction, param);
					} else if(whatNext == 'retry'){
						spAjaxRequestWithId(spHandlerString, spAction, param);
					} else if(whatNext == 'retryGET'){
						spAjaxGETRequestWithId(spHandlerString, spAction, param);
					}
				}
				else {
				}
				}}};

function getSportplan2011aReadyStateHandlerResponse(req,responseXmlHandler,spAction){
		return function(){if(req.readyState==4){
				if (req.status == 200) {
					clearTimeout(errorEmailTimeout);
					responseXmlHandler(req);
				}
				else if (req.status !== 0) {
						var spHandlerString = responseXmlHandler + '';
						spHandlerString = spHandlerString.substring(spHandlerString.indexOf('function ') + 9, spHandlerString.indexOf('('));
						var whatNext=decideErrorResponce(parseInt(req.status), spHandlerString,req.statusText,spAction);
						if (whatNext=='error') {
					alert("HTTP error: '" + req.status + "'\n'" + req.statusText + "'\n'An Error Message has been sent\n to Sportplan to Investigate.\nThank you for your patience.'");
					} else if(whatNext == 'reload'){
						//window.location.reload();
					} else if(whatNext == 'redirect'){
						window.location.href='http://'+sphost+'/index.jsp';
					} else if(whatNext == 'retry'){
						spAjaxRequest(spHandlerString, spAction,param);
					} else if(whatNext == 'retryGET'){
						spAjaxGETRequest(spHandlerString, spAction,param);
					}
				}
				else {}
				}}};

var LastDecision;

function test404()
	{
		spAjaxRequest(test404Success, '/drills/test404.jsp','');
		
	}
	
function test404Success(req)
	{
		alert("gotcha");
	}
function decideErrorResponce(reqStatus,spHandler,reqStatusText,spAction)
	{
		var decision='';
		if(reqStatus==12152 && spHandler.indexOf('processPlans')>-1) decision= 'ignore';
		else if(reqStatusText=='Unknown' ) decision= 'ignore';
		else if(reqStatus==12152 && spHandler.indexOf('noEvent')>-1) decision= 'ignore';
		else if(reqStatus==12152 && spHandler.indexOf('recordSessionViewResponse')>-1) decision='ignore';
		else if(reqStatus==12152 && spHandler.indexOf('closeCartoonPopupResponse')>-1) decision= 'ignore';
		else if(reqStatus==12007 && spHandler.indexOf('setUpTimeAjaxTimeOut')>-1) decision='ignore';
		else if(reqStatus==12152 && spHandler.indexOf('setJustViewDrills')>-1) decision= 'ignore';
		else if(reqStatus==12029 && spHandler.indexOf('setUpTimeAjaxTimeOut')>-1) decision='ignore'
		else if(reqStatus==12152 && spHandler.indexOf('loadMyTeamResponse')>-1) decision= 'ignore';
		else if(reqStatus==12152 && spHandler.indexOf('showJoinNotice')>-1) decision='ignore';
		else if(reqStatus==12152 && spHandler.indexOf('initCBPractices')>-1) decision='reload';
		else if(reqStatus==12002 && spHandler.indexOf('setUpTimeAjaxTimeOut')>-1) decision= 'ignore';
		else if(spHandler.indexOf('setUpTimeAjaxTimeOut')>-1) decision= 'ignore';
		else if(spHandler.indexOf('noEvent')>-1) decision='ignore';
		else if(reqStatus==401 && spHandler.indexOf('processPlans')>-1) decision= 'ignore';
		else if(reqStatus==12002 && spHandler.indexOf('recordSessionViewResponse')>-1) decision= 'ignore';
		else if(reqStatus==12152 && spHandler.indexOf('reDrawClipBoard')>-1) decision= 'reload';
		else if(reqStatus==408 && spHandler.indexOf('checkForLinksResponse')>-1) decision= 'ignore';
		else if(reqStatus==408) decision= 'ignore';
		else if(reqStatus==502) decision= 'ignore';
		else if(reqStatus==504 && spHandler.indexOf('setJustViewDrills')>-1) decision= 'ignore';
		else if(reqStatus==504 && spHandler.indexOf('processPlans')>-1) decision= 'ignore';
		else if(reqStatus==503&&lastLoadedFile.indexOf('jsonIndex')>-1) decision= 'ignore';
		else if(reqStatus==400&&spHandler.indexOf('countrySetReloadPage')>-1) decision= 'ignore';
		else if(spHandler.indexOf('closeCartoonPopupResponse')>-1) decision= 'ignore';
		else if(reqStatus==503) decision= 'redirect';
		else if(reqStatus==12002) decision= 'retry';
		else if(reqStatus==504) decision= 'retry';
		else if(reqStatus==412) {
		//	if(spAction.indexOf('http') == -1){
		//		decision='reload';	
		//	} else decision= 'retry';
		decision= 'retryGET';
		}
		else if(reqStatus==502){
			if(LastDecision!='retry'){
				LastDecision=decision='retry';
			} else decision='error';
		} else if(reqStatus == '12007' || reqStatus=='12029'){
			alert("Please make sure you are connected to the Internet");
			decision='ignore';
		}
		
		if (decision != 'ignore'&&reqStatus!=12002) {
			var errMssg = ':: ' + spHandler;
			if (spHandler.indexOf('displayPractice') > -1) 
				errMssg += ' ::: ' + lastLoadedFile;
			errMssg += ' :::' + reqStatusText +'::';
			errMssg += ' ::: ' + escape(spAction);
			errorEmailTimeout = setTimeout('sendErrorToSP("'+errMssg+'","'+reqStatus+'","'+decision+'")',2500);
		}
		if(decision!='') return decision;			
		
		return 'error';
	}

function sendErrorToSP(errMssg,errStatus,errDec)
	{
		var errorFeedbackURL='http://sportplan3.sportplan.net/servlet/EmailForm';
		if(errStatus=='404'&&errMssg.indexOf('displayPractice')>-1) errorFeedbackURL += '?recipient=alex@sportplan.com';
		else errorFeedbackURL += '?recipient=sportplan@googlemail.com';
		errorFeedbackURL += '&comment='+errMssg;
		errorFeedbackURL += '&redirect=http://www.sportplan.com/drills/layout/nothing.jsp';
		errorFeedbackURL += '&username='+lastEmail;
		errorFeedbackURL += '&name='+lastFullName;
		errorFeedbackURL += '&decsion='+errDec;
		try{
			errorFeedbackURL += navigator.userAgent;
		} catch(err) { errorFeedbackURL += 'navigator didnt work';}
		errorFeedbackURL += '&host='+sphost;
		errorFeedbackURL += '&location='+document.location.href;
		errorFeedbackURL += '&subject='+errStatus+' AJAX Error';
		errorFeedbackURL += '&user-agent='+navigator.userAgent;
		var spBox=document.getElementById('cpFrame');
		if(spBox) spBox.src=errorFeedbackURL;
	}

function findStart(str)
{  
  str = str.replace(/&lt;span style="text-decoration: underline;"&gt;/g,'&lt;span style=\\"text-decoration: underline;\\"&gt;');
  str = str.replace(/class="/g,'class=\\"');
  str = str.replace(/"&gt;/g,'\\"&gt;');

  var e = str.length;
  while(e > 0 && str.charAt(e) != '}')
  {
    e--;
  }
  
  if (e > 0)
  {
    str = str.substring(0, e+1);
  }
  
  return str.substring(str.indexOf('{'));
}



function strip_tags (str, allowed_tags) {
    // http://kevin.vanzonneveld.net
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Luke Godfrey
    // +      input by: Pul
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: Onno Marsman
    // +      input by: Alex
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: Marc Palau
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +      input by: Brett Zamir (http://brett-zamir.me)
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: Eric Nagel
    // +      input by: Bobby Drake
    // +   bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: Tomasz Wesolowski
    
    // fixed Titanium warning by: Kosso
    
    // *     example 1: strip_tags('<p>Kevin</p> <br /><b>van</b> <i>Zonneveld</i>', '<i><b>');
    // *     returns 1: 'Kevin <b>van</b> <i>Zonneveld</i>'
    // *     example 2: strip_tags('<p>Kevin <img src="someimage.png" onmouseover="someFunction()">van <i>Zonneveld</i></p>', '<p>');
    // *     returns 2: '<p>Kevin van Zonneveld</p>'
    // *     example 3: strip_tags("<a href='http://kevin.vanzonneveld.net'>Kevin van Zonneveld</a>", "<a>");
    // *     returns 3: '<a href='http://kevin.vanzonneveld.net'>Kevin van Zonneveld</a>'
    // *     example 4: strip_tags('1 < 5 5 > 1');
    // *     returns 4: '1 < 5 5 > 1'

    var key = '', allowed = false;
    var matches = [];
    var allowed_array = [];
    var allowed_tag = '';
    var i = 0;
    var k = '';
    var html = '';

    var replacer = function (search, replace, str) {
        return str.split(search).join(replace);
    };

    // Build allowes tags associative array
    if (allowed_tags) {
        allowed_array = allowed_tags.match(/([a-zA-Z0-9]+)/gi);
    }

    str += '';

    // Match tags
    matches = str.match(/(<\/?[\S][^>]*>)/gi);

    // Go through all HTML tags
    for (key in matches) {
	
		if(key){
	
			// Save HTML tag
			html = matches[key].toString();
	
			// Is tag not in allowed list? Remove from str!
			allowed = false;
	
			// Go through all allowed tags
			for (k in allowed_array) {
	
				if(k){
		
					// Init
					allowed_tag = allowed_array[k];
					i = -1;
		
					if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+'>');}
					if (i != 0) { i = html.toLowerCase().indexOf('<'+allowed_tag+' ');}
					if (i != 0) { i = html.toLowerCase().indexOf('</'+allowed_tag)   ;}
		
					// Determine
					if (i == 0) {
						allowed = true;
						break;
					}
				
				}
			}
	
			if (!allowed) {
				str = replacer(html, "", str); // Custom replace. No regexing
			}
        
        }
    }

    return removeXML(str);
}

function spSearchComplete (req, id)
{
  if(req.getResponseHeader('clipboardError'))
  {
    alert("Clipboard Error: " + req.getResponseHeader('clipboardError'));
    return;
  }
  
  var searchType = 'old';
  var resultString = req.responseText.substring(req.responseText.indexOf('<') -1);
  var resultTitle;
  var resultThumb;
  var resultCP;
  if (resultString.indexOf('<Attribute name="title">') > -1) {searchType = 'new';}
  if(lastSportName=='Field Hockey') {lastSportName='Hockey';}
  while (resultString.indexOf('<U>') > -1)
  {
    resultString = resultString.substring(resultString.indexOf('<U>') + 3);
    var tempString = resultString.substring(0, resultString.indexOf('</U>'));
    
    if (tempString.indexOf(lastSportName) > -1 && !drillsFilter(tempString))
    {
    
      var currentResultString = resultString.substring(0, resultString.indexOf('</R>'));
      
	  
      if(tempString.indexOf('answers')>-1){
      	var answerTitle=currentResultString.substring(currentResultString.indexOf('<T>')+3,currentResultString.indexOf('</T>'));
      	var answerContext=currentResultString.substring(currentResultString.indexOf('<S>')+3,currentResultString.indexOf('</S>'));
      	drawAnswerResult(tempString.substring(tempString.indexOf('/drills')),answerTitle,answerContext);
      	} 
		else if(tempString.indexOf('products')>-1){
      	var resultTitle = resultString.substring(resultString.indexOf('<Attribute name="title">') + 24);
        resultTitle = resultTitle.substring(0, resultTitle.indexOf('</Attribute>'));
        var resultThumb = resultString.substring(resultString.indexOf('<Attribute name="thumbnail">') + 28);
        resultThumb = resultThumb.substring(0, resultThumb.indexOf('</Attribute>'));
        
        var resultDescritpion = resultString.substring(resultString.indexOf('<Attribute name="description">') + 30);
        resultDescritpion = resultDescritpion.substring(0, resultDescritpion.indexOf('</Attribute>'));
        
        var resultRating = resultString.substring(resultString.indexOf('<Attribute name="rating">') + 25);
        resultRating = resultRating.substring(0, resultRating.indexOf('</Attribute>'));
       
        drawProducts(tempString.substring(tempString.indexOf('/drills')),resultTitle,resultThumb,resultDescritpion,resultRating);
       }else if(tempString.indexOf('/sessionPlans/')>-1){
      	
        var resultTitle = resultString.substring(resultString.indexOf('<Attribute name="title">') + 24);
        resultTitle = resultTitle.substring(0, resultTitle.indexOf('</Attribute>'));
        var resultThumb = resultString.substring(resultString.indexOf('<Attribute name="thumbnail">') + 28);
        resultThumb = resultThumb.substring(0, resultThumb.indexOf('</Attribute>'));
        
        var resultDescritpion = resultString.substring(resultString.indexOf('<Attribute name="description">') + 30);
        resultDescritpion = resultDescritpion.substring(0, resultDescritpion.indexOf('</Attribute>'));
        
        var resultRating = resultString.substring(resultString.indexOf('<Attribute name="rating">') + 25);
        resultRating = resultRating.substring(0, resultRating.indexOf('</Attribute>'));
       
        addTooSessionsPlans(tempString.substring(tempString.indexOf('/drills')),resultTitle,resultThumb,resultDescritpion,resultRating);
       } else {
      
      if (currentResultString.indexOf('<Attribute name="title">') > -1) {searchType = 'new';}
      else {searchType = 'old';}
      
      if (searchType == 'new')
      {
        resultTitle = resultString.substring(resultString.indexOf('<Attribute name="title">') + 24);
        resultTitle = resultTitle.substring(0, resultTitle.indexOf('</Attribute>'));
        
        //alert("new title"+resultTitle);
       	resultThumb = resultString.substring(resultString.indexOf('<Attribute name="thumbnail">') + 28);
        resultThumb = resultThumb.substring(0, resultThumb.indexOf('</Attribute>'));
        
        if(resultString.indexOf('<Attribute name="coachingPoints">')>-1){
        resultCP = resultString.substring(resultString.indexOf('<Attribute name="coachingPoints">') + 33);
        resultCP = resultCP.substring(0, resultCP.indexOf('</Attribute>'));
        } else var resultCP='';
        
        var resultDes = resultString.substring(resultString.indexOf('<Attribute name="description">') + 30);
        resultDes = resultDes.substring(0, resultDes.indexOf('</Attribute>'));
        
        //alert("new thumb"+resultThumb);
        drillsResult[drillsResult.length] = new GSearchThumbs(tempString.substring(tempString.indexOf('/drills')), resultTitle, resultThumb.substring(resultThumb.indexOf('/drills')),resultDes,resultCP);
      }
      else
      {
	  	
		var notFound=true;
		var tempTest='';
		var newTempString=tempString.substring(tempString.indexOf('/drills'));
		if(newTempString.indexOf('jsession')>-1) newTempString.substring(0,newTempString.indexOf('jsession')-1);
       		for(var spa=0;spa<drillsResult.length;spa++) {
				if (typeof(drillsResult[spa]) == 'object') {
					if (drillsResult[spa].url == newTempString) 
						notFound = false;
					tempTest += drillsResult[spa].url + '::' + newTempString + '\n';
				}
				else{
					if(drillsResult[spa]==newTempString) notFound=false;
				tempTest+=drillsResult[spa]+'::'+newTempString+'::'+typeof(drillsResult[spa])+'\n';
				}
			}
		//if(lastEmail=='johndnurse@gmail.com') alert(tempTest);
		if(notFound) drillsResult[drillsResult.length] = newTempString;
        //alert("old"+tempString.substring(tempString.indexOf('/drills')));
      }
     }
    }
  }

  processDrillResult();
}

function insertXML(s)
  {
    s = s.replace(/&lt;/g,"<");
    s = s.replace(/&gt;/g,">");
    s = s.replace(/&#039;/g,"'");
    s = s.replace(/&lt;table border=&#034;/g,"");
  return s;
  }	

function loadPlayer(baseDir,fileName,spDiv)
	{
	var result='';
	var browser=navigator.appName;
  var b_version=navigator.appVersion;
  var version=parseFloat(b_version);
  if(browser.indexOf('Microsoft')>-1) browser='Microsoft';
  if(browser!='Microsoft'){
		if (sphost.indexOf('sportplan.net') > -1) {
			result += '<object width="100%" height="100%" id="player_api' + spDiv.id + '" name="player_api" data="/drills/iphone/flowplayer/flowplayer.commercial-3.2.2-7.swf" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="quality" value="high"><param name="cachebusting" value="true"><param name="bgcolor" value="#000000"><param name="flashvars" value="config={&quot;key&quot;:&quot;#$8fa9f7e72fede7785d7&quot;,&quot;play&quot;:{&quot;opacity&quot;:&quot;0&quot;},&quot;clip&quot;:{&quot;baseUrl&quot;:&quot;' + baseDir + '&quot;,&quot;autoPlay&quot;:true,&quot;autoBuffering&quot;:true,&quot;url&quot;:&quot;' + fileName + '.flv&quot;},&quot;playerId&quot;:&quot;player&quot;,&quot;playlist&quot;:[{&quot;baseUrl&quot;:&quot;' + baseDir + '&quot;,&quot;autoPlay&quot;:false,&quot;autoBuffering&quot;:true,&quot;url&quot;:&quot;' + fileName + '.flv&quot;}]}"><embed type="application/x-shockwave-flash" width="100%" height="100% src="/drills/iphone/flowplayer/flowplayer.commercial-3.2.2-7.swf" flashvars="config={&quot;key&quot;:&quot;#$8fa9f7e72fede7785d7&quot;,&quot;play&quot;:{&quot;opacity&quot;:&quot;0&quot;},&quot;clip&quot;:{&quot;baseUrl&quot;:&quot;' + baseDir + '&quot;,&quot;autoPlay&quot;:true,&quot;autoBuffering&quot;:true,&quot;url&quot;:&quot;' + fileName + '.flv&quot;},&quot;playerId&quot;:&quot;player&quot;,&quot;playlist&quot;:[{&quot;baseUrl&quot;:&quot;' + baseDir + '&quot;,&quot;autoPlay&quot;:false,&quot;autoBuffering&quot;:true,&quot;url&quot;:&quot;' + fileName + '.flv&quot;}]}"/></object>';
		}
	if (sphost.indexOf('sportplan.com') > -1) {
		result += '<object width="100%" height="100%" id="player_api' + spDiv.id + '" name="player_api" data="/drills/iphone/flowplayer/flowplayer.commercial-3.2.2-7.swf" type="application/x-shockwave-flash"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="quality" value="high"><param name="cachebusting" value="true"><param name="bgcolor" value="#000000"><param name="flashvars" value="config={&quot;key&quot;:&quot;#$4c99b38ddff9946a90c&quot;,&quot;play&quot;:{&quot;opacity&quot;:&quot;0&quot;},&quot;clip&quot;:{&quot;baseUrl&quot;:&quot;' + baseDir + '&quot;,&quot;autoPlay&quot;:true,&quot;autoBuffering&quot;:true,&quot;url&quot;:&quot;' + fileName + '.flv&quot;},&quot;playerId&quot;:&quot;player&quot;,&quot;playlist&quot;:[{&quot;baseUrl&quot;:&quot;' + baseDir + '&quot;,&quot;autoPlay&quot;:false,&quot;autoBuffering&quot;:true,&quot;url&quot;:&quot;' + fileName + '.flv&quot;}]}"><embed type="application/x-shockwave-flash" width="100%" height="100% src="/drills/iphone/flowplayer/flowplayer.commercial-3.2.2-7.swf" flashvars="config={&quot;key&quot;:&quot;#$4c99b38ddff9946a90c&quot;,&quot;play&quot;:{&quot;opacity&quot;:&quot;0&quot;},&quot;clip&quot;:{&quot;baseUrl&quot;:&quot;' + baseDir + '&quot;,&quot;autoPlay&quot;:true,&quot;autoBuffering&quot;:true,&quot;url&quot;:&quot;' + fileName + '.flv&quot;},&quot;playerId&quot;:&quot;player&quot;,&quot;playlist&quot;:[{&quot;baseUrl&quot;:&quot;' + baseDir + '&quot;,&quot;autoPlay&quot;:false,&quot;autoBuffering&quot;:true,&quot;url&quot;:&quot;' + fileName + '.flv&quot;}]}"/></object>';
	}
  } else{
    result+='<object id="flowplayer-'+spDiv.id+'" width="100%" height="100%" data="/drills/iphone/flowplayer/flowplayer.commercial-3.2.2-7.swf"  ';
 		result+='type="application/x-shockwave-flash" bgcolor="#000000"> ';
  	result+='<param name="movie" value="/drills/iphone/flowplayer/flowplayer.commercial-3.2.4-8.swf" />  ';
  	
  var theConfig=''
  					theConfig+='config={';
           	if (sphost.indexOf('sportplan.net') > -1) {
				theConfig += '"key":"#$8fa9f7e72fede7785d7",';
			}
          	if (sphost.indexOf('sportplan.com') > -1) {
				theConfig += '"key":"#$4c99b38ddff9946a90c",';
			}
      
  					theConfig+='"play":{"opacity":"0"},';
  					theConfig+='"clip":{"url":"'+baseDir+''+fileName+'.flv","autoPlay":false,"autoBuffering":true}}';
  					//theConfig=theConfig.replace(/"/g,'&quot;');
  					result+='<param name="flashvars" value=\''+theConfig+'\' /> ';
  					result+='<embed wmode="transparent"  />';
  					result+='</object>';
  			
   }
 // if(lastEmail=='john@sportplan.net') alert(result);
  var spBox=document.getElementById(spDiv);
  if(spBox) spBox.innerHTML=result;
	}
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;if(n==null) alert(_20);n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

