var basepath = '/home/sites/ling.co.uk/public_html/';
var sitepath = '/';


function changeEditor(type,content){
	if($('code_area')){

	}
}

function setupSubmitCode(){
    if($('codeForm')){
        $('codeForm').onsubmit = function(){
		alert('ok');
            	codecontent.toggleEditor();
        }
    }
}

/*
 * CodePress - Real Time Syntax Highlighting Editor written in JavaScript - http://codepress.org/
 * 
 * Copyright (C) 2006 Fernando M.A.d.S. <fermads@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify it under the terms of the 
 * GNU Lesser General Public License as published by the Free Software Foundation.
 * 
 * Read the full licence: http://www.opensource.org/licenses/lgpl-license.php
 */

CodePress = function(obj) {
	var self = document.createElement('iframe');
	self.textarea = obj;
	self.textarea.disabled = true;
	self.textarea.style.overflow = 'hidden';
	self.style.height = self.textarea.clientHeight +'px';
	self.style.width = self.textarea.clientWidth +'px';
	self.textarea.style.overflow = 'auto';
	self.style.border = '1px solid gray';
	self.frameBorder = 0; // remove IE internal iframe border
	self.style.visibility = 'hidden';
	self.style.position = 'absolute';
	self.options = self.textarea.className;
	
	self.initialize = function() {
		this.editor = this.contentWindow.CodePress;
		this.editor.body = this.contentWindow.document.getElementsByTagName('body')[0];
		this.editor.setCode(this.textarea.value);
		this.setOptions();
		this.editor.syntaxHighlight('init');
		/* # Patched by sam (sam@design-monkey.co.uk) for Ajax - Load width and height here */
		// {	
		this.style.width = this.textarea.style.width;
		this.style.height = this.textarea.style.height;
		//	}
		this.textarea.style.display = 'none';
		this.style.position = 'relative';
		this.style.visibility = 'visible';
		this.style.display = 'inline';
	}
	
	// obj can by a textarea id or a string (code)
	self.edit = function(obj,language) {
		if(obj) self.textarea.value = $(obj) ? $(obj).value : obj;
		if(!self.textarea.disabled) return;
		self.language = language ? language : self.getLanguage();
		self.src = '/modules/code/codepress.html?language='+self.language+'&ts='+(new Date).getTime();
		Event.observe(self,'load',function(){
			codecontent.initialize();
		});
	}

	self.getLanguage = function() {
		for (language in CodePress.languages) 
			if(self.options.match('\\b'+language+'\\b')) 
				return CodePress.languages[language] ? language : 'generic';
	}
	
	self.setOptions = function() {
		if(self.options.match('autocomplete-off')) self.toggleAutoComplete();
		if(self.options.match('readonly-on')) self.toggleReadOnly();
		if(self.options.match('linenumbers-off')) self.toggleLineNumbers();
	}
	
	self.getCode = function() {
		return self.textarea.disabled ? self.editor.getCode() : self.textarea.value;
	}

	self.setCode = function(code) {
		self.textarea.disabled ? self.editor.setCode(code) : self.textarea.value = code;
	}

	self.toggleAutoComplete = function() {
		self.editor.autocomplete = (self.editor.autocomplete) ? false : true;
	}
	
	self.toggleReadOnly = function() {
		self.textarea.readOnly = (self.textarea.readOnly) ? false : true;
		if(self.style.display != 'none') // prevent exception on FF + iframe with display:none
			self.editor.readOnly(self.textarea.readOnly ? true : false);
	}
	
	self.toggleLineNumbers = function() {
		var cn = self.editor.body.className;
		self.editor.body.className = (cn==''||cn=='show-line-numbers') ? 'hide-line-numbers' : 'show-line-numbers';
	}
	
	self.toggleEditor = function() {
		if(self.textarea.disabled) {
			self.textarea.value = self.getCode();
			self.textarea.disabled = false;
			self.style.display = 'none';
			self.textarea.style.display = 'inline';
		}
		else {
			self.textarea.disabled = true;
			self.setCode(self.textarea.value);
			self.editor.syntaxHighlight('init');
			self.style.display = 'inline';
			self.textarea.style.display = 'none';
		}
	}

	self.edit();
	return self;

}

CodePress.languages = {	
	csharp : 'C#', 
	css : 'CSS', 
	generic : 'Generic',
	html : 'HTML',
	java : 'Java', 
	javascript : 'JavaScript', 
	perl : 'Perl', 
	ruby : 'Ruby',	
	php : 'PHP', 
	text : 'Text', 
	sql : 'SQL',
	vbscript : 'VBScript'
}


