$(document).ready(function(){
    if($('.items_list').size){
        $('.items_list li').each(function(){
            $(this).mouseover(function(){
                $(this).addClass('over');
            });
            $(this).mouseout(function(){
                $(this).removeClass('over');
            });
        });
    }
    if($('.error').size() > 0) $('.error').fadeIn(); 
    if($('.message').size() > 0) $('.message').fadeIn();
    
    $(".nav ul ul").css({display: "none"}); // Opera Fix
    $(".nav li").hover(function(){
		$(this).find('ul:first').css({visibility: "visible",display: "none"}).show(100);
		},function(){
		$(this).find('ul:first').hide(400);
		});
	$("table.listing tr").hover(function(){$(this).addClass('over')},function(){$(this).removeClass('over')});

});

function order_set(item_id){
    var url = "index.php?do=products&products=order&order=set&items="+item_id;
    $.getJSON(url, function(data){
        if(data.error != '') {
            alert(data.error);
        } else if(confirm(data.success_msg)){
            window.location = data.success_url;
        } else {
            $("#show_cart").html(data.cart_msg);
        }
    });
}
function sendMail() {
	var firstName = $('#first_name').val();
	var lastName = $('#last_name').val();
	var phone = $('#phone_number').val();
	var mail = $('#mail').val();
	var inquiry = $('#inquiry').val();
	
	$.post("sendMail.php", { firstName: firstName, lastName: lastName, phone: phone, mail: mail, inquiry: inquiry } ,
		function (data) {
			alert(data);
			window.location='index.php';
		});
}

function setCookie(c_name,value,expiredays)
{
    if (value == 'none'){
        value = 'block';
    } else {
        value = 'none';
    }
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +value+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")


//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined"){
//document.onselectstart=new Function ("return false")
}else{
//document.onmousedown=disableselect
//document.onmouseup=reEnable
}


//  End -->

