var fully_loaded=0;
var sw_turn=0;
var total_prods=0;
var content_is_overlayed=0;
var show_arrow = 0;
var contact_send = false;

function loaded_flag()
{
  fully_loaded=1;
}

var ie6 = document.getElementById && document.all&&(navigator.appVersion.indexOf("MSIE 6.")>=0);
function htmlspecialchars (string, quote_style) {
    // http://kevin.vanzonneveld.net
    // +   original by: Mirek Slugen
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   bugfixed by: Nathan
    // +   bugfixed by: Arno
    // +    revised by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // -    depends on: get_html_translation_table
    // *     example 1: htmlspecialchars("<a href='test'>Test</a>", 'ENT_QUOTES');
    // *     returns 1: '&lt;a href=&#039;test&#039;&gt;Test&lt;/a&gt;'
 
    var histogram = {}, symbol = '', tmp_str = '', i = 0;
    tmp_str = string.toString();
    
    if (false === (histogram = get_html_translation_table('HTML_SPECIALCHARS', quote_style))) {
        return false;
    }
    
    for (symbol in histogram) {
        entity = histogram[symbol];
        tmp_str = tmp_str.split(symbol).join(entity);
    }
    
    return tmp_str;
}


function utf8_decode ( str_data ) {    // Converts a string with ISO-8859-1 characters encoded with UTF-8   to single-byte
    // ISO-8859-1
    // 
    // +   original by: Webtoolkit.info (http://www.webtoolkit.info/)
 
    var string = "", i = 0, c = c1 = c2 = 0;
 
    while ( i < str_data.length ) {
        c = str_data.charCodeAt(i);
        if (c < 128) {
            string += String.fromCharCode(c);
            i++;
        } else if((c > 191) && (c < 224)) {
            c2 = str_data.charCodeAt(i+1);
            string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
            i += 2;
        } else {
            c2 = str_data.charCodeAt(i+1);
            c3 = str_data.charCodeAt(i+2);
            string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
            i += 3;
        }
    }
 
    return string;
}


function str_replace ( search, replace, subject ) {    // Replace all occurrences of the search string with the replacement string
    // 
    // +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Gabriel Paderni
 
    if(!(replace instanceof Array)){
        replace=new Array(replace);
        if(search instanceof Array){//If search    is an array and replace    is a string, then this replacement string is used for every value of search
            while(search.length>replace.length){
                replace[replace.length]=replace[0];
            }
        }
    }
 
    if(!(search instanceof Array))search=new Array(search);
    while(search.length>replace.length){//If replace    has fewer values than search , then an empty string is used for the rest of replacement values
        replace[replace.length]='';
    }
 
    if(subject instanceof Array){//If subject is an array, then the search and replace is performed with every entry of subject , and the return value is an array as well.
        for(k in subject){
            subject[k]=str_replace(search,replace,subject[k]);
        }
        return subject;
    }
 
    for(var k=0; k<search.length; k++){
        var i = subject.indexOf(search[k]);
        while(i>-1){
            subject = subject.replace(search[k], replace[k]);
            i = subject.indexOf(search[k],i);
        }
    }
 
    return subject;
 
}
    function object_rollOver(a)
	{

	if(!ie6){
			//document.getElementById("flash_menu").style.border="solid 1px green";
		document.getElementById("flash_menu").style.width='1000px';   
	}
		
	  	document.getElementById("flash_menu").style.zIndex="35";
		//flashonByClick('flash/App.swf','100%','100%');
		show_overlay_for_menu();
 		
        return "successful";
    }
	
	function object_rollOut(a)
	{

		
		
      if(!ie6){
	   document.getElementById('flash_menu').style.width='320px';
	  }
         
          document.getElementById("flash_menu").style.zIndex="3";
	    
		  hide_overlay_for_menu();
		
        return "successful";

    }
	function getPageSize() {
	        
	     var xScroll, yScroll;
		
		if (window.innerHeight && window.scrollMaxY) {	
			xScroll = window.innerWidth + window.scrollMaxX;
			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
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth; 
			} else {
				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 = xScroll;		
		} else {
			pageWidth = windowWidth;
		}

		return [pageWidth,pageHeight];
	}