CodePress.run = function() {
	var codepressItems = document.getElementsByClassName('codepress');
	for(i=0;i<codepressItems.length;i++){
			id = codepressItems[i].id;
			codepressItems[i].id = id + '_cp';
			eval(id + ' = new CodePress(codepressItems[i])');
			codepressItems[i].parentNode.insertBefore(eval(id), codepressItems[i]);
	}
}



/*

function addGalleryItem(){

	var imgsrc = $('data_varchar_file').value;
	var imgtitle = $('data_varchar_title').value;

	if(imgsrc){
	}else{
		alert('Please add an image path.');
		var error = 1;
	}

	if(!error){

		$('gallerynum').value = ($('gallerynum').value-1)+2;
		createGalleryItem($('gallerynum').value,imgsrc,imgtitle);

	}
}

function createGalleryItem(num,imgsrc,imgtitle){
	
	var newItem = document.createElement("div");
	newItem.setAttribute('id','gallery_item_' + num);

	var data_gallerytitle = document.createElement("input");
	data_gallerytitle.setAttribute('type','text');
	data_gallerytitle.setAttribute('name','data_varchar_imgtitle_' + num);
	data_gallerytitle.setAttribute('value',imgtitle);
	data_gallerytitle.setAttribute('style','width:140px; color:#999;');
	data_gallerytitle.setAttribute('readonly','readonly');

	var data_galleryitem = document.createElement("input");
	data_galleryitem.setAttribute('type','text');
	data_galleryitem.setAttribute('name','data_varchar_imgsrc_' + num);
	data_galleryitem.setAttribute('value',imgsrc);
	data_galleryitem.setAttribute('style','width:100px; color:#999;');
	data_galleryitem.setAttribute('readonly','readonly');

	var prev_img = document.createElement("img");
	prev_img.setAttribute('src','../../images/cms/img_icon.gif');
	prev_img.setAttribute('style','margin: 0 5px;');
	prev_img.setAttribute('alt','View Image');
	prev_img.setAttribute('title','View Image');
	prev_img.setAttribute('border','0');

	var prev_galleryitem = document.createElement("a");
	prev_galleryitem.setAttribute('href',imgsrc);
	prev_galleryitem.setAttribute('target','_blank');

	var rem_img = document.createElement("img");
	rem_img.setAttribute('src','../../images/cms/deletecontentbutton.gif');
	rem_img.setAttribute('style','margin: 0 5px; cursor: pointer;');
	rem_img.setAttribute('alt','Remove');
	rem_img.setAttribute('title','Remove');
	rem_img.setAttribute('border','0');

	var rem_galleryitem = document.createElement("span");
	rem_galleryitem.setAttribute('onclick','removeGalleryItem("' + num + '")');
	
	newItem.appendChild(data_gallerytitle);
	newItem.appendChild(data_galleryitem);
	prev_galleryitem.appendChild(prev_img);
	newItem.appendChild(prev_galleryitem);
	rem_galleryitem.appendChild(rem_img);		
	newItem.appendChild(rem_galleryitem);
	$('current_gallery_items').appendChild(newItem);

}


function removeGalleryItem(remId){
	$('current_gallery_items').removeChild($('gallery_item_' + remId));
	$('gallerynum').value = ($('gallerynum').value-1);
	renameGalleryItems();
}

function renameGalleryItems(){
	var items = $$('#current_gallery_items div');
	for(i=0;i<items.length;i++){
		var inputs = items[i].getElementsByTagName('input');
		var imgtitle = inputs[0].value;		
		var imgsrc = inputs[1].value;
		var num = (i-1)+2;
		createGalleryItem(num,imgsrc,imgtitle);
		$('current_gallery_items').removeChild(items[i]);
	}
}

*/




function fileUploadPopup(base,path,type){
    var url = 'http://79.170.40.231/ling.co.uk/plugins/tiny_mcpuk/filemanager/browser.html?Connector=/ling.co.uk/plugins/tiny_mcpuk/filemanager/connectors/php/connector.php&Type=' + type + '&From=fileupload';
	window.open(url,"filebrowser",
	"menubar=no,width=610,height=460,toolbar=no");
}






function addFormItem(){

    var error;
    var inputs = $('newFormItem').getElementsByTagName('input');
    var label = inputs[0].value;		
    var data = inputs[1].value;
    var values = inputs[2].value;
    if(inputs[3].checked==true){
        var mand = "1";
    }else{
        var mand = "0";
    }
    var selects = $('newFormItem').getElementsByTagName('select');
    var inputtype = selects[0].value;
	
	if(error!=1){
    
        $('formnum').value = ($('formnum').value-1)+2;
		createFormItem($('formnum').value,label,inputtype,data,values,mand);
    
    }
    
}
    

