function shake(n) {
	// var sW = window.screen.availWidth;
	// var sH = window.screen.availHeight;
	// var wW = window.outerWidth;
	// var wH= window.outerHeight;
	var n = 4;
	// if(sW!=wW-8 && sH!=wH-8){
		
		if(navigator.userAgent.indexOf('Mac') == -1){
			if (parent.moveBy) {
				for (i = 6; i > 0; i--) {
					for (j = n; j > 0; j--) {
					parent.moveBy(0,i);
					parent.moveBy(i,0);
					parent.moveBy(0,-i);
					parent.moveBy(-i,0);
					}
			    }
			}
		}
		
	// }
}

function setAnchor(_flashPath){
	window.location.href = ('#' + _flashPath);
	flashPath = _flashPath;
	curPath1 = window.location.href.split('#')[1];
	curPath2 = curPath1.split('/')[1];;
	if(curPath2=='collection'){
		$('title').text('Осенне-зимняя коллекция AppleMoon');
	}
	if(curPath2=='fitting'){
		$('title').text('Примерочная AppleMoon');
	}
	
};
function getAnchor(){
	return flashPath;
}
function testLocation(){
	var curPath = window.location.href.split('#')[1];
	
	if(curPath != flashPath){
		var scu = new SWFConnector("/f/1/global/SWFConnector.swf", "connector");
		scu.addCommand(connectionId, 'changeSection', curPath).sendCommands();
		flashPath = curPath;
	}
	if(flashPath=='/collection/'){
		$('title').text('Осенне-зимняя коллекция AppleMoon');
	}
}

var flashPath = window.location.href.split('#')[1];
var connectionId = new Date().getTime();
setInterval(testLocation, 100);

// $(function(){
// 	if(!$('object#site').length){
// 		$('html').removeClass('js');
// 	}
// });

	function flashVersion() { 
		
      // Отдельно определяем Internet Explorer 
      var ua = navigator.userAgent.toLowerCase(); 
      var isIE = (ua.indexOf("msie") != -1 && ua.indexOf("opera") == -1 && ua.indexOf("webtv") == -1); 
      // Стартовые переменные 
      var version = 0; 
      var lastVersion = 10; // c запасом 
      var i; 
      if (isIE) { // browser == IE 
            try { 
                  for (i = 3; i <= lastVersion; i++) { 
                        if (eval('new ActiveXObject("ShockwaveFlash.ShockwaveFlash.'+i+'")')) { 
                              version = i; 
                        } 
                  } 
            } catch(e) {} 
      } else { // browser != IE 
            for (i = 0; i < navigator.plugins.length; i++) { 
                  if (navigator.plugins[i].name.indexOf('Flash') > -1) {
                  		var verNum= parseInt(navigator.plugins[i].description.split(' ')[2]);
                        version = (verNum > version) ? verNum : version; 
                  } 
            } 
      } 
      return version; 
	}
$(function(){
	if(flashVersion()<'9'){
		$('html').removeClass('js');
		$('#background_container').css('display','block');
	}
});