function show_overlay_for_menu()
	{		 

		  document.getElementById("overlay_menu").style.width=document.getElementById("main_big").offsetWidth+'px';
	
		 // document.getElementById("overlay_menu").style.width='1100px';
		   
		 // alert(document.getElementById("overlay_menu").style.width);
		  document.getElementById("overlay_menu").style.height = document.getElementById("main_big").offsetHeight+'px';
		   
		  document.getElementById("overlay_menu").style.display="block";

		


		  document.getElementById("overlay_menu").style.zIndex="30";
		  Element.Methods.setOpacity(document.getElementById("overlay_menu"),'0.80');	
	}


	function hide_overlay_for_menu()
	{		 
				//alert("hide_overlay");
				document.getElementById("overlay_menu").style.display="none";
				document.getElementById("overlay_menu").style.zIndex="0";
				//alert( document.getElementById("overlay_menu").style.width +' '+ document.getElementById("overlay_menu").style.height);
			
	}


function showtooltip(number, flag){
		if (flag==1)
		{			
			document.getElementById('tool_'+number).style.display="block";
			document.getElementById('tolltips_holder_table').style.zIndex=10;
			
         
		 }else {
                        document.getElementById('tolltips_holder_table').style.zIndex="0";
			document.getElementById('tool_'+number).style.display="none";			
 
		}
	}




function switch_page(url,evalScripting,returnW, flash_menu)

{
	/*
		if(flash_menu){	
			
			new Ajax.Updater('main_big', url+'?ajax=true&flash_menu=true',{ method: 'get', evalScripts: 'true'} );
			 
		}else{
			
		 	new Ajax.Updater('main_big', url+'?ajax=true&flash_menu=false',{ method: 'get', evalScripts: 'true'} );

	    }	

		if(returnW=='true')
	    {
		   return false;
	    }
	*/
	document.location = url;
}









function submit_login(form)
{
         //
         /*
         var url_params=encodeURI('?site=4&activity=downloads&email=' + form.email.value + '&password=' + form.password.value);
         var url = "/KDB/public/auth_request.php" + url_params;
                  
         new Ajax.Request(url, { method: 'get',
             onSuccess: function(transport) {
               if (transport.responseText.match(/failure/))
               {
                     var url = '/public/content/home/login_registration/';
                     
                     new Ajax.Updater('main_big', url+"?login_error=true&ajax=true&flash_menu=false", 
					    { method: 'get', evalScripts: true });
                     
               }else{
                  submit_login_ok(encodeURI(transport.responseText + "&login=true"));
               }
            }
         });
         
		 //new Ajax.Updater('main_big', url+'?ajax=true&flash_menu=false',{ method: 'get', evalScripts: 'true'} );
		 */
		 
		 document.login_form.submit();
}



function submit_login_ok(result)
{
   var url = '/public/content/home/login_registration/downloads/overview/';
   document.location.href = url+"?"+result;
}









  function check_form_newsletter(){

   var flag=true;
	if(document.getElementById("firstname").value==''){
	
		
		flag=false;
		document.getElementById("firstname").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("firstname").style.backgroundColor="#292929";

	}
	if(document.getElementById("lastname").value==''){
	
		flag=false;
		document.getElementById("lastname").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("lastname").style.backgroundColor="#292929";

	}

	
	if(document.getElementById('email').value=="" || (!/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(document.getElementById('email').value))){
	
		flag=false;
		document.getElementById("email").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("email").style.backgroundColor="#292929";

	}

	
	if(document.getElementById("country").value=='Choose country' || document.getElementById("country").value=='' || document.getElementById("country").value=='0'){
	     
		flag=false;
		document.getElementById("country_combo").style.backgroundImage="url('img/select1_red.gif')";
	} else{
	    
		document.getElementById("country_combo").style.backgroundImage="url('img/select1.gif')";
	}
	//alert(document.getElementById("UpDiv_select_newsletter").value); 

	if (flag){

      if(!contact_send)
      {
		 Event.observe(document.contact_form, 'submit', function(event) {
			if(!contact_send) return true;
			else return false;			
		 });      
		 document.getElementById("sendMail").value = "1";
		 document.contact_form.submit(); 
         contact_send = true;
      }
	} else {
	
		return false;
	}
}
function country1 (NWSselectObj, EditingId, Params){


	document.getElementById('country2').value=NWSselectObj.Data[EditingId].Caption;
	document.getElementById('distr_email').value=EditingId;
	
} 

	


