var myTimer = null;



window.addEvent('load', init);

/*

window.addEvent('unload', timeIt);

//alert("Click OK as fast as you can.");
var start = new Date();
var difference;

function timeIt()
{
//alert("Click OK as fast as you can.");
var end = new Date();

difference = end.getTime() - start.getTime();


//alert("It took you " + difference + " milliseconds to click OK!");
addPlayerTimeOnSession(difference);
}

function addPlayerTimeOnSession(timerDif)
{
	var timeVolume = document.getElementById('movie1').GetVolume();
	//alert(timerDif+' ' + timeVolume); 
	var req = new Request.HTML({url:'index.php?p=timersession&timeDef='+timerDif+'&timeVolume='+timeVolume,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
			//alert(timerDif);
    		alert(responseHTML);
			//document.getElementById('addShopBagProdpop').innerHTML = responseHTML;
			//$('addShopBagProdpop').fade(1);
		},
		onFailure: function() {
			alert('Connection error: Cannot add to shopping bag!');
		}
	});
    req.send();
	
	return false; //always return false in order to be used to prevent href
}
*/


function init()
{
		if ($defined($('fb-modal'))) $('fb-modal').setStyles({opacity:'0',display:'block'});
		
        $$('a').each(function(el){
        	if (el.href.indexOf('#')<1) el.addEvent('click',function(){$('wrapper').fade(0); return true;});
        });
        if ($defined($('img1')))
            {
                var image=$('img1');
                var initial_position = image.getCoordinates();
                var newimage = image.clone().injectAfter(image);
                image.setStyle('visibility','hidden');
                newimage.id=image.id+'_view';
                newimage.setStyles({position:'relative',left:0,top:0,margin:0});
                var initial_size = image.getSize();
                var container=new Element('div',{id:image.id+'_container'}).setStyles({width:initial_size.x,height:initial_size.y,overflow:'hidden',position:'absolute',left:initial_position.left,top:initial_position.top}).injectInside(document.body).adopt(newimage);
                var limiter=new Element('div',{id:image.id+'_limiter'}).setStyles({width:initial_size.x,height:initial_size.y}).injectBefore(newimage).adopt(newimage);
                new Drag(limiter, {
            	    // Drag.Move options
            		handle: newimage,
            		// Drag.Move Events
            		modifiers:{'x':'margin-left','y':'margin-top'},
            	// Drag Events
            	onStart: function(el){
            			moveimg();
            		},
            	onDrag: function(el){
            			moveimg();
            		},	
            	snap:2
            	});
                newimage.addEvent('mousewheel', function(e){
                e.stop();
                zoomimg(e.wheel);
                });
            }
			
	$('loading').setStyles({display:'none'});		//my
}

function addshopbag(typeid,quant)
{
	var myquant=parseInt(quant);
	if (myquant>0)
	{
    var req = new Request.HTML({url:'index.php?p=shoppingbag&aj=aj&add'+typeid+'&addq='+myquant,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
    		alert(responseHTML);
			//document.getElementById('addShopBagCollpop').innerHTML = responseHTML;
			//$('addShopBagCollpop').fade(1);
		},
		onFailure: function() {
			alert('Connection error: Cannot add to shopping bag!');
		}
	});
    req.send();
	}
	return false; //always return false in order to be used to prevent href
}

function addshopbagProduct(typeid,quant)
{
	var myquant=parseInt(quant);
	if (myquant>0)
	{
    var req = new Request.HTML({url:'index.php?p=shoppingbag&aj=aj&add'+typeid+'&addq='+myquant,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
    		//alert(responseHTML);
			document.getElementById('addShopBagProdpop').innerHTML = responseHTML;
			$('addShopBagProdpop').fade(1);
		},
		onFailure: function() {
			alert('Connection error: Cannot add to shopping bag!');
		}
	});
    req.send();
	}
	return false; //always return false in order to be used to prevent href
}


