function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		Untitled_1b_sliced_06_over = newImage("images/Untitled-1b_sliced_06-over.gif");
		Untitled_1b_sliced_07_over = newImage("images/Untitled-1b_sliced_07-over.gif");
		Untitled_1b_sliced_08_over = newImage("images/Untitled-1b_sliced_08-over.gif");
		Untitled_1b_sliced_09_over = newImage("images/Untitled-1b_sliced_09-over.gif");
		preloadFlag = true;
	}
}

function HideNow(MenuID)
{
	LiveMenu = document.getElementById(MenuID);
	if((LiveMenu.style)&&(LiveMenu.style.visibility)){
		LiveMenu.style.visibility = 'hidden';
	}
}

function MenuOver(MenuID)
{
	HideNow('menu1'); HideNow('menu2');
	LiveMenu = document.getElementById(MenuID);
	if((LiveMenu.style)&&(LiveMenu.style.visibility!=null)){
		LiveMenu.style.visibility = 'visible';}
}

var	popy
function PopWin(theURL,winName,features) { window.open(theURL,winName,features); }
function PopW(theURL,winName,features) { 
	if(!window.focus) return true;	if(popy!=null){	if(!popy.closed) popy.window.close();
	}
	popy=window.open(theURL,winName,features);	popy.focus();
	return false;
}

function More(the_id,path)
{
    if(!path) path = '';
	PopW(path+'view.php?item='+the_id,'Info','width=550,height=450,top=10,left=10,scrollbars=yes,resizable=yes,status=no');
}

function nzgirl_Basket_makeover(id_,path_,book_date,book_time)
{
	if(!path_) path_="";

	if(book_date!=null && book_time!=null)
	{
		PopW(path_+"basket.php?key="+id_+"&book_date="+book_date+"&book_time="+book_time,"Basket","width=550,height=650,scrollbars=yes,resizable=yes,status=no");	
	}
}

function nzgirl_Basket(id_,path_,size_,color_)
{
	if(!path_) path_='';
	
	if(size_!=null && color_!=null)
	{
		PopW(path_+'basket.php?key='+id_+'&size='+size_+'&color='+color_,'Basket','width=550,height=650,scrollbars=yes,resizable=yes,status=no');	
	}
}

function Basket(the_id,path)
{
    if(!path) path = '';
	PopW(path+'shop/basket/basket.php?key='+the_id,'Basket','width=550,height=650,scrollbars=yes,resizable=yes,status=no');
}

// FLASHING TEXT --------------------------
function initArray()
{
    this.length = initArray.arguments.length;
    for (var i = 0; i < this.length; i++) { this[i] = initArray.arguments[i]; }
}

var speed = 400;
var x = 0;
var color = new initArray("#DF0000","#FFFFFF");

function chc()
{
    obj = document.getElementById('err');
    if((obj.style)&&(obj.style.color!=null))
    {
        obj.style.color = color[x];
        (x < color.length-1) ? x++ : x = 0;
    }
    setTimeout("chc()",speed);
}
// /FLASHING TEXT -------------------------

//setTimeout("alert('Please note that your session will expire soon.\r\nTo complete your shopping please go trough the shopping process within next few minutes.')", <?php echo (ini_get('session.gc_maxlifetime')*1000)-300000; ?>);

var count = 0;
// Change the number after delay to change scroll speed. 
// Higher number equals slower scroll.
var delay = 100;
// text between quotes will display in the status window. 
// Leave blank spaces after text.
var text = "";
function  scroll(textc) {
    if(textc) text = textc;
    window.status = text.substring (count, text.length) + text.substring (0, count)
    if (count < text.length) count ++;
    else count = 0;
    setTimeout ("scroll()", delay);
}

