/*if(!Cookie.read('full')&&Cookie.write('full','true')){
	var w=screen.availWidth,h=screen.availHeight,nh=Math.round(w*(4/3.2)),nw=Math.round(h*(4/3.2)),w=nh>h?nw:((nw>w&&(h=nh))?w:w);
	$try(function(c){
		if(document.all)window.resizeTo(w,h);window.outerHeight=h;window.outerWidth=w;
		window.moveTo(window.screenY=window.screenTop=0,window.screenX=window.screenLeft=Math.round((screen.availWidth-w)/2));
	});
}*/

document.menu=$('menu').set({opacity:0.7,tween:{property:'opacity',duration:200}});
document.addEvents({
	contextmenu:function(e){return $type(e.target.value)=='string'},
	click:function(e){
		var el=document.menu,trg=$(e.target),tag=trg.get('tag'),embed=$('embed');
		if(el.style.opacity>2)return el.set('opacity',2);
		if(tag!='a'&&tag!='textarea'&&tag!='input'&&!trg.getParent('a')&&!(embed&&embed.hasChild(trg))){
			var win=window.getSize(),siz=el.getSize();
			el.setStyles(
			).tween('opacity',1.7);
		}
	}
});
if($('cont').get('tag')=='img')new ScaleView();
$$('body').setStyle('cursor','pointer');

$$('form').each(function(form){
	var els=form.getElements('input[type="text"],textarea').addEvents({
				blur:function(){if(!this.value)this.value=this.title}
	});
	form.addEvent('submit',function(e,fail){
		els.each(function(){el.removeClass('unvalid').value||el.value!=el.title||(fail=el.addClass('unvalid'))});
		return !fail;
	});
});