 
 
	function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
	window.onload = func;
	} else {
	window.onload = function() {
	oldonload();
	func();
	}
	}
	}
	
  function cumparaturi_on ()
  {var cosulet = document.getElementById('comanda_cos');
   if(!cosulet) {return;}
   var cosulmeu = document.getElementById('cosulmeu');
   if(!cosulmeu) {return;}
   cosulmeu.onmouseover = function () {cosulet.className = 'on';}
   cosulmeu.onmouseout = function () {cosulet.className = 'off';}
   }
   
   function cumparaturi_on2 ()
  {var cosulet = document.getElementById('comanda_cos');
   if(!cosulet) {return;}
   var cosulmeu_selected = document.getElementById('cosulmeu_selected');
   if(!cosulmeu_selected) {return;}
   cosulmeu_selected.onmouseover = function () {cosulet.className = 'on';}
   cosulmeu_selected.onmouseout = function () {cosulet.className = 'off';}
   }
  
  
  function scroller_news() {
    var news = document.getElementById('scroller_news');
	if(!news) {return;}
	// speed, dragHeight, trackHeight, trackObj, upObj, downObj, dragObj, contentMaskObj, contentObj
	myScroll = new ScrollObj(6,17,290,"track_news","up_news","down_news","drag_news","masca_news","continut_news"); }
	
  function scroller_stecil() {
    var stencil = document.getElementById('scroller_stencil');
	if(!stencil) {return;}
	// speed, dragHeight, trackHeight, trackObj, upObj, downObj, dragObj, contentMaskObj, contentObj
	myScroll = new ScrollObj(6,17,387,"track_stencil","up","down","drag_stencil","masca_stencil","continut_stencil"); } 
	
	function scroller_anonimtm() {
    var scroll_anonimtm = document.getElementById('scroller_anonimtm');
	if(!scroll_anonimtm) {return;}
	// speed, dragHeight, trackHeight, trackObj, upObj, downObj, dragObj, contentMaskObj, contentObj
	myScroll = new ScrollObj(6,17,290,"track","up","down","drag","masca","continut"); }
	
	function scroller_stoic() {
    var scroller_stoich = document.getElementById('scroller_stoicescu');
	if(!scroller_stoich) {return;}
	// speed, dragHeight, trackHeight, trackObj, upObj, downObj, dragObj, contentMaskObj, contentObj
	myScroll = new ScrollObj(6,17,180,"track_stoicescu","up","down","drag_stoicescu","masca_stoicescu","continut_stoicescu"); }	
	
	function scroller_skateri() {
    var scroller_skate = document.getElementById('scroller_skateri');
	if(!scroller_skate) {return;}
	// speed, dragHeight, trackHeight, trackObj, upObj, downObj, dragObj, contentMaskObj, contentObj
	myScroll = new ScrollObj(6,33,145,"track_skateri","up","down","drag_skateri","masca_skateri","continut_skateri"); }	
	
  
  function branduri()
   { 
    var branduri = document.getElementById('branduri');
	if(!branduri) {return;}
	var branduri_img = branduri.getElementsByTagName('img');
	for(i=0; i<branduri_img.length; i++)
	{
	  branduri_img[i].onmouseover = function ()
	  { 
	   if(this.className == 'selected') {return;}
	   original_src = this.getAttribute('src');
	   original_src = original_src.split(".gif");
	   original_src = original_src[original_src.length - 2];
	   new_src = original_src + '_on.gif';
	   this.setAttribute('src',new_src);
	  }
	  
	  branduri_img[i].onmouseout = function ()
	  {
	    if(this.className=='selected') {return;}
	   original_src = this.getAttribute('src');
	   original_src = original_src.split("_on.gif");
	   original_src = original_src[original_src.length - 2];
	   new_src = original_src + '.gif';
	   this.setAttribute('src',new_src);
	  }
	  
	  
	  
	}
   
   }	
 
  function clasa (action, reaction)
   {document.getElementById(action).className = reaction; }
  
  function team_on  (stanga, sus,titlu, continut_em, continut_span ) 
  {document.getElementById('trupa_info').style.left = stanga + "px"  ;
  document.getElementById('trupa_info').style.top = sus + "px"  ;
  document.getElementById('reclamant').src = "../images/" + titlu;
  var p = document.getElementById('reclama');
  var em = p.getElementsByTagName('em');
  em[0].innerHTML = continut_em + " "; 
  var span = p.getElementsByTagName('span');
  span[0].innerHTML = continut_span;
  document.getElementById('trupa_info').style.display = 'block' ;
  } 
  function team_off()
 {document.getElementById('trupa_info').style.display = 'none' ;}	 
 
  function cautare_av ()
  { document.getElementById('cautare_fieldset').className ='off';
    document.getElementById('cautare_cuvant_cheie').className ='on';
	document.getElementById('cautare_avansata').className ='on';
	document.getElementById('poll').className ='off';
  }
  
  function inchide_cautare()
  {
    document.getElementById('cautare_fieldset').className ='on';
	document.getElementById('cautare_cuvant_cheie').className ='off';
	document.getElementById('cautare_avansata').className ='off';
	document.getElementById('poll').className ='on';
  }
  
  function show_img (link_cu_poza)
  { 
   var img = link_cu_poza.getElementsByTagName('img')[0];
   img.style.display = 'block';
    }
  
  function hide_img (link_cu_poza)
  { 
   var img = link_cu_poza.getElementsByTagName('img')[0];
   img.style.display = 'none';
    }
	
	function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
	
	
	
	 function cupi ()
 {   var video = document.getElementById('cupi_video');
	 if(!video) {return;}
	 
	   video.onclick = function ()
	   {  
	     
		 getPageSize();
		  
		  
		   biggest_div = document.createElement('div');
		  biggest_div.style.width = arrayPageSize[2]- 30 + 'px';
		  biggest_div.style.height = arrayPageSize[1] + 'px';
		  biggest_div.setAttribute('id','biggest_div');
		  
		  
		  
		 
	      var unic = document.getElementById('video');
		  var video_container = document.createElement('div');
		  video_container.setAttribute('id','video');
		  video_wrapper = document.createElement('div');
		  video_wrapper.setAttribute('id','video_wrapper');
		  
		  var video_close = document.createElement('span');
		  video_close.setAttribute('id','video_close');
		  var vc_link = document.createElement('span');
		  vc_link.setAttribute('id','vc_link');
		  
		  var fo = new FlashObject("http://www.youtube.com/v/nGt0muG9Ae8", "cupi_tube", "425", "350", "8", "#555148");
		  fo.addParam("menu", "false");
		  fo.write(video_wrapper);
		  
		  video_container.appendChild(video_wrapper);
		  video_container.appendChild(video_close);
		  video_close.appendChild(vc_link);
		  biggest_div.appendChild(video_container);
		  
		 
		 document.body.appendChild(biggest_div); 
		  vc_link.onclick = function ()
		  { video_wrapper.innerHTML = '';
			document.body.removeChild(biggest_div);  
			}
		 	  
		 return false;  
		 }
  }
  
    function anarhie ()
 {   var video = document.getElementById('anarhie_video');
	 if(!video) {return;}
	 
	   video.onclick = function ()
	   {  
	     
		 getPageSize();
		  
		  
		   biggest_div = document.createElement('div');
		  biggest_div.style.width = arrayPageSize[2]- 30 + 'px';
		  biggest_div.style.height = arrayPageSize[1] + 'px';
		  biggest_div.setAttribute('id','biggest_div');
		  
		  
		  
		 
	      var unic = document.getElementById('video');
		  var video_container = document.createElement('div');
		  video_container.setAttribute('id','video');
		  video_wrapper2 = document.createElement('div');
		  video_wrapper2.setAttribute('id','video_wrapper');
		  
		  var video_close = document.createElement('span');
		  video_close.setAttribute('id','video_close');
		  var vc_link = document.createElement('span');
		  vc_link.setAttribute('id','vc_link');
		  
		  var fo = new FlashObject("http://www.youtube.com/v/uk2wqi5sK2c", "cupi_tube", "425", "350", "8", "#555148");
		  fo.addParam("menu", "false");
		  fo.write(video_wrapper2);
		  
		  video_container.appendChild(video_wrapper2);
		  video_container.appendChild(video_close);
		  video_close.appendChild(vc_link);
		  biggest_div.appendChild(video_container);
		  
		 
		 document.body.appendChild(biggest_div); 
		  vc_link.onclick = function ()
		  { video_wrapper2.innerHTML = '';
			document.body.removeChild(biggest_div);  
			}
		 	  
		 return false;  
		 }
  }
  
   window.onresize = function ()
   {
	  getPageSize();
	    biggest_div = document.getElementById('biggest_div');
		 if(!biggest_div) {return;}
	    biggest_div.style.width = arrayPageSize[2]- 30 + 'px';
		biggest_div.style.height = arrayPageSize[1] + 'px';
		
		
		  
	  
	 }
 

   addLoadEvent(externalLinks);
   addLoadEvent(scroller_news);
   addLoadEvent(scroller_stecil);
   addLoadEvent(scroller_anonimtm);
   addLoadEvent(scroller_stoic);
   addLoadEvent(scroller_skateri);
  
   addLoadEvent(cumparaturi_on);
   addLoadEvent(cumparaturi_on2);
   addLoadEvent(cupi);
   addLoadEvent(anarhie);
   
  
