
// ajax copyright 2001-2007 ismael canales Luis
// Under the LGPL license
// this software do not have any garanty implicit or explicit



function ajax(){

	this.print=print
	this.get=get
	this.post=post
	this.wget=wget
	this.onEndRequest=onEndRequest
	this.push=push_html;
	this.pop=pop_html;
	this.msg_loading=1;


	function push_html(id)
	{
		/*
		o=document.getElementById(id)
		if(o){
			try{
				o.cache.push(o.innerHTML);
			}catch(e){
				o.cache=new Array();
				o.cache.push(o.innerHTML);
			}
		}
		*/
	}


	function pop_html(id)
	{
		/*
		o=document.getElementById(id)
		if(o){
			try{
				o.innerHTML=o.cache.pop();
			}catch(e){
			}
		}
		*/
	}




	function onEndRequest(status,content){

		return 0+1;	
	}	


	function print(msg,object_id,operation)
	{


		if(this.msg_loading == 1){
				obj=document.getElementById(object_id);
				if(obj)
					obj.innerHTML='<span style="font-face:arial; font-size: 12px;">'+msg+'</span><br>'+obj.innerHTML;
		}
	
	}

	// Ajax: Recibe un fichero remoto en el que hacer la peticion, y una cadena de parametros GET
	// Hace una llamada a la 'url', y cambia el contenido del objeto 'object_id' aplicando la accion 'operation'
	function get (url,object_id,operation) {

		this.req=false

		if(operation == ''){
			operation='set_html';
		}

		// Constructor
		if (this.req==false) {
			if (window.XMLHttpRequest) {
				try {
					this.req=new XMLHttpRequest()
				} catch (e) {
					//alert(e);
					this.req=false
				}
			} else if (window.ActiveXObject) {
				try {
					this.req=new ActiveXObject("Msxml2.XMLHTTP")
				} catch (e) {
					try {
						this.req=new ActiveXObject("Microsoft.XMLHTTP")
					} catch (e) {
						this.req=false
					}
				}
			}

			if (this.req) {
				var request=this.req
				var oer=this.onEndRequest;
				this.req.onreadystatechange=function () {
					// Cuando me llamen porque ya esta cargada la respuesta
					if (request.readyState==4) {
						// Si todo fue bien...
						if (request.status==200) {	// OK
							try {
								// Sustituye el contenido en el objeto 'object_id', realizando la accion 'operation'
								refreshHTMLContent(request.responseText,object_id,operation,url)
								oer(request.status,request.responseText);
							
							} catch (e) {
								//alert("Error conectando con el servidor "+e);
								oer(request.status,request.responseText);
								//alert('El contenido del id "'+object_id+'" no se pudo actualizar')
								//alert('Error al procesar la respuesta de ajax '+e.message)
								//alert('El contenido de la respuesta es\n'+request.responseText)
							}
						} else {
							//alert("Error conectando con el servidor");
							oer(request.status,request.responseText);
							//alert(request.status+': No se ha podido acceder a la url "'+url+'"')
						}

						//document.getElementsByTagName('body')[0].style.cursor='default';
					}
				}
				// Envia la peticion
				if(url.indexOf('?')==-1){
					url+='?ajax=1'
				}else{
					url+='&ajax=1'
				}
				this.req.open("GET",url,true)
				this.req.send(null)
				if(operation!="append" && operation!="call")
					this.print("Cargando...",object_id,operation);
			} else {
				alert("Ajax not supported")
			}
		}
	}

	function post (url,object_id,f,operation) {

			if(operation == ''){
				operation='set_html';
			}
			this.req=false;

			if (window.XMLHttpRequest) {
				try {
					this.req=new XMLHttpRequest()
				} catch (e) {
					this.req=false
				}
			} else if (window.ActiveXObject) {
				try {
					this.req=new ActiveXObject("Msxml2.XMLHTTP")
				} catch (e) {
					try {
						this.req=new ActiveXObject("Microsoft.XMLHTTP")
					} catch (e) {
						this.req=false
					}
				}
			}

			if (this.req) {
				var request=this.req
				// Se llama cuando se recibe una respuesta y la procesa
				
				var oer=this.onEndRequest;
				this.req.onreadystatechange=function () {
					// Cuando me llamen porque ya esta cargada la respuesta
					if (request.readyState==4) {
						// Si todo fue bien...
						if (request.status==200) {	// OK
							try {
								// Sustituye el contenido en el objeto 'object_id', realizando la accion 'operation'
								oer(request.status,request.responseText);
								refreshHTMLContent(request.responseText,object_id,operation,url)
							} catch (e) {
								//alert("Error conectando con el servidor "+e);
								oer(request.status,request.responseText);
								//alert('El contenido del id "'+object_id+'" no se pudo actualizar')
								//alert('Error al procesar la respuesta de ajax '+e)
								//alert('El contenido de la respuesta es\n'+request.responseText)

							}
						} else {
							oer(request.status,request.responseText);
							//alert('No se ha podido acceder a la url "'+url+'" para hacer la peticion code='+request.status)
						}
					}else{

					}
				}

				// Envia la peticion
				parameters="";
				if(f.elements != null){

					for(i=0;i<f.elements.length;i++){
						try{
							type=f.elements[i].type.toUpperCase();
							if( type == 'SELECT'){
								val=f.elements[i].options[f.elements[i].selectedIndex].value
							}else if ( type == 'CHECKBOX'){
								val=f.elements[i].checked ? f.elements[i].value : null
							}else if ( type == 'RADIOBUTTON'){
								if(f.elements[i].checked){
									val=f.elements[i].value;
								}else continue;
							}else if (type == 'BUTTON' || type=='IMAGE'){
								continue;
							}else{
								val=f.elements[i].value;
							}	
							parameters+=encodeURI(f.elements[i].name)+'='+encodeURIComponent(val)+"&";
						}catch(e){
							alert(e)
						}
						
					}
				}else{
					for(key in f){
						try{
							parameters+=encodeURI(key)+'='+encodeURIComponent(f[key])+"&";
						}catch(e){
							alert(e)
						}
					}
					parameters+="ajax=1";
				}
				this.req.open('POST', url, true);
				if(url.indexOf('&')<0){
					url=url+'?'+parameters
				}else{
					url=url+'?'+parameters
				}
				this.req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
				this.req.setRequestHeader("Content-length", parameters.length);
				this.req.setRequestHeader("Connection", "close");
				this.req.send(parameters);

				if(operation!="append" && operation!="call")
				this.print("Conectando...",object_id,operation);
				
			} else {
				alert("Ajax not supported")
			}
	}

}