function grossByClickMovie(movie)
	{		 
          var w = 513;
          var h = 289;

		  var positionArray = windowPosition();
		  var sizeArray = windowSize();
		  var arrayPageSize = this.getPageSize();


		  document.getElementById("overlay").style.width=document.getElementById("main_big").offsetWidth+'px';
		  document.getElementById("overlay").style.height =arrayPageSize[1] + 'px'
		  document.getElementById("overlay").style.display="block";
		  document.getElementById("overlay").style.zIndex="100";
		  document.getElementById("flash_menu").style.zIndex="40";
          Element.Methods.setOpacity(document.getElementById("overlay"),'0.80');			
			
	      var myDiv = document.createElement("div");
		  var myCloser = document.createElement("a");
		  var myCloserImg = document.createElement("img");
		  var myCloserDiv = document.createElement("div");
          var myImage = document.createElement("div");		  
		  
		  myImage.setAttribute("id","movieplayer");
		  
		  new Ajax.Updater("movieplayer", 'movieplayer?url=' + movie, 
					    { method: 'get', evalScripts: true });
					    
					    

		  myCloser.setAttribute("href","javascript:kleinByClick();");
		 

	  

          myCloser.appendChild(myCloserImg);
		  myCloserDiv.appendChild(myCloser);
		  myDiv.appendChild(myCloserDiv);
		  
		  myDiv.appendChild(myImage);
		  	

		  with(myCloserImg)
		  {
		     setAttribute("src","img/closelabel.gif");
		     setAttribute("border","0");	     
		  }
		  
		  with(myCloserDiv.style)
		  {
			 position = "absolute";
			 top = "0px";
			 left = "920px";
		  }	
		 
		  myImage.style.top = "220px";
		  myImage.style.left = "260px";
		  myImage.style.position = "absolute";
		  //document.getElementById("movieplayer").style.left = "200px";
		 
		  
          with(myDiv.style)
		  {
			  position = "absolute";
			  visibility = "visible";
			  left = "0px";
			  top = "20px";
			  width = w + "px";
			  height = h + "px";
		  }			  
		  
		  document.getElementById("showproc").appendChild(myDiv);
		  document.getElementById("showproc").style.visibility = "visible";
		  document.getElementById("showproc").style.overflow = "visible";
		  document.getElementById("showproc").style.width = '100%';
		  document.getElementById("showproc").style.height = document.getElementById("haupt").offsetHeight + 'px';
	}





