function okno(){
window.open('http://konkurs.develey.pl','','height=400,width=400,toolbar=no,scrollbars=no');
}

// content-swapper for product area
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

/*
var defaultContent1;
var defaultContent2;
var myContentObj1 = '';
var myContentObj2 = '';
function defaultText() {
	myContentObj1 = MM_findObj("dynamicContent1");
	myContentObj2 = MM_findObj("dynamicContent2");
	if (myContentObj1 && myContentObj2) {
		defaultContent1 = myContentObj1.innerHTML;
		defaultContent2 = myContentObj2.innerHTML;
	}
}

function swapText(myText1, myText2, flag_txtCols1) {
	if(flag_txtCols1 == true){ 
		myContentObj1.innerHTML = myText1;
		myContentObj2.innerHTML = myText2;
	}
	else{
		myContentObj1.innerHTML = myText1;
		myContentObj2.innerHTML = "<div class='txtCols2_2'>"+myText2+"</div>";
	}
}

function restoreText() {
	myContentObj1.innerHTML = defaultContent1;
	myContentObj2.innerHTML = defaultContent2;
}
*/

var defaultContent1;
var myContentObj1 = '';
function defaultText() {
	myContentObj1 = MM_findObj("dynamicContent1");
	if (myContentObj1) {
		defaultContent1 = myContentObj1.innerHTML;
	}
}

function swapText(theElement) {
	myContainer = MM_findObj(theElement);
	myContentObj1.innerHTML = myContainer.innerHTML;
}

function restoreText() {
	myContentObj1.innerHTML = defaultContent1;
}

function preloadImages(){
		a=preloadImages.arguments;
		bilder=new Array();
		for (i=0; i<a; i++){
			bilder[i] = new Image();
			bilder[i].src = a[i];
		}
}
function preloadImagesAll(imagearray){
	bilder=new Array;
	for (i=0; i<imagearray.length; i++){
		bilder[i] = new Image();
		bilder[i].src = imagearray[i].src;
		}
}
//function preloadLowsrc(lowsrc_img){
//	if (document.images)	
//}

/* POPUP Control */
function popupInit(el, width)
{
  popupShow(el, width);
  popupSetPosition(el, width);
}
function popupShow(el, width)
{ 
  popup=document.getElementById(el);
  theCookieName='d'+el;
  if (!popupHasCookie(theCookieName)) {
      popup.style.display = 'block';    
  }else{
      popup.style.display = 'none';
  }
}
function popupClose(el)
{
  popup=document.getElementById(el);
  popup.style.display = 'none';
  
  popupAddCookie('d'+el);
}
function popupHasCookie(cookieName)
{
  theCookie=""+document.cookie;
  ind=theCookie.indexOf(cookieName);
  return ind==-1 || cookieName=="" ? false : true;
}
function popupAddCookie(cookieName)
{
  today = new Date();
  expire = new Date();
  expire.setTime(today.getTime() + 3600000*10);
  document.cookie = cookieName+"="+escape('ok')+ ";expires="+expire.toGMTString();
}
function popupSetPosition(el, width)
{
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    windowWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    windowWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    windowWidth = document.body.clientWidth;
  }

  popup=document.getElementById(el);
  popup.style.top = '250px';
  popup.style.left = (windowWidth/2)-(width/2)+'px';
}