function ajump(url,container_id,handler,observer,msg)
{
	a= new ajax()
	a.push(container_id)
	if(observer)
		a.onEndRequest=observer
	if(!msg)
		a.msg_loading=0
	a.get(url,container_id,handler)
}


function wget(url)
{
	a= new ajax()
	return a.wget(url)
}

function apost(url,object_id,operation,f,observer) {

	a= new ajax()
	a.push(object_id)
	if(observer)
		a.onEndRequest=observer
	a.post(url,object_id,f,operation)
}

function ajax_pop(id)
{
	a=new ajax()
	a.pop(id)
}

function ajax_clean(id)
{
/*
	o=get(id);
	o.cache=new Array()
	o.innerHTML="";
*/
}


function js_parser(content)
{
	code="";
	rgx= new RegExp('(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)','img');	
	m=rgx.exec(content);
	while(m!=null){
	code= code + ";" + m[1];
	rgx= new RegExp('(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)','img');	
	m=rgx.exec(RegExp.rightContext);
	}
	return new Array(content,code);
}

function refreshHTMLContent (content,object_id,operation,url)
{
	var result=true


	// Default operation
	if (operation==null || operation=='') {
		if( object_id == null || object_id == ''){
			operation='just_call'
		}else{
			operation='set_value'
		}
	}


	flag_eval=0;

	var js_code="";
	
	if( content.match(/<script.*?>/)){
		try{
			var cont=js_parser(content);
			js_code=cont[1];
			content=cont[0];
			flag_eval=1;
		}catch(e){
			//alert("Error evaluando javascript (js_parser):\n"+js_code+e);
		}
	}else{
		try{	// sistema antiguo por json perro
			content=eval(content);	
			js_code=content[1]
			flag_eval=1;
			content=content[0];
		}catch(e){  // parser de <script>
		}
	}

	switch (operation) {
	// Para campos de formularios, establece el valor del campo
		case 'set_value':
			setObjectValue(object_id,content)
			break

		case 'call':
			// operacion call, no cambia ningun inner ni nada de la pagina
			break;

		case 'reload':
			window.document.location.href=window.document.location.href
			break;

		case 'reload_opener':
			opener.document.location.href=opener.document.location.href
			break;

		case 'append':
			var obj=document.getElementById(object_id)
			if(obj){
			obj.ajax_url=url
			if(!content)content="";
			obj.innerHTML+=content
			}
			break;

		case '':
		case 'set_html':
			var obj=document.getElementById(object_id)
			if(obj){
				obj.ajax_url=url;
				obj.innerHTML='';
				obj.innerHTML=content;
			}
			break

		default:
			operation()
			break;
	}

	if( flag_eval ){
			kk=eval(js_code);	
	}
	
}	