function addCustomShopbagProduct(typeid,quant)
{
	var myquant=parseInt(quant);
	
	if (myquant>0)
	{
	var req = new Request.HTML({url:'index.php?p=customshoppingbag&aj=aj&add'+typeid+'&addq='+myquant,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
    		document.getElementById('addShopBagProdpop').innerHTML = responseHTML;
			$('addShopBagProdpop').fade(1);
			
		},
		onFailure: function() {
			alert('Connection error: Cannot add to shopping bag!');
		}
	});
    req.send();
	}
	return false; //always return false in order to be used to prevent href
}

function styleCustomize(productsid,styleid)
{
	//alert(productsid);
	if (productsid>0)
	{
		//alert(styleid);
	var req = new Request.HTML({url:'index.php?p=stylecustomize&products_id='+productsid+'&style_id='+styleid,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
			//alert(responseHTML);
			//alert(styleid);
			
			var res = Array();
			res = responseHTML.split('@##@');
			//alert(res);
			
    		document.getElementById('div_img_'+productsid).innerHTML = res[0];
			document.getElementById('div_pcsbox_'+productsid).innerHTML = res[1];
			document.getElementById('div_ppp_'+productsid).innerHTML = res[2];
			document.getElementById('div_ppb_'+productsid).innerHTML = res[3];
			document.getElementById('div_addbttn_'+productsid).innerHTML = res[4];
			
			
		},
		onFailure: function() {
			alert('Connection error. Please try again.');
		}
	});
    req.send();
	}
	return false; //always return false in order to be used to prevent href
}

function addshopbagProductTable(typeid,quant)
{
	var myquant=parseInt(quant);
	if (myquant>0)
	{
    var req = new Request.HTML({url:'index.php?p=shoppingbag&aj=aj&add'+typeid+'&addq='+myquant,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
    		//alert(responseHTML);
			document.getElementById('addShopBagProdpop').innerHTML = responseHTML;
			$('addShopBagProdpop').fade(1);
		},
		onFailure: function() {
			alert('Connection error: Cannot add to shopping bag!');
		}
	});
    req.send();
	}
	return false; //always return false in order to be used to prevent href
}


function addshopbagProduct_addReplacements(typeid,quant)
{
	//alert(typeid+' '+quant );
	var myquant=parseInt(quant);
	if (myquant>0)
	{
    var req = new Request.HTML({url:'index.php?p=shoppingbag&aj=aj&add'+typeid+'&addq='+myquant,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
    		//alert(responseHTML);
			document.getElementById('addShopBagProdpop').innerHTML = responseHTML;
			$('addShopBagProdpop').fade(1);
		},
		onFailure: function() {
			alert('Connection error: Cannot add to shopping bag!');
		}
	});
    req.send();
	}
	return false; //always return false in order to be used to prevent href
}


function addshopbagColection(typeid,quant)
{
	//alert(typeid);
	var myquant=parseInt(quant);
	if (myquant>0)
	{
    var req = new Request.HTML({url:'index.php?p=shoppingbag&aj=aj&add'+typeid+'&addq='+myquant,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
    		//alert(responseHTML);
			document.getElementById('addShopBagCollpop').innerHTML = responseHTML;
			$('addShopBagCollpop').fade(1);
		},
		onFailure: function() {
			alert('Connection error: Cannot add to shopping bag!');
		}
	});
    req.send();
	}
	return false; //always return false in order to be used to prevent href
}



function loadproduct(id,imagesrc)
{
    if ($('productpop').value!=id)
    {
           
            var req = new Request.HTML({url:'index.php?p=product&prod='+id,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
            if ( responseHTML.length<2 ) return alert('No product information available!');
			$('popupn_wrapper').set('html', responseHTML);
            //var image=$('mainimage');
            //var newimage = image.clone().injectAfter(image);
            //image.setStyle('visibility','hidden');
            //newimage.id='overlayimage';
            //newimage.setStyles({position:'relative',left:0,top:0,margin:0});
            showprodimg(imagesrc);
            $('fb-modal').fade('in');
            $('productpop').value=id;
            if ($defined($('quantpop'))) $('add').setStyle('display','none');
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			alert('Connection error: Cannot load product information!');
		}
	});
    req.send();
   } else {
    showprodimg(imagesrc);
    $('fb-modal').fade('in');
   }
   return false;
}


