function showImagePreview(imgname,ww,wh,languageCode) {
  url="/images/show_image_preview.php?filename="+imgname+"&languageCode="+languageCode;
  window.open(url,"previewnewspage", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+(ww+10)+",height="+(wh+10)+"");
}
function showNewsPreview(imgname,ww,wh,languageCode) {
  url="/images/show_news_preview.php?filename="+imgname+"&languageCode="+languageCode;
  window.open(url,"previewnewspage", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+(ww+10)+",height="+(wh+50)+"");
}
function showMachinenPreview(imgname,ww,wh,languageCode) {
  url="/images/show_machinen_preview.php?filename="+imgname+"&languageCode="+languageCode;
  window.open(url,"previewmachinenpage", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+(ww+10)+",height="+(wh+50)+"");
}

function CheckClick(val,checkval)
{
if (val.value==checkval)
	val.value="";
}

function isValidEmail(str) {
   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
 
}

function CheckData(fid)
{
if (isValidEmail(fid.email.value))
	return true;
	alert('Не верный E-mail');
	return false;
}
function setHomePage(obj)
{
loc=new String(document.location.href);
   obj.style.behavior='url(#default#homepage)';
   if (!(obj.isHomePage(loc)) || obj.isHomePage(loc))
   {
   obj.setHomePage(loc);
   return false;
   }

 return true;
}



function viewImage(src,title)
{

 prevImg = new Image();
 prevImg.src = src;
 var w=480;
 var h=520;
 
 if (prevImg.width>w){
 w = prevImg.width;
 }
  if (prevImg.height>h){
 h = prevImg.height+40;
 }
 myWin= open("", title,"width="+w+",height="+h+",status=no,toolbar=no,menubar=no,resizable=yes");
 myWin.document.open();

myWin.document.write("<html><head><title>"+title+"</title></head><body><img src='"+src+"'/><br/><a target='_blank' width='16' height='12' title='Google map'  href='http://www.google.de/maps?f=d&hl=de&geocode=&saddr=m%C3%B6nchengladbach&daddr=Ausfahrt+9a+%4050.928710,+6.816540+to:50.910772,6.831179&mrcr=1&mrsp=2&sz=14&mra=dme&sll=50.920351,6.833925&sspn=0.038092,0.080338&ie=UTF8&z=14&om=1'>Link:</a></body> </html>");
 
  myWin.document.close();  
 
 return false;
}