var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();



/*
	sexfun.js
	v1.0 - 16/aug/2006 - Initial version.
	All rights reserved.
*/

function selectLanguage(lang_) {
	location.href = 'xf.language.php?lang=' + lang_ + '&uri=' + escape(location.href);
}

function windowOpen(mypage,myname,w,h,features) {
	if (screen.width) {
		var winl = (screen.width-w) / 2;
		var wint = (screen.height-h) / 2;
	}else {
		winl = 0;
		wint =0;
	}
	if (winl < 0) winl = 0;
	if (wint < 0) wint = 0;
	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += features;
	win = window.open(mypage,myname,settings);
	win.window.focus();
}

function selectItem(url_) {
	windowOpen(url_, 'player', 930, 700, 'scrollbars=yes,resizable=yes,');
	return false;
}

function voteFor(id_, score_) {
	location.href = "xf.score.php?id=" + id_ + "&score=" + score_;

}

function mailFriend(id_, title_, button_send_, button_cancel_) {
	dialog.open( {
		title:title_,
		modal:true,
		width:400,
		duration:0.5,
		background:'#DBFFAA',
		source:'form.mailfriend.php?id=' + id_ + '&rn=' + Math.random(),
		buttons:button_send_ + ',' + button_cancel_,
		button_cancel:button_cancel_,
		callback:function(button_, dialog_) {
			// This function is executed whenever the user presses a button on the dialog.
			switch(button_) {
				case button_cancel_: /* cancel button pressed */
					dialog_.close();
				break;
				case button_send_: /* send button pressed */
					new Ajax.Request(
						$('friendForm').getAttribute('action'), {
							method:'post',
							parameters:Form.serialize('friendForm'),
							onComplete:function(req_) {
//								alert(req_.responseText);
//								return;
								// This function is executed whenever the server returns the contact form result.
								if ((result = req_.responseText).indexOf('|') > -1) {
									var parts = result.split('|');
									dialog.open( {
										title:title_,
										modal:false,
										width:300,
										duration:0.5,
										background:'#DBFFAA',
										content:parts[1],
										buttons:button_cancel_,
										button_cancel:button_cancel_
									} );
								} else dialog_.close();
							}
						}
					);
				break;
			}
		}
	} );
}

function addGuestbook(id_, title_, button_send_, button_cancel_) {
	dialog.open( {
		title:title_,
		modal:true,
		width:400,
		duration:0.5,
		background:'#DBFFAA',
		source:'form.guestbook.php?id=' + id_ + '&rn=' + Math.random(),
		buttons:button_send_ + ',' + button_cancel_,
		button_cancel:button_cancel_,
		callback:function(button_, dialog_) {
			// This function is executed whenever the user presses a button on the dialog.
			switch(button_) {
				case button_cancel_: /* cancel button pressed */
					dialog_.close();
				break;
				case button_send_: /* send button pressed */
					new Ajax.Request(
						$('guestbookForm').getAttribute('action'), {
							method:'post',
							parameters:Form.serialize('guestbookForm'),
							onComplete:function(req_) {
								// This function is executed whenever the server returns the contact form result.
								if(req_.responseText == 'OK' ){
									alert('Su comentario ha sido enviado.'); document.location.reload();
								}
								if ((result = req_.responseText).indexOf('|') > -1) {
									var parts = result.split('|');
									dialog.open( {
										title:title_,
										modal:false,
										width:300,
										duration:0.5,
										background:'#DBFFAA',
										content:parts[1],
										buttons:button_cancel_,
										button_cancel:button_cancel_
									} );
								} else dialog_.close();
							}
						}
					);
				break;
			}
		}
	} );
}



function bookmark() {
	if (navigator.appVersion.indexOf("MSIE") > 0) {
		if (parseInt(navigator.appVersion)>=4) {
			window.external.AddFavorite(location.href= window.location, document.title= "Yotubesexo, videos calentitos todos los dias");
		}
	}else{
		alert("Tu navegador no soporta esta funcionalidad");
	}
}



/*
	Added transparent bg to the floating thing for yotubesexo
	forced to use the charset uft-8 internet explorer 8 complains about the charset unicode
*/



var openxAttributes={}
var openxDebugMode=0;


function openxAddVar(name,value)
{
	openxAttributes[name]=value
}

function openxClearVars()
{
	openxAttributes={}
}