function loadproduct_fromCollection(id,imagesrc)
{
    if ($('productpop').value!=id)
    {
           
            var req = new Request.HTML({url:'index.php?p=product_fromCollection&prod='+id,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
            if ( responseHTML.length<2 ) return alert('No product information available!');
			$('popupn_wrapper').set('html', responseHTML);
            //var image=$('mainimage');
            //var newimage = image.clone().injectAfter(image);
            //image.setStyle('visibility','hidden');
            //newimage.id='overlayimage';
            //newimage.setStyles({position:'relative',left:0,top:0,margin:0});
            showprodimg(imagesrc);
            $('fb-modal').fade('in');
            $('productpop').value=id;
            if ($defined($('quantpop'))) $('add').setStyle('display','none');
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			alert('Connection error: Cannot load product information!');
		}
	});
    req.send();
   } else {
    showprodimg(imagesrc);
    $('fb-modal').fade('in');
   }
   return false;
}


function loadproduct_fromCollection_v2(id,imagesrc,col_id)
{
    if ($('productpop').value!=id)
    {
           //alert(id+' '+imagesrc+' '+col_id);
            var req = new Request.HTML({url:'index.php?p=product_fromCollection&prod='+id+'&col_id='.col_id,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
            if ( responseHTML.length<2 ) return alert('No product information available!');
			$('popupn_wrapper').set('html', responseHTML);
            //var image=$('mainimage');
            //var newimage = image.clone().injectAfter(image);
            //image.setStyle('visibility','hidden');
            //newimage.id='overlayimage';
            //newimage.setStyles({position:'relative',left:0,top:0,margin:0});
            showprodimg(imagesrc);
            $('fb-modal').fade('in');
            $('productpop').value=id;
            if ($defined($('quantpop'))) $('add').setStyle('display','none');
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			alert('Connection error: Cannot load product information!');
		}
	});
    req.send();
   } else {
    showprodimg(imagesrc);
    $('fb-modal').fade('in');
   }
   return false;
}

function loadproduct_fromCollection_v3(id,imagesrc,my_collection_id)
{
    if ($('productpop_2').value!=id)
    {
           //alert(id+' '+imagesrc+' '+my_collection_id+' '+$('productpop_2').value);
            var req = new Request.HTML({url:'index.php?p=product_fromCollection_2&prod='+id+'&my_collection_id='+my_collection_id,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
            if ( responseHTML.length<2 ) return alert('No product information available!');
			
			$('popupn_wrapper_2').set('html', responseHTML);
			//alert('asd');
            //var image=$('mainimage');
            //var newimage = image.clone().injectAfter(image);
            //image.setStyle('visibility','hidden');
            //newimage.id='overlayimage';
            //newimage.setStyles({position:'relative',left:0,top:0,margin:0});
            showprodimg(imagesrc);
            $('fb-modal_2').fade('in');
			$('fb-modal_2').setStyle('display','block');
			
            $('productpop_2').value=id;
			
			
			
            //if ($defined($('quantpop'))) $('add').setStyle('display','none');
			
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			alert('Connection error: Cannot load product information!');
		}
	});
    req.send();
   } else {
    showprodimg(imagesrc);
    $('fb-modal_2').fade('in');
   }
   return false;
}

function __myloadCollectionProducts(id,imagesrc,sorter)
{
	//alert(id);
    if ($('productpop').value!=id || true)
    {
           
            var req = new Request.HTML({url:'index.php?p=mycollectionproducts&col='+id+'&sorter='+sorter,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
            if ( responseHTML.length<2 ) return alert('No product information available!');
			$('popupn_wrapper').set('html', responseHTML);
            //var image=$('mainimage');
            //var newimage = image.clone().injectAfter(image);
            //image.setStyle('visibility','hidden');
            //newimage.id='overlayimage';
            //newimage.setStyles({position:'relative',left:0,top:0,margin:0});
            showprodimg(imagesrc);
            $('fb-modal').fade('in');
            $('productpop').value=id;
            if ($defined($('quantpop'))) $('add').setStyle('display','none');
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			alert('Connection error: Cannot load product information!');
		}
	});
    req.send();
   } else {
    showprodimg(imagesrc);
    $('fb-modal').fade('in');
   }
   return false;
}