function grossByClick(img,w,h)
	{		 

		  var positionArray = windowPosition();
		  var sizeArray = windowSize();

		  var arrayPageSize = this.getPageSize();

		  document.getElementById("overlay").style.width=document.getElementById("main_big").offsetWidth+'px';
		  //document.getElementById("overlay").style.height = document.getElementById("main_big").offsetHeight+'px';
		  document.getElementById("overlay").style.height =arrayPageSize[1] + 'px'
		  document.getElementById("overlay").style.display="block";
		  document.getElementById("overlay").style.zIndex="100";
		  document.getElementById("flash_menu").style.zIndex="40";
          Element.Methods.setOpacity(document.getElementById("overlay"),'0.80');			
			
	      var myDiv = document.createElement("div");
		  var myCloser = document.createElement("a");
		  var myCloserImg = document.createElement("img");
		  var myCloserDiv = document.createElement("div");
          var myImage = document.createElement("img");	

          var myLoaderDiv = document.createElement("div");	            
          var myLoader = document.createElement("img");	  
		  

		  myCloser.setAttribute("href","javascript:kleinByClick();");

		  with(myDiv){	  
			setAttribute("border","4")
		  }
		  with(myCloserImg)
		  {
			 setAttribute("position","absolute");
		     setAttribute("src",img);
		     setAttribute("width",w);
		     setAttribute("height",h);
		     setAttribute("border","0");
			 setAttribute("z-index","110");
			 setAttribute("opacity","0.1");
			 setAttribute("className","transp");
		  }
		  
		  myCloser.appendChild(myCloserImg);
		  myCloserDiv.appendChild(myCloser);

		  myDiv.appendChild(myCloserDiv);

		  myCloserImg.style.visibility="hidden";

		  //myLoader.setOpacity(1);	
		  with(myLoaderDiv)
		  {
			 setAttribute("style","position:absolute;padding-top:380px;left:50%");	
			 setAttribute("className","img_loader");			 	  
		  }			  
		  with(myLoader)
		  {
		     setAttribute("src",'img/loading.gif');
		  }		 
		  myLoaderDiv.appendChild(myLoader); 	
		  document.getElementById("overlay").appendChild(myLoaderDiv);		  

					  
			if (myCloserImg.complete) {	
				document.getElementById("overlay").removeChild(myLoaderDiv);
			  	myCloserImg.style.visibility="visible";
			} else {								
				myCloserImg.onload = function() {	
					document.getElementById("overlay").removeChild(myLoaderDiv);
				  	myCloserImg.style.visibility="visible";				
				}
			}	  	
			
			if(Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6){
					document.getElementById("overlay").removeChild(myLoaderDiv);
				  	myCloserImg.style.visibility="visible";							
			}

			
          with(myDiv.style)
		  {
			  position = "absolute";
			  left = ((document.getElementById("haupt").offsetWidth-w) / 2) + "px";
			  //top = ((sizeArray[1]-h)/2 + positionArray[1]) + "px";
			  width = w + "px";
			  height = h + "px";
		  }			  
		  
		  document.getElementById("showproc").appendChild(myDiv);
		  document.getElementById("showproc").style.visibility = "visible";
		  document.getElementById("showproc").style.overflow = "visible";
		  document.getElementById("showproc").style.width = '100%';
		  document.getElementById("showproc").style.height = document.getElementById("haupt").offsetHeight + 'px';		
			

							
		  var arrayPageSize = this.getPageSize();
		  if(h>arrayPageSize[1]){
		  	document.getElementById("overlay").style.height =h + 'px';		  
		  }else{
		  	document.getElementById("overlay").style.height =arrayPageSize[1] + 'px';		  
		  }
		  document.getElementById("overlay").style.width ='100%';			  
	}

	function kleinByClick()
	{
	      document.getElementById("showproc").style.visibility = "hidden";
		  document.getElementById("showproc").style.overflow = "hidden";
		  document.getElementById("showproc").style.width = '0px';
		  document.getElementById("showproc").style.height = '0px';
		  document.getElementById("flash_menu").style.zIndex="3";
          document.getElementById("showproc").removeChild(document.getElementById("showproc").childNodes[0]);
		  document.getElementById("overlay").style.display="none";
	}
	function windowPosition()
	{
      var x,y;
      if (self.pageYOffset) // all except Explorer
      {
	     x = self.pageXOffset;
	     y = self.pageYOffset;
      }
      else if (document.documentElement && document.documentElement.scrollTop)
	  // Explorer 6 Strict
      {
	    x = document.documentElement.scrollLeft;
	    y = document.documentElement.scrollTop;
      }
      else if (document.body) // all other Explorers
      {
	     x = document.body.scrollLeft;
	     y = document.body.scrollTop;
      }		
	  return new Array(x,y);
	}
	function windowSize()
	{
       var myWidth = 0, myHeight = 0;
       if( typeof( window.innerWidth ) == 'number' )
	   {
         //Non-IE
         myWidth = window.innerWidth;
         myHeight = window.innerHeight;
       } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
         //IE 6+ in 'standards compliant mode'
         myWidth = document.documentElement.clientWidth;
         myHeight = document.documentElement.clientHeight;
       } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
         //IE 4 compatible
         myWidth = document.body.clientWidth;
         myHeight = document.body.clientHeight;
       }

         return new Array(myWidth, myHeight);
    }	







	

	
	



 function get_element(id)
        {
            return document.getElementById ? document.getElementById(id) : document.all[id];
        }
        
 function fix_height(){

        
            x1=get_element('summary').offsetHeight;
           
       // alert(x1);

            
			if(x1>185){
				get_element('holder1').style.height=x1+'px';
				 get_element('td_holder1').style.height=x1+'px';
			} else{
			    get_element('holder1').style.height='185px';
				 get_element('td_holder1').style.height='185px';
			}
        }

