function validateForm()
{   
	
     if($("#popupColor").val() == "none" || $("#popupSize").val() == "none")
    {
        $("#popupSubmit").attr("disabled", true);
        $("#popupSubmit").css("color", "#eeeeee");
          $("#popupSubmit").css("border", "1px solid #eeeeee");

    }
    else
    {
        $("#popupSubmit").attr("disabled", false);
        $("#popupSubmit").css("color", "#976e4c");
$("#popupSubmit").css("border", "1px solid #976e4c");
    }
}

function onAjaxSuccess(data)
{
    $("#popupWindow").html(data);
    $("#popupWindow").css("background", "#fff");
    $("#popupWindow select").bind("change", validateForm);
    $("#popupSubmit").css("color", "#eeeeee");
$("#popupSubmit").css("border", "1px solid #eeeeee");
        $("#popupSubmit").attr("disabled", true);

}

function showHidePopupWindow(obj)
{

    var ID = $(obj).attr("id");
    
    if($("#popupWindow").css("display") == "block")
    {
    if($("#popupWindow").hasClass(ID))
        {
            $("#popupWindow").removeClass(ID);
            $("#popupWindow").fadeOut("slow");
        } 
              
    }
    else
    {
        $("#popupWindow").addClass(ID);
        $("#popupWindow").css("top", $(obj).offset().top-$("#wrapper").offset().top-240+"px");
	if(navigator.userAgent.indexOf ("MSIE 6") != -1)
		$("#popupWindow").css("left", $(obj).parent().parent().offset().left-$("#wrapper").offset().left+64+"px"); 
	else
		$("#popupWindow").css("left", $(obj).parent().parent().offset().left-$("#wrapper").offset().left-22+"px");
        
        $("#popupWindow").fadeIn("slow");
	$("#popupWindow").css("background", "url(loadinfo.gif) center no-repeat #fff");
	$("#popupWindow").html("");

        var url = "/index.php?id=61&stuff_id="+ID;
        $.get(url, onAjaxSuccess);
    }    
}

function showHidePopupWindowInInner(obj)
{

    var ID = $(obj).attr("id");
    
    if($("#popupWindow").css("display") == "block")
    {
    if($("#popupWindow").hasClass(ID))
        {
            $("#popupWindow").removeClass(ID);
            $("#popupWindow").fadeOut("slow");
        } 
              
    }
    else
    {
        $("#popupWindow").addClass(ID);
        $("#popupWindow").css("top", $(obj).offset().top-$("#wrapper").offset().top+"px");
	if(navigator.userAgent.indexOf ("MSIE 6") != -1)
		$("#popupWindow").css("left", $(obj).offset().left-$("#wrapper").offset().left+64+"px"); 
	else
		$("#popupWindow").css("left", $(obj).offset().left-$("#wrapper").offset().left-59+"px");
        
        $("#popupWindow").fadeIn("slow");
	$("#popupWindow").css("background", "url(loadinfo.gif) center no-repeat #fff");
	$("#popupWindow").html("");

        var url = "/index.php?id=61&stuff_id="+ID;
        $.get(url, onAjaxSuccess);
    }    
}

function closePopup()
{
	$("#popupWindow").attr("class", "shk-item");
	$("#popupWindow").fadeOut("slow");
}