function __myloadCollectionProducts_addRplcmnts(id,imagesrc,sorter)
{
	//alert(id);
    if ($('productpop').value!=id || true)
    {
           
            var req = new Request.HTML({url:'index.php?p=mycollectionproducts_addrplcmnts&col='+id+'&sorter='+sorter,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
            if ( responseHTML.length<2 ) return alert('No product information available!');
			$('popupn_wrapper').set('html', '');
			$('popupn_wrapper').set('html', responseHTML);
            //var image=$('mainimage');
            //var newimage = image.clone().injectAfter(image);
            //image.setStyle('visibility','hidden');
            //newimage.id='overlayimage';
            //newimage.setStyles({position:'relative',left:0,top:0,margin:0});
            showprodimg(imagesrc);
            $('fb-modal').fade('in');
            $('productpop').value=id;
            if ($defined($('quantpop'))) $('add').setStyle('display','none');
		},
		//Our request will most likely succeed, but just in case, we'll add an
		//onFailure method which will let the user know what happened.
		onFailure: function() {
			alert('Connection error: Cannot load product information!');
		}
	});
    req.send();
   } else {
    showprodimg(imagesrc);
    $('fb-modal').fade('in');
   }
   return false;
}



var moveimg=function (x,y)
{
    var image='img1';
    var step=10;
    var mx=x || 0;
    var my=y || 0;
    var view=$(image+'_view');
    var limiter=$(image+'_limiter');
    var container=$(image+'_container');
    var offx=limiter.getStyle('marginLeft').toInt();
    var offy=limiter.getStyle('marginTop').toInt();
    var mw=container.getStyle('width').toInt();
    var mh=container.getStyle('height').toInt();
    var iw=view.getStyle('width').toInt();
    var ih=view.getStyle('height').toInt();
    var changex=Math.abs(step*mx);
    var changey=Math.abs(step*my);
    if ( (mx<0)  && ( 0>= (offx+changex)) ) offx+=changex; //move right
    if ( (mx>0) && (  (offx-changex) > ( mw-iw ) ) ) offx-=changex; // move left
    if ( (my<0)  && ( 0>= (offy+changey)) ) offy+=changey; //move down
    if ( (my>0) && (  (offy-changey) > ( mh-ih ) ) ) offy-=changey; // move up
    if ((mx==my) && (my==0)) {
     if (offx>0) offx=0;
     if (offy>0) offy=0;
     if ((mw-iw)>=offx) offx=mw-iw;
     if ((mh-ih)>=offy) offy=mh-ih;
    }
    limiter.setStyles({marginLeft:offx+'px',marginTop:offy+'px'});
   }