function thumbnails_news(image, image_huge, w, h){

		if(image!='' && image_huge!='' && w!='' && h!=''){
	
			document.getElementById('picture_big').innerHTML="<img style='width:350px;' src='" + image + "'>";
			document.getElementById('plus').innerHTML="<a href=\"javascript:grossByClick('"+image_huge+"','"+w+"','"+h+"')\"><img src=\"img/plus.gif\" /></a>";
		}

	}
function thumbnails(image, image_huge, w, h){

		if(image!='' && image_huge!='' && w!='' && h!=''){
	
			document.getElementById('picture_big').innerHTML="<img src='" + image + "'>";
			document.getElementById('plus').innerHTML="<a href=\"javascript:grossByClick('"+image_huge+"','"+w+"','"+h+"')\"><img src=\"img/plus.gif\" /></a>";
		}

	}

function flashonByClick(img,w,h)
	{		 


		  var positionArray = windowPosition();
		  var sizeArray = windowSize();

		  document.getElementById("overlay2").style.width=document.getElementById("main_big").offsetWidth+'px';
		  document.getElementById("overlay2").style.height = document.getElementById("main_big").offsetHeight+'px';
		  document.getElementById("overlay2").style.display="block";
                  Element.Methods.setOpacity(document.getElementById("overlay2"),'0.80');			
			
	      var myDiv = document.createElement("div");
		  var myCloser = document.createElement("a");
		  var myCloserImg = document.createElement("img");
		  var myCloserDiv = document.createElement("div");
          var myImage = document.createElement("img");		  
		  

		  myCloser.setAttribute("href","javascript:flashoutByClick();");
		   //myImage.setAttribute("href","javascript:kleinByClick();");

		  with(myDiv){	  
			setAttribute("border","4")
		  }

		  with(myCloserImg)
		  {
			 setAttribute("position","absolute");
		     setAttribute("src",img);
		     setAttribute("width",w);
		     setAttribute("height",h);
		     setAttribute("border","0");
			 setAttribute("z-index","100");
			 setAttribute("opacity","0.1");
			 setAttribute("className","transp");
			
			 
		  }
		  
		 /* with(myCloserImg)
		  {
		    setAttribute("src","images/kleinmacher.gif");
		    setAttribute("width","15");
		    setAttribute("height","16");
		    setAttribute("border","0");
		  }
		 */


		// myCloser.appendChild(myImage);
		  myCloser.appendChild(myCloserImg);
		  myCloserDiv.appendChild(myCloser);
		  
		/*  with(myCloserDiv.style)
		  {
			 position = "relative";
	         top =  "-16px"; 
		  }*/
		  
		  //myDiv.appendChild(myImage);
		  myDiv.appendChild(myCloserDiv);
		  	
		  
          with(myDiv.style)
		  {
			  position = "absolute";
			  left = ((document.getElementById("haupt2").offsetWidth-w) / 2) + "px";
			  top = ((sizeArray[1]-h)/2 + positionArray[1]) + "px";
			  width = w + "px";
			  height = h + "px";
		  }			  
		  
		  document.getElementById("showproc2").appendChild(myDiv);
		  document.getElementById("showproc2").style.visibility = "visible";
		  document.getElementById("showproc2").style.overflow = "visible";
		  document.getElementById("showproc2").style.width = '100%';
		//  document.getElementById("showproc2").style.border = 'solid 2px green';
		  document.getElementById("showproc2").style.height = document.getElementById("haupt2").offsetHeight + 'px';
	}

	function flashoutByClick()
	{
		//alert("flashout");
	      document.getElementById("showproc2").style.visibility = "hidden";
		  document.getElementById("showproc2").style.overflow = "hidden";
		  document.getElementById("showproc2").style.width = '0px';
		  document.getElementById("showproc2").style.height = '0px';
          document.getElementById("showproc2").removeChild(document.getElementById("showproc2").childNodes[0]);
		  document.getElementById("overlay2").style.display="none";
	}
	function windowPosition()
	{
      var x,y;
      if (self.pageYOffset) // all except Explorer
      {
	     x = self.pageXOffset;
	     y = self.pageYOffset;
      }
      else if (document.documentElement && document.documentElement.scrollTop)
	  // Explorer 6 Strict
      {
	    x = document.documentElement.scrollLeft;
	    y = document.documentElement.scrollTop;
      }
      else if (document.body) // all other Explorers
      {
	     x = document.body.scrollLeft;
	     y = document.body.scrollTop;
      }		
	  return new Array(x,y);
	}
	function windowSize()
	{
       var myWidth = 0, myHeight = 0;
       if( typeof( window.innerWidth ) == 'number' )
	   {
         //Non-IE
         myWidth = window.innerWidth;
         myHeight = window.innerHeight;
       } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
         //IE 6+ in 'standards compliant mode'
         myWidth = document.documentElement.clientWidth;
         myHeight = document.documentElement.clientHeight;
       } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
         //IE 4 compatible
         myWidth = document.body.clientWidth;
         myHeight = document.body.clientHeight;
       }

         return new Array(myWidth, myHeight);
    }	







	

	
	



 function get_element(id)
        {
            return document.getElementById ? document.getElementById(id) : document.all[id];
        }
        
 function fix_height(){

        
            x1=get_element('summary').offsetHeight;
           
       // alert(x1);

            
			if(x1>185){
				get_element('holder1').style.height=x1+'px';
				 get_element('td_holder1').style.height=x1+'px';
			} else{
			    get_element('holder1').style.height='185px';
				 get_element('td_holder1').style.height='185px';
			}
        }