function openxWriteZone(id,preventContext)
{
	if(openxDebugMode){
		document.write("[[zone "+id+"]]");
	}
	var m3_u = (location.protocol=='https:'?'https://adsdelivery.envialo.es/ajs.php':'http://adsdelivery.envialo.es/ajs.php');
	var m3_r = Math.floor(Math.random()*99999999999);
	if (!document.MAX_used) document.MAX_used = ',';
	document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
	document.write ("?zoneid="+id+"&amp;target=_blank");
	document.write ('&amp;cb=' + m3_r);
	if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
//	document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
	document.write (document.charset ? '&amp;charset='+'utf-8' : (document.characterSet ? '&amp;charset='+'utf-8' : ''));
	document.write ("&amp;loc=" + escape(window.location));

	// Content channels
	for(k in openxAttributes){
		document.write ("&amp;"+escape(k)+"=" + escape( openxAttributes[k] ));
	}

	if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
	// Disabled by ismael 11-may-2010, it fucks the zones in somes sites like xxxrasuradas.com
	if(!preventContext)
		if (document.context) document.write ("&amp;context=" + escape(document.context));
	if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
	document.write ("'><\/scr"+"ipt>");
}


function openxWriteFloatingZone(id,align,valign,preventContext,closetime)
{
	if(!align){
		align='left';
	}


	if(!closetime){
		closetime=15;
	}

	if(!valign){
		valign='middle';
	}
   	var ox_u = 'http://adsdelivery.envialo.es/al.php?zoneid='+id+'&cb=INSERT_RANDOM_NUMBER_HERE&layerstyle=simple&align='+align+'&valign='+valign+'&padding=2&closetime='+closetime+'&padding=2&shifth=0&shiftv=0&closebutton=t&closetext=Cerrar&noborder=t&nobg=t';
	// Custom ESPANACASH vars

	// Content channels
	for(k in openxAttributes){
		ox_u +="&"+escape(k)+"=" + escape(openxAttributes[k]);
	}
	if(!preventContext)
	      if (document.context) ox_u += '&context=' + escape(document.context);
	// Custom yosolo vars
         document.write("<scr"+"ipt type='text/javascript' src='" + ox_u + "'></scr"+"ipt>");
}


function openxSecuence( zone_list, step)
{
	this.zones = zone_list
	this.step=step
	this.current=1

	this.getZone=function (){
		var ret=0;
		if( (this.current % step) ==0 && this.zones.length ){
			ret= this.zones.shift()
		}

		this.current++
		return ret;
	}

	return this
}


function openxGetVars()
{
	return openxAttributes;
}

function openxGetVarsAsQuery()
{
	var query="";
	for(var t in openxAttributes){
		query += t +"="+encodeURIComponent(openxAttributes[t])+"&";				
	}
	return query;
}



//Popunder
var puShown = false;

  function doOpen(url)
  {
          if ( puShown == true )
          {
                  return true;
          }
          var wFeatures = "toolbar=1,statusbar=1,resizable=1,scrollbars=1,menubar=1,location=1,directories=0";
          if(navigator.userAgent.indexOf('Chrome') != -1){
             wFeatures = "scrollbar=yes";
          }
          pu_window=  window.open('about:blank','wmPu',wFeatures +  ',height=768,width=1024');

          var regex = new RegExp(/rv:[2-9]/);
   if (regex.exec(navigator.userAgent)) {
       pu_window.ljPop = function (jsm_url) {

           if (regex.exec(navigator.userAgent)) { // Gecko 2+
                          this.window.open('about:blank').close();
                      }
                      this.document.location.href = url;
                  };
                  pu_window.ljPop(url);
              }
              else {
                  pu_window.document.location.href = url;
              }
              setTimeout(window.focus);
              window.focus();

           if(pu_window) {
               pu_window.blur();
               puShown = true;
            }

              return pu_window;
  }


  function setCookie(name, value, time)
  {
      var expires = new Date();

      expires.setTime( expires.getTime() + time );

      document.cookie = name + '=' + value + '; expires=' + expires.toGMTString();
  }


  function getCookie(name) {
      var cookies = document.cookie.toString().split('; ');
      var cookie, c_name, c_value;

      for (var n=0; n<cookies.length; n++) {
          cookie  = cookies[n].split('=');
          c_name  = cookie[0];
          c_value = cookie[1];

          if ( c_name == name ) {
              return c_value;
          }
      }

      return null;
  }


  function initPu()
  {
          if ( document.attachEvent )
          {
                  document.attachEvent( 'onclick', checkTarget );
          }
          else if ( document.addEventListener )
          {
                  document.addEventListener( 'click', checkTarget, false );
          }
  }


  function checkTarget(e)
  {
      if ( !getCookie('popundr') ) {
          var e = e || window.event;
          
          var sites = [ '/popunder/index.php?'+openxGetVarsAsQuery() ];
			    var site = sites[ Math.floor( Math.random()*sites.length) ];
          
          var win = doOpen(site);

          setCookie('popundr', 1, 24*60*60*1000);
      }
  }

