function GetWidth() {
	  var myWidth = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myWidth = window.innerWidth;	    
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	    //IE 6+ in 'standards compliant mode'
	    myWidth = document.documentElement.clientWidth;	    
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	    //IE 4 compatible
	    myWidth = document.body.clientWidth;	    
	  }
	  return myWidth;
	}
 function ResW(){
//	if (GetWidth() > 1600)
//	{
//		document.getElementById('maindv').style.width = '1600px';
//	}
//	else
//	{
//		document.getElementById('maindv').style.width = '100%';
//	} 
 }
 window.onresize = function(){ResW();}
 
 jQuery.noConflict();
 function buy()
 {
	 
	 jQuery.add2cart( 'preview', 'cart'  );
 }
 
 jQuery(function () {
 jQuery('.dv1').each(function () { 
		 var linker = jQuery('a', this).attr('href');
		 if(typeof(linker) != "undefined")
		 jQuery(this).click(function(event) { window.location = linker; });
		 jQuery(this).css('cursor', 'pointer');
	 }	 
	);
 jQuery('.dv2').each(function () { 
	 var linker = jQuery('a', this).attr('href');
	 if(typeof(linker) != "undefined")
	 jQuery(this).click(function(event) { window.location = linker; });
	 jQuery(this).css('cursor', 'pointer');
 }	 
);
 jQuery('.pages').each(function () { 
	 var linker = jQuery('a', this).attr('href');
	 if(typeof(linker) != "undefined")
	 jQuery(this).click(function(event) { window.location = linker; });
 }	 
);
 jQuery('.inp2').each(function () { 
	 
//	 alert(linker.attr('href'));
//	 $('a', this).attr('onclick','javascript:alert(1);');
//	 $('a', this).click (function () { alert(1)});
	 if(typeof(linker) != "undefined")
	 jQuery(this).click(function(event) { window.location = linker; });
//	 $('a', this).attr("onclick", "javascript: alert('foo');");
	 jQuery(this).focus(function () { jQuery(this).css('border', '1px solid #000000'); jQuery(this).css('background-color', '#f0f0f0'); });
	 jQuery(this).blur(function () { jQuery(this).css('border', '1px solid #999999'); jQuery(this).css('background-color', '#FFFFFF'); });
 }	 
);
 
 jQuery('.bubbleInfo').each(function () {
         var distance = 20;
         var leftdistance = -20;
         var time = 500;
         var hideDelay = 500;

         var hideDelayTimer = null;

         var beingShown = false;
         var shown = false;
         var trigger = jQuery('.trigger', this);
         var info = jQuery('.popup', this).css('opacity', 0);
         

         jQuery([trigger.get(0), info.get(0)]).mouseover(function () {
             if (hideDelayTimer) clearTimeout(hideDelayTimer);
             
             return false;
         }).mouseout(function () {
             if (hideDelayTimer) clearTimeout(hideDelayTimer);
             hideDelayTimer = setTimeout(function () {
                 hideDelayTimer = null;
                 info.animate({
                     top: '-=' + distance + 'px',
                     opacity: 0
                 }, time, 'swing', function () {
                     shown = false;
                     beingShown = false;
                     info.css('display', 'none');
                 });

             }, hideDelay);

             return false;
         }).click(function () {
             if (hideDelayTimer) clearTimeout(hideDelayTimer);
             if (beingShown || shown) {
                 // don't trigger the animation again
                 return ;
             } else {
                 // reset position of info box
                 beingShown = true;

                 info.css({
                     top: -5,
                     left: -235,
                     display: 'block'
                 }).animate({
                     top: '+=' + distance + 'px',
                     left: '+='+ leftdistance +  'px',
                     opacity: 1
                 }, time, 'swing', function() {
                     beingShown = false;
                     shown = true;
                 });
             } 
             });
         
     });
 });