function createFormItem(num,label,inputtype,data,values,mand){

        
		var newItem = document.createElement("div");
		newItem.setAttribute('id','form_item_' + $('formnum').value);
       		newItem.setAttribute('style','margin-top: 1px;');

		var data_label = document.createElement("input");
		data_label.setAttribute('type','text');
		data_label.setAttribute('name','data_varchar_label_' + num);
		data_label.setAttribute('value',label);
		data_label.setAttribute('style','width:130px; margin-right: 3px;');
		if(document.all){
			data_label.style.width = '130px';
			data_label.style.marginRight = '3px';
		}

		var data_type = document.createElement("select");
		data_type.setAttribute('name','data_varchar_formtype_' + num);
		data_type.setAttribute('style','width:120px; margin-right: 3px;');
		if(document.all){
			data_type.style.width = '120px';
			data_type.style.marginRight = '3px';
		}

		var data_type_options = $$('#form_type option');
		for(it=0;it<data_type_options.length;it++){
			var data_type_option = document.createElement("option");
			data_type_option.setAttribute('value',data_type_options[it].value);
			data_type_option.innerHTML = data_type_options[it].innerHTML;
			if(inputtype==data_type_options[it].value)	data_type_option.setAttribute('selected','selected');
			data_type.appendChild(data_type_option);
		}

        	var data_formdata = document.createElement("input");
		data_formdata.setAttribute('type','text');
		data_formdata.setAttribute('name','data_text_formdata_' + num);
		data_formdata.setAttribute('value',data);
		data_formdata.setAttribute('style','width:110px; margin-right: 3px;');
		if(document.all){
			data_formdata.style.width = '110px';
			data_formdata.style.marginRight = '3px';
		}

        	var data_formvalues = document.createElement("input");
		data_formvalues.setAttribute('type','text');
		data_formvalues.setAttribute('name','data_text_formvalues_' + num);
		data_formvalues.setAttribute('value',values);
		data_formvalues.setAttribute('style','width:110px; margin-right: 3px;');
		if(document.all){
			data_formvalues.style.width = '110px';
			data_formvalues.style.marginRight = '3px';
		}

        	var data_mand = document.createElement("input");
		data_mand.setAttribute('type','checkbox');
		data_mand.setAttribute('name','data_int_mand_' + num);
		data_mand.setAttribute('value','1');
        	if(mand==1) data_mand.setAttribute('checked','checked');

		var rem_img = document.createElement("img");
		rem_img.setAttribute('src','images/cms/deletecontentbutton.gif');
		rem_img.setAttribute('style','margin-left: 8px; cursor: pointer;');
		rem_img.setAttribute('alt','Remove');
		rem_img.setAttribute('title','Remove');
		rem_img.setAttribute('border','0');
		if(document.all){
			rem_img.style.cursor = 'pointer';
		}
		

		var rem_formitem = document.createElement("span");
		rem_formitem.setAttribute('onclick','removeFormItem("' + $('formnum').value + '")');
		if(document.all){
			rem_img.onclick = function(){
				removeFormItem("' + $('formnum').value + '");
			}
		}

		newItem.appendChild(data_label);
		newItem.appendChild(data_type);
		newItem.appendChild(data_formdata);
		newItem.appendChild(data_formvalues);
        	newItem.appendChild(data_mand);
		rem_formitem.appendChild(rem_img);
		newItem.appendChild(rem_formitem);
		$('current_form_items').appendChild(newItem);
}


function removeFormItem(remId){
	$('current_form_items').removeChild($('form_item_' + remId));
	$('formnum').value = ($('formnum').value-1);
    renameFormItems();
}

function renameFormItems(){
	var items = $$('#current_form_items div');
	for(i=0;i<items.length;i++){
		var inputs = items[i].getElementsByTagName('input');
		var label = inputs[0].value;		
		var data = inputs[1].value;
		var values = inputs[2].value;
		if(inputs[3].checked==true){
		    var mand = "1";
		}else{
		    var mand = "0";
		}
		var selects = items[i].getElementsByTagName('select');
		var inputtype = selects[0].value;

		var num = (i-1)+2;
		createFormItem(num,label,inputtype,data,values,mand);
		$('current_form_items').removeChild(items[i]);
	}
}