initPu();


var rotatorFamily='';
var rotatorlastimage=''
var rotatorIdx=0;
var rotatorOldFamily='';
var rotatorTarget=null;


function rotatorTick()
{	
	if( rotatorTarget ){
		// http://media.yotubesexo.es/autothumbs/boysfood-26-08-08/17/18871.mp4/snap002.jpg
		var file="http://media.yotubesexo.es/"+rotatorFamily+"/snap00"+rotatorIdx+".jpg";
		rotatorTarget.attr('src',file);
		rotatorIdx++;
		// one less as sometimes the thumber did not get the last one or is corrupt
		if( rotatorIdx > 6) rotatorIdx=1
	}
	setTimeout( rotatorTick, 500);
}

function rotatorActivate(event)
{
	var target = $(event.target);
	var family=target.attr('autodir');
	if( family ) {
		if( family != rotatorFamily || rotatorFamily == ''){		// new family, reset the idx and put the family and old....
			rotatorIdx=1;
			rotatorOldFamily = rotatorFamily;
			rotatorFamily = family;
		}else{
			rotatorIdx++;
		}
		rotatorTarget = target;
	}
}

function rotatorDeactivate(event){
	rotatorTarget=null;
	rotatorFamiliy='';
}

function rotatorRemove(event)
{
	var target = $(event.target);
	target.attr('rel',false);
}

function rotatorInstall()
{
	$(document).ready(
		function (){
			setTimeout( rotatorTick, 500);
			$('.thumbnail').mouseover( rotatorActivate )
			$('.thumbnail').mouseout( rotatorDeactivate )
			$('.thumbnail').error( rotatorDeactivate )
		}
	);
}



/*	sIFR 2.0.2
	Copyright 2004 - 2006 Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben

	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
*/