function thumbnails(image, image_huge, w, h){

		if(image!='' && image_huge!='' && w!='' && h!=''){
	
			document.getElementById('picture_big').innerHTML="<img src='" + image + "' class='image_thumb' onclick=\"javascript:grossByClick('"+image_huge+"','"+w+"','"+h+"')\">";
			document.getElementById('plus').innerHTML="<a href=\"javascript:grossByClick('"+image_huge+"','"+w+"','"+h+"')\"><img src=\"img/plus.gif\" /></a>";
			if(document.getElementById('tooltips_holder_td')){			
				document.getElementById('gr').value = "grossByClick('"+image_huge+"','"+w+"','"+h+"')";
				document.getElementById('tooltips_holder_td').onclick=function anonymous() { eval(document.getElementById('gr').value); }
			}
			
		}

	}


function over_red(id){
	     
		  document.getElementById("prod_div_"+id).style.border="1px #d92c00 solid";
		
		  document.getElementById("prod_link_"+id).style.color="#000000";  //alert(id);
	}
	function out_black(id){
			 document.getElementById("prod_div_"+id).style.border="1px #000000 solid";
			document.getElementById("prod_link_"+id).style.color="#FFFFFF";
	}
	
	
function check_form(url,formular){

   var flag=true;
   
   if(document.getElementById("firstname").value=='')
   {	
		flag=false;
		document.getElementById("firstname").style.backgroundColor="#d92c00";
   }else{
		document.getElementById("firstname").style.backgroundColor="#292929";
   }
   
   if(document.getElementById("lastname").value=='')
   {	
		flag=false;
		document.getElementById("lastname").style.backgroundColor="#d92c00";
   }else{
		document.getElementById("lastname").style.backgroundColor="#292929";
   }   
   
   if(document.getElementById('email').value=="" || (!/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(document.getElementById('email').value)))
   {
		flag=false;
		document.getElementById("email").style.backgroundColor="#d92c00";
   }else{
		document.getElementById("email").style.backgroundColor="#292929";
   }


   if(document.getElementById("distributor").value=='Choose country' || document.getElementById("distributor").value=='' || document.getElementById("distributor").value=='0')
   {
		flag=false;
		document.getElementById("distributor_combo").style.backgroundImage="url('img/select_red.gif')";
   }else{   
		document.getElementById("distributor_combo").style.backgroundImage="url('img/select.gif')";
   }

   if(document.getElementById("country").value=='Choose country' || document.getElementById("country").value=='' || document.getElementById("country").value=='0')
   {
		flag=false;
		document.getElementById("country_combo").style.backgroundImage="url('img/select_red.gif')";
   }else{   
		document.getElementById("country_combo").style.backgroundImage="url('img/select.gif')";
   }

   //document.getElementById("comments").value= str_replace('\n', '<br />', document.getElementById("comments").value);
		
	

   if(flag)
   {
      document.getElementById("sendMail").value = '1';
      if(!contact_send)
      {
		 Event.observe(formular, 'submit', function(event) {
			if(!contact_send) return true;
			else return false;			
		 });      
         formular.submit();
         contact_send = true;
      }   
   }else{
      document.getElementById("sendMail").value = '';
      return false;
   }
   
}


