var gambaron  = new Array();
var gambaroff = new Array();
var flag = new Array();
var count;
count=0;

gambaron[1] = new Image();
gambaron[2] = new Image();
gambaron[3] = new Image();
gambaron[4] = new Image();
gambaron[5] = new Image();
gambaron[6] = new Image();
gambaron[7] = new Image();
gambaron[8] = new Image();
gambaron[9] = new Image();

gambaroff[1] = new Image();
gambaroff[2] = new Image();
gambaroff[3] = new Image();
gambaroff[4] = new Image();
gambaroff[5] = new Image();
gambaroff[6] = new Image();
gambaroff[7] = new Image();
gambaroff[8] = new Image();
gambaroff[9] = new Image();

gambaroff[1].src = "img/home-a.gif";
gambaroff[2].src = "img/color-a.gif";
gambaroff[3].src = "img/catalogue-a.gif";
gambaroff[4].src = "img/room-a.gif";
gambaroff[5].src = "img/contact-a.gif";
gambaroff[6].src = "img/news-a.gif";
gambaroff[7].src = "img/about-a.gif";
gambaroff[8].src = "img/slide_show-a.gif";
gambaroff[9].src = "img/kitchen-a.gif";

gambaron[1].src = "img/home-b.gif";
gambaron[2].src = "img/color-b.gif";
gambaron[3].src = "img/catalogue-b.gif";
gambaron[4].src = "img/room-b.gif";
gambaron[5].src = "img/contact-b.gif";
gambaron[6].src = "img/news-b.gif";
gambaron[7].src = "img/about-b.gif";
gambaron[8].src = "img/slide_show-b.gif";
gambaron[9].src = "img/kitchen-b.gif";

function imageon(n)
{
 document.images["img" + n].src=gambaron[n].src;
}

function imageoff(n)
{
if (flag[n]!=1)
{
 document.images["img" + n].src=gambaroff[n].src;
}
else
{
}
}


function pop_room_settings(a)
{
	window.open('pop-room-settings.php?p_id='+a,"","height=500,width=700,left=50,top=20, scrollbars=yes")
}


function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 


function pop_product(a)
{
	window.open('pop-product.php?p_id='+a,"","height=700,width=600,left=200,top=20,resizable=yes, scrollbars=yes")
}

function pop_product_frame(a)
{
	window.open('pop-product-frame.php?p_id='+a,"","height=700,width=600,left=200,top=20,resizable=yes, scrollbars=yes")
}

function pop_news(a,b)
{
	window.open('pop-news.php?p_id=' + a + '&where=' + b,"","height=700,width=850,left=50,top=20")
}


function confirmation(a,b)
{
 var question_form_receipt_process= confirm("Delete " + b + " ?");
 if (question_form_receipt_process== true)
 {
	self.location='delete-product.php?prod_id=' + a;
 }
 else
 {
	return false;
  }


	 return true 
}