var hasFlash=function(){var a=6;if(navigator.appVersion.indexOf("MSIE")!=-1&&navigator.appVersion.indexOf("Windows")>-1){document.write('<script language="VBScript"\> \non error resume next \nhasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & '+a+'))) \n</script\> \n');if(window.hasFlash!=null)return window.hasFlash}if(navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin){var b=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;return parseInt(b.charAt(b.indexOf(".")-1))>=a}return false}();String.prototype.normalize=function(){return this.replace(/\s+/g," ")};if(Array.prototype.push==null){Array.prototype.push=function(){var i=0,a=this.length,b=arguments.length;while(i<b){this[a++]=arguments[i++]}return this.length}}if(!Function.prototype.apply){Function.prototype.apply=function(a,b){var c=[];var d,e;if(!a)a=window;if(!b)b=[];for(var i=0;i<b.length;i++){c[i]="b["+i+"]"}e="a.__applyTemp__("+c.join(",")+");";a.__applyTemp__=this;d=eval(e);a.__applyTemp__=null;return d}}function named(a){return new named.Arguments(a)}named.Arguments=function(a){this.oArgs=a};named.Arguments.prototype.constructor=named.Arguments;named.extract=function(a,b){var c,d;var i=a.length;while(i--){d=a[i];if(d!=null&&d.constructor!=null&&d.constructor==named.Arguments){c=a[i].oArgs;break}}if(c==null)return;for(e in c)if(b[e]!=null)b[e](c[e]);return};var parseSelector=function(){var a=/^([^#.>`]*)(#|\.|\>|\`)(.+)$/;function r(s,t){var u=s.split(/\s*\,\s*/);var v=[];for(var i=0;i<u.length;i++)v=v.concat(b(u[i],t));return v}function b(c,d,e){c=c.normalize().replace(" ","`");var f=c.match(a);var g,h,i,j,k,n;var l=[];if(f==null)f=[c,c];if(f[1]=="")f[1]="*";if(e==null)e="`";if(d==null)d=document;switch(f[2]){case "#":k=f[3].match(a);if(k==null)k=[null,f[3]];g=document.getElementById(k[1]);if(g==null||(f[1]!="*"&&!o(g,f[1])))return l;if(k.length==2){l.push(g);return l}return b(k[3],g,k[2]);case ".":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;k=f[3].match(a);if(k!=null){if(g.className==null||g.className.match("(\\s|^)"+k[1]+"(\\s|$)")==null)continue;j=b(k[3],g,k[2]);l=l.concat(j)}else if(g.className!=null&&g.className.match("(\\s|^)"+f[3]+"(\\s|$)")!=null)l.push(g)}return l;case ">":if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;j=b(f[3],g,">");l=l.concat(j)}return l;case "`":h=m(d,f[1]);for(i=0,n=h.length;i<n;i++){g=h[i];j=b(f[3],g,"`");l=l.concat(j)}return l;default:if(e!=">")h=m(d,f[1]);else h=d.childNodes;for(i=0,n=h.length;i<n;i++){g=h[i];if(g.nodeType!=1)continue;if(!o(g,f[1]))continue;l.push(g)}return l}}function m(d,o){if(o=="*"&&d.all!=null)return d.all;return d.getElementsByTagName(o)}function o(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:", "")==q.toLowerCase()}return r}();var sIFR=function(){var a="http://www.w3.org/1999/xhtml";var b=false;var c=false;var d;var ah=[];var al=document;var ak=al.documentElement;var am=window;var au=al.addEventListener;var av=am.addEventListener;var f=function(){var g=navigator.userAgent.toLowerCase();var f={a:g.indexOf("applewebkit")>-1,b:g.indexOf("safari")>-1,c:navigator.product!=null&&navigator.product.toLowerCase().indexOf("konqueror")>-1,d:g.indexOf("opera")>-1,e:al.contentType!=null&&al.contentType.indexOf("xml")>-1,f:true,g:true,h:null,i:null,j:null,k:null};f.l=f.a||f.c;f.m=!f.a&&navigator.product!=null&&navigator.product.toLowerCase()=="gecko";if(f.m&&g.match(/.*gecko\/(\d{8}).*/))f.j=new Number(g.match(/.*gecko\/(\d{8}).*/)[1]);f.n=g.indexOf("msie")>-1&&!f.d&&!f.l&&!f.m;f.o=f.n&&g.match(/.*mac.*/)!=null;if(f.d&&g.match(/.*opera(\s|\/)(\d+\.\d+)/))f.i=new Number(g.match(/.*opera(\s|\/)(\d+\.\d+)/)[2]);if(f.n||(f.d&&f.i<7.6))f.g=false;if(f.a&&g.match(/.*applewebkit\/(\d+).*/))f.k=new Number(g.match(/.*applewebkit\/(\d+).*/)[1]);if(am.hasFlash&&(!f.n||f.o)){var aj=(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]).description;f.h=parseInt(aj.charAt(aj.indexOf(".")-1))}if(g.match(/.*(windows|mac).*/)==null||f.o||f.c||(f.d&&(g.match(/.*mac.*/)!=null||f.i<7.6))||(f.b&&f.h<7)||(!f.b&&f.a&&f.k<312)||(f.m&&f.j<20020523))f.f=false;if(!f.o&&!f.m&&al.createElementNS)try{al.createElementNS(a,"i").innerHTML=""}catch(e){f.e=true}f.p=f.c||(f.a&&f.k<312);return f}();function at(){return{bIsWebKit:f.a,bIsSafari:f.b,bIsKonq:f.c,bIsOpera:f.d,bIsXML:f.e,bHasTransparencySupport:f.f,bUseDOM:f.g,nFlashVersion:f.h,nOperaVersion:f.i,nGeckoBuildDate:f.j,nWebKitVersion:f.k,bIsKHTML:f.l,bIsGecko:f.m,bIsIE:f.n,bIsIEMac:f.o,bUseInnerHTMLHack:f.p}}if(am.hasFlash==false||!al.getElementsByTagName||!al.getElementById||(f.e&&(f.p||f.n)))return{UA:at()};function af(e){if((!k.bAutoInit&&(am.event||e)!=null)||!l(e))return;b=true;for(var i=0,h=ah.length;i<h;i++)j.apply(null,ah[i]);ah=[]}var k=af;function l(e){if(c==false||k.bIsDisabled==true||((f.e&&f.m||f.l)&&e==null&&b==false)||(al.body==null||al.getElementsByTagName("body").length==0))return false;return true}function m(n){if(f.n)return n.replace(new RegExp("%\d{0}","g"),"%25");return n.replace(new RegExp("%(?!\d)","g"),"%25")}function as(p,q){return q=="*"?true:p.nodeName.toLowerCase().replace("html:", "")==q.toLowerCase()}function o(p,q,r,s,t){var u="";var v=p.firstChild;var w,x,y,z;if(s==null)s=0;if(t==null)t="";while(v){if(v.nodeType==3){z=v.nodeValue.replace("<","&lt;");switch(r){case "lower":u+=z.toLowerCase();break;case "upper":u+=z.toUpperCase();break;default:u+=z}}else if(v.nodeType==1){if(as(v,"a")&&!v.getAttribute("href")==false){if(v.getAttribute("target"))t+="&sifr_url_"+s+"_target="+v.getAttribute("target");t+="&sifr_url_"+s+"="+m(v.getAttribute("href")).replace(/&/g,"%26");u+='<a href="asfunction:_root.launchURL,'+s+'">';s++}else if(as(v,"br"))u+="<br/>";if(v.hasChildNodes()){y=o(v,null,r,s,t);u+=y.u;s=y.s;t=y.t}if(as(v,"a"))u+="</a>"}w=v;v=v.nextSibling;if(q!=null){x=w.parentNode.removeChild(w);q.appendChild(x)}}return{"u":u,"s":s,"t":t}}function A(B){if(al.createElementNS&&f.g)return al.createElementNS(a,B);return al.createElement(B)}function C(D,E,z){var p=A("param");p.setAttribute("name",E);p.setAttribute("value",z);D.appendChild(p)}function F(p,G){var H=p.className;if(H==null)H=G;else H=H.normalize()+(H==""?"":" ")+G;p.className=H}function aq(ar){var a=ak;if(k.bHideBrowserText==false)a=al.getElementsByTagName("body")[0];if((k.bHideBrowserText==false||ar)&&a)if(a.className==null||a.className.match(/\bsIFR\-hasFlash\b/)==null)F(a, "sIFR-hasFlash")}function j(I,J,K,L,M,N,O,P,Q,R,S,r,T){if(!l())return ah.push(arguments);aq();named.extract(arguments,{sSelector:function(ap){I=ap},sFlashSrc:function(ap){J=ap},sColor:function(ap){K=ap},sLinkColor:function(ap){L=ap},sHoverColor:function(ap){M=ap},sBgColor:function(ap){N=ap},nPaddingTop:function(ap){O=ap},nPaddingRight:function(ap){P=ap},nPaddingBottom:function(ap){Q=ap},nPaddingLeft:function(ap){R=ap},sFlashVars:function(ap){S=ap},sCase:function(ap){r=ap},sWmode:function(ap){T=ap}});var U=parseSelector(I);if(U.length==0)return false;if(S!=null)S="&"+S.normalize();else S="";if(K!=null)S+="&textcolor="+K;if(M!=null)S+="&hovercolor="+M;if(M!=null||L!=null)S+="&linkcolor="+(L||K);if(O==null)O=0;if(P==null)P=0;if(Q==null)Q=0;if(R==null)R=0;if(N==null)N="#FFFFFF";if(T=="transparent")if(!f.f)T="opaque";else N="transparent";if(T==null)T="";var p,V,W,X,Y,Z,aa,ab,ac;var ad=null;for(var i=0,h=U.length;i<h;i++){p=U[i];if(p.className!=null&&p.className.match(/\bsIFR\-replaced\b/)!=null)continue;V=p.offsetWidth-R-P;W=p.offsetHeight-O-Q;aa=A("span");aa.className="sIFR-alternate";ac=o(p,aa,r);Z="txt="+m(ac.u).replace(/\+/g,"%2B").replace(/&/g,"%26").replace(/\"/g, "%22").normalize() + S + "&w=" + V + "&h=" + W + ac.t;F(p,"sIFR-replaced");if(ad==null||!f.g){if(!f.g){if(!f.n)p.innerHTML=['<embed class="sIFR-flash" type="application/x-shockwave-flash" src="',J,'" quality="best" wmode="',T,'" bgcolor="',N,'" flashvars="',Z,'" width="',V,'" height="',W,'" sifr="true"></embed>'].join("");else p.innerHTML=['<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" sifr="true" width="',V,'" height="',W,'" class="sIFR-flash"><param name="movie" value="',J,"?",Z,'"></param><param name="quality" value="best"></param><param name="wmode" value="',T,'"></param><param name="bgcolor" value="',N,'"></param> </object>'].join('')}else{if(f.d){ab=A("object");ab.setAttribute("data",J);C(ab,"quality","best");C(ab,"wmode",T);C(ab,"bgcolor",N)}else{ab=A("embed");ab.setAttribute("src",J);ab.setAttribute("quality","best");ab.setAttribute("flashvars",Z);ab.setAttribute("wmode",T);ab.setAttribute("bgcolor",N)}ab.setAttribute("sifr","true");ab.setAttribute("type","application/x-shockwave-flash");ab.className="sIFR-flash";if(!f.l||!f.e)ad=ab.cloneNode(true)}}else ab=ad.cloneNode(true);if(f.g){if(f.d)C(ab,"flashvars",Z);else ab.setAttribute("flashvars",Z);ab.setAttribute("width",V);ab.setAttribute("height",W);ab.style.width=V+"px";ab.style.height=W+"px";p.appendChild(ab)}p.appendChild(aa);if(f.p)p.innerHTML+=""}if(f.n&&k.bFixFragIdBug)setTimeout(function(){al.title=d},0)}function ai(){d=al.title}function ae(){if(k.bIsDisabled==true)return;c=true;if(k.bHideBrowserText)aq(true);if(am.attachEvent)am.attachEvent("onload",af);else if(!f.c&&(al.addEventListener||am.addEventListener)){if(f.a&&f.k>=132&&am.addEventListener)am.addEventListener("load",function(){setTimeout("sIFR({})",1)},false);else{if(al.addEventListener)al.addEventListener("load",af,false);if(am.addEventListener)am.addEventListener("load",af,false)}}else if(typeof am.onload=="function"){var ag=am.onload;am.onload=function(){ag();af()}}else am.onload=af;if(!f.n||am.location.hash=="")k.bFixFragIdBug=false;else ai()}k.UA=at();k.bAutoInit=true;k.bFixFragIdBug=true;k.replaceElement=j;k.updateDocumentTitle=ai;k.appendToClassName=F;k.setup=ae;k.debug=function(){aq(true)};k.debug.replaceNow=function(){ae();k()};k.bIsDisabled=false;k.bHideBrowserText=true;return k}();

if(typeof sIFR == "function" && !sIFR.UA.bIsIEMac){
	sIFR.replaceElement("h3", named({sFlashSrc: "support/casmira.swf",  sFlashVars: "textalign=center", sBgColor: "FFFFFF", sColor: "#650171", sWmode: "transparent"}));
	sIFR.setup();
};


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




<!-- 
function playMedia(mediaURL,rpt,height,width) {

var mediaURL,rpt,height,width;

if (GetBrowser() == "IE") 
	embedIEobject(mediaURL,rpt,height,width);
else 
  embedMPlayer(mediaURL,rpt,height,width);  
}

function embedMPlayer(mediaURL,rpt,height,width)
{
	 codeGen = '';
	 
	 codeGen = '<object data="' + mediaURL +'" type="video/x-ms-wmv"' + '\n'; 
	 codeGen = codeGen + 'width="'+width+'" height="'+height+'">' + '\n';
	 codeGen = codeGen + '<param name="ShowStatusBar" value="1">' + '\n';
   codeGen = codeGen + '<param name="src" value="'+mediaURL+'">' + '\n';
   codeGen = codeGen + '<param name="autostart" value="1">' + '\n';
   // <param name="volume" value="0">
   codeGen = codeGen + '</object>';
   
   document.write(codeGen);
}

function embedIEobject(mediaURL,rpt,height,width){


		CodeGen = "" 
    	var mediaURL,rpt,height,width

		CodeGen = '<object id=Player' + '\n' ;
		CodeGen += 'codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' + '\n' ;
		CodeGen += 'type=application/x-oleobject height=' + height + ' width=' + width + '\n' ;
		CodeGen += ' standby="Loading Microsoft® Windows® Media Player components..." ' + '\n' ;
		CodeGen += 'classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"> ' + '\n' ;
		CodeGen += '<param NAME="Filename" VALUE="' + mediaURL + '">' + '\n' ;
		if ((height == 24) && (width == 299)) 
			CodeGen += '<param NAME="ShowStatusBar" VALUE= "true">';
		if ((height >= 50) && (width >= 200)) 
			CodeGen += '<param NAME="ShowStatusBar" VALUE= "true">'; 
		if ((height <= 49) && (width != 299))
			CodeGen += '<param NAME="ShowStatusBar" VALUE= "false"> ';
		
		CodeGen += '<param NAME="autoStart" VALUE="true"><param NAME="Volume" VALUE="-1">' + '\n' ;
		CodeGen += '<param NAME="playCount" VALUE=' + rpt + '></object>'
		
		document.write(CodeGen)

}

function GetBrowser()
{
   var agt=navigator.userAgent.toLowerCase();
   if( ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1)) )
       return "IE";
   else if( ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
         && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
         && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1)) )
       return "Netscape";
   else
       return "unknown";
}
//-->


