jQuery(CheckPop);

function CheckPop(){
   	if (cwReadCookie('minosegiKlimak') == 'ok') 
		return false;
	else {
		RegistrationBox()
		document.getElementById('CustomFields_1_1').focus();
		cwCreateCookie('minosegiKlimak','ok',30);
	}
   }
   
   function go(){
   		document.getElementById('frmSS1').submit();
   }
   function cwCreateCookie(name, value, days){
       if (days) {
           var date = new Date();
           date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
           var expires = "; expires=" + date.toGMTString();
       }
       else 
           var expires = "";
       document.cookie = name + "=" + value + expires + "; path=/";
   }
   
   function cwReadCookie(name){
       var nameEQ = name + "=";
       var ca = document.cookie.split(';');
       for (var i = 0; i < ca.length; i++) {
           var c = ca[i];
           while (c.charAt(0) == ' ') 
               c = c.substring(1, c.length);
           if (c.indexOf(nameEQ) == 0) 
               return c.substring(nameEQ.length, c.length);
       }
       return null;
   }

	var ACTUAL = "";
	var ACTUALSRC = "";

    jQuery(document).ready(function(){
    
        jQuery("#sideTabs #sideTabs_ul").tabs({
            fx: {
                height: 'toggle',
                duration: 'fast'
            }
        });
 
        jQuery("#product_details_container #pTab").tabs({
            fx: {
                height: 'toggle',
                duration: 'fast'
            }
        
        });
    });

function TabClick(obj, newpic){
	
	if (ACTUAL) {
		ACTUAL.src = ACTAULSRC;
		ACTUAL = obj;
	}
	
	ACTUALSRC = obj.src;
	obj.src = newpic;
}

function RegistrationBox(){
    var overlay = jQuery('#regOverlay');
    var width = document.body.scrollWidth;
    var height = document.body.scrollHeight;
    var top = document.viewport.getScrollOffsets().top + Math.round((document.viewport.getDimensions().height - 600) / 2);
    overlay.css({
        width: width + "px",
        height: height + "px"
    });
    jQuery('#Reg_Box').css({
        display: 'block',
        width: width + "px",
        height: height + "px"
    });
    jQuery('#regDiv').css({
        top: top + 'px'
    });
    
}

function hideRegistrationBox(){
    jQuery('#Reg_Box').css({
        display: 'none'
    });
}
			
