// JavaScript Document

//popup script written by salamkt

function designpop1()
{
	qu_popUpWindow("images/bellow_design_1.jpg", 10, 10, 800, 600);
}

function designpop2()
{
	qu_popUpWindow("images/bellow_design_2.jpg", 10, 10, 800, 600);
}

var my_popUpWin=0;

function qu_popUpWindow(URLStr, left, top, width, height)

{

  if(my_popUpWin)

  {

    if(!my_popUpWin.closed) my_popUpWin.close();

  }

  my_popUpWin = open(URLStr, 'my_popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');

}

function myqlyanim()
{
	qu_popUpWindow("quality_anim.html", 10, 10, 500, 450);
}








function displayPopup(img,number)
  {
	 var imgName = document.getElementById(img);
	 
	 for(var i=1;i<number; i++)
	 {
		if (document.getElementById(img + i))
		{
			document.getElementById(img + i).style.display = "none";	
		}
	 }
	 imgName.style.display = "block";
  }
  
function closePopup(img,number)
  {
 
		if (document.getElementById(img))
		{
			document.getElementById(img).style.display = "none";	
		}

}

function displayBlock(blockName)
{
		hideAll();
		
		document.getElementById(blockName).style.display = "block";
}


function hideAll()
{
	document.getElementById('block1').style.display = "none";
	document.getElementById('block2').style.display = "none";
	document.getElementById('block3').style.display = "none";
	document.getElementById('block4').style.display = "none";
	document.getElementById('block5').style.display = "none";
	//document.getElementById('block6').style.display = "none";
}


function openPopup(title,fileName,width,height)
  {
	 var imgNumber = 0;
	  
//     var imgPath = 'images/' + imgName + '.jpg';
     var properties = 'toolbar=0,statusbar=0,menubar=0,location=0,height='+height+', width = '+width;
     var leftprop, topprop, screenX, screenY;
	 //var content = '<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Blue Valley :: ' + title + '</title> </head> <body style="margin:0px;"> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="' + imgPath + '" width="'+ width +'" height="' +height +'" /></td> </tr> </table> </body> </html>';
	 
     if (navigator.appName == 'Microsoft Internet Explorer')
     {
         screenY = window.screen.availHeight;
         screenX = window.screen.availWidth;
     }
     else
     {
         screenY = screen.height;
         screenX = screen.width;
     }
     leftvar = (screenX - width) / 2;
     rightvar = (screenY - height) / 2;
     if (navigator.appName == 'Microsoft Internet Explorer')
     {
         leftprop = leftvar;
         topprop = rightvar;
     }
     else
     {
         leftprop = (leftvar - pageXOffset);
         topprop = (rightvar - pageYOffset);
     }
     properties = properties+', left = '+leftprop;
     properties = properties+', top = '+topprop;
     closePopup();
	 
     popupHandle = open(fileName + ".html",name,properties);
	// popupHandle.document.write(content);
  }  

function disableRightClick(e) {
  var message = "Right click disabled";  
  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers) 
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      alert(message);
      return false;
    }
  }
  else
  {
    alert(message);
    return false;
  }
}


function init () {
	disableRightClick();		
}
window.onload=init;
