/*--------------------------------------------------------------
	javascript: 	user control panel interface inits:
					
	version: 		0.2.0.0
	cmf version: 	0.4.3.0
	date: 			29.05.2009
	author:			maxus <webdev_w@list.ru>
	idea:			own
--------------------------------------------------------------*/
(function($){
	$(document).ready(function() {
		/* IE fixes */
		if($.browser.msie){
			//Fix IE focus for forms
			$('input[type="text"], textarea, select').focus(function(){
				$(this).css({'background' : '#FFF', 'border-color' : '#707070'});
			});
			$('input[type="text"], textarea, select').blur(function(){
				$(this).css({'background' : '#f0eded', 'border-color' : '#ccc'});
			});
			//Fix IE text-indents
			$('p + p').css({'text-indent': '2em', 'margin-top': '-1.5em'});
			$('form p + p').css({'text-indent': 0});
		}	
		$('a.blank').click(function(){
			this.target = '_blank';
		});
		
		//adding flash element
//		var ad_video = new SWFObject("/flash/mediaplayer-viral/player-viral.swf", "single", "320", "240", "7");
//		ad_video.addVariable("repeat","true");
//		ad_video.useExpressInstall('/flash/expressinstall.swf');
//		ad_video.addVariable("allowfullscreen","true");
//		ad_video.addVariable("image","/store/uploads/media/video1.jpg");
//		ad_video.addVariable("file","/store/uploads/media/colgateexplorerapproved.flv");
//		ad_video.addVariable("showdownload","true");
//		ad_video.addParam("wmode","transparent");
//		ad_video.write("ad_video");
		

		//gethering cleck statistic
		$(document).click(function(){
			var posx = 0;
			var posy = 0;
			if (!e) var e = window.event;
			if (e.pageX || e.pageY) 	{
				posx = e.pageX;
				posy = e.pageY;
			}
			else if (e.clientX || e.clientY) 	{
				posx = e.clientX + document.body.scrollLeft
					+ document.documentElement.scrollLeft;
				posy = e.clientY + document.body.scrollTop
					+ document.documentElement.scrollTop;
			}
			$.get('boot.php?iclick&x=' + posx + '&y=' + posy + '&w=' + screen.width + '&h=' + screen.height, {u:window.location.href});
		});
	});
})(jQuery);