window.moveTo(0,0);
window.opener = self;
window.resizeTo(screen.width,screen.height);


function getqtyKev(pid)
	{
		var qtyId = pid.toString() + '_cart_quantity';
		var cart_quantity = document.getElementById(qtyId).value;
		return cart_quantity;
	}
	
	
function hideError()
	{
	$('#error').slideUp('100');
	return false;
	}
	
	
function delay(act)
	{
	return act;
	}
	
function validate()
	{
	var f=document.getElementsByName('keywords')[0].value;
	var g=document.getElementsByName('page_num')[0].value;
	if (f=='' && g=='')
		{
		$('#error').slideDown('100');
		setTimeout("hideError()", 5000);
return false;
		}else{
		return true;
		}
	}
	
function increaseOpacity(e)
	{
	$(".index_btn_1, .index_btn_2, .index_btn_3, .index_btn_4, .index_btn_5, .index_btn_6, .index_btn_7, .index_btn_8").css({'-moz-opacity' : '0.99', '-khtml-opacity' : '0.99', 'opacity' : '0.99', 'filter' : 'alpha(opacity=99)'});
	$(e).css({'-moz-opacity' : '0.25', '-khtml-opacity' : '0.25', 'opacity' : '0.25', 'filter' : 'alpha(opacity=25)'});
	}
function hideLoader()
	{
	$("#loading").hide();
	}

$(document).ready(function() {











	$('#inputPageNumber').keyup(function(e)
		{		
		
		this.value = this.value.toUpperCase();
		
		
			
		

		
		
			if(e.keyCode == 13)
		{
		

		
			$('#searchform').submit();
		}
	});
	

$('#inputString').keyup(function(e)
	{		
		if(e.keyCode == 13)
		{
			$('#searchform').submit();
		}
	});

// do stuff when DOM is ready
$('#hide_index').hide();
$('.indexbackBTN').hide();
$('.indexnextBTN').hide();
$('#index_nav').hide();
$('#error').hide();
$('#index').hide();
$('area').click(function(){
return false;
});


//index buttons
$(".index_btn_1").click(function(){
$("#loading").show("fast");
$("#index").load("pages/index/Index_1.html","" , function(){
setTimeout("hideLoader()", 2000);
});
increaseOpacity(this);
});

$(".index_btn_2").click(function(){
$("#loading").show("fast");
$("#index").load("pages/index/Index_2.html","" , function(){
setTimeout("hideLoader()", 2000);
});
increaseOpacity(this);
});

$(".index_btn_3").click(function(){
$("#loading").show("fast");
$("#index").load("pages/index/Index_3.html","" , function(){
setTimeout("hideLoader()", 2000);
});
increaseOpacity(this);
});

$(".index_btn_4").click(function(){
$("#loading").show("fast");
$("#index").load("pages/index/Index_4.html","" , function(){
setTimeout("hideLoader()", 2000);
});
increaseOpacity(this);
});

$(".index_btn_5").click(function(){
$("#loading").show("fast");
$("#index").load("pages/index/Index_5.html","" , function(){
setTimeout("hideLoader()", 2000);
});
increaseOpacity(this);
});

$(".index_btn_6").click(function(){
$("#loading").show("fast");
$("#index").load("pages/index/Index_6.html","" , function(){
setTimeout("hideLoader()", 2000);
});
increaseOpacity(this);
});

$(".index_btn_7").click(function(){
$("#loading").show("fast");
$("#index").load("pages/index/Index_7.html","" , function(){
setTimeout("hideLoader()", 2000);

});
increaseOpacity(this);
});

$(".index_btn_8").click(function(){
$("#loading").show("fast");
$("#index").load("pages/index/Index_8.html","" , function(){
setTimeout("hideLoader()", 2000);

});
increaseOpacity(this);
});

$('#index_btn').click(function(){
	$(this).hide();
	delay($('#index_nav').show());
	delay($('#inner_nav').hide());
	delay($('#index').slideToggle());
	delay($('#hide_index').slideToggle(2400));
	
	
$("#loading").show("fast");
$("#index").load("pages/index/Index_1.html","" , function(){
setTimeout("hideLoader()", 2000);
});
increaseOpacity(".index_btn_1");
});

$('.index_btn_hide_index').click(function(){

	delay($('#index').slideUp(900));
	delay($('#hide_index').slideToggle(900));
    delay($('#index_nav').toggle());
	delay($('#inner_nav').toggle());
$('#index_btn').show();
});


$('#error').click(function(){
	$(this).slideUp(400);
});

            $("#imgProgLeft").show();
            $("#image_left").hide();
            
            $("#imgProgRight").show();
            $("#image_right").hide();
            
            $('#image_left').load(function() {
                $("#imgProgLeft").hide();
                $("#image_left").show();
            });
            
             $('#image_right').load(function() {
                $("#imgProgRight").hide();
                $("#image_right").show();
            });
 });
 
 
 function lookup(inputString) {
		if(inputString.length == 0) {
			// Hide the suggestion box.
			$('#suggestions').hide();

		} else {
			$.post("rpc.php", {queryString: ""+inputString+""}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup

function fill(thisValue) {
		$('#inputString').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
	
	function hideError()
	{
		$('#error').slideUp('100');
		return false;
	}