function alert_err(){
	//alert("error");
}
function submit_contact_form()
	{
	  document.contact_form.submit(); 
	}
function country1 (NWSselectObj, EditingId, Params){
	
	document.getElementById('country1').value=NWSselectObj.Data[EditingId].Caption;
	document.getElementById('distr_email').value=EditingId;
	
}
function country2 (NWSselectObj, EditingId, Params){
	
	document.getElementById('country2').value=NWSselectObj.Data[EditingId].Caption;
	
}
function select_newsletter_country (NWSselectObj, EditingId, Params){

	document.getElementById('country').value=NWSselectObj.Data[EditingId].Caption;
	
}

function check_login_form(){

   var flag=true;
	if(document.getElementById("username").value==''){
	
		
		flag=false;
		document.getElementById("username").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("username").style.backgroundColor="#292929";

	}

	if(document.getElementById("password").value==''){
	
		
		flag=false;
		document.getElementById("password").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("password").style.backgroundColor="#292929";

	}
	
	if (flag){
		document.contact_form.submit(); 
	} else {
	
		return false;
	}
}

function go_to_registration(){

		
		if(document.go_to_reg.account_type[0].checked){
			
			document.getElementById("div_login").style.display="none";
			document.getElementById("reg_select").style.display="none";
			document.getElementById("press_account").style.display="block";
			document.getElementById("firstname_press").focus();
		}else{

			
			document.getElementById("div_login").style.display="none";
			document.getElementById("reg_select").style.display="none";
			document.getElementById("distr_account").style.display="block";
			document.getElementById("firstname_distr").focus();
		}

	return false;
}


function check_press_form(url,formular){

   var flag=true;
	if(document.getElementById("firstname_press").value==''){
	
		
		flag=false;
		document.getElementById("firstname_press").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("firstname_press").style.backgroundColor="#292929";

	}

	if(document.getElementById("lastname_press").value==''){
	
		
		flag=false;
		document.getElementById("lastname_press").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("lastname_press").style.backgroundColor="#292929";

	}

	if(formular.email.value=="" || (!/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(formular.email.value))){

	
		
		flag=false;
		formular.email.style.backgroundColor="#d92c00";

	}	else{
	
		formular.email.style.backgroundColor="#292929";

	}
	if(document.getElementById("password_press").value==''){
	
		
		flag=false;
		document.getElementById("password_press").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("password_press").style.backgroundColor="#292929";

	}

	if(document.getElementById("job_title_press").value==''){
	
		
		flag=false;
		document.getElementById("job_title_press").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("job_title_press").style.backgroundColor="#292929";

	}

	if(document.getElementById("medium_press").value==''){
	
		
		flag=false;
		document.getElementById("medium_press").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("medium_press").style.backgroundColor="#292929";

	}

	if(document.getElementById("publication_press").value==''){
	
		
		flag=false;
		document.getElementById("publication_press").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("publication_press").style.backgroundColor="#292929";

	}

	if(document.getElementById("editorial_department_press").value==''){
	
		
		flag=false;
		document.getElementById("editorial_department_press").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("editorial_department_press").style.backgroundColor="#292929";

	}

	if(document.getElementById("street_press").value==''){
	
		
		flag=false;
		document.getElementById("street_press").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("street_press").style.backgroundColor="#292929";

	}

	if(document.getElementById("city_press").value==''){
	
		
		flag=false;
		document.getElementById("city_press").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("city_press").style.backgroundColor="#292929";

	}


	if(document.getElementById("zip_press").value==''){
	
		
		flag=false;
		document.getElementById("zip_press").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("zip_press").style.backgroundColor="#292929";

	}

	

   if(document.getElementById("country_press").value=='Choose country' || document.getElementById("country_press").value=='' || document.getElementById("country_press").value=='0')
   {
		flag=false;
		document.getElementById("country_press_combo").style.backgroundImage="url('img/select_red.gif')";
   }else{   
		document.getElementById("country_press_combo").style.backgroundImage="url('img/select.gif')";
   }


	
     

	
	if (flag){
      if(!contact_send)
      {
		 Event.observe(formular, 'submit', function(event) {
			if(!contact_send) return true;
			else return false;			
		 });      
         formular.submit();
         contact_send = true;
      }	
	} else {
	
		return false;
	}
	
	
}

