//<!-- JavaScript Document

if(typeof(console)=="undefined"){console = {log:function(){}}}
//submit form
function submitform(f1){
	document.getElementById(f1).submit();
	}


//Submit Form with condition
function submitform2(id1,id2,d)
{
var str=document.getElementById(id2).value;	
if (str!=d && str!=''){
	document.getElementById(id1).submit();
	}
}


function changeSearch(id,d,dir)
{
var str=document.getElementById(id).value;
if (dir==1){
	if (str==d) document.getElementById(id).value='';
	}
else {
	if (str=='') document.getElementById(id).value=d;
	}
}


//show contact map
function showContactMap(n)
{
if (maplist==undefined) maplist=[];
var ind;
for (var i in maplist){
	ind=maplist[i];
	if (document.getElementById('maplink'+ind)!=undefined){
		document.getElementById('maplink'+ind).style.display='none';
		}
	}

if (document.getElementById('contactmap'+n)!=undefined){
	document.getElementById('contactmap'+n).style.display='block';
	}
}


//close contact map
function closeContactMap(n)
{
if (maplist==undefined) maplist=[];
var ind;
for (var i in maplist){
	ind=maplist[i];
	if (document.getElementById('maplink'+ind)!=undefined){
		document.getElementById('maplink'+ind).style.display='block';
		}
	}

if (document.getElementById('contactmap'+n)!=undefined){
	document.getElementById('contactmap'+n).style.display='none';
	}
}


//show product win
function showproductwin(fid,d)
{


var id1='cprod'+fid;
var id2='cblackcell'+fid;
$("#"+id2).click(function(){
    showproductwin(fid,-1);
});

    var  neededHeight = 90;
       var windowHeight = $(window).height();
            if((windowHeight - 616)>90){
                neededHeight = 90;
            }else if((windowHeight - 616)<0){
                neededHeight = 0;
            }else {
                neededHeight = windowHeight - 616;
            }
            $('#'+id1).animate({
                top:neededHeight
            },0);


if (d==1){
    window.scrollTo(0,0);
	//document.getElementById(id1).style.display='block';
	//document.getElementById(id2).style.display='block';
        $('#'+id1).animate({ opacity: 0}, 1 );
        $('#'+id1).show(0);
         $('#'+id1).animate({ opacity: 1}, 1000 );
                $('#'+id2).animate({ opacity: 0}, 1 );
        $('#'+id2).show(0);
         $('#'+id2).animate({ opacity: 1}, 1000 );
         console.log("#"+id1);
	}
        
else {
	//document.getElementById(id1).style.display='none';
	//document.getElementById(id2).style.display='none';
         //$('#'+id1).hide(1000,function(){ $('#'+id2).hide();});
          $('#'+id1).animate({ opacity: 0}, 1000);
          $('#'+id2).animate({ opacity: 0}, 1000,function(){$('#'+id2).hide();$('#'+id1).hide();} );
          
	}
    

}



//-->
