﻿
jQuery(document).ready(
    function(){
        var storeNews = jQuery('#divStoreNewsAll');
        jQuery('.pnlPlus').append(storeNews);    
});

function popupFlash(filename) {
newwindow = window.open('MultiMediaViewer.aspx?fvf=' + filename + '','' + 'Stihl' + '','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=320,height=300,left = 490,top = 362');
}

function popupFlashTS(filename) {
newwindow = window.open('../MultiMediaViewer.aspx?fvf=' + filename + '','' + 'Stihl' + '','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=320,height=300,left = 490,top = 362');
}


function myopen(filename,windowname,properties) 
{
	 mywindow = window.open(filename,windowname,properties) ;
}
   

function MM_openBrWindow(theURL,winName,features) 
{ 
    window.open(theURL,winName,features);
}


function BookmarkPage(url, title) {
    if (window.sidebar) { // Mozilla Firefox Bookmark
	    alert("Please Press 'CTRL + D' to bookmark this page!");
    } else if( window.external ) { // IE Favorite
	    window.external.AddFavorite( url, title); 
	}
      else if(window.opera && window.print) { // Opera Hotlist
	   return true; 
	}
    else
      { 
            var ua=navigator.userAgent.toLowerCase();
            var isMac=(ua.indexOf('mac')!=-1);
            var buttonStr=isMac?'Command/Cmd':'CTRL';
            alert("Please Press '" +buttonStr+ " + D' to bookmark this page!");
      }
    }

function new_window(url, obj) {
    //alert(obj.value);
    if (obj.value == -1 || obj == -1)
	    {
		    link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=150,left=40,top=50");
	    }
}

var newWin;

function showPrinterWindow(){
	if (!document.getElementById){
		window.print();
		return;
	}
	
	var cont = document.getElementById('container');
	var header = document.getElementById('header');

	newWin = window.open('printer-friendly.htm', 'printWin'); 

	if (!newWin || !cont || !header){
		window.print();
		return;
	}
	
	newWin.document.write("...");
	newWin.document.body.removeChild(newWin.document.body.firstChild);
								
	newWin.document.title = document.title;
	var clone = header.cloneNode(true);
	newWin.document.body.appendChild(clone);
	newWin.document.body.appendChild(cont.cloneNode(true));

}




function setFocus(e, buttonid)
{

      var evt = e ? e : window.event;
      var bt = document.getElementById(buttonid);
      
      if (bt)
      {
          if ((evt.which ? evt.which : evt.keyCode) == 13)
          {
               bt.click(); 
               return false;
          }
     }
}







 var menuLocationsX = menuLocationsY = 0;
jQuery().mousemove(function(e){
    menuLocationsX = e.pageX;
    menuLocationsY = e.pageY;
}); 


showListing = function()
{
    
    var posAnchor = jQuery('.MainMenu').position();
    jQuery('.MainMenuLocationListings').animate({left:menuLocationsX - 20, top: menuLocationsY + 10}, 0, function(){
    jQuery('.MainMenuLocationListings').animate({opacity: 'show'}, 400);});
    
}

hideListing = function()
{
    jQuery('.MainMenuLocationListings').animate({opacity: 'hide'}, 400);
}