function addGalleryItem(){

	var imgsrc = $('data_varchar_file').value;
	var imgtitle = $('data_varchar_title').value;

	if(imgsrc){
	}else{
		alert('Please add an image path.');
		var error = 1;
	}

	if(!error){

		// Add new item
		$('gallerynum').value = ($('gallerynum').value-1)+2;
		createGalleryItem($('gallerynum').value,imgsrc,imgtitle);
		// Now Clear Adding Inputs
		$('data_varchar_file').value = '';
		$('data_varchar_title').value = '';
		loadGallerySortables();
	}
}

function createGalleryItem(num,imgsrc,imgtitle){
	
	var newItem = document.createElement("div");
	newItem.setAttribute('id','gallery_item_' + num);

	var data_gallerytitle = document.createElement("input");
	data_gallerytitle.setAttribute('type','text');
	data_gallerytitle.setAttribute('name','data_varchar_imgtitle_' + num);
	data_gallerytitle.setAttribute('value',imgtitle);
	data_gallerytitle.setAttribute('style','width:160px; color:#999;');

	var data_galleryitem = document.createElement("input");
	data_galleryitem.setAttribute('type','text');
	data_galleryitem.setAttribute('name','data_varchar_imgsrc_' + num);
	data_galleryitem.setAttribute('value',imgsrc);
	data_galleryitem.setAttribute('style','width:150px; color:#999;');

	var prev_img = document.createElement("img");
	prev_img.setAttribute('src','images/cms/img_icon.gif');
	prev_img.setAttribute('style','margin: 0 5px;');
	prev_img.setAttribute('alt','View Image');
	prev_img.setAttribute('title','View Image');
	prev_img.setAttribute('border','0');

	var prev_galleryitem = document.createElement("a");
	prev_galleryitem.setAttribute('href',imgsrc);
	prev_galleryitem.setAttribute('target','_blank');

	var rem_img = document.createElement("img");
	rem_img.setAttribute('src','images/cms/deletecontentbutton.gif');
	rem_img.setAttribute('style','margin: 0 3px; cursor: pointer;');
	rem_img.setAttribute('alt','Remove');
	rem_img.setAttribute('title','Remove');
	rem_img.setAttribute('border','0');

	var rem_galleryitem = document.createElement("span");
	rem_galleryitem.setAttribute('onclick','removeGalleryItem("' + num + '")');

	var drag_img = document.createElement("img");
	drag_img.setAttribute('src','images/cms/dragcorner.gif');
	drag_img.setAttribute('style','margin: 0; cursor: move;');
	drag_img.className = 'handle';
	drag_img.setAttribute('alt','Move');
	drag_img.setAttribute('title','Move');
	drag_img.setAttribute('border','0');

	newItem.appendChild(data_gallerytitle);
	newItem.appendChild(data_galleryitem);
	prev_galleryitem.appendChild(prev_img);
	newItem.appendChild(prev_galleryitem);
	rem_galleryitem.appendChild(rem_img);		
	newItem.appendChild(rem_galleryitem);		
	newItem.appendChild(drag_img);
	$('current_gallery_items').appendChild(newItem);

}


function removeGalleryItem(remId){
	$('current_gallery_items').removeChild($('gallery_item_' + remId));
	$('gallerynum').value = ($('gallerynum').value-1);
	renameGalleryItems();
	loadGallerySortables();
}

function renameGalleryItems(){
	var items = $$('#current_gallery_items div');
	for(i=0;i<items.length;i++){
		var inputs = items[i].getElementsByTagName('input');
		var imgtitle = inputs[0].value;		
		var imgsrc = inputs[1].value;
		var num = (i-1)+2;
		createGalleryItem(num,imgsrc,imgtitle);
		$('current_gallery_items').removeChild(items[i]);
	}
}

function loadGallerySortables(){
	Sortable.create('current_gallery_items',{tag:'div', dropOnEmpty: true, revert: true, handle: 'handle',
		endeffect: function(element){
			renameGalleryItems();
		}
	});

}





function findpageContent(page_id,content_id,module){
	if($('content_position')){
		new Ajax.Updater('content_position', 'modules/htmltext/functions.php', {
 			 method: 'get',
			 parameters: {
				 action: 'find_content_blocks',
				 page_id: page_id,
				 content_id: content_id,
				 module: module
			 },
			 onSuccess: function(){
				 //alert('done');
				 return true;
			 }
		});
	}
}


function findMenuBlocks(template,page_menu,module){
	if($('page_menu')){
		new Ajax.Updater('page_menu', 'modules/pages/functions.php', {
 			 method: 'get',
			 parameters: {
				 action: 'find_menu_blocks',
				 template: template,
				 page_menu: page_menu,
				 module: module
			 },
			 onSuccess: function(){
				 //alert('done');
				 return true;
			 }
		});
	}
}