function check_distr_form(url,formular){

   var flag=true;
	if(document.getElementById("firstname_distr").value==''){
	
		
		flag=false;
		document.getElementById("firstname_distr").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("firstname_distr").style.backgroundColor="#292929";

	}

	if(document.getElementById("lastname_distr").value==''){
	
		
		flag=false;
		document.getElementById("lastname_distr").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("lastname_distr").style.backgroundColor="#292929";

	}

	if(formular.email.value=="" || (!/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(formular.email.value))){

	
		flag=false;
		formular.email.style.backgroundColor="#d92c00";

	}	else{
	
		formular.email.style.backgroundColor="#292929";

	}

	if(document.getElementById("password_distr").value==''){
	
		
		flag=false;
		document.getElementById("password_distr").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("password_distr").style.backgroundColor="#292929";

	}
	if(document.getElementById("street_distr").value==''){
	
		
		flag=false;
		document.getElementById("street_distr").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("street_distr").style.backgroundColor="#292929";

	}

	if(document.getElementById("company_distr").value==''){
	
		
		flag=false;
		document.getElementById("company_distr").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("company_distr").style.backgroundColor="#292929";

	}

	if(document.getElementById("city_distr").value==''){
	
		
		flag=false;
		document.getElementById("city_distr").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("city_distr").style.backgroundColor="#292929";

	}

	if(document.getElementById("zip_distr").value==''){
	
		
		flag=false;
		document.getElementById("zip_distr").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("zip_distr").style.backgroundColor="#292929";

	}


	if(document.getElementById("phone_distr").value==''){
	
		
		flag=false;
		document.getElementById("phone_distr").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("phone_distr").style.backgroundColor="#292929";

	}
	

   if(document.getElementById("country_distr").value=='Choose country' || document.getElementById("country_distr").value=='' || document.getElementById("country_distr").value=='0')
   {
		flag=false;
		document.getElementById("country_distr_combo").style.backgroundImage="url('img/select_red.gif')";
   }else{   
		document.getElementById("country_distr_combo").style.backgroundImage="url('img/select.gif')";
   }


	
     

	
	if (flag){
      if(!contact_send)
      {
		 Event.observe(formular, 'submit', function(event) {
			if(!contact_send) return true;
			else return false;			
		 });      
         formular.submit();
         contact_send = true;
      } 
	} else {
	
		return false;
	}
}

function show_detailed_prod(img){
		
		document.getElementById('prod_detail_img').innerHTML="<img  src='img/products/" + img + "'>";
	}


function check_newsletter_uns(){
	var flag=true;
	if(document.getElementById('email').value=="" || (!/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/.test(document.getElementById('email').value))){

	
		flag=false;
		document.getElementById("email").style.backgroundColor="#d92c00";

	}	else{
	
		document.getElementById("email").style.backgroundColor="#292929";

	}

	if (flag){

		return true;
		
	} else {
	
		return false;
	}
}

function select_country_press (NWSselectObj, EditingId, Params){

	document.getElementById('country_press').value=NWSselectObj.Data[EditingId].Caption;
	
}

function select_country_distr (NWSselectObj, EditingId, Params){

	document.getElementById('country_distr').value=NWSselectObj.Data[EditingId].Caption;
	
}

function country_contact(NWSselectObj, EditingId, Params){

	document.getElementById('country').value=NWSselectObj.Data[EditingId].Caption;
	
}