


function getViewportWidth() {

	var viewportwidth = 0;

	// mozilla/netscape/opera/IE7
	if ( typeof window.innerWidth != 'undefined' ) {
		viewportwidth = window.innerWidth;
	}
	// IE6
	else if ( typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
		viewportwidth = document.documentElement.clientWidth;
	}
	// regi IE
	else {
		viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
	}
	
	return viewportwidth;
}

/**-------------------------------------------------------------**/

function getViewportHeight() {

	var viewportheight = 0;

	// mozilla/netscape/opera/IE7
	if ( typeof window.innerWidth != 'undefined' ) {
		viewportheight = window.innerHeight;
	}
	// IE6
	else if ( typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
		viewportheight = document.documentElement.clientHeight;
	}
	// regi IE
	else {
		viewportheight = document.getElementsByTagName('body')[0].clientHeight;
	}
	
	return viewportheight;
}

/**-------------------------------------------------------------**/

function showImage( image_path ) {
	var div_width = getViewportWidth();
	var div_height = getViewportHeight();
	alert( 'width: '+getViewportWidth()+'; height: '+getViewportHeight() );
	getImageWidth( image_path );
	var img_container = document.createElement( 'div' );
	img_container.innerHTML = "<h1>Hi there and greetings!</h1>";
	// img_container.setAttribute( "className", "gallery_pic_container" );
	img_container.setAttribute( "style", "width: 100px; height: 100px; position: absolute; top: 100px; left: 100px; display: none;" );
	img_container.setAttribute( "id", "valami" );
	var bodyID = document.getElementById("sitebody");
	// var bodyID = document.getElementsByTagName("body")[0];
	bodyID.appendChild(img_container);
	Effect.Appear('valami');
}

/**-------------------------------------------------------------**/

function getImageWidth( image_path ) {
	var pic_id = "pic_"+Math.round( Math.random() * 10000 );
	alert( "pic_id: "+pic_id );
	var Image = document.createElement( 'img' );
}

/**-------------------------------------------------------------**/

function getImageHeight( id ) {
}

/**-------------------------------------------------------------**/

function feldob(nev) {
    var layer = document.getElementById(nev);
    // layer.style.visibility = "visible";
    layer.style.display = "block";
}

/**-------------------------------------------------------------**/

function ki(nev) {
    var layer = document.getElementById(nev);
    // layer.style.visibility = "hidden";
    layer.style.display = "none";
}

// Webaudit
WEBAUDIT=function() {
    
  this.WACID=null;
  this.WACIDName="WACID";
  
  
  this.getCookie=function(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;
  }
  
  this.setCookie=function(name,value,topDomain) {
    var date = new Date(2020,12,31,23,59,59);
    var expires = "; expires="+date.toGMTString();
    document.cookie = name+"="+value+expires+"; path=/; domain=" + topDomain;  
  }
  
  this.generateID=function(splitter) {
    var sp=(splitter) ? splitter : 'A';
    var now=new Date();
    return Date.parse(now.toGMTString()) + sp + Math.floor(Math.random()*1000000000);
  }
  
  this.getTopDomain=function(fullDomain) {
    var darabok=fullDomain.split('.');
    return darabok[(darabok.length-2)] + '.' + darabok[(darabok.length-1)];
  }
  
  this.getDomain=function(url) {
    var urlDarabok=url.split('/');
    return urlDarabok[2];
  }
  
  this.WACID=this.getCookie(this.WACIDName);
}

var same =  Math.floor(Math.random()*1000000);
var wa=new WEBAUDIT();
var felbontas = "";
var wa_url = "@u=";
var wa_referrer = "@r=";

if(wa.WACID==null)
{
  wa.WACID=wa.generateID('A');
  wa.setCookie(wa.WACIDName,wa.WACID,wa.getTopDomain(wa.getDomain(document.URL)));
}

same = same + "@c=" + wa.WACID;
if(screen) felbontas='@s='+screen.width+'x'+screen.height;
if(document.referrer) wa_referrer=wa_referrer+document.referrer;
if(document.URL) wa_url=wa_url+document.URL;
same = same + felbontas + wa_url + wa_referrer;
// Webaudit vege

// Fontsize controll
var fontsize_min = 8;
var fontsize_max = 18;

function increaseFontSize() {
   var p = document.getElementsByTagName( 'p' );
   for( i = 0; i < p.length; i++ ) {
      if( p[i].style.fontSize ) {
         var s = parseInt( p[i].style.fontSize.replace( "px", "" ) );
      } else {
         var s = 12;
      }
      if( s != fontsize_max ) {
         s += 1;
      }
      p[i].style.fontSize = s + "px"
   }
}

function decreaseFontSize() {
   var p = document.getElementsByTagName( 'p' );
   for( i = 0; i < p.length; i++ ) {
      if( p[i].style.fontSize ) {
         var s = parseInt( p[i].style.fontSize.replace( "px", "" ) );
      } else {
         var s = 12;
      }
      if( s != fontsize_min ) {
         s -= 1;
      }
      p[i].style.fontSize = s + "px"
   }   
}
// Fontsize vege
/**
var message="";
///////////////////////////////////
function clickIE()
 
{if (document.all)
{(message);return false;}}
 
function clickNS(e) {
if
(document.layers||(document.getElementById&&!document.all))
{
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else
{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
 
document.oncontextmenu=new Function("return false")
*/