function findpageMenu(menu,template,parent,module){
	if($('parent')){
		new Ajax.Updater('parent', 'modules/pages/functions.php', {
 			 method: 'get',
			 parameters: {
				 action: 'find_menu_items',
				 template: template,
				 menu: menu,
				 parent: parent,
				 module: module
			 },
			 onSuccess: function(){
				 //alert('done');
				 return true;
			 }
		});
	}
}


function findpageUrl(link_to,page_url){
	if($('parent')){
		new Ajax.Updater('page_url', 'modules/pages/functions.php', {
 			 method: 'get',
			 parameters: {
				 action: 'find_url_items',
				 link_to: link_to,
				 page_url: page_url
			 },
			 onSuccess: function(){
				 //alert('done');
				 if(link_to!=0){
					$('page_index').disabled = true;
				 }else{
					$('page_index').disabled = false;
				 }
			 }
		});
	}
}


function findUrl(page_name,page_index,id,parent){
	if($('page_url_text')){
		new Ajax.Request('modules/pages/functions.php', {
 			 method: 'get',
			 parameters: {
				 action: 'create_url',
				 page_name: page_name,
				 page_index: page_index,
				 id: id,
				 parent: parent
			 },onSuccess: function(t){
				$('page_url_text').value = t.responseText;
				return true;
			 }
		});		
	}
}


function findContentBlocks(template){
	if($('content_position')){
		new Ajax.Updater('content_position', 'modules/permissions/findcontentpos.php', {
 			 method: 'get',
			 parameters: { template: template }
		});
	}
}

function createPermissionNum(){
	if($('permissions')){
		var permissionNum = 0;
	//	alert($('owner1').checked);
		if($('owner1').checked == true){
			permissionNum = permissionNum+($('owner1').value*1);
		}
		if($('owner2').checked == true){
			permissionNum = permissionNum+($('owner2').value*1);
		}
		if($('group1').checked == true){
			permissionNum = permissionNum+($('group1').value*1);
		}
		if($('group2').checked == true){
			permissionNum = permissionNum+($('group2').value*1);
		}
		if($('all1').checked == true){
			permissionNum = permissionNum+($('all1').value*1);
		}
		if($('all2').checked == true){
			permissionNum = permissionNum+($('all2').value*1);
		}
		$('permissions').value = permissionNum;
	}
}






function setupCheckAll(){
	if($('checkall')){
		$('checkall').onclick = function(){
			var checkboxes = $$('input[type="checkbox"]');
			if(this.checked==true){
				// Check All Checkboxes
				for(ic=0;ic<checkboxes.length;ic++){
					checkboxes[ic].checked = true;
				}
			}else{
				// Un-Check All Checkboxes
				for(ic=0;ic<checkboxes.length;ic++){
					checkboxes[ic].checked = false;
				}
			}
		}
	}
}


function submitblukBin(value){
    if($('dothis')){
        $('dothis').value = value;
    }
    var checkboxes = $$('input[type="checkbox"][rel="items"]');
    var checkedString = '-';
    for(ic=0;ic<checkboxes.length;ic++){
        if(checkboxes[ic].checked==true){
            checkedString += '|' + checkboxes[ic].value;
        }
    }
    if($('selecteditems')){
        $('selecteditems').value = checkedString;
    }
    if(value==0){
        return confirm('Are your sure you want to delete these items? Note: Once Deleted, items cannot be restored!');
    }else{
        return true;
    }
}




function findcontentTypes(moduleRef,currentType){
	if($('contentType')){
		new Ajax.Updater('contentType', 'modules/updatevalues/functions.php', {
 			 method: 'get',
			 evalScripts: true,
			 parameters: {
				 action: 'find_content_types',
				 moduleRef: moduleRef,
				 currentType: currentType
			 },
			 onSuccess: function(){
				 //alert('done');
				 return true;
			 }
		});
	}
}

function findcurrentContent(contentType,moduleRef,formaction){
	if($('currentContent')){
		new Ajax.Updater('currentContent', 'modules/updatevalues/functions.php', {
 			 method: 'get',
			 evalScripts: true,
			 parameters: {
				 action: 'find_current_content',
				 moduleRef: moduleRef,
				 contentType: contentType,
				 formaction: formaction
			 },
			 onSuccess: function(){
				 //alert('done');
				 return true;
			 }
		});
	}
}


/**
 * 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;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;