var zoomimg = function (zoom)
{
    var image='img1';
    var step=20;
    var zoomit=zoom || 1;
    var view=$(image+'_view');
    var limiter=$(image+'_limiter');
    var container=$(image+'_container');
    var offx=limiter.getStyle('marginLeft').toInt();
    var offy=limiter.getStyle('marginTop').toInt();
    var mw=container.getStyle('width').toInt();
    var mh=container.getStyle('height').toInt();
    var iw = view.getStyle('width').toInt();
    var ih = view.getStyle('height').toInt();
    var change=zoomit*step;
    iw+=change;
    if (iw<mw) {
        iw=mw;
        offx=0;
        view.setStyle('cursor','default');
    } else {
        offx-=Math.round(change/2);
		view.setStyle('cursor','move');
        view.setStyle('cursor','-moz-zoom-in');
		/*view.setStyle('cursor','url(\'i/cursor/star_trek_TNG_Busy1.ani\')');*/
    }
    ih+=change;
    if (ih<mh) {
        ih=mh;
        offy=0;
        view.setStyle('cursor','default');
    } else {
        offy-=Math.round(change/2);
        view.setStyle('cursor','move');
	    view.setStyle('cursor','-moz-zoom-in');
		/*view.setStyle('cursor','url(\'i/cursor/star_trek_TNG_Busy1.ani\')');*/
    }
  
    //view.setStyles({width:iw+'px',height:ih+'px'});
    
    if (iw>ih) view.setStyle('width',iw+'px'); else  view.setStyle('height',ih+'px');

    if (change<0)
        {
           iw = view.getStyle('width').toInt();
           ih = view.getStyle('height').toInt();
           if ((mw-iw)>offx) offx=mw-iw;
           if ((mh-ih)>offy) offy=mh-ih;
           if (offx>0) offx=0;
           if (offy>0) offy=0;
         }
    limiter.setStyles({marginTop:offy+'px',marginLeft:offx+'px'});
}

function showprodimg(newsrc)
{
    if (!$defined($('mainimage'))) return false;
    var image=$('mainimage');
    image.src=newsrc;
    return false;
    //Todo:
    if (image.src==newsrc) return false;
    var view=$('overlayimage');
    image.src=newsrc;
    view.fade(0);
    image.fade(1);
    setprodimg.delay(700,image,[newsrc,image]);
    return false;
}


function switchimg(newsrc)
{
    var image=$('img1');
	
	document.body.style.cursor = 'url(\'i/aero_busy_xl.ani\')'; 
	
	
	if (image.src==newsrc){ 
		//document.body.style.cursor = '';
		document.body.style.cursor = ''; 
		return false;
		
	}
	else
	{
			//$('img1').setStyle('cursor','url(\'i/aero_busy_xl.ani\')');
			document.body.style.cursor = 'url(\'i/aero_busy_xl.ani\')'; 
			document.body.style.cursor = 'wait'; 
			//image.src = "i/lightbox-ico-loading.gif"; //progressbar_long_green.gif
	}
	
    var view=$(image.id+'_view');
    var limiter=$(image.id+'_limiter');
    var container=$(image.id+'_container');
    var iw = view.getStyle('width').toInt();
    var ih = view.getStyle('height').toInt();
    limiter.set({'morph': { duration: 700, transition: 'expo:out' } });
    view.set({'morph': { duration: 700, transition: 'expo:out' } });
    limiter.morph({marginTop:'0px',marginLeft:'0px'});
    if (iw>ih) view.morph({width:container.getStyle('width')}); else view.morph({height:container.getStyle('height')});
    image.src=newsrc;
    view.fade(0);
    image.fade(1);
    setimg.delay(700,image,[newsrc,image]);
	document.body.style.cursor = '';
    return false; 
}

function switchimg_v2(newsrc,imgID)
{
    var image=$('img1');
	//document.getElementById(imgID).style.cursor = 'wait';
	//document.getElementById(imgID).style.cursor = 'url(\'i/aero_busy_xl.ani\')';
			
	if (image.src==newsrc){ 
		//document.body.style.cursor = '';
		document.body.style.cursor = ''; 
		document.getElementById(imgID).style.cursor = '';
		document.getElementById(imgID).style.cursor = '';
		
		return false;
		
	}
	else
	{
			//document.getElementById(imgID).style.cursor = 'wait';
			//document.getElementById(imgID).style.cursor = 'url(\'i/aero_busy_xl.ani\')';
			document.body.style.cursor = 'wait'; 
			document.body.style.cursor = 'url(\'i/aero_busy_xl.ani\')'; 
			
	}
	
    var view=$(image.id+'_view');
    var limiter=$(image.id+'_limiter');
    var container=$(image.id+'_container');
    var iw = view.getStyle('width').toInt();
    var ih = view.getStyle('height').toInt();
    limiter.set({'morph': { duration: 700, transition: 'expo:out' } });
    view.set({'morph': { duration: 700, transition: 'expo:out' } });
    limiter.morph({marginTop:'0px',marginLeft:'0px'});
    if (iw>ih) view.morph({width:container.getStyle('width')}); else view.morph({height:container.getStyle('height')});
    image.src=newsrc;
    view.fade(0);
    image.fade(1);
    setimg.delay(700,image,[newsrc,image]);
	//document.body.style.cursor = '';
	//document.getElementById(imgID).style.cursor = '';
    return false; 
}

function updatebag(link,quant)
{
	var newquant=quant;
	if (!newquant>0)
        {
            if (!confirm('Remove this item from the shopping bag?'))
             return false;
           newquant=0; 
        }
    $('wrapper').fade(0);
    return location.href='index.php?p=shoppingbag&'+link+'&addq='+newquant;
}

function updatequant(link,quant)
{
	if ($('quantpopurl').value.length>0) return false; //already open
	$('quantpopurl').value=link;
	$('newquant').value=quant;
	$('quantpop').fade(1);
	return false;
}

function updatequant_v2(link,quant,mgp_custQty,divID)
{
	if ($('quantpopurl').value.length>0) return false; //already open
	$('quantpopurl').value=link;
	$('newquant').value=quant;
	$('mgp_cutomMinQty').value=mgp_custQty;
	$('input_divID').value=divID;
	$('quantpop').fade(1);
	return false;
}




function dontShowMeAgain()
{
	//alert(typeid);
	 var req = new Request.HTML({url:'index.php?p=dontshowmeagain',
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
    		//alert(responseHTML);
			//document.getElementById('addShopBagCollpop').innerHTML = responseHTML;
			//$('addShopBagCollpop').fade(1);
		},
		onFailure: function() {
			alert('Connection error: Cannot add to shopping bag!');
		}
	});
    req.send();
	
	return false; //always return false in order to be used to prevent href
}

var setprodimg=function (newsrc,image){
     var view=$('overlayimage');
    view.src=newsrc;
    image.setStyle('visibility','hidden');
    view.setStyles({'visibility':'visible','opacity':1});
    }

var setimg=function (newsrc,image){
   var view=$(image.id+'_view');
    view.src=newsrc;
    image.setStyle('visibility','hidden');
    view.setStyles({'visibility':'visible','opacity':1});
	
	document.body.style.cursor = '';
	
	
    }
	
	
/**************************MOUSE POSITION*********************************************/
// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0
var tempY = 0


function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft;
    tempY = event.clientY + document.body.scrollTop;//document.body.scrollTop;
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX;
    tempY = e.pageY+document.body.scrollTop;
	
  } 
  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
 // document.Show.MouseX.value = tempX
 // document.Show.MouseY.value = tempY
  return true
}

/********
******************END OF MOUSE POSITION*********************************************/

/*
var jq_mouseX = 0;
var jq_mouseY = 0;
$().mousemove( function(e) {
   jq_mouseX = e.pageX; 
   jq_mouseY = e.pageY;
 }
);
*/

/*
var jq_mouseX = 0;
var jq_mouseY = 0;

jQuery(document).ready(function(){
   $().mousemove(function(e){
      //$('#status').html(e.pageX +', '+ e.pageY);
	  jq_mouseX = e.pageX; 
   	  jq_mouseY = e.pageY;
   }); 
})
*/

function show_colectnsMsovr(collectionid)
{
	//alert(collectionid);
	 var req = new Request.HTML({url:'index.php?p=mycollections&coll='+collectionid,
		onSuccess: function(html, responseElements, responseHTML, responseJavaScript) {
    		//alert(responseHTML);
			document.getElementById('photo_mo').innerHTML = responseHTML;
		
			//document.getElementById('photo_mo').style.top = tempY;//'';//tempY;
			//document.getElementById('photo_mo').style.left = tempX;//tempX;
			//alert(tempY);
			$('photo_mo').fade(1);
			
			
		},
		onFailure: function() {
			//alert('Connection error: Cannot add to shopping bag!');
		}
	});
    req.send();
	
	return false; //always return false in order to be used to prevent